From 709884212abe2e149b8d1a3e329617f6fe5d949b Mon Sep 17 00:00:00 2001 From: Ryan Wang Date: Mon, 7 Oct 2024 17:28:51 +0800 Subject: [PATCH] refactor: login-related page templates structure (#6769) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #### What type of PR is this? /area core /kind improvement /milestone 2.20.x #### What this PR does / why we need it: Fixes https://github.com/halo-dev/halo/issues/6760 重构登录、注册、找回密码、两步验证等模板的结构,提供更好的复用性,现在主题可以这样复用模板: login.html ```html
``` signup.html ```html
``` challenges/two-factor/totp.html ```html
``` #### Special notes for your reviewer: 需要测试各个页面是否功能正常 #### Does this PR introduce a user-facing change? ```release-note None ``` --- .../templates/challenges/two-factor/totp.html | 30 +- .../challenges/two-factor/totp.properties | 3 - .../challenges/two-factor/totp_en.properties | 3 - .../challenges/two-factor/totp_es.properties | 3 - .../two-factor/totp_zh_TW.properties | 3 - .../gateway_modules/common_fragments.html | 13 +- .../gateway_modules/form_fragments.html | 291 ++++++++++++++++++ .../gateway_modules/form_fragments.properties | 36 +++ .../form_fragments_en.properties | 36 +++ .../form_fragments_es.properties | 36 +++ .../form_fragments_zh_TW.properties | 36 +++ .../gateway_modules/login_fragments.html | 40 +-- .../login_fragments.properties | 10 - .../login_fragments_en.properties | 10 - .../login_fragments_es.properties | 11 +- .../login_fragments_zh_TW.properties | 10 +- .../src/main/resources/templates/login.html | 4 +- .../main/resources/templates/login_email.html | 37 --- .../src/main/resources/templates/logout.html | 8 +- .../resources/templates/logout.properties | 3 +- .../resources/templates/logout_en.properties | 3 +- .../resources/templates/logout_es.properties | 3 +- .../templates/logout_zh_TW.properties | 3 +- .../templates/password-reset-link.html | 27 +- .../templates/password-reset-link.properties | 4 - .../password-reset-link_en.properties | 4 - .../password-reset-link_es.properties | 4 - .../password-reset-link_zh_TW.properties | 4 - .../resources/templates/password-reset.html | 23 +- .../templates/password-reset.properties | 4 - .../templates/password-reset_en.properties | 4 - .../templates/password-reset_es.properties | 6 +- .../templates/password-reset_zh_TW.properties | 6 +- .../src/main/resources/templates/signup.html | 190 +----------- .../resources/templates/signup.properties | 15 +- .../resources/templates/signup_en.properties | 15 +- .../resources/templates/signup_es.properties | 15 +- .../templates/signup_zh_TW.properties | 15 +- 38 files changed, 466 insertions(+), 502 deletions(-) create mode 100644 application/src/main/resources/templates/gateway_modules/form_fragments.html create mode 100644 application/src/main/resources/templates/gateway_modules/form_fragments.properties create mode 100644 application/src/main/resources/templates/gateway_modules/form_fragments_en.properties create mode 100644 application/src/main/resources/templates/gateway_modules/form_fragments_es.properties create mode 100644 application/src/main/resources/templates/gateway_modules/form_fragments_zh_TW.properties delete mode 100644 application/src/main/resources/templates/login_email.html diff --git a/application/src/main/resources/templates/challenges/two-factor/totp.html b/application/src/main/resources/templates/challenges/two-factor/totp.html index 96baa8d8c..7b02af8ab 100644 --- a/application/src/main/resources/templates/challenges/two-factor/totp.html +++ b/application/src/main/resources/templates/challenges/two-factor/totp.html @@ -8,35 +8,7 @@

-
- -
- -
- -
-
-
- -
-
+
diff --git a/application/src/main/resources/templates/challenges/two-factor/totp.properties b/application/src/main/resources/templates/challenges/two-factor/totp.properties index dfea51a90..1b02e431c 100644 --- a/application/src/main/resources/templates/challenges/two-factor/totp.properties +++ b/application/src/main/resources/templates/challenges/two-factor/totp.properties @@ -1,4 +1 @@ title=两步验证 -messages.invalidError=错误的验证码 -form.code.label=验证码 -form.submit=验证 \ No newline at end of file diff --git a/application/src/main/resources/templates/challenges/two-factor/totp_en.properties b/application/src/main/resources/templates/challenges/two-factor/totp_en.properties index bffc96863..65a92c204 100644 --- a/application/src/main/resources/templates/challenges/two-factor/totp_en.properties +++ b/application/src/main/resources/templates/challenges/two-factor/totp_en.properties @@ -1,4 +1 @@ title=Two-Factor Authentication -messages.invalidError=Invalid TOTP code -form.code.label=TOTP Code -form.submit=Verify diff --git a/application/src/main/resources/templates/challenges/two-factor/totp_es.properties b/application/src/main/resources/templates/challenges/two-factor/totp_es.properties index 43e5e25e1..0f0517887 100644 --- a/application/src/main/resources/templates/challenges/two-factor/totp_es.properties +++ b/application/src/main/resources/templates/challenges/two-factor/totp_es.properties @@ -1,4 +1 @@ title=Autenticación en Dos Pasos -messages.invalidError=Código de verificación incorrecto -form.code.label=Código de Verificación -form.submit=Verificar \ No newline at end of file diff --git a/application/src/main/resources/templates/challenges/two-factor/totp_zh_TW.properties b/application/src/main/resources/templates/challenges/two-factor/totp_zh_TW.properties index a2be3bc9c..8b8ac4120 100644 --- a/application/src/main/resources/templates/challenges/two-factor/totp_zh_TW.properties +++ b/application/src/main/resources/templates/challenges/two-factor/totp_zh_TW.properties @@ -1,4 +1 @@ title=兩步驗證 -messages.invalidError=錯誤的驗證碼 -form.code.label=驗證碼 -form.submit=驗證 diff --git a/application/src/main/resources/templates/gateway_modules/common_fragments.html b/application/src/main/resources/templates/gateway_modules/common_fragments.html index 78885a91f..6ce5f4a41 100644 --- a/application/src/main/resources/templates/gateway_modules/common_fragments.html +++ b/application/src/main/resources/templates/gateway_modules/common_fragments.html @@ -1,7 +1,9 @@ - - + + + + + + + + +