-
-
Notifications
You must be signed in to change notification settings - Fork 9.3k
[FIX JENKINS-54325] Add support for multiple SimplePageDecorators in … #3710
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
Changes from 1 commit
3fd970c
89ccd6a
245f979
213ec32
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 |
|---|---|---|
|
|
@@ -27,6 +27,9 @@ | |
| import hudson.ExtensionPoint; | ||
| import hudson.model.Describable; | ||
| import hudson.model.Descriptor; | ||
|
|
||
| import java.util.List; | ||
|
|
||
| /** | ||
| * Participates in the rendering of the login page | ||
| * | ||
|
|
@@ -69,4 +72,12 @@ public static SimplePageDecorator first(){ | |
| } | ||
| } | ||
|
|
||
| /** | ||
| * Returns all login page decorators. | ||
| * @since TODO | ||
| */ | ||
| public static List<SimplePageDecorator> all() { | ||
|
Contributor
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. 👍 |
||
| return Jenkins.get().getDescriptorList(SimplePageDecorator.class); | ||
| } | ||
|
|
||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -49,15 +49,17 @@ THE SOFTWARE. | |
| <j:set var="from" value="${error ? request.session.getAttribute('from') : request.getParameter('from')}"/> | ||
| <!-- in case of error we want to surround the form elements with an error hint --> | ||
| <j:set var="inputClass" value="${error ? 'danger' : 'normal'}"/> | ||
| <j:set var="simpleDecorator" value="${h.simplePageDecorator}"/> | ||
| <j:set var="simpleDecorators" value="${h.simplePageDecorators}"/> | ||
|
Contributor
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. see above, you need both |
||
| <!-- real deal starting here --> | ||
| <html lang="${request.getLocale().toLanguageTag()}"> | ||
| <head data-rooturl="${rootURL}" data-resurl="${resURL}" resURL="${resURL}"> | ||
| <title>${%signIn} [Jenkins]</title> | ||
| <!-- we do not want bots on this page --> | ||
| <meta name="ROBOTS" content="NOFOLLOW" /> | ||
| <!-- css styling, will fallback to default implementation --> | ||
| <st:include it="${simpleDecorator}" page="simple-head.jelly" optional="true"/> | ||
|
Contributor
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. 👎 |
||
| <j:forEach var="simpleDecorator" items="${simpleDecorators}"> | ||
| <st:include it="${simpleDecorator}" page="simple-head.jelly" optional="true"/> | ||
| </j:forEach> | ||
| </head> | ||
| <body> | ||
| <j:choose> | ||
|
|
@@ -67,7 +69,9 @@ THE SOFTWARE. | |
| <j:otherwise> | ||
| <div class="simple-page" role="main"> | ||
| <div class="modal login"> | ||
| <st:include it="${simpleDecorator}" page="simple-header.jelly" optional="true"/> | ||
|
Contributor
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. 👎 |
||
| <j:forEach var="simpleDecorator" items="${simpleDecorators}"> | ||
| <st:include it="${simpleDecorator}" page="simple-header.jelly" optional="true"/> | ||
| </j:forEach> | ||
| <!-- login form --> | ||
| <form name="login" action="${it.securityRealm.authenticationGatewayUrl}" method="post"> | ||
| <j:if test="${it.securityRealm.allowsSignup()}"> | ||
|
|
@@ -145,8 +149,9 @@ THE SOFTWARE. | |
| </j:forEach> | ||
|
|
||
| <div class="footer"> | ||
|
|
||
| <st:include it="${simpleDecorator}" page="simple-footer.jelly" optional="true"/> | ||
| <j:forEach var="simpleDecorator" items="${simpleDecorators}"> | ||
|
Contributor
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 is actually the only change you need besides creating the methods to get all decorators. |
||
| <st:include it="${simpleDecorator}" page="simple-footer.jelly" optional="true"/> | ||
| </j:forEach> | ||
| </div> | ||
|
|
||
| </div> | ||
|
|
||
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.
👍