Files
breadcrumb-the-shire/pages/auth/register(login).phtml
2026-02-04 23:31:53 +01:00

75 lines
3.0 KiB
PHTML

<?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;
use MintyPHP\Service\UserService;
Buffer::set('title', t('Register'));
?>
<a role="button" class="back_to_login small secondary outline" href="/login"><i
class="bi bi-arrow-left"></i> <?php e(t('Back to Login')); ?></a>
<article>
<header>
<img src="<?php e(appLogoUrl(128)); ?>" alt="<?php e(appTitle()); ?>" class="brand-logo" style="margin-bottom:1rem;">
<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" />
</label>
<label for="last_name">
<span><?php e(t('Last name')); ?></span>
<input required type="text" name="last_name" id="last_name" />
</label>
<label for="email">
<span><?php e(t('Email')); ?></span>
<input required type="email" name="email" id="email" />
</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(UserService::passwordMinLength()); ?>" autocomplete="new-password" />
</label>
<label for="password2">
<span><?php e(t('Password (again)')); ?></span>
<input required type="password" name="password2" id="password2"
minlength="<?php e(UserService::passwordMinLength()); ?>" autocomplete="new-password" />
</label>
<div class="form-hint" data-password-hints data-password-input="#password" data-confirm-input="#password2"
data-email-input="#email" data-min-length="<?php e(UserService::passwordMinLength()); ?>">
<strong><?php e(t('Password requirements')); ?></strong>
<ul class="form-hint-list">
<?php foreach (UserService::passwordHints() as $hint): ?>
<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 class="notice" data-variant="error"><?php e($error); ?></div>
<?php endif; ?>
<?php Session::getCsrfInput(); ?>
</form>
</article>