Skip to content

Commit

Permalink
[FIXED JENKINS-10738] Different "build now" text for parameterized bu…
Browse files Browse the repository at this point in the history
…ilds.

(Not touching the icon since I do not feel like playing with Inkscape; would be a nice pull request for somebody.)
  • Loading branch information
jglick committed Apr 9, 2013
1 parent 97da161 commit b22b17c
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 6 deletions.
3 changes: 3 additions & 0 deletions changelog.html
Expand Up @@ -55,6 +55,9 @@
<!-- Record your changes in the trunk here. -->
<div id="trunk" style="display:none"><!--=TRUNK-BEGIN=-->
<ul class=image>
<li class=rfe>
Different text than “Build Now” for parameterized jobs.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-10738">issue 10738</a>)
<li class=bug>
“Build Now” context menu item broken for parameterized jobs.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-17110">issue 17110</a>)
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/hudson/model/AbstractProject.java
Expand Up @@ -448,7 +448,7 @@ public String getPronoun() {
* @since 1.401
*/
public String getBuildNowText() {
return AlternativeUiTextProvider.get(BUILD_NOW_TEXT,this,Messages.AbstractProject_BuildNow());
return AlternativeUiTextProvider.get(BUILD_NOW_TEXT, this, isParameterized() ? Messages.AbstractProject_build_with_parameters() : Messages.AbstractProject_BuildNow());
}

/**
Expand Down
3 changes: 2 additions & 1 deletion core/src/main/resources/hudson/model/Messages.properties
Expand Up @@ -37,6 +37,7 @@ AbstractProject.Pronoun=Project
AbstractProject.Aborted=Aborted
AbstractProject.BuildInProgress=Build #{0} is already in progress{1}
AbstractProject.BuildNow=Build Now
AbstractProject.build_with_parameters=Build with Parameters
AbstractProject.UpstreamBuildInProgress=Upstream project {0} is already building.
AbstractProject.DownstreamBuildInProgress=Downstream project {0} is already building.
AbstractProject.Disabled=Build disabled
Expand Down Expand Up @@ -345,4 +346,4 @@ BuildAuthorizationToken.InvalidTokenProvided=Invalid token provided.
Jenkins.CheckDisplayName.NameNotUniqueWarning=The display name, "{0}", is used as a name by a job and could cause confusing search results.
Jenkins.CheckDisplayName.DisplayNameNotUniqueWarning=The display name, "{0}", is already in use by another job and could cause confusion and delay.

Jenkins.NotAllowedName="{0}" is not allowed name
Jenkins.NotAllowedName="{0}" is not allowed name
Expand Up @@ -27,10 +27,19 @@ THE SOFTWARE.
<td>
<j:if test="${job.buildable and job.hasPermission(job.BUILD)}">
<a href="${jobBaseUrl}${job.shortUrl}build?delay=0sec">
<img src="${imagesURL}/${subIconSize}/clock.png"
title="${%Schedule a build}" alt="${%Schedule a build}"
onclick="${job.parameterized ? null : 'return build(this)'}"
border="0"/>
<j:choose>
<j:when test="${job.parameterized}">
<img src="${imagesURL}/${subIconSize}/clock.png"
title="${%Schedule a build with parameters}" alt="${%Schedule a build with parameters}"
border="0"/>
</j:when>
<j:otherwise>
<img src="${imagesURL}/${subIconSize}/clock.png"
title="${%Schedule a build}" alt="${%Schedule a build}"
onclick="return build(this)"
border="0"/>
</j:otherwise>
</j:choose>
</a>
<script>
function build(img) {
Expand Down

0 comments on commit b22b17c

Please sign in to comment.