|
|
@@ -2,6 +2,11 @@
|
|
|
|
|
|
$newsletter_consent_checked = ($user->newsletter_consent) ? "checked" : "";
|
|
|
|
|
|
+$year = $month = $day = null;
|
|
|
+if($user->date_of_birth) {
|
|
|
+ list($year, $month, $day) = explode("-", $user->date_of_birth);
|
|
|
+}
|
|
|
+
|
|
|
?>
|
|
|
<div class="container mt-3 py-4">
|
|
|
<h2><?=htmlspecialchars(__("Register"))?></h2>
|
|
|
@@ -54,8 +59,7 @@ $newsletter_consent_checked = ($user->newsletter_consent) ? "checked" : "";
|
|
|
<option value=""><?=htmlspecialchars(__("Select gender"))?></option>
|
|
|
<?php
|
|
|
foreach(User::genders() as $value => $display) {
|
|
|
- $value = substr($value, 0, 1);
|
|
|
- $selected = ($user->value == $value) ? "selected" : "";
|
|
|
+ $selected = ($user->gender == $value) ? "selected" : "";
|
|
|
?>
|
|
|
<option value="<?=htmlspecialchars($value)?>" <?=$selected?>><?=htmlspecialchars($display)?></option>
|
|
|
<?php
|
|
|
@@ -79,7 +83,7 @@ $newsletter_consent_checked = ($user->newsletter_consent) ? "checked" : "";
|
|
|
<div class="row mb-1">
|
|
|
<label class="col-sm-4 col-form-label" for="password"><?=htmlspecialchars(__("Password"))?></label>
|
|
|
<div class="col-sm">
|
|
|
- <input class="form-control" type="password" name="password" id="password" placeholder="<?=htmlspecialchars(__("Enter password"))?>" required />
|
|
|
+ <input class="form-control" type="password" name="password" id="password" placeholder="<?=htmlspecialchars(__("Enter password"))?>" autocomplete="new-password" required />
|
|
|
<small class="text-muted form-text"><?=sprintf(htmlspecialchars(__("At least %s6 characters%s. Must contain at least one %slowercase%s, %suppercase%s, %snumber%s and %sspecial%s character.")),
|
|
|
'<span data-length-requirement>', '</span>',
|
|
|
'<span data-lowercase-requirement>', '</span>',
|
|
|
@@ -92,7 +96,7 @@ $newsletter_consent_checked = ($user->newsletter_consent) ? "checked" : "";
|
|
|
<div class="row mb-1">
|
|
|
<label class="col-sm-4 col-form-label" for="password-confirm"><?=htmlspecialchars(__("Confirm Password"))?></label>
|
|
|
<div class="col-sm">
|
|
|
- <input class="form-control" type="password" name="password_confirm" id="password-confirm" placeholder="<?=htmlspecialchars(__("Confirm password"))?>" required />
|
|
|
+ <input class="form-control" type="password" name="password_confirm" id="password-confirm" placeholder="<?=htmlspecialchars(__("Confirm password"))?>" autocomplete="new-password" required />
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="row mb-1">
|
|
|
@@ -102,21 +106,21 @@ $newsletter_consent_checked = ($user->newsletter_consent) ? "checked" : "";
|
|
|
<select class="form-control w-auto d-inline-block" name="date_of_birth_day" id="date-of-birth-day" required>
|
|
|
<option value=""><?=htmlspecialchars(__("Day"))?></option>
|
|
|
<?php
|
|
|
- Form::renderDayOptions();
|
|
|
+ Form::renderDayOptions($day);
|
|
|
?>
|
|
|
</select>
|
|
|
<label for="date-of-birth-month" class="sr-only"><?=htmlspecialchars(__("Month"))?></label>
|
|
|
<select class="form-control w-auto d-inline-block" name="date_of_birth_month" id="date-of-birth-month" required>
|
|
|
<option value=""><?=htmlspecialchars(__("Month"))?></option>
|
|
|
<?php
|
|
|
- Form::renderMonthOptions();
|
|
|
+ Form::renderMonthOptions($month);
|
|
|
?>
|
|
|
</select>
|
|
|
<label for="date-of-birth-year" class="sr-only"><?=htmlspecialchars(__("Year"))?></label>
|
|
|
<select class="form-control w-auto d-inline-block" name="date_of_birth_year" id="date-of-birth-year" required>
|
|
|
<option value=""><?=htmlspecialchars(__("Year"))?></option>
|
|
|
<?php
|
|
|
- Form::renderYearOptionsDescending();
|
|
|
+ Form::renderYearOptionsDescending(null, null, $year);
|
|
|
?>
|
|
|
</select>
|
|
|
</div>
|
|
|
@@ -127,6 +131,14 @@ $newsletter_consent_checked = ($user->newsletter_consent) ? "checked" : "";
|
|
|
<input class="form-control w-auto" type="text" name="postal_code" id="postal-code" placeholder="<?=htmlspecialchars(__("Enter postal code"))?>" value="<?=htmlspecialchars($user_address->postal_code)?>" required />
|
|
|
</div>
|
|
|
</div>
|
|
|
+
|
|
|
+ <div class="row mb-1">
|
|
|
+ <label class="col-sm-4 col-form-label" for="secondary-postal-code"><?=htmlspecialchars(__("Secondary Postal Code"))?></label>
|
|
|
+ <div class="col-sm">
|
|
|
+ <input class="form-control w-auto" type="text" name="secondary_postal_code" id="secondary-postal-code" placeholder="<?=htmlspecialchars(__("Enter postal code"))?>" value="<?=htmlspecialchars($secondary_user_address->postal_code)?>" />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
<div class="row mb-3">
|
|
|
<label class="col-sm-4 col-form-label" for="country"><?=htmlspecialchars(__("Country"))?></label>
|
|
|
<div class="col-sm">
|