8000 Theme updates by stianst · Pull Request #214 · keycloak/keycloak · GitHub
[go: up one dir, main page]

Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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 @@ -6,6 +6,8 @@
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.util.Collections;
import java.util.Comparator;
import java.util.LinkedList;
import java.util.List;
import java.util.ListIterator;
Expand All @@ -25,7 +27,17 @@ public static Theme createTheme(String name, Theme.Type type) throws FreeMarkerE
name = DEFAULT;
}

Iterable<ThemeProvider> providers = ProviderLoader.load(ThemeProvider.class);
List<ThemeProvider> providers = new LinkedList();
for (ThemeProvider p : ProviderLoader.load(ThemeProvider.class)) {
providers.add(p);
}

Collections.sort(providers, new Comparator<ThemeProvider>() {
@Override
public int compare(ThemeProvider o1, ThemeProvider o2) {
return o2.getProviderPriority() - o1.getProviderPriority();
}
});

Theme theme = findTheme(providers, name, type);
if (theme.getParentName() != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
*/
public interface ThemeProvider {

public int getProviderPriority();

public Theme createTheme(String name, Theme.Type type) throws IOException;

public Set<String> nameSet(Theme.Type type);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,20 @@
*/
public class DefaultLoginThemeProvider implements ThemeProvider {

public static final String RCUE = "rcue";
public static final String PATTERNFLY = "patternfly";
public static final String KEYCLOAK = "keycloak";

private static Set<String> defaultLoginThemes = new HashSet<String>();
private static Set<String> defaultThemes = new HashSet<String>();

static {
defaultLoginThemes.add(ThemeLoader.BASE);
defaultLoginThemes.add(PATTERNFLY);
defaultLoginThemes.add(KEYCLOAK);
defaultThemes.add(ThemeLoader.BASE);
defaultThemes.add(PATTERNFLY);
defaultThemes.add(KEYCLOAK);
}

private static Set<String> defaultAccountThemes = new HashSet<String>();

static {
defaultAccountThemes.add(ThemeLoader.BASE);
defaultAccountThemes.add(RCUE);
defaultAccountThemes.add(KEYCLOAK);
@Override
public int getProviderPriority() {
return 0;
}

@Override
Expand All @@ -45,10 +41,8 @@ public Theme createTheme(String name, Theme.Type type) throws IOException {

@Override
public Set<String> nameSet(Theme.Type type) {
if (type == Theme.Type.LOGIN) {
return defaultLoginThemes;
} else if (type == Theme.Type.ACCOUNT) {
return defaultAccountThemes;
if (type == Theme.Type.LOGIN || type == Theme.Type.ACCOUNT) {
return defaultThemes;
} else {
return Collections.emptySet();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ public FolderThemeProvider() {
}
}

@Override
public int getProviderPriority() {
return 100;
}

@Override
public Theme createTheme(String name, Theme.Type type) throws IOException {
if (hasTheme(name, type)) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,33 +1,66 @@
<#import "template.ftl" as layout>
<@layout.mainLayout active='account' bodyClass='user'; section>

<h2 class="pull-left">Edit Account</h2>
<div class="row">
<div class="col-md-10">
<h2>Edit Account</h2>
</div>
<div class="col-md-2 subtitle">
<span class="subtitle"><span class="required">*</span> Required fields</span>
</div>
</div>

<form action="${url.accountUrl}" class="form-horizontal" method="post">

<div class="form-group">
<div class="col-sm-2 col-md-2">
<label for="username" class="control-label">${rb.username}</label>
</div>

<div class="col-sm-10 col-md-10">
<input type="text" class="form-control" id="username" name="username" disabled="disabled" value="${account.username!''}"/>
</div>
</div>

<div class="form-group">
<div class="col-sm-2 col-md-2">
<label for="email" class="control-label">${rb.email}</label> <span class="required">*</span>
</div>

<p class="subtitle"><span class="required">*</span> Required fields</p>
<div class="col-sm-10 col-md-10">
<input type="text" class="form-control" id="email" name="email" autofocus value="${account.email!''}"/>
</div>
</div>


<div class="form-group">
<div class="col-sm-2 col-md-2">
<label for="lastName" class="control-label">${rb.lastName}</label> <span class="required">*</span>
</div>

<form action="${url.accountUrl}" method="post">
<fieldset class="border-top">
<div class="form-group">
<label for="username">${rb.username}</label>
<input type="text" id="username" name="username" disabled="disabled" value="${account.username!''}"/>
<div class="col-sm-10 col-md-10">
<input type="text" class="form-control" id="lastName" name="lastName" value="${account.lastName!''}"/>
</div>
<div class="form-group">
<label for="email">${rb.email}</label><span class="required">*</span>
<input type="text" id="email" name="email" autofocus value="${account.email!''}"/>
</div>

<div class="form-group">
<div class="col-sm-2 col-md-2">
<label for="firstName" class="control-label">${rb.firstName}</label> <span class="required">*</span>
</div>
<div class="form-group">
<label for="lastName">${rb.lastName}</label><span class="required">*</span>
<input type="text" id="lastName" name="lastName" value="${account.lastName!''}"/>

<div class="col-sm-10 col-md-10">
<input type="text" class="form-control" id="firstName" name="firstName" value="${account.firstName!''}"/>
</div>
<div class="form-group">
<label for="firstName">${rb.firstName}</label><span class="required">*</span>
<input type="text" id="firstName" name="firstName" value="${account.firstName!''}"/>
</div>

<div class="form-group">
<div id="kc-form-buttons" class="col-md-offset-2 col-md-10 submit">
<div class="">
<#if url.referrerURI??><a href="${url.referrerURI}">Back to application</a></#if>
<button type="submit" class="btn btn-primary btn-lg">Save</button>
<button type="submit" class="btn btn-default btn-lg">Cancel</button>
</div>< 10BC8 /span>
</div>
</fieldset>
<div class="form-actions">
<#if url.referrerURI??><a href="${url.referrerURI}">Back to application</a></#if>
<button type="submit" class="primary">Save</button>
<button type="submit">Cancel</button>
</div>
</form>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ errorHeader=Error!
firstName=First name
lastName=Last name
password=Password
passwordConfirm=Password confirmation
passwordConfirm=Confirmation
passwordNew=New Password
successHeader=Success!
username=Username
Expand Down
Original file line number Diff line number Diff line change
@@ -1,29 +1,53 @@
<#import "template.ftl" as layout>
<@layout.mainLayout active='password' bodyClass='password'; section>

<h2 class="pull-left">Change Password</h2>
<div class="row">
<div class="col-md-10">
<h2>Change Password</h2>
</div>
<div class="col-md-2 subtitle">
<span class="subtitle">All fields required</span>
</div>
</div>

<form action="${url.passwordUrl}" class="form-horizontal" method="post">
<div class="form-group">
<div class="col-sm-2 col-md-2">
<label for="password" class="control-label">${rb.password}</label>
</div>

<div class="col-sm-10 col-md-10">
<input type="password" class="form-control" id="password" name="password" autofocus>
</div>
</div>

<p class="subtitle">All fields required</p>
<div class="form-group">
<div class="col-sm-2 col-md-2">
<label for="password-new" class="control-label">${rb.passwordNew}</label>
</div>

<form action="${url.passwordUrl}" method="post">
<fieldset class="border-top">
<div class="form-group">
<label for="password">${rb.password}</label>
<input type="password" id="password" name="password" autofocus>
<div class="col-sm-10 col-md-10">
<input type="password" class="form-control" id="password-new" name="password-new">
</div>
<div class="form-group">
<label for="password-new">${rb.passwordNew}</label>
<input type="password" id="password-new" name="password-new">
</div>

<div class="form-group">
<div class="col-sm-2 col-md-2">
<label for="password-confirm" class="control-label" class="two-lines">${rb.passwordConfirm}</label>
</div>
<div class="form-group">
<label for="password-confirm" class="two-lines">${rb.passwordConfirm}</label>
<input type="password" id="password-confirm" name="password-confirm">

<div class="col-sm-10 col-md-10">
<input type="password" class="form-control" id="password-confirm" name="password-confirm">
</div>
</div>

<div class="form-group">
<div id="kc-form-buttons" class="col-md-offset-2 col-md-10 submit">
<div class="">
<button type="submit" class="btn btn-primary btn-lg">Save</button>
<button type="submit" class="btn btn-default btn-lg">Cancel</button>
</div>
</div>
</fieldset>
<div class="form-actions">
<#if url.referrerURI??><a href="${url.referrerURI}">Back to application</a></#if>
<button type="submit" class="primary">Save</button>
<button type="submit">Cancel</button>
</div>
</form>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,50 +18,48 @@
</head>
<body class="admin-console user ${bodyClass}">

<#if message?has_content>
<div class="feedback-aligner">
<#if message.success>
<div class="feedback success show"><p><strong>${rb.successHeader}</strong> ${message.summary}</p></div>
</#if>
<#if message.error>
<div class="feedback error show"><p><strong>${rb.errorHeader}</strong> ${message.summary}</p></div>
</#if>
</div>
</#if>
<header class="navbar navbar-default navbar-pf navbar-main header">
<div class="container">
<div>
<nav class="navbar" role="navigation">
<div class="navbar-header">
<div class="navbar-title">
</div>
</div>

<div class="header rcue">
<div class="navbar utility">
<div class="navbar-inner clearfix container">
<h1><a href="#"><strong>Keycloak</strong> Account Management</a></h1>
<ul class="nav pull-right">
<li>
<a href="${url.logoutUrl}">Sign Out</a>
</li>
</ul>
<div class="navbar-collapse">
<ul class="nav navbar-nav navbar-utility">
<#if url.referrerURI??><li><a href="${url.referrerURI}">Back to application</a></li></#if>
<li><a href="${url.logoutUrl}">Sign Out</a></li>
</ul>
</div>
</nav>
</div>
</div>
</div>
</div><!-- End .header -->
</header>

<div class="container">
<div class="row">
<div class="bs-sidebar col-md-3 clearfix">
<div class="container">
<div class="bs-sidebar col-sm-3 ng-scope">
<ul>
<li class="<#if active=='account'>active</#if>"><a href="${url.accountUrl}">Account</a></li>
<li class="<#if active=='password'>active</#if>"><a href="${url.passwordUrl}">Password</a></li>
<li class="<#if active=='totp'>active</#if>"><a href="${url.totpUrl}">Authenticator</a></li>
<#--<li class="<#if active=='social'>active</#if>"><a href="${url.socialUrl}">Social Accounts</a></li>-->
<#--<li class="<#if active=='access'>active</#if>"><a href="${url.accessUrl}">Authorized Access</a></li>-->
</ul>
</div>

<div id="content-area" class="col-md-9" role="main">
<div id="content">
<#nested "content">
</div>
<div class="col-md-9 content-area">
<#if message?has_content>
<div class="alert alert-${message.type}">
<#if message.type=='success' ><span class="pficon pficon-ok"></span></#if>
<#if message.type=='error' ><span class="pficon pficon-error-octagon"></span><span class="pficon pficon-error-exclamation"></span></#if>
${message.summary}
</div>
</#if>

<#nested "content">
</div>
<div id="container-right-bg"></div>
</div>
</div>

</body>
</html>
</#macro>
Loading
0