Skip to content

armgit / core

Public Imported from GitHub
0

100% open-source IoT Platform - Integrate your devices, add intelligence, build custom apps

Applied OR theme to login page

Christian Bauer1746d19dcc66
diff --git a/keycloak/theme/account/template.ftl b/keycloak/theme/account/template.ftl
index addd1ad8c..be5de707d 100644
--- a/keycloak/theme/account/template.ftl
+++ b/keycloak/theme/account/template.ftl
@@ -6,6 +6,13 @@
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
<meta name="robots" content="noindex, nofollow">
+
+ <#if properties.meta?has_content>
+ <#list properties.meta?split(' ') as meta>
+ <meta name="${meta?split('==')[0]}" content="${meta?split('==')[1]}"/>
+ </#list>
+ </#if>
+
<link rel="icon" type="image/png" href="/static/img/favicon.png" />
<script src="/static//js/loader.js"></script>
diff --git a/keycloak/theme/login/login.ftl b/keycloak/theme/login/login.ftl
new file mode 100755
index 000000000..c202946b8
--- /dev/null
+++ b/keycloak/theme/login/login.ftl
@@ -0,0 +1,88 @@
+<#import "template.ftl" as layout>
+<@layout.registrationLayout displayInfo=social.displayInfo; section>
+ <#if section = "title">
+ ${msg("loginTitle",(realm.displayName!''))}
+ <#elseif section = "header">
+ ${msg("loginTitleHtml",(realm.displayNameHtml!''))}
+ <#elseif section = "form">
+ <#if realm.password>
+ <form class="layout vertical or-Form theme-Form" action="${url.loginAction}" method="post">
+ <div class="layout horizontal center or-FormGroup theme-FormGroup">
+ <div class="or-FormLabel theme-FormLabel">
+ <label for="username"><#if !realm.registrationEmailAsUsername>${msg("usernameOrEmail")}<#else>${msg("email")}</#if></label>
+ </div>
+
+ <div class="or-FormField theme-FormField">
+ <#if usernameEditDisabled??>
+ <input id="username"
+ class="or-FormControl theme-FormControl or-FormInputText theme-FormInputText"
+ name="username" value="${(login.username!'')?html}" type="text" disabled/>
+ <#else>
+ <input id="username"
+ class="or-FormControl theme-FormControl or-FormInputText theme-FormInputText"
+ name="username" value="${(login.username!'')?html}" type="text" autofocus/>
+ </#if>
+ </div>
+ </div>
+
+ <div class="layout horizontal center or-FormGroup theme-FormGroup">
+ <div class="or-FormLabel theme-FormLabel">
+ <label for="password">${msg("password")}</label>
+ </div>
+
+ <div class="or-FormField theme-FormField">
+ <input id="password" class="or-FormControl theme-FormControl or-FormInputText theme-FormInputText"
+ name="password" type="password" autocomplete="off"/>
+ </div>
+ </div>
+
+ <div class="layout horizontal center-center or-FormGroup theme-FormGroup">
+ <div>
+ <#if realm.rememberMe && !usernameEditDisabled??>
+ <div class="checkbox">
+ <label>
+ <#if login.rememberMe??>
+ <input id="rememberMe" name="rememberMe" type="checkbox" tabindex="3"
+ checked> ${msg("rememberMe")}
+ <#else>
+ <input id="rememberMe" name="rememberMe" type="checkbox"
+ tabindex="3"> ${msg("rememberMe")}
+ </#if>
+ </label>
+ </div>
+ </#if>
+ <div>
+ <#if realm.resetPasswordAllowed>
+ <span><a href="${url.loginResetCredentialsUrl}">${msg("doForgotPassword")}</a></span>
+ </#if>
+ </div>
+ </div>
+
+ <div class="or-FormField theme-FormField">
+ <input class="or-FormControl theme-FormControl or-FormButtonPrimary theme-FormButtonPrimary or-PushButton theme-PushButton"
+ name="login"
+ type="submit"
+ value="${msg("doLogIn")}"/>
+ </div>
+ </div>
+ </form>
+ </#if>
+ <#elseif section = "info" >
+ <#if realm.password && realm.registrationAllowed && !usernameEditDisabled??>
+ <div id="kc-registration">
+ <span>${msg("noAccount")} <a href="${url.registrationUrl}">${msg("doRegister")}</a></span>
+ </div>
+ </#if>
+
+ <#if realm.password && social.providers??>
+ <div id="kc-social-providers">
+ <ul>
+ <#list social.providers as p>
+ <li><a href="${p.loginUrl}" id="zocial-${p.alias}" class="zocial ${p.providerId}"> <span
+ class="text">${p.alias}</span></a></li>
+ </#list>
+ </ul>
+ </div>
+ </#if>
+ </#if>
+</@layout.registrationLayout>
diff --git a/keycloak/theme/login/resources/css/login.css b/keycloak/theme/login/resources/css/login.css
deleted file mode 100644
index 688adbdd9..000000000
--- a/keycloak/theme/login/resources/css/login.css
+++ /dev/null
@@ -1,324 +0,0 @@
-.btn-primary {
- background: #c1d72f;
- color: white;
- border-color: #c1d72f;
-}
-
-.form-control {
- background: white;
- color: black;
- border-color: #455a64;
-}
-
-.login-pf body {
- background: #455a64;
-}
-
-.alert-error {
- background-color: #ffffff;
- border-color: #e64a19;
- color: #333333;
- font-weight: bold;
-}
-
-.pficon-error-circle-o:before {
- color: #e64a19;
-}
-
-#kc-locale ul {
- display: none;
- position: absolute;
- background-color: #fff;
- list-style: none;
- right: 20px;
- top: 30px;
- width: 200px;
- padding: 2px;
-}
-
-#kc-locale:hover ul {
- display: block;
- margin: 0;
-}
-
-#kc-locale ul li a {
- display: block;
- padding: 1px 11px;
- color: #000 !important;
- border: 1px solid #fff;
- text-decoration: none;
- display:block;
- line-height: 20px;
-}
-
-#kc-locale ul li a:hover {
- color: #4d5258;
- background-color: #c1d72f;
- border-color: #49a942;
-}
-
-#kc-locale-dropdown a {
- color: #fff;
-}
-
-#kc-locale-dropdown a:hover {
- text-decoration: none;
-}
-
-a#kc-current-locale-link {
- display: block;
- padding: 5px;
-}
-
-a#kc-current-locale-link:hover {
- background-color: rgba(0,0,0,0.2);
-}
-
-a#kc-current-locale-link::after {
- content: "\2c5";
- margin-left: 4px;
-}
-
-.login-pf .container {
- padding-top: 40px;
-}
-
-.login-pf a:hover {
- color: #c1d72f;
-}
-
-div.kc-logo-text span {
- color: #c1d72f;
-}
-
-#kc-header {
- color: #fff;
- overflow: visible;
- padding-left: 80px;
- white-space: nowrap;
-}
-
-#kc-header-wrapper {
- font-size: 26px;
- text-transform: uppercase;
- line-height: 1.2em;
- margin-bottom: 15px;
-}
-
-#kc-content {
- position: relative;
-}
-
-#kc-content-wrapper {
- overflow-y: hidden;
-}
-
-#kc-info {
- padding-bottom: 200px;
- margin-bottom: -200px;
-}
-
-#kc-info-wrapper {
- font-size: 13px;
-}
-
-#kc-form-options span {
- display: block;
-}
-
-#kc-terms-text {
- margin-bottom: 20px;
-}
-
-#kc-registration {
- margin-bottom: 15px;
-}
-
-/* TOTP */
-
-ol#kc-totp-settings {
- margin: 0;
- padding: 0;
-}
-
-ol#kc-totp-settings li {
- margin-top: 1em;
-}
-
-ol#kc-totp-settings li:first-of-type {
- margin-top: 0;
-}
-
-/* OAuth */
-
-#kc-oauth h3 {
- margin-top: 0;
-}
-
-#kc-oauth ul {
- list-style: none;
- padding: 0;
- margin: 0;
-}
-
-#kc-oauth ul li {
- border-top: 1px solid rgba(255, 255, 255, 0.1);
- font-size: 12px;
- padding: 10px 30px;
-}
-
-#kc-oauth ul li:first-of-type {
- border-top: 0;
-}
-
-#kc-oauth .kc-role {
- display: inline-block;
- width: 50%;
-}
-
-/* Code */
-#kc-code textarea {
- width: 100%;
- height: 8em;
-}
-
-/* Social */
-
-#kc-social-providers ul {
- padding: 0;
- margin: 0;
-}
-
-#kc-social-providers li {
- display: block;
- margin-top: 5px;
-}
-
-#kc-social-providers li:first-of-type {
- margin-top: 0;
-}
-
-.zocial {
- width: 150px;
-}
-
-.zocial:hover {
- color: #fff !important;
-}
-
-.zocial.facebook,
-.zocial.github,
-.zocial.google,
-.zocial.microsoft,
-.zocial.stackoverflow,
-.zocial.linkedin,
-.zocial.twitter {
- background-image: none;
- border-radius: 2px;
-
- font-family: "Open Sans", sans-serif;
- font-weight: normal;
-
- box-shadow: none;
- text-shadow: none;
-}
-
-.zocial.google {
- background-color: #dd4b39 !important;
-}
-.zocial.google .text:after {
- content: "+";
-}
-
-.zocial.facebook:hover,
-.zocial.github:hover,
-.zocial.google:hover,
-.zocial.microsoft:hover,
-.zocial.stackoverflow:hover,
-.zocial.linkedin:hover,
-.zocial.twitter:hover {
- background-image: linear-gradient(rgba(0, 0, 0, 0.2) 0%, rgba(0, 0, 0, 0.2) 100%) !important;
-}
-
-/* Copy of zocial windows classes to be used for microsoft's social provider button */
-.zocial.microsoft {background-color: #0052a4; color: #fff;}
-.zocial.microsoft:before { content: "\f15d"; }
-
-
-@media (min-width: 768px) {
- #kc-container-wrapper {
- bottom: 13%;
- position: absolute;
- width: 100%;
- }
-
- #kc-logo-wrapper {
- position: absolute;
- top: 50px;
- right: 50px;
- }
-
- .login-pf .container {
- padding-right: 80px;
- }
-
- #kc-locale {
- position: relative;
- width: 200px;
- left: -230px;
- text-align: right;
- z-index: 9999;
- }
-}
-
-@media (max-width: 767px) {
-
- #kc-logo-wrapper {
- background-position: center;
- width: 100%;
- margin: 20px 0;
- }
-
- #kc-header {
- padding-left: 15px;
- padding-right: 15px;
- float: none;
- text-align: center;
- }
-
- #kc-form {
- float: none;
- }
-
- #kc-info-wrapper {
- border-top: 1px solid rgba(255, 255, 255, 0.1);
- margin-top: 15px;
- padding-top: 15px;
- padding-left: 0px;
- padding-right: 15px;
- }
-
- #kc-social-providers li {
- display: inline-block;
- margin-right: 5px;
- }
-
- .login-pf .container {
- padding-top: 15px;
- padding-bottom: 15px;
- }
-
- #kc-locale {
- position: absolute;
- width: 200px;
- top: 10px;
- right: 0px;
- text-align: right;
- z-index: 9999;
- }
-}
-
-@media (max-height: 500px) {
- #kc-container-wrapper {
- }
-}
diff --git a/keycloak/theme/login/template.ftl b/keycloak/theme/login/template.ftl
index a6b93b167..e62c05a70 100755
--- a/keycloak/theme/login/template.ftl
+++ b/keycloak/theme/login/template.ftl
@@ -1,89 +1,95 @@
-<#macro registrationLayout bodyClass="" displayInfo=false displayMessage=true>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" class="${properties.kcHtmlClass!}">
-
+<#macro registrationLayout displayInfo=false displayMessage=true>
+<!DOCTYPE html>
+<html>
<head>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
+ <meta name="robots" content="noindex, nofollow">
+
<#if properties.meta?has_content>
<#list properties.meta?split(' ') as meta>
<meta name="${meta?split('==')[0]}" content="${meta?split('==')[1]}"/>
</#list>
</#if>
- <title><#nested "title"></title>
- <link rel="icon" href="${url.resourcesPath}/img/favicon.ico" />
- <#if properties.styles?has_content>
- <#list properties.styles?split(' ') as style>
- <link href="${url.resourcesPath}/${style}" rel="stylesheet" />
- </#list>
- </#if>
- <#if properties.scripts?has_content>
- <#list properties.scripts?split(' ') as script>
- <script src="${url.resourcesPath}/${script}" type="text/javascript"></script>
- </#list>
- </#if>
- <#if scripts??>
- <#list scripts as script>
- <script src="${script}" type="text/javascript"></script>
- </#list>
- </#if>
-</head>
-<body class="${properties.kcBodyClass!}">
+ <link rel="icon" type="image/png" href="/static/img/favicon.png" />
+
+ <script src="/static//js/loader.js"></script>
-<div id="kc-container" class="${properties.kcContainerClass!}">
- <div id="kc-container-wrapper" class="${properties.kcContainerWrapperClass!}">
+ <title>OpenRemote Manager</title>
- <div id="kc-header" class="${properties.kcHeaderClass!}">
- <div id="kc-header-wrapper" class="${properties.kcHeaderWrapperClass!}"><#nested "header"></div>
+ <link rel="icon" type="image/png" href="/static/img/favicon.png" />
+
+ <script>
+ document.addEventListener("DOMContentLoaded", function (event) {
+ Promise.all([
+ load.js("/static/bower_components/webcomponentsjs/webcomponents-lite.min.js"),
+ load.import("/static/bower_components/iron-flex-layout/iron-flex-layout-classes.html"),
+ load.css("/static/bower_components/font-awesome/css/font-awesome.css"),
+
+ load.import("/static/css/style.html"),
+ load.import("/static/css/theme.html")
+ ]).then(function () {
+ console.log("Auxiliary application resources loaded, web components will initialize...");
+ }).catch(function () {
+ alert("Error loading application resources. " + defaultErrorMessage);
+ });
+ });
+ </script>
+</head>
+<body class="layout vertical">
+
+ <div class="flex layout vertical center-center">
+
+ <div class="layout horizontal center-center" style="margin: 1em;">
+ <svg style="pointer-events: none; display: block; width: 4em; height:4em; margin-right: 0.4em;"
+ viewBox="0 0 24 24"
+ preserveAspectRatio="xMidYMid meet">
+ <path fill="#C4D600"
+ d="M11.93,21.851c-5.551,0-10.066-4.515-10.066-10.065h2.108c0,4.388,3.57,7.958,7.958,7.958 c4.387,0,7.958-3.57,7.958-7.958c0-4.388-3.57-7.958-7.958-7.958V1.72c5.55,0,10.066,4.517,10.066,10.066 C21.996,17.336,17.48,21.851,11.93,21.851L11.93,21.851z"/>
+ <path fill="#4E9D2D"
+ d="M10.406,19.088c-1.95-0.406-3.626-1.549-4.717-3.215s-1.469-3.66-1.062-5.61 c0.407-1.951,1.55-3.626,3.217-4.718c1.667-1.092,3.659-1.469,5.61-1.062c4.027,0.84,6.62,4.799,5.779,8.825l-2.063-0.429 c0.603-2.889-1.257-5.73-4.147-6.333c-1.4-0.292-2.829-0.022-4.025,0.762C7.802,8.091,6.982,9.293,6.69,10.693 c-0.291,1.398-0.021,2.828,0.762,4.024c0.783,1.196,1.985,2.016,3.385,2.307L10.406,19.088L10.406,19.088z"/>
+ <path fill="#1D5632"
+ d="M11.936,16.622c-0.082,0-0.164-0.001-0.245-0.004c-1.29-0.065-2.478-0.628-3.346-1.585 c-0.868-0.958-1.31-2.195-1.246-3.487l2.104,0.105c-0.036,0.728,0.214,1.427,0.704,1.967c0.488,0.54,1.16,0.858,1.888,0.894 c0.725,0.033,1.426-0.213,1.966-0.703c0.541-0.489,0.858-1.159,0.895-1.887c0.075-1.503-1.088-2.787-2.591-2.862l0.105-2.104 c2.664,0.132,4.724,2.406,4.592,5.07c-0.064,1.291-0.628,2.478-1.585,3.345C14.28,16.183,13.137,16.622,11.936,16.622L11.936,16.622 z"/>
+ </svg>
+ <div class="layout vertical">
+ <div class="or-Header1 theme-Header1" style="margin: 0;"><#nested "header"></div>
+ <div class="or-HeaderSub theme-HeaderSub" style="margin-left: 0.2em;">Manager Login</div>
+ </div>
</div>
<#if realm.internationalizationEnabled>
- <div id="kc-locale" class="${properties.kcLocaleClass!}">
- <div id="kc-locale-wrapper" class="${properties.kcLocaleWrapperClass!}">
- <div class="kc-dropdown" id="kc-locale-dropdown">
+ <div id="kc-locale">
+ <div id="kc-locale-dropdown">
<a href="#" id="kc-current-locale-link">${locale.current}</a>
<ul>
<#list locale.supported as l>
- <li class="kc-dropdown-item"><a href="${l.url}">${l.label}</a></li>
+ <li><a href="${l.url}">${l.label}</a></li>
</#list>
</ul>
</div>
- </div>
</div>
</#if>
- <div id="kc-content" class="${properties.kcContentClass!}">
- <div id="kc-content-wrapper" class="${properties.kcContentWrapperClass!}">
-
- <#if displayMessage && message?has_content>
- <div class="${properties.kcFeedbackAreaClass!}">
- <div class="alert alert-${message.type}">
- <#if message.type = 'success'><span class="${properties.kcFeedbackSuccessIcon}"></span></#if>
- <#if message.type = 'warning'><span class="${properties.kcFeedbackWarningIcon}"></span></#if>
- <#if message.type = 'error'><span class="${properties.kcFeedbackErrorIcon}"></span></#if>
- <#if message.type = 'info'><span class="${properties.kcFeedbackInfoIcon}"></span></#if>
- <span class="kc-feedback-text">${message.summary}</span>
- </div>
- </div>
- </#if>
+ <#if displayMessage && message?has_content>
+ <div class="layout horizontal or-FormMessages theme-FormMessages ${message.type}">
+ <#if message.type=='success' ><div class="or-MessagesIcon theme-MessagesIcon fa fa-check"></div></#if>
+ <#if message.type=='warning' ><div class="or-MessagesIcon theme-MessagesIcon fa fa-warning"></div></#if>
+ <#if message.type=='error' ><div class="or-MessagesIcon theme-MessagesIcon fa fa-warning"></div></#if>
+ <#if message.type=='info' ><div class="or-MessagesIcon theme-MessagesIcon fa fa-info"></div></#if>
+ ${message.summary}
+ </div>
+ </#if>
- <div id="kc-form" class="${properties.kcFormAreaClass!}">
- <div id="kc-form-wrapper" class="${properties.kcFormAreaWrapperClass!}">
- <#nested "form">
- </div>
- </div>
+ <#nested "form">
+
+ <#if displayInfo>
+ <#nested "info">
+ </#if>
- <#if displayInfo>
- <div id="kc-info" class="${properties.kcInfoAreaClass!}">
- <div id="kc-info-wrapper" class="${properties.kcInfoAreaWrapperClass!}">
- <#nested "info">
- </div>
- </div>
- </#if>
- </div>
- </div>
</div>
-</div>
+
</body>
</html>
</#macro>
diff --git a/keycloak/theme/login/theme.properties b/keycloak/theme/login/theme.properties
index 58e4e6b1c..ca5bcb85a 100644
--- a/keycloak/theme/login/theme.properties
+++ b/keycloak/theme/login/theme.properties
@@ -1,59 +1,2 @@
-# or-darkgreen: #006224; /* rgb(0, 98, 36); */
-# or-mediumgreen: #49a942; /* rgb(73, 169, 66); */
-# or-lightgreen: #c1d72f; /* rgb(193, 215, 47); */
-# or-darkgrey: #455a64; /* rgb(69, 90, 100); */
-# or-mediumgrey: #919194; /* rgb(145, 145, 148); */
-# or-lightgrey: #cccccc; /* rgb(204, 204, 204); */
-# or-brightgrey: #f5f5f5; /* rgb(245, 245, 245); */
-# or-red: #e64a19; /* rgb(230, 74, 25); */
-# or-yellow: #fbc02d; /* rgb(251, 192, 45); */
-# or-blue: #1976d2; /* rgb(25, 118, 210); */
-# or-purple: #660092; /* rgb(102, 0, 146) */
-
-# TODO cleanup
-
parent=base
import=common/keycloak
-
-styles=lib/patternfly/css/patternfly.css lib/zocial/zocial.css css/login.css
-meta=viewport==width=device-width,initial-scale=1
-
-kcHtmlClass=login-pf
-
-kcContentClass=col-sm-12 col-md-12 col-lg-12 container
-kcContentWrapperClass=row
-
-kcHeaderClass=col-xs-12 col-sm-8 col-md-8 col-lg-7
-kcFeedbackAreaClass=col-md-12
-kcLocaleClass=col-xs-12 col-sm-1
-kcAlertIconClasserror=pficon pficon-error-circle-o
-
-kcFormAreaClass=col-xs-12 col-sm-8 col-md-8 col-lg-7 login
-
-kcFeedbackErrorIcon=pficon pficon-error-circle-o
-kcFeedbackWarningIcon=pficon pficon-warning-triangle-o
-kcFeedbackSuccessIcon=pficon pficon-ok
-kcFeedbackInfoIcon=pficon pficon-info
-
-
-kcFormClass=form-horizontal
-kcFormGroupClass=form-group
-kcFormGroupErrorClass=has-error
-kcLabelClass=control-label
-kcLabelWrapperClass=col-xs-12 col-sm-12 col-md-4 col-lg-3
-kcInputClass=form-control
-kcInputWrapperClass=col-xs-12 col-sm-12 col-md-8 col-lg-9
-kcFormOptionsClass=col-xs-4 col-sm-5 col-md-offset-4 col-md-4 col-lg-offset-3 col-lg-5
-kcFormButtonsClass=col-xs-8 col-sm-7 col-md-4 col-lg-4 submit
-kcTextareaClass=form-control
-
-kcInfoAreaClass=col-xs-12 col-sm-4 col-md-4 col-lg-5 details
-
-##### css classes for form buttons
-# main class used for all buttons
-kcButtonClass=btn
-# classes defining priority of the button - primary or default (there is typically only one priority button for the form)
-kcButtonPrimaryClass=btn-primary
-kcButtonDefaultClass=btn-default
-# classes defining size of the button
-kcButtonLargeClass=btn-lg
diff --git a/manager/src/main/webapp/css/style.html b/manager/src/main/webapp/css/style.html
index 7ab49752d..0af486780 100644
--- a/manager/src/main/webapp/css/style.html
+++ b/manager/src/main/webapp/css/style.html
@@ -117,7 +117,6 @@
}
.or-Form {
- margin: 0.4em 0;
}
.or-FormMessages {
@@ -125,7 +124,7 @@
}
.or-FormGroup {
-
+ margin-bottom: 0.4em;
}
.or-FormLabel {
@@ -150,10 +149,9 @@
}
.or-FormInputText {
- border: 1px solid;
+ border-bottom: 1px solid;
font-size: inherit;
padding: 0.2em;
- border-radius: 0.2em;
}
.or-FormButton:focus, .or-FormButtonPrimary:focus {