Files
breadcrumb-the-shire/pages/auth/register(login).phtml

84 lines
3.9 KiB
PHTML
Raw Normal View History

2026-02-04 23:31:53 +01:00
<?php
/**
* @var mixed|null $error
* @var mixed|null $firstName
* @var mixed|null $lastName
* @var mixed|null $email
* @var mixed|null $password
* @var mixed|null $password2
*/
use MintyPHP\Buffer;
use MintyPHP\Session;
Buffer::set('title', t('Register'));
2026-02-23 12:58:19 +01:00
$passwordMinLength = (int) ($passwordMinLength ?? 0);
$passwordHints = is_array($passwordHints ?? null) ? $passwordHints : [];
$errorNoticeId = !empty($error) ? 'auth-register-error-notice' : '';
$passwordHintId = 'auth-register-password-hints';
2026-03-07 14:10:36 +01:00
$authHelpContext = [
'show_back_to_login' => true,
'show_support' => true,
];
$authLogoHref = lurl('login');
2026-02-04 23:31:53 +01:00
?>
2026-03-07 21:21:47 +01:00
<article class="login-card">
<?php require templatePath('partials/auth-logo.phtml'); ?>
2026-02-04 23:31:53 +01:00
<header>
<hgroup>
<h1><?php e(t('Register')); ?></h1>
<p><?php e(t('Create your account')); ?></p>
</hgroup>
</header>
<form method="post">
<label for="first_name">
<span><?php e(t('First name')); ?></span>
<input required type="text" name="first_name" id="first_name" <?php if ($errorNoticeId !== ''): ?>aria-invalid="true" aria-describedby="<?php e($errorNoticeId); ?>"<?php endif; ?> />
2026-02-04 23:31:53 +01:00
</label>
<label for="last_name">
<span><?php e(t('Last name')); ?></span>
<input required type="text" name="last_name" id="last_name" <?php if ($errorNoticeId !== ''): ?>aria-invalid="true" aria-describedby="<?php e($errorNoticeId); ?>"<?php endif; ?> />
2026-02-04 23:31:53 +01:00
</label>
<label for="email">
<span><?php e(t('Email')); ?></span>
<input required type="email" name="email" id="email" autocomplete="email" <?php if ($errorNoticeId !== ''): ?>aria-invalid="true" aria-describedby="<?php e($errorNoticeId); ?>"<?php endif; ?> />
2026-02-04 23:31:53 +01:00
</label>
<fieldset>
<legend>
<small>
<?php e(t('Password')); ?>
</small>
</legend>
<label for="password">
<span><?php e(t('Password')); ?></span>
<input required type="password" name="password" id="password"
minlength="<?php e($passwordMinLength); ?>" autocomplete="new-password"
aria-describedby="<?php e(trim($passwordHintId . ' ' . $errorNoticeId)); ?>" <?php if ($errorNoticeId !== ''): ?>aria-invalid="true"<?php endif; ?> />
2026-02-04 23:31:53 +01:00
</label>
<label for="password2">
<span><?php e(t('Password (again)')); ?></span>
<input required type="password" name="password2" id="password2"
minlength="<?php e($passwordMinLength); ?>" autocomplete="new-password"
aria-describedby="<?php e(trim($passwordHintId . ' ' . $errorNoticeId)); ?>" <?php if ($errorNoticeId !== ''): ?>aria-invalid="true"<?php endif; ?> />
2026-02-04 23:31:53 +01:00
</label>
<div id="<?php e($passwordHintId); ?>" class="form-hint" data-password-hints data-password-input="#password" data-confirm-input="#password2"
2026-02-23 12:58:19 +01:00
data-email-input="#email" data-min-length="<?php e($passwordMinLength); ?>">
2026-02-04 23:31:53 +01:00
<strong><?php e(t('Password requirements')); ?></strong>
<ul class="form-hint-list">
2026-02-23 12:58:19 +01:00
<?php foreach ($passwordHints as $hint): ?>
2026-02-04 23:31:53 +01:00
<li data-rule="<?php e($hint['rule']); ?>"><?php e($hint['text']); ?></li>
<?php endforeach; ?>
<li data-rule="match"><?php e(t('Passwords must match')); ?></li>
</ul>
</div>
</fieldset>
<button type="submit"><?php e(t('Register')); ?></button>
<?php if (!empty($error)): ?>
<div id="<?php e($errorNoticeId); ?>" class="notice" data-variant="error" role="alert" aria-live="assertive" tabindex="-1"><?php e($error); ?></div>
2026-02-04 23:31:53 +01:00
<?php endif; ?>
<?php Session::getCsrfInput(); ?>
</form>
2026-03-06 21:59:41 +01:00
<?php require templatePath('partials/auth-help-links.phtml'); ?>
2026-02-04 23:31:53 +01:00
</article>