feat(auth): 登录注册找回绑定前台 1:1 壳层/文案/协议
抽出 sign.css,统一全页登录/注册与找回/绑定视觉;中文文案与用户协议契约对齐 Auth_Service;弹层字段与 logo 同步。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -51,32 +51,40 @@ foreach ($oauth_providers as $provider) {
|
||||
|
||||
$site_name = get_bloginfo('name');
|
||||
$reset_url = function_exists('aksrt_get_reset_password_url') ? aksrt_get_reset_password_url() : wp_lostpassword_url();
|
||||
$agreement = function_exists('aksrt_get_auth_agreement_view')
|
||||
? aksrt_get_auth_agreement_view()
|
||||
: ['enabled' => true, 'required' => true, 'label_html' => esc_html__('我已阅读并同意用户协议', 'aksrt'), 'field_name' => 'agree_terms'];
|
||||
$logo_url = class_exists('AKSRT_Settings') ? AKSRT_Settings::user_logo_url() : '';
|
||||
?>
|
||||
|
||||
<div class="aksrt-modal-auth" id="aksrt-modal-auth" aria-hidden="true" role="dialog" aria-modal="true" aria-label="<?php esc_attr_e('Sign In', 'aksrt'); ?>">
|
||||
<div class="aksrt-modal-auth" id="aksrt-modal-auth" aria-hidden="true" role="dialog" aria-modal="true" aria-label="<?php esc_attr_e('登录', 'aksrt'); ?>">
|
||||
<div class="aksrt-modal-auth__overlay"></div>
|
||||
<div class="aksrt-modal-auth__card">
|
||||
<button type="button" class="aksrt-modal-auth__close" aria-label="<?php esc_attr_e('Close', 'aksrt'); ?>">
|
||||
<button type="button" class="aksrt-modal-auth__close" aria-label="<?php esc_attr_e('关闭', 'aksrt'); ?>">
|
||||
<i class="fas fa-times"></i>
|
||||
</button>
|
||||
|
||||
<div class="aksrt-modal-auth__header">
|
||||
<div class="aksrt-modal-auth__logo">AK</div>
|
||||
<?php if ($logo_url) : ?>
|
||||
<div class="aksrt-modal-auth__logo aksrt-modal-auth__logo--image"><img src="<?php echo esc_url($logo_url); ?>" alt=""></div>
|
||||
<?php else : ?>
|
||||
<div class="aksrt-modal-auth__logo"><?php echo esc_html(mb_substr($site_name, 0, 2)); ?></div>
|
||||
<?php endif; ?>
|
||||
<h2 class="aksrt-modal-auth__title"><?php echo esc_html($site_name); ?></h2>
|
||||
</div>
|
||||
|
||||
<div class="aksrt-modal-auth__tabs" role="tablist">
|
||||
<button type="button" class="aksrt-modal-auth__tab is-active" data-tab="login" role="tab" aria-selected="true">
|
||||
<?php esc_html_e('Sign In', 'aksrt'); ?>
|
||||
<?php esc_html_e('登录', 'aksrt'); ?>
|
||||
</button>
|
||||
<?php if ($registration_open) : ?>
|
||||
<button type="button" class="aksrt-modal-auth__tab" data-tab="register" role="tab" aria-selected="false">
|
||||
<?php esc_html_e('Register', 'aksrt'); ?>
|
||||
<?php esc_html_e('注册', 'aksrt'); ?>
|
||||
</button>
|
||||
<?php endif; ?>
|
||||
<?php if ($show_qrcode_tab) : ?>
|
||||
<button type="button" class="aksrt-modal-auth__tab" data-tab="qrcode" role="tab" aria-selected="false">
|
||||
<?php esc_html_e('QR Login', 'aksrt'); ?>
|
||||
<?php esc_html_e('扫码登录', 'aksrt'); ?>
|
||||
</button>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
@@ -84,7 +92,7 @@ $reset_url = function_exists('aksrt_get_reset_password_url') ? aksrt_get_reset_p
|
||||
<div class="aksrt-modal-auth__panel is-active" data-panel="login">
|
||||
<?php if ($close_signin) : ?>
|
||||
<div class="aksrt-modal-auth__error is-success" id="aksrt-modal-login-error">
|
||||
<?php esc_html_e('Password sign-in is currently disabled. Please use one of the social login methods below.', 'aksrt'); ?>
|
||||
<?php esc_html_e('当前已关闭账密登录,请使用下方第三方登录方式。', 'aksrt'); ?>
|
||||
</div>
|
||||
<?php else : ?>
|
||||
<form class="aksrt-modal-auth__form" id="aksrt-modal-login-form">
|
||||
@@ -92,15 +100,15 @@ $reset_url = function_exists('aksrt_get_reset_password_url') ? aksrt_get_reset_p
|
||||
<?php wp_nonce_field('aksrt_login', '_login_nonce'); ?>
|
||||
|
||||
<div class="aksrt-modal-auth__field">
|
||||
<label for="modal-login-user"><?php esc_html_e('Email / Username', 'aksrt'); ?></label>
|
||||
<input type="text" id="modal-login-user" name="log" autocomplete="username" required placeholder="<?php esc_attr_e('Please enter your email or username', 'aksrt'); ?>">
|
||||
<label for="modal-login-user"><?php esc_html_e('邮箱 / 用户名', 'aksrt'); ?></label>
|
||||
<input type="text" id="modal-login-user" name="log" autocomplete="username" required placeholder="<?php esc_attr_e('请输入邮箱或用户名', 'aksrt'); ?>">
|
||||
</div>
|
||||
|
||||
<div class="aksrt-modal-auth__field">
|
||||
<label for="modal-login-pass"><?php esc_html_e('Password', 'aksrt'); ?></label>
|
||||
<label for="modal-login-pass"><?php esc_html_e('密码', 'aksrt'); ?></label>
|
||||
<div class="aksrt-modal-auth__pass-wrap">
|
||||
<input type="password" id="modal-login-pass" name="pwd" autocomplete="current-password" required placeholder="<?php esc_attr_e('Please enter your password', 'aksrt'); ?>">
|
||||
<button type="button" class="aksrt-modal-auth__pass-toggle" aria-label="<?php esc_attr_e('Toggle password visibility', 'aksrt'); ?>">
|
||||
<input type="password" id="modal-login-pass" name="pwd" autocomplete="current-password" required placeholder="<?php esc_attr_e('请输入密码', 'aksrt'); ?>">
|
||||
<button type="button" class="aksrt-modal-auth__pass-toggle" aria-label="<?php esc_attr_e('显示或隐藏密码', 'aksrt'); ?>">
|
||||
<i class="far fa-eye"></i>
|
||||
</button>
|
||||
</div>
|
||||
@@ -111,11 +119,11 @@ $reset_url = function_exists('aksrt_get_reset_password_url') ? aksrt_get_reset_p
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="aksrt-modal-auth__actions">
|
||||
<a href="<?php echo esc_url($reset_url); ?>" class="aksrt-modal-auth__link"><?php esc_html_e('Forgot password?', 'aksrt'); ?></a>
|
||||
<a href="<?php echo esc_url($reset_url); ?>" class="aksrt-modal-auth__link"><?php esc_html_e('忘记密码?', 'aksrt'); ?></a>
|
||||
</div>
|
||||
|
||||
<button type="submit" class="aksrt-modal-auth__submit">
|
||||
<span><?php esc_html_e('Sign In', 'aksrt'); ?></span>
|
||||
<span><?php esc_html_e('登录', 'aksrt'); ?></span>
|
||||
<i class="fas fa-spinner fa-spin" hidden></i>
|
||||
</button>
|
||||
</form>
|
||||
@@ -129,30 +137,30 @@ $reset_url = function_exists('aksrt_get_reset_password_url') ? aksrt_get_reset_p
|
||||
<?php wp_nonce_field('aksrt_register', '_register_nonce'); ?>
|
||||
|
||||
<div class="aksrt-modal-auth__field">
|
||||
<label for="modal-reg-user"><?php esc_html_e('Username', 'aksrt'); ?></label>
|
||||
<input type="text" id="modal-reg-user" name="user_login" autocomplete="username" required placeholder="<?php esc_attr_e('Please enter a username', 'aksrt'); ?>">
|
||||
<label for="modal-reg-user"><?php esc_html_e('用户名', 'aksrt'); ?></label>
|
||||
<input type="text" id="modal-reg-user" name="user_login" autocomplete="username" required placeholder="<?php esc_attr_e('请输入用户名', 'aksrt'); ?>">
|
||||
</div>
|
||||
|
||||
<div class="aksrt-modal-auth__field">
|
||||
<label for="modal-reg-email"><?php esc_html_e('Email', 'aksrt'); ?></label>
|
||||
<input type="email" id="modal-reg-email" name="user_email" autocomplete="email" required placeholder="<?php esc_attr_e('Please enter your email', 'aksrt'); ?>">
|
||||
<label for="modal-reg-email"><?php esc_html_e('邮箱', 'aksrt'); ?></label>
|
||||
<input type="email" id="modal-reg-email" name="user_email" autocomplete="email" required placeholder="<?php esc_attr_e('请输入邮箱', 'aksrt'); ?>">
|
||||
</div>
|
||||
|
||||
<div class="aksrt-modal-auth__field">
|
||||
<label for="modal-reg-pass"><?php esc_html_e('Password', 'aksrt'); ?></label>
|
||||
<label for="modal-reg-pass"><?php esc_html_e('密码', 'aksrt'); ?></label>
|
||||
<div class="aksrt-modal-auth__pass-wrap">
|
||||
<input type="password" id="modal-reg-pass" name="user_pass" autocomplete="new-password" required minlength="6" placeholder="<?php esc_attr_e('At least 6 characters', 'aksrt'); ?>">
|
||||
<button type="button" class="aksrt-modal-auth__pass-toggle" aria-label="<?php esc_attr_e('Toggle password visibility', 'aksrt'); ?>">
|
||||
<input type="password" id="modal-reg-pass" name="user_pass" autocomplete="new-password" required minlength="6" placeholder="<?php esc_attr_e('至少 6 位字符', 'aksrt'); ?>">
|
||||
<button type="button" class="aksrt-modal-auth__pass-toggle" aria-label="<?php esc_attr_e('显示或隐藏密码', 'aksrt'); ?>">
|
||||
<i class="far fa-eye"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="aksrt-modal-auth__field">
|
||||
<label for="modal-reg-pass-confirm"><?php esc_html_e('Confirm Password', 'aksrt'); ?></label>
|
||||
<label for="modal-reg-pass-confirm"><?php esc_html_e('确认密码', 'aksrt'); ?></label>
|
||||
<div class="aksrt-modal-auth__pass-wrap">
|
||||
<input type="password" id="modal-reg-pass-confirm" name="user_pass_confirm" autocomplete="new-password" required minlength="6" placeholder="<?php esc_attr_e('Re-enter your password', 'aksrt'); ?>">
|
||||
<button type="button" class="aksrt-modal-auth__pass-toggle" aria-label="<?php esc_attr_e('Toggle password visibility', 'aksrt'); ?>">
|
||||
<input type="password" id="modal-reg-pass-confirm" name="user_pass_confirm" autocomplete="new-password" required minlength="6" placeholder="<?php esc_attr_e('请再次输入密码', 'aksrt'); ?>">
|
||||
<button type="button" class="aksrt-modal-auth__pass-toggle" aria-label="<?php esc_attr_e('显示或隐藏密码', 'aksrt'); ?>">
|
||||
<i class="far fa-eye"></i>
|
||||
</button>
|
||||
</div>
|
||||
@@ -173,13 +181,15 @@ $reset_url = function_exists('aksrt_get_reset_password_url') ? aksrt_get_reset_p
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (!empty($agreement['enabled'])) : ?>
|
||||
<label class="aksrt-modal-auth__checkbox aksrt-modal-auth__agreement">
|
||||
<input type="checkbox" name="agree_terms" value="1" required>
|
||||
<span><?php esc_html_e('I agree to the Terms of Service', 'aksrt'); ?></span>
|
||||
<input type="checkbox" name="<?php echo esc_attr($agreement['field_name']); ?>" value="1" <?php echo !empty($agreement['required']) ? 'required' : ''; ?>>
|
||||
<span><?php echo $agreement['label_html']; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></span>
|
||||
</label>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($email_verification) : ?>
|
||||
<p class="aksrt-modal-auth__hint"><?php esc_html_e('Email verification is required after registration.', 'aksrt'); ?></p>
|
||||
<p class="aksrt-modal-auth__hint"><?php esc_html_e('注册后需要完成邮箱验证。', 'aksrt'); ?></p>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (function_exists('aksrt_render_captcha')) : ?>
|
||||
@@ -187,7 +197,7 @@ $reset_url = function_exists('aksrt_get_reset_password_url') ? aksrt_get_reset_p
|
||||
<?php endif; ?>
|
||||
|
||||
<button type="submit" class="aksrt-modal-auth__submit">
|
||||
<span><?php esc_html_e('Register', 'aksrt'); ?></span>
|
||||
<span><?php esc_html_e('注册', 'aksrt'); ?></span>
|
||||
<i class="fas fa-spinner fa-spin" hidden></i>
|
||||
</button>
|
||||
</form>
|
||||
@@ -199,14 +209,14 @@ $reset_url = function_exists('aksrt_get_reset_password_url') ? aksrt_get_reset_p
|
||||
<div class="aksrt-modal-auth__form">
|
||||
<div class="aksrt-modal-auth__error" id="aksrt-modal-qrcode-error" hidden></div>
|
||||
<div class="aksrt-modal-auth__qr-code"></div>
|
||||
<p class="aksrt-modal-auth__hint"><?php esc_html_e('Use WeChat to scan the QR code and complete sign-in on your phone.', 'aksrt'); ?></p>
|
||||
<p class="aksrt-modal-auth__hint"><?php esc_html_e('请使用微信扫码,在手机上完成登录。', 'aksrt'); ?></p>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (!empty($oauth_providers)) : ?>
|
||||
<div class="aksrt-modal-auth__divider">
|
||||
<span><?php esc_html_e('Or continue with', 'aksrt'); ?></span>
|
||||
<span><?php esc_html_e('其他登录方式', 'aksrt'); ?></span>
|
||||
</div>
|
||||
|
||||
<div class="aksrt-modal-auth__oauth">
|
||||
@@ -231,23 +241,23 @@ $reset_url = function_exists('aksrt_get_reset_password_url') ? aksrt_get_reset_p
|
||||
<div class="aksrt-modal-auth__footer">
|
||||
<span class="aksrt-modal-auth__footer-text" data-for="login">
|
||||
<?php if ($registration_open) : ?>
|
||||
<?php esc_html_e('No account yet?', 'aksrt'); ?>
|
||||
<button type="button" class="aksrt-modal-auth__switch" data-switch="register"><?php esc_html_e('Register now', 'aksrt'); ?></button>
|
||||
<?php esc_html_e('还没有账号?', 'aksrt'); ?>
|
||||
<button type="button" class="aksrt-modal-auth__switch" data-switch="register"><?php esc_html_e('立即注册', 'aksrt'); ?></button>
|
||||
<?php elseif ($show_qrcode_tab) : ?>
|
||||
<?php esc_html_e('Prefer QR sign-in?', 'aksrt'); ?>
|
||||
<button type="button" class="aksrt-modal-auth__switch" data-switch="qrcode"><?php esc_html_e('Open QR Login', 'aksrt'); ?></button>
|
||||
<?php esc_html_e('使用扫码登录?', 'aksrt'); ?>
|
||||
<button type="button" class="aksrt-modal-auth__switch" data-switch="qrcode"><?php esc_html_e('打开扫码登录', 'aksrt'); ?></button>
|
||||
<?php endif; ?>
|
||||
</span>
|
||||
<?php if ($registration_open) : ?>
|
||||
<span class="aksrt-modal-auth__footer-text" data-for="register" hidden>
|
||||
<?php esc_html_e('Already have an account?', 'aksrt'); ?>
|
||||
<button type="button" class="aksrt-modal-auth__switch" data-switch="login"><?php esc_html_e('Sign in now', 'aksrt'); ?></button>
|
||||
<?php esc_html_e('已有账号?', 'aksrt'); ?>
|
||||
<button type="button" class="aksrt-modal-auth__switch" data-switch="login"><?php esc_html_e('立即登录', 'aksrt'); ?></button>
|
||||
</span>
|
||||
<?php endif; ?>
|
||||
<?php if ($show_qrcode_tab) : ?>
|
||||
<span class="aksrt-modal-auth__footer-text" data-for="qrcode" hidden>
|
||||
<?php esc_html_e('Want to use your password instead?', 'aksrt'); ?>
|
||||
<button type="button" class="aksrt-modal-auth__switch" data-switch="login"><?php esc_html_e('Back to Sign In', 'aksrt'); ?></button>
|
||||
<?php esc_html_e('改用密码登录?', 'aksrt'); ?>
|
||||
<button type="button" class="aksrt-modal-auth__switch" data-switch="login"><?php esc_html_e('返回登录', 'aksrt'); ?></button>
|
||||
</span>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user