Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
8 changes: 8 additions & 0 deletions core/src/main/java/hudson/Functions.java
Original file line number Diff line number Diff line change
Expand Up @@ -1779,6 +1779,14 @@ public static SimplePageDecorator getSimplePageDecorator() {
return SimplePageDecorator.first();
}

/**
* Gets all {@link SimplePageDecorator}s for the login page.
* @since TODO
*/
public static List<SimplePageDecorator> getSimplePageDecorators() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

return SimplePageDecorator.all();
}

public static List<Descriptor<Cloud>> getCloudDescriptors() {
return Cloud.all();
}
Expand Down
11 changes: 11 additions & 0 deletions core/src/main/java/jenkins/model/SimplePageDecorator.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand Down Expand Up @@ -69,4 +72,12 @@ public static SimplePageDecorator first(){
}
}

/**
* Returns all login page decorators.
* @since TODO
*/
public static List<SimplePageDecorator> all() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

return Jenkins.get().getDescriptorList(SimplePageDecorator.class);
}

}
15 changes: 10 additions & 5 deletions core/src/main/resources/jenkins/model/Jenkins/login.jelly
Original file line number Diff line number Diff line change
Expand Up @@ -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}"/>
Copy link
Contributor

Choose a reason for hiding this comment

The 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"/>
Copy link
Contributor

Choose a reason for hiding this comment

The 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>
Expand All @@ -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"/>
Copy link
Contributor

Choose a reason for hiding this comment

The 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()}">
Expand Down Expand Up @@ -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}">
Copy link
Contributor

Choose a reason for hiding this comment

The 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>
Expand Down