diff --git a/static/scripts/repo.js b/static/scripts/repo.js index 9f89105c..47d456fa 100644 --- a/static/scripts/repo.js +++ b/static/scripts/repo.js @@ -19,6 +19,13 @@ function RepoViewModel(repo) { // construct the build entry if it doesn't already exist // so that we can append to the DOM. The code may not be // pretty, but it is simple enough and it works. + authoredOrDeployed = "authored" + branchOrDeploy = data.branch + if ( data.event == "deployment" ) { + authoredOrDeployed = "deployed" + branchOrDeploy = data.deploy_to + } + el = $("").attr("class", "card").attr("href", "/"+repo+"/"+data.number).attr("data-build", data.number) .append( $("
").attr("class", "card-header").append( @@ -36,13 +43,13 @@ function RepoViewModel(repo) { $("

").attr("class","card-text").append( $("").text(data.author) ).append( - $("").text("authored") + $("").text(authoredOrDeployed) ).append( $("").attr("data-livestamp", data.created_at) ).append( $("").text("to") ).append( - $("").text(data.branch) + $("").text(branchOrDeploy) ) ) ).css("display", "flex").hide().fadeIn(1000); diff --git a/template/amber/build.amber b/template/amber/build.amber index 3d8cbc8d..55a117c8 100644 --- a/template/amber/build.amber +++ b/template/amber/build.amber @@ -26,10 +26,16 @@ block content a.material-icons[href=Build.Link][target="_blank"] link p em #{Build.Author} - span authored + if Build.Event != "deployment" + span authored + else + span deployed em[data-livestamp=Build.Created] span to - em #{Build.Branch} + if Build.Event != "deployment" + em #{Build.Branch} + else + em #{Build.Deploy} diff --git a/template/amber/repo.amber b/template/amber/repo.amber index d7358c69..dd1fd79c 100644 --- a/template/amber/repo.amber +++ b/template/amber/repo.amber @@ -42,10 +42,16 @@ block content h3 #{$build.Message} p.card-text em #{$build.Author} - span authored + if $build.Event != "deployment" + span authored + else + span deployed em[data-livestamp=$build.Created] span to - em #{$build.Branch} + if $build.Event != "deployment" + em ${build.Branch} + else + em #{$build.Deploy} block append scripts