-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
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
Create a new taglib to capture the save/apply bottom bar #9813
Changes from all commits
8cf0d03
d30acbe
53d0008
710fc1c
c9aa779
45f40a0
6e54132
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -66,12 +66,8 @@ THE SOFTWARE. | |
</f:entry> | ||
</f:section> | ||
|
||
<f:bottomButtonBar> | ||
<f:submit value="${%OK}" /> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This effectively changes the label |
||
<f:apply value="${%Apply}"/> | ||
</f:bottomButtonBar> | ||
<f:saveApplyBar/> | ||
</f:form> | ||
<st:adjunct includes="lib.form.confirm" /> | ||
</l:main-panel> | ||
</l:layout> | ||
</j:jelly> |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,11 +55,7 @@ THE SOFTWARE. | |
|
||
<f:descriptorList title="${%Node Properties}" descriptors="${h.getNodePropertyDescriptors(descriptor.clazz)}" field="nodeProperties" /> | ||
|
||
<l:hasPermission permission="${it.CONFIGURE}"> | ||
<f:bottomButtonBar> | ||
<f:submit value="${%Save}"/> | ||
</f:bottomButtonBar> | ||
</l:hasPermission> | ||
<f:saveApplyBar/> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
</f:form> | ||
</l:main-panel> | ||
</l:layout> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,6 +32,7 @@ THE SOFTWARE. | |
<f:breadcrumb-config-outline title="${%System}" /> | ||
|
||
<l:main-panel> | ||
<j:set var="readOnlyMode" value="${!h.hasPermission(app.MANAGE)}"/> | ||
<l:app-bar title="${%System}" /> | ||
|
||
<div class="behavior-loading"><l:spinner text="${%LOADING}"/></div> | ||
|
@@ -46,7 +47,6 @@ THE SOFTWARE. | |
</div> | ||
</f:entry> | ||
<f:entry title="${%System Message}" description="${%This message will be displayed at the top of the Jenkins main page. This can be useful for posting notifications to your users}"> | ||
<j:set var="readOnlyMode" value="${!h.hasPermission(app.MANAGE)}" /> | ||
<f:textarea name="system_message" value="${it.systemMessage}" disabled="${readOnlyMode?'true':null}" readonly="${readOnlyMode?'true':null}" | ||
codemirror-mode="${app.markupFormatter.codeMirrorMode}" codemirror-config="${app.markupFormatter.codeMirrorConfig}" previewEndpoint="/markupFormatter/previewDescription"/> | ||
</f:entry> | ||
|
@@ -60,17 +60,9 @@ THE SOFTWARE. | |
<st:include page="${descriptor.globalConfigPage}" from="${descriptor}" /> | ||
</f:rowSet> | ||
</j:forEach> | ||
|
||
<l:hasAdministerOrManage> | ||
<f:bottomButtonBar> | ||
<f:submit value="${%Save}" /> | ||
<f:apply /> | ||
</f:bottomButtonBar> | ||
</l:hasAdministerOrManage> | ||
<j:set var="readOnlyMode" value="${!h.hasPermission(app.MANAGE)}"/> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Needed because of https://github.com/jenkinsci/jenkins/pull/9813/files#diff-04f3f5f17eaeb24ac6c8f50acae68a658010e18d2de16105942d34e151542fbfR57 overrriding the first defined value. |
||
<f:saveApplyBar/> | ||
</f:form> | ||
<l:hasAdministerOrManage> | ||
<st:adjunct includes="lib.form.confirm" /> | ||
</l:hasAdministerOrManage> | ||
</l:main-panel> | ||
</l:layout> | ||
</j:jelly> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<!-- | ||
The MIT License | ||
|
||
Copyright (c) 2024, CloudBees, Inc. | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
THE SOFTWARE. | ||
--> | ||
|
||
<?jelly escape-by-default='true'?> | ||
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form"> | ||
<st:documentation> | ||
Creates the bottom bar for the "Save" and "Apply" buttons. | ||
In read only mode (<j:set var="readOnlyMode" value="true"/>) the buttons are not displayed. | ||
</st:documentation> | ||
|
||
<j:if test="${!readOnlyMode}"> | ||
<f:bottomButtonBar> | ||
<f:submit value="${%Save}" /> | ||
<f:apply/> | ||
</f:bottomButtonBar> | ||
<st:adjunct includes="lib.form.confirm" /> | ||
</j:if> | ||
</j:jelly> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one is funny, after clicking Apply:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, fixed by https://github.com/jenkinsci/jenkins/pull/9813/files#diff-581669f62053a1ed8fed271068c074eec26588530194da1aef0d14f722f48b30R1516