Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow custom text for abort - just like the ok (proceed button) #54

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,20 @@ private String capitalize(String id) {
return id;
}

/**
* Caption of the Abort button.
*/

private String abort;

public String getAbort() {
return abort!=null ? abort : Messages.abort();
}

@DataBoundSetter public void setAbort(String abort) {
this.abort = Util.fixEmptyAndTrim(abort);
}

/**
* Caption of the OK button.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public boolean start() throws Exception {
String thisUrl = baseUrl + Util.rawEncode(getId()) + '/';
listener.getLogger().printf("%s%n%s or %s%n", input.getMessage(),
POSTHyperlinkNote.encodeTo(thisUrl + "proceedEmpty", input.getOk()),
POSTHyperlinkNote.encodeTo(thisUrl + "abort", "Abort"));
POSTHyperlinkNote.encodeTo(thisUrl + "abort", input.getAbort()));
} else {
// TODO listener.hyperlink(…) does not work; why?
// TODO would be even cooler to embed the parameter form right in the build log (hiding it after submission)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ THE SOFTWARE.
<f:entry field="ok" title="${%OK Button Caption}">
<f:textbox/>
</f:entry>
<f:entry field="abort" title="${%Abort Button Caption}">
<f:textbox/>
</f:entry>
<f:entry field="submitter" title="${%Allowed Submitter}">
<f:textbox/>
</f:entry>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<p>Similar to the ok Proceed button, the Abort can be customised too.</p>

<p>
Usage: <code>input message: 'Do you approve?' ok: "Yes" abort: "No"</code>
gyula-s marked this conversation as resolved.
Show resolved Hide resolved
</p>

<p>Which will look like:</p>
<pre>
Do you approve?
Yes or No
</pre>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<p>
You can customize the text for the proceed button to better match the context
of the prompt you're asking your users about.
</p>

<p>Usage: <code>input message: 'Do you approve?' ok: "Yes"</code></p>
gyula-s marked this conversation as resolved.
Show resolved Hide resolved

<p>Which will look like:
<pre>
Do you approve?
Yes or Abort
</pre>
</p>

Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</j:forEach>
<f:block>
<f:submit value="${it.input.ok}" name="proceed"/>
<f:submit value="${%Abort}" name="abort"/>
<f:submit value="${it.input.abort}" name="abort"/>
</f:block>
</f:form>
</j:if>
Expand Down