Sfoglia il codice sorgente

Adjust form control widths and add labels

Alan Lam 7 anni fa
parent
commit
63e4cd976b
1 ha cambiato i file con 14 aggiunte e 11 eliminazioni
  1. 14 11
      views/register.php

+ 14 - 11
views/register.php

@@ -1,4 +1,4 @@
-<?php
+<?php /** @noinspection PhpVoidFunctionResultUsedInspection */
 
 
 $newsletter_consent_checked = ($user->newsletter_consent) ? "checked" : "";
 $newsletter_consent_checked = ($user->newsletter_consent) ? "checked" : "";
 
 
@@ -22,7 +22,7 @@ $newsletter_consent_checked = ($user->newsletter_consent) ? "checked" : "";
 				<div class="row mb-1">
 				<div class="row mb-1">
 					<label class="col-sm-4 col-form-label" for="title"><?=htmlspecialchars(__("Title"))?></label>
 					<label class="col-sm-4 col-form-label" for="title"><?=htmlspecialchars(__("Title"))?></label>
 					<div class="col-sm">
 					<div class="col-sm">
-						<select class="form-control" name="title" id="title" required>
+						<select class="form-control w-auto" name="title" id="title" required>
 							<option value=""><?=htmlspecialchars(__("Select title"))?></option>
 							<option value=""><?=htmlspecialchars(__("Select title"))?></option>
 							<?php
 							<?php
 							foreach(User::titles() as $value => $display) {
 							foreach(User::titles() as $value => $display) {
@@ -38,19 +38,19 @@ $newsletter_consent_checked = ($user->newsletter_consent) ? "checked" : "";
 				<div class="row mb-1">
 				<div class="row mb-1">
 					<label class="col-sm-4 col-form-label"  for="first-name"><?=htmlspecialchars(__("First Name"))?></label>
 					<label class="col-sm-4 col-form-label"  for="first-name"><?=htmlspecialchars(__("First Name"))?></label>
 					<div class="col-sm">
 					<div class="col-sm">
-						<input class="form-control" type="text" name="first_name" id="first-name" placeholder="<?=htmlspecialchars(__("Enter first name"))?>" value="<?=htmlspecialchars($user->first_name)?>" required />
+						<input class="form-control w-auto" type="text" name="first_name" id="first-name" placeholder="<?=htmlspecialchars(__("Enter first name"))?>" value="<?=htmlspecialchars($user->first_name)?>" required />
 					</div>
 					</div>
 				</div>
 				</div>
 				<div class="row mb-1">
 				<div class="row mb-1">
 					<label class="col-sm-4 col-form-label"  for="last-name"><?=htmlspecialchars(__("Last Name"))?></label>
 					<label class="col-sm-4 col-form-label"  for="last-name"><?=htmlspecialchars(__("Last Name"))?></label>
 					<div class="col-sm">
 					<div class="col-sm">
-						<input class="form-control" type="text" name="last_name" id="last-name" placeholder="<?=htmlspecialchars(__("Enter last name"))?>" value="<?=htmlspecialchars($user->last_name)?>" required />
+						<input class="form-control w-auto" type="text" name="last_name" id="last-name" placeholder="<?=htmlspecialchars(__("Enter last name"))?>" value="<?=htmlspecialchars($user->last_name)?>" required />
 					</div>
 					</div>
 				</div>
 				</div>
 				<div class="row mb-1">
 				<div class="row mb-1">
 					<label class="col-sm-4 col-form-label"  for="gender"><?=htmlspecialchars(__("Gender"))?></label>
 					<label class="col-sm-4 col-form-label"  for="gender"><?=htmlspecialchars(__("Gender"))?></label>
 					<div class="col-sm">
 					<div class="col-sm">
-						<select class="form-control" name="gender" id="gender" required>
+						<select class="form-control w-auto" name="gender" id="gender" required>
 							<option value=""><?=htmlspecialchars(__("Select gender"))?></option>
 							<option value=""><?=htmlspecialchars(__("Select gender"))?></option>
 							<?php
 							<?php
 							foreach(User::genders() as $value => $display) {
 							foreach(User::genders() as $value => $display) {
@@ -73,7 +73,7 @@ $newsletter_consent_checked = ($user->newsletter_consent) ? "checked" : "";
 				<div class="row mb-1">
 				<div class="row mb-1">
 					<label class="col-sm-4 col-form-label"  for="phone"><?=htmlspecialchars(__("Mobile Number"))?></label>
 					<label class="col-sm-4 col-form-label"  for="phone"><?=htmlspecialchars(__("Mobile Number"))?></label>
 					<div class="col-sm">
 					<div class="col-sm">
-						<input class="form-control" type="phone" name="phone" id="phone" placeholder="<?=htmlspecialchars(__("Enter mobile number"))?>" value="<?=htmlspecialchars($user->phone)?>" required />
+						<input class="form-control w-auto" type="tel" name="phone" id="phone" placeholder="<?=htmlspecialchars(__("Enter mobile number"))?>" value="<?=htmlspecialchars($user->phone)?>" required />
 					</div>
 					</div>
 				</div>
 				</div>
 				<div class="row mb-1">
 				<div class="row mb-1">
@@ -96,20 +96,23 @@ $newsletter_consent_checked = ($user->newsletter_consent) ? "checked" : "";
 					</div>
 					</div>
 				</div>
 				</div>
 				<div class="row mb-1">
 				<div class="row mb-1">
-					<label class="col-sm-4 col-form-label"  for="date-of-birth"><?=htmlspecialchars(__("Date of Birth"))?></label>
+					<label class="col-sm-4 col-form-label"><?=htmlspecialchars(__("Date of Birth"))?></label>
 					<div class="col-sm">
 					<div class="col-sm">
+                        <label for="date-of-birth-day" class="sr-only"><?=htmlspecialchars(__("Day"))?></label>
 						<select class="form-control w-auto d-inline-block" name="date_of_birth_day" id="date-of-birth-day" required>
 						<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>
 							<option value=""><?=htmlspecialchars(__("Day"))?></option>
 							<?php
 							<?php
 							Form::renderDayOptions();
 							Form::renderDayOptions();
 							?>
 							?>
 						</select>
 						</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>
 						<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>
 							<option value=""><?=htmlspecialchars(__("Month"))?></option>
 							<?php
 							<?php
 							Form::renderMonthOptions();
 							Form::renderMonthOptions();
 							?>
 							?>
 						</select>
 						</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>
 						<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>
 							<option value=""><?=htmlspecialchars(__("Year"))?></option>
 							<?php
 							<?php
@@ -119,15 +122,15 @@ $newsletter_consent_checked = ($user->newsletter_consent) ? "checked" : "";
 					</div>
 					</div>
 				</div>
 				</div>
 				<div class="row mb-1">
 				<div class="row mb-1">
-					<label class="col-sm-4 col-form-label"  for="postal-code"><?=htmlspecialchars(__("Postal Code"))?></label>
+					<label class="col-sm-4 col-form-label" for="postal-code"><?=htmlspecialchars(__("Postal Code"))?></label>
 					<div class="col-sm">
 					<div class="col-sm">
-						<input class="form-control" type="text" name="postal_code" id="postal-code" placeholder="<?=htmlspecialchars(__("Enter postal code"))?>" value="<?=htmlspecialchars($user_address->postal_code)?>" required />
+						<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>
 				</div>
 				<div class="row mb-3">
 				<div class="row mb-3">
 					<label class="col-sm-4 col-form-label" for="country"><?=htmlspecialchars(__("Country"))?></label>
 					<label class="col-sm-4 col-form-label" for="country"><?=htmlspecialchars(__("Country"))?></label>
 					<div class="col-sm">
 					<div class="col-sm">
-						<select class="form-control" name="country" id="country" required>
+						<select class="form-control w-auto" name="country" id="country" required>
 						<?=Form::renderCountryOptions($user_address->country)?>
 						<?=Form::renderCountryOptions($user_address->country)?>
 						</select>
 						</select>
 					</div>
 					</div>
@@ -164,4 +167,4 @@ $newsletter_consent_checked = ($user->newsletter_consent) ? "checked" : "";
 			</div>
 			</div>
 		</div>
 		</div>
 	</form>
 	</form>
-</div>
+</div>