From 5dad1e2c7fe3a484dd38573bc811dc37e9a7e751 Mon Sep 17 00:00:00 2001 From: Tim Date: Mon, 6 Sep 2021 10:14:25 +0200 Subject: [PATCH 1/2] Added IDP extension --- .../keywind/login/login-idp-link-confirm.ftl | 20 ++++++ theme/keywind/login/login-update-password.ftl | 42 ++++++++++++ theme/keywind/login/login-update-profile.ftl | 64 +++++++++++++++++++ 3 files changed, 126 insertions(+) create mode 100644 theme/keywind/login/login-idp-link-confirm.ftl create mode 100644 theme/keywind/login/login-update-password.ftl create mode 100644 theme/keywind/login/login-update-profile.ftl diff --git a/theme/keywind/login/login-idp-link-confirm.ftl b/theme/keywind/login/login-idp-link-confirm.ftl new file mode 100644 index 0000000..7e44d8f --- /dev/null +++ b/theme/keywind/login/login-idp-link-confirm.ftl @@ -0,0 +1,20 @@ +<#import "template.ftl" as layout> +<#import "components/button/primary.ftl" as buttonPrimary> +<@layout.registrationLayout; section> + <#if section = "header"> + ${msg("confirmLinkIdpTitle")} + <#elseif section = "form"> +
+
+ <@buttonPrimary.kw type="submit" name="submitAction" id="updateProfile" value="updateProfile"> + ${msg("confirmLinkIdpReviewProfile")} + +
+
+ <@buttonPrimary.kw type="submit" name="submitAction" id="linkAccount" value="linkAccount"> + ${msg("confirmLinkIdpContinue", idpDisplayName)} + +
+
+ + diff --git a/theme/keywind/login/login-update-password.ftl b/theme/keywind/login/login-update-password.ftl new file mode 100644 index 0000000..0297275 --- /dev/null +++ b/theme/keywind/login/login-update-password.ftl @@ -0,0 +1,42 @@ +<#import "template.ftl" as layout> +<#import "components/button/primary.ftl" as buttonPrimary> +<#import "components/input/primary.ftl" as inputPrimary> +<@layout.registrationLayout displayMessage=!messagesPerField.existsError('password','password-confirm'); section> + <#if section = "header"> + ${msg("updatePasswordTitle")} + <#elseif section = "form"> +
+ + + +
+ <@inputPrimary.kw + autocomplete="new-password" + invalid=["password", "password-confirm"] + message=false + autofocus=true + name="password-new" + type="password" + > + ${msg("passwordNew")} + +
+
+ <@inputPrimary.kw + autocomplete="new-password" + invalid=["password-confirm"] + name="password-confirm" + type="password" + > + ${msg("passwordConfirm")} + +
+
+ <@buttonPrimary.kw type="submit"> + ${msg("doSubmit")} + +
+
+ + \ No newline at end of file diff --git a/theme/keywind/login/login-update-profile.ftl b/theme/keywind/login/login-update-profile.ftl new file mode 100644 index 0000000..771dd26 --- /dev/null +++ b/theme/keywind/login/login-update-profile.ftl @@ -0,0 +1,64 @@ +<#import "template.ftl" as layout> +<#import "components/button/primary.ftl" as buttonPrimary> +<#import "components/input/primary.ftl" as inputPrimary> +<@layout.registrationLayout displayMessage=!messagesPerField.existsError('username','email','firstName','lastName'); section> + <#if section = "header"> + ${msg("loginProfileTitle")} + <#elseif section = "form"> +
+ <#if user.editUsernameAllowed> +
+ <@inputPrimary.kw + autocomplete="username" + autofocus=true + invalid=["username"] + name="username" + type="text" + value=(user.username)!'' + > + ${msg("username")} + +
+ +
+ <@inputPrimary.kw + autocomplete="email" + invalid=["email"] + name="email" + type="email" + value=(user.email)!'' + > + ${msg("email")} + +
+
+ <@inputPrimary.kw + autocomplete="given-name" + invalid=["firstName"] + name="firstName" + type="text" + value=(user.firstName)!'' + > + ${msg("firstName")} + +
+
+ <@inputPrimary.kw + autocomplete="family-name" + invalid=["lastName"] + name="lastName" + type="text" + value=(user.lastName)!'' + > + ${msg("lastName")} + +
+ +
+ <@buttonPrimary.kw type="submit"> + ${msg("doSubmit")} + +
+
+ + From 60792959f3d987147c9b93e59ec452ac73eb4cd0 Mon Sep 17 00:00:00 2001 From: "@lukin" Date: Mon, 6 Sep 2021 18:40:00 +0700 Subject: [PATCH 2/2] Prettier --- .../keywind/login/login-idp-link-confirm.ftl | 33 ++--- theme/keywind/login/login-update-password.ftl | 87 ++++++------ theme/keywind/login/login-update-profile.ftl | 125 +++++++++--------- theme/keywind/login/login.ftl | 20 +-- 4 files changed, 142 insertions(+), 123 deletions(-) diff --git a/theme/keywind/login/login-idp-link-confirm.ftl b/theme/keywind/login/login-idp-link-confirm.ftl index 7e44d8f..5f7923e 100644 --- a/theme/keywind/login/login-idp-link-confirm.ftl +++ b/theme/keywind/login/login-idp-link-confirm.ftl @@ -1,20 +1,21 @@ <#import "template.ftl" as layout> <#import "components/button/primary.ftl" as buttonPrimary> + <@layout.registrationLayout; section> - <#if section = "header"> - ${msg("confirmLinkIdpTitle")} - <#elseif section = "form"> -
-
- <@buttonPrimary.kw type="submit" name="submitAction" id="updateProfile" value="updateProfile"> - ${msg("confirmLinkIdpReviewProfile")} - -
-
- <@buttonPrimary.kw type="submit" name="submitAction" id="linkAccount" value="linkAccount"> - ${msg("confirmLinkIdpContinue", idpDisplayName)} - -
-
- + <#if section="header"> + ${msg("confirmLinkIdpTitle")} + <#elseif section="form"> +
+
+ <@buttonPrimary.kw name="submitAction" type="submit" value="updateProfile"> + ${msg("confirmLinkIdpReviewProfile")} + +
+
+ <@buttonPrimary.kw name="submitAction" type="submit" value="linkAccount"> + ${msg("confirmLinkIdpContinue", idpDisplayName)} + +
+
+ diff --git a/theme/keywind/login/login-update-password.ftl b/theme/keywind/login/login-update-password.ftl index 0297275..84d3037 100644 --- a/theme/keywind/login/login-update-password.ftl +++ b/theme/keywind/login/login-update-password.ftl @@ -1,42 +1,53 @@ <#import "template.ftl" as layout> <#import "components/button/primary.ftl" as buttonPrimary> <#import "components/input/primary.ftl" as inputPrimary> -<@layout.registrationLayout displayMessage=!messagesPerField.existsError('password','password-confirm'); section> - <#if section = "header"> - ${msg("updatePasswordTitle")} - <#elseif section = "form"> -
- - -
- <@inputPrimary.kw - autocomplete="new-password" - invalid=["password", "password-confirm"] - message=false - autofocus=true - name="password-new" - type="password" - > - ${msg("passwordNew")} - -
-
- <@inputPrimary.kw - autocomplete="new-password" - invalid=["password-confirm"] - name="password-confirm" - type="password" - > - ${msg("passwordConfirm")} - -
-
- <@buttonPrimary.kw type="submit"> - ${msg("doSubmit")} - -
-
- - \ No newline at end of file +<@layout.registrationLayout + displayMessage=!messagesPerField.existsError("password", "password-confirm") + ; + section +> + <#if section="header"> + ${msg("updatePasswordTitle")} + <#elseif section="form"> +
+ + +
+ <@inputPrimary.kw + autocomplete="new-password" + autofocus=true + invalid=["password", "password-confirm"] + message=false + name="password-new" + type="password" + > + ${msg("passwordNew")} + +
+
+ <@inputPrimary.kw + autocomplete="new-password" + invalid=["password-confirm"] + name="password-confirm" + type="password" + > + ${msg("passwordConfirm")} + +
+ + <#-- TODO isAppInitiatedAction --> + +
+ <@buttonPrimary.kw type="submit"> + ${msg("doSubmit")} + +
+
+ + diff --git a/theme/keywind/login/login-update-profile.ftl b/theme/keywind/login/login-update-profile.ftl index 771dd26..6c538e9 100644 --- a/theme/keywind/login/login-update-profile.ftl +++ b/theme/keywind/login/login-update-profile.ftl @@ -1,64 +1,71 @@ <#import "template.ftl" as layout> <#import "components/button/primary.ftl" as buttonPrimary> <#import "components/input/primary.ftl" as inputPrimary> -<@layout.registrationLayout displayMessage=!messagesPerField.existsError('username','email','firstName','lastName'); section> - <#if section = "header"> - ${msg("loginProfileTitle")} - <#elseif section = "form"> -
- <#if user.editUsernameAllowed> -
- <@inputPrimary.kw - autocomplete="username" - autofocus=true - invalid=["username"] - name="username" - type="text" - value=(user.username)!'' - > - ${msg("username")} - -
- -
- <@inputPrimary.kw - autocomplete="email" - invalid=["email"] - name="email" - type="email" - value=(user.email)!'' - > - ${msg("email")} - -
-
- <@inputPrimary.kw - autocomplete="given-name" - invalid=["firstName"] - name="firstName" - type="text" - value=(user.firstName)!'' - > - ${msg("firstName")} - -
-
- <@inputPrimary.kw - autocomplete="family-name" - invalid=["lastName"] - name="lastName" - type="text" - value=(user.lastName)!'' - > - ${msg("lastName")} - -
-
- <@buttonPrimary.kw type="submit"> - ${msg("doSubmit")} - -
-
- +<@layout.registrationLayout + displayMessage=!messagesPerField.existsError("email", "firstName", "lastName", "username") + ; + section +> + <#if section="header"> + ${msg("loginProfileTitle")} + <#elseif section="form"> +
+ <#if user.editUsernameAllowed> +
+ <@inputPrimary.kw + autocomplete="username" + autofocus=true + invalid=["username"] + name="username" + type="text" + value=(user.username)!'' + > + ${msg("username")} + +
+ +
+ <@inputPrimary.kw + autocomplete="email" + invalid=["email"] + name="email" + type="email" + value=(user.email)!'' + > + ${msg("email")} + +
+
+ <@inputPrimary.kw + autocomplete="given-name" + invalid=["firstName"] + name="firstName" + type="text" + value=(user.firstName)!'' + > + ${msg("firstName")} + +
+
+ <@inputPrimary.kw + autocomplete="family-name" + invalid=["lastName"] + name="lastName" + type="text" + value=(user.lastName)!'' + > + ${msg("lastName")} + +
+ + <#-- TODO isAppInitiatedAction --> + +
+ <@buttonPrimary.kw type="submit"> + ${msg("doSubmit")} + +
+
+ diff --git a/theme/keywind/login/login.ftl b/theme/keywind/login/login.ftl index c704742..9b02754 100644 --- a/theme/keywind/login/login.ftl +++ b/theme/keywind/login/login.ftl @@ -51,16 +51,16 @@
- <#if realm.rememberMe && !usernameEditDisabled??> - <@checkboxPrimary.kw checked=login.rememberMe?? name="rememberMe"> - ${msg("rememberMe")} - - - <#if realm.resetPasswordAllowed> - <@linkPrimary.kw href=url.loginResetCredentialsUrl> - ${msg("doForgotPassword")} - - + <#if realm.rememberMe && !usernameEditDisabled??> + <@checkboxPrimary.kw checked=login.rememberMe?? name="rememberMe"> + ${msg("rememberMe")} + + + <#if realm.resetPasswordAllowed> + <@linkPrimary.kw href=url.loginResetCredentialsUrl> + ${msg("doForgotPassword")} + +
<@buttonPrimary.kw name="login" type="submit">