mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-12-26 18:30:30 +00:00
changing text based on whether this was a deployment
This commit is contained in:
parent
8a6857a74b
commit
e68ae7145b
3 changed files with 25 additions and 6 deletions
|
@ -19,6 +19,13 @@ function RepoViewModel(repo) {
|
||||||
// construct the build entry if it doesn't already exist
|
// construct the build entry if it doesn't already exist
|
||||||
// so that we can append to the DOM. The code may not be
|
// so that we can append to the DOM. The code may not be
|
||||||
// pretty, but it is simple enough and it works.
|
// 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 = $("<a>").attr("class", "card").attr("href", "/"+repo+"/"+data.number).attr("data-build", data.number)
|
el = $("<a>").attr("class", "card").attr("href", "/"+repo+"/"+data.number).attr("data-build", data.number)
|
||||||
.append(
|
.append(
|
||||||
$("<div>").attr("class", "card-header").append(
|
$("<div>").attr("class", "card-header").append(
|
||||||
|
@ -36,13 +43,13 @@ function RepoViewModel(repo) {
|
||||||
$("<p>").attr("class","card-text").append(
|
$("<p>").attr("class","card-text").append(
|
||||||
$("<em>").text(data.author)
|
$("<em>").text(data.author)
|
||||||
).append(
|
).append(
|
||||||
$("<span>").text("authored")
|
$("<span>").text(authoredOrDeployed)
|
||||||
).append(
|
).append(
|
||||||
$("<em>").attr("data-livestamp", data.created_at)
|
$("<em>").attr("data-livestamp", data.created_at)
|
||||||
).append(
|
).append(
|
||||||
$("<span>").text("to")
|
$("<span>").text("to")
|
||||||
).append(
|
).append(
|
||||||
$("<em>").text(data.branch)
|
$("<em>").text(branchOrDeploy)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
).css("display", "flex").hide().fadeIn(1000);
|
).css("display", "flex").hide().fadeIn(1000);
|
||||||
|
|
|
@ -26,10 +26,16 @@ block content
|
||||||
a.material-icons[href=Build.Link][target="_blank"] link
|
a.material-icons[href=Build.Link][target="_blank"] link
|
||||||
p
|
p
|
||||||
em #{Build.Author}
|
em #{Build.Author}
|
||||||
|
if Build.Event != "deployment"
|
||||||
span authored
|
span authored
|
||||||
|
else
|
||||||
|
span deployed
|
||||||
em[data-livestamp=Build.Created]
|
em[data-livestamp=Build.Created]
|
||||||
span to
|
span to
|
||||||
|
if Build.Event != "deployment"
|
||||||
em #{Build.Branch}
|
em #{Build.Branch}
|
||||||
|
else
|
||||||
|
em #{Build.Deploy}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -42,10 +42,16 @@ block content
|
||||||
h3 #{$build.Message}
|
h3 #{$build.Message}
|
||||||
p.card-text
|
p.card-text
|
||||||
em #{$build.Author}
|
em #{$build.Author}
|
||||||
|
if $build.Event != "deployment"
|
||||||
span authored
|
span authored
|
||||||
|
else
|
||||||
|
span deployed
|
||||||
em[data-livestamp=$build.Created]
|
em[data-livestamp=$build.Created]
|
||||||
span to
|
span to
|
||||||
em #{$build.Branch}
|
if $build.Event != "deployment"
|
||||||
|
em ${build.Branch}
|
||||||
|
else
|
||||||
|
em #{$build.Deploy}
|
||||||
|
|
||||||
|
|
||||||
block append scripts
|
block append scripts
|
||||||
|
|
Loading…
Reference in a new issue