From b488fe24a27bf76e0b777202bf13a68660121305 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20B=C3=A4dorf?= Date: Mon, 28 Nov 2022 15:28:56 +0100 Subject: [PATCH] Fix Authenticator remove button --- account/template.ftl | 2 +- account/totp.ftl | 242 +++++++++++++++--------------- common/resources/scss/button.scss | 15 +- login/template.ftl | 2 +- 4 files changed, 133 insertions(+), 128 deletions(-) diff --git a/account/template.ftl b/account/template.ftl index 7bedd04..14a948c 100644 --- a/account/template.ftl +++ b/account/template.ftl @@ -10,7 +10,7 @@ - + diff --git a/account/totp.ftl b/account/totp.ftl index b5ff59b..100d344 100755 --- a/account/totp.ftl +++ b/account/totp.ftl @@ -1,131 +1,131 @@ <#import "template.ftl" as layout> <@layout.mainLayout active='totp' bodyClass='totp'; section> -
-
-

${msg("authenticatorTitle")}

-
- <#if totp.otpCredentials?size == 0> -
- * ${msg("requiredFields")} -
- +
+
+

${msg("authenticatorTitle")}

+
+ <#if totp.otpCredentials?size == 0> +
+ * ${msg("requiredFields")} +
+ +
+ + <#if totp.enabled> + + + <#if totp.otpCredentials?size gt 1> + + + + <#else> + + + + + + + <#list totp.otpCredentials as credential> + + + <#if totp.otpCredentials?size gt 1> + + + + + + + +
${msg("configureAuthenticators")}
${msg("configureAuthenticators")}
${msg("mobile")}${credential.id}${credential.userLabel!} +
+ + + + +
+
+ <#else> + +
+ +
    +
  1. +

    ${msg("totpStep1")}

    + +
      + <#list totp.supportedApplications as app> +
    • ${msg(app)}
    • + +
    +
  2. + + <#if mode?? && mode = "manual"> +
  3. +

    ${msg("totpManualStep2")}

    +
    ${totp.totpSecretEncoded}
    +

    ${msg("totpScanBarcode")}

    +
  4. +
  5. +

    ${msg("totpManualStep3")}

    +
      +
    • ${msg("totpType")}: ${msg("totp." + totp.policy.type)}
    • +
    • ${msg("totpAlgorithm")}: ${totp.policy.getAlgorithmKey()}
    • +
    • ${msg("totpDigits")}: ${totp.policy.digits}
    • + <#if totp.policy.type = "totp"> +
    • ${msg("totpInterval")}: ${totp.policy.period}
    • + <#elseif totp.policy.type = "hotp"> +
    • ${msg("totpCounter")}: ${totp.policy.initialCounter}
    • + +
    +
  6. + <#else> +
  7. +

    ${msg("totpStep2")}

    +

    Figure: Barcode

    +

    ${msg("totpUnableToScan")}

    +
  8. + +
  9. +

    ${msg("totpStep3")}

    +

    ${msg("totpStep3DeviceName")}

    +
  10. +
+ +
+ +
+ +
+ + + +
- <#if totp.enabled> - - - <#if totp.otpCredentials?size gt 1> - - - - <#else> - - - - - - - <#list totp.otpCredentials as credential> - - - <#if totp.otpCredentials?size gt 1> - - - - - - - -
${msg("configureAuthenticators")}
${msg("configureAuthenticators")}
${msg("mobile")}${credential.id}${credential.userLabel!} - - - - - - -
- <#else> +
+ -
+ +
-
    -
  1. -

    ${msg("totpStep1")}

    - -
      - <#list totp.supportedApplications as app> -
    • ${msg(app)}
    • - -
    -
  2. - - <#if mode?? && mode = "manual"> -
  3. -

    ${msg("totpManualStep2")}

    -
    ${totp.totpSecretEncoded}
    -

    ${msg("totpScanBarcode")}

    -
  4. -
  5. -

    ${msg("totpManualStep3")}

    -
      -
    • ${msg("totpType")}: ${msg("totp." + totp.policy.type)}
    • -
    • ${msg("totpAlgorithm")}: ${totp.policy.getAlgorithmKey()}
    • -
    • ${msg("totpDigits")}: ${totp.policy.digits}
    • - <#if totp.policy.type = "totp"> -
    • ${msg("totpInterval")}: ${totp.policy.period}
    • - <#elseif totp.policy.type = "hotp"> -
    • ${msg("totpCounter")}: ${totp.policy.initialCounter}
    • - -
    -
  6. - <#else> -
  7. -

    ${msg("totpStep2")}

    -

    Figure: Barcode

    -

    ${msg("totpUnableToScan")}

    -
  8. - -
  9. -

    ${msg("totpStep3")}

    -

    ${msg("totpStep3DeviceName")}

    -
  10. -
- -
- -
- -
- - - - +
+
+
+ +
- -
- - - -
- -
-
-
- - -
-
-
- - +
+
+ + diff --git a/common/resources/scss/button.scss b/common/resources/scss/button.scss index 23ca2a6..96ea290 100644 --- a/common/resources/scss/button.scss +++ b/common/resources/scss/button.scss @@ -1,9 +1,9 @@ .ps-button { - padding: 0.5rem 1rem; font-size: 1rem; - line-height: 1.2rem; - border: 2px solid var(--foreground); - border-radius: 1.5rem; + padding: 0.5em 1em; + line-height: 1.2em; + border: 0.125em solid var(--foreground); + border-radius: 1.5em; background-color: var(--background-darker-2); cursor: pointer; @@ -13,7 +13,7 @@ } &_primary { - border: 4px solid var(--foreground); + border: 0.25em solid var(--foreground); background-color: var(--background); color: var(--foreground); font-weight: bold; @@ -24,4 +24,9 @@ color: var(--background); } } + + &_small { + font-size: 0.8rem; + padding: 0.25em 0.7em; + } } diff --git a/login/template.ftl b/login/template.ftl index 1c58aa2..f8dd10b 100644 --- a/login/template.ftl +++ b/login/template.ftl @@ -13,7 +13,7 @@ - +