Skip to content

Commit

Permalink
Remove unnecessary fieldsets.
Browse files Browse the repository at this point in the history
  • Loading branch information
dracos committed Feb 8, 2023
1 parent 132131f commit 21c6958
Show file tree
Hide file tree
Showing 27 changed files with 478 additions and 526 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
- Add missing label to alert distance input.
- Give generated map tiles blank alt attribute.
- Add fieldset to alert list and improve sort order.
- Remove unnecessary fieldsets.
- Improve fancybox accessibility (text and focus).
- Admin improvements:
- Admin 'add user' form now always creates staff users
Expand Down
46 changes: 21 additions & 25 deletions templates/web/base/alert/_updates.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,30 +13,26 @@

[% PROCESS 'auth/form_extra.html' %]

<fieldset>
[% IF c.user_exists %]
[% IF permissions.contribute_as_another_user %]
<label for="alert_rznvy">[% loc('Email') %]</label>
<div class="form-txt-submit-box">
<input type="email" class="form-control" name="rznvy" id="alert_rznvy" value="[% email %]" size="30">
<input class="green-btn" type="submit" name="alert" value="[% loc('Subscribe') %]">
</div>
[% ELSE %]
[% IF c.user_exists %]
[% IF permissions.contribute_as_another_user %]
<label for="alert_rznvy">[% loc('Email') %]</label>
<div class="form-txt-submit-box">
<input type="email" class="form-control" name="rznvy" id="alert_rznvy" value="[% email %]" size="30">
<input class="green-btn" type="submit" name="alert" value="[% loc('Subscribe') %]">
[% END %]
[% ELSE %]
<label for="alert_rznvy">[% loc('Your email') %]</label>

<div class="form-txt-submit-box">
<input type="email" class="form-control" name="rznvy" id="alert_rznvy" value="[% email %]" size="30">
<input class="green-btn" type="submit" name="alert" value="[% loc('Subscribe') %]">
</div>
[% END %]

<input type="hidden" name="token" value="[% csrf_token %]">
<input type="hidden" name="id" value="[% problem.id %]">
<input type="hidden" name="type" value="updates">
</fieldset>
</div>
[% ELSE %]
<input class="green-btn" type="submit" name="alert" value="[% loc('Subscribe') %]">
[% END %]
[% ELSE %]
<label for="alert_rznvy">[% loc('Your email') %]</label>

<div class="form-txt-submit-box">
<input type="email" class="form-control" name="rznvy" id="alert_rznvy" value="[% email %]" size="30">
<input class="green-btn" type="submit" name="alert" value="[% loc('Subscribe') %]">
</div>
[% END %]

<input type="hidden" name="token" value="[% csrf_token %]">
<input type="hidden" name="id" value="[% problem.id %]">
<input type="hidden" name="type" value="updates">
</form>


3 changes: 0 additions & 3 deletions templates/web/base/auth/change_email.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ <h1>[% title %]</h1>
<form method="post" name="change_email">
<input type="hidden" name="token" value="[% csrf_token %]">

<fieldset>
[% IF username_error;
errors = {
missing_email = loc('Please enter your email'),
Expand All @@ -45,8 +44,6 @@ <h1>[% title %]</h1>
<input type="submit" class="btn" value="[% title %]">
</div>

</fieldset>
</form>


[% INCLUDE 'footer.html' %]
2 changes: 0 additions & 2 deletions templates/web/base/auth/change_password.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ <h1>[% title %]</h1>
<form action="[% c.uri_for_action('/auth/profile/change_password') %]" method="post" name="change_password" class="fieldset">
<input type="hidden" name="token" value="[% csrf_token %]">

<fieldset>
[% IF password_error == 'failed' %]
<div class="form-error">[% field_errors.password_register %]</div>
[% ELSIF password_error;
Expand Down Expand Up @@ -55,7 +54,6 @@ <h1>[% title %]</h1>
<input type="submit" class="btn" value="[% title %]">
</div>

</fieldset>
</form>

[% END %]
Expand Down
3 changes: 0 additions & 3 deletions templates/web/base/auth/change_phone.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ <h1>[% title %]</h1>
<form method="post" name="change_phone">
<input type="hidden" name="token" value="[% csrf_token %]">

<fieldset>
[% loc_username_error = INCLUDE 'auth/_username_error.html' default='phone' %]
[% IF loc_username_error %]
<div class="form-error">[% loc_username_error %]</div>
Expand All @@ -44,8 +43,6 @@ <h1>[% title %]</h1>
<input type="submit" class="btn" value="[% title %]">
</div>

</fieldset>
</form>


[% INCLUDE 'footer.html' %]
50 changes: 24 additions & 26 deletions templates/web/base/auth/create.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,43 +36,41 @@ <h1>
[% END %]

<form action="/auth/[% expired_password ? 'expired' : forgotten ? 'forgot' : 'create' %]" method="post" name="general_auth" class="validate">
<fieldset>

<input type="hidden" name="r" value="[% c.req.params.r | html %]">
<input type="hidden" name="r" value="[% c.req.params.r | html %]">

[% IF NOT expired_password %]
[% IF NOT expired_password %]

[% loc_username_error = INCLUDE 'auth/_username_error.html' default='email' %]
[% loc_username_error = INCLUDE 'auth/_username_error.html' default='email' %]

[% IF c.cobrand.sms_authentication %]
[% SET username_label = loc('Your email or mobile') %]
[% ELSE %]
[% SET username_label = loc('Your email') %]
[% END %]
[% IF c.cobrand.sms_authentication %]
[% SET username_label = loc('Your email or mobile') %]
[% ELSE %]
[% SET username_label = loc('Your email') %]
[% END %]

<label class="n" for="username">[% username_label %]</label>
[% IF loc_username_error %]
<div class="form-error">[% loc_username_error %]</div>
[% END %]
<input type="text" class="form-control required" id="username" name="username" value="[% username | html %]" autofocus autocomplete="username">
<label class="n" for="username">[% username_label %]</label>
[% IF loc_username_error %]
<div class="form-error">[% loc_username_error %]</div>
[% END %]
<input type="text" class="form-control required" id="username" name="username" value="[% username | html %]" autofocus autocomplete="username">

[% END %]

[% IF field_errors.password_register %]
<p class='form-error'>[% field_errors.password_register %]</p>
[% END %]
<label for="password_register">[% forgotten ? loc('New password:') : loc('Your password') %]</label>
[% IF field_errors.password_register %]
<p class='form-error'>[% field_errors.password_register %]</p>
[% END %]
<label for="password_register">[% forgotten ? loc('New password:') : loc('Your password') %]</label>

<div class="general-notes">
<p>[% tprintf(loc('Your password should include %d or more characters.'), c.cobrand.password_minimum_length) %]</p>
</div>
<div class="general-notes">
<p>[% tprintf(loc('Your password should include %d or more characters.'), c.cobrand.password_minimum_length) %]</p>
</div>

<div class="form-txt-submit-box">
<input class="required form-control js-password-validate" type="password" name="password_register" id="password_register" value="" autocomplete="new-password">
<input class="green-btn" type="submit" name="sign_in_by_code" value="[% expired_password ? loc('Reset') : loc('Sign in') %]">
</div>
<div class="form-txt-submit-box">
<input class="required form-control js-password-validate" type="password" name="password_register" id="password_register" value="" autocomplete="new-password">
<input class="green-btn" type="submit" name="sign_in_by_code" value="[% expired_password ? loc('Reset') : loc('Sign in') %]">
</div>

</fieldset>
</form>

[% INCLUDE 'footer.html' %]
4 changes: 1 addition & 3 deletions templates/web/base/auth/general.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@ <h1>
[% END %]

<form action="/auth" method="post" name="general_auth" class="validate">
<fieldset>

<input type="hidden" name="r" value="[% c.req.params.r | html %]">
<input type="hidden" name="r" value="[% c.req.params.r | html %]">

[% IF NOT oauth_need_email AND c.cobrand.social_auth_enabled %]
[% IF c.config.FACEBOOK_APP_ID %]
Expand Down Expand Up @@ -77,7 +76,6 @@ <h1>
</div>
[% END %]

</fieldset>
</form>

[% INCLUDE 'footer.html' %]
Expand Down
118 changes: 59 additions & 59 deletions templates/web/base/contact/enquiry/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,75 +6,75 @@
<form method="post" action="/contact/enquiry/submit" class="validate" enctype="multipart/form-data">
<input type="hidden" name="token" value="[% csrf_token %]">
<input type="hidden" name="submit_problem" value="1">
<fieldset>
[% INCLUDE 'errors.html' %]

<label for="form_name">[% loc('Your name') %]</label>
[% IF field_errors.name %]
<div class="form-error">[% field_errors.name %]</div>
[% END %]
<input type="text" class="form-control required" name="name" id="form_name" value="[% ( form_name OR c.user.name ) | html %]" size="30">
[% INCLUDE 'errors.html' %]

<label for="form_email">[% loc('Your email') %]</label>
[% IF field_errors.username_register %]
<div class="form-error">[% field_errors.username_register %]</div>
[% END %]
<input type="text" class="form-control required email" name="username_register" id="form_email" [% "disabled" IF c.user.email %] value="[% ( email OR c.user.email ) | html %]" size="30">
<label for="form_name">[% loc('Your name') %]</label>
[% IF field_errors.name %]
<div class="form-error">[% field_errors.name %]</div>
[% END %]
<input type="text" class="form-control required" name="name" id="form_name" value="[% ( form_name OR c.user.name ) | html %]" size="30">

<div class="form-group">
<label for="form_phone">[% loc('Your phone number') %]</label>
<span class="required-text required-text--optional">[% loc('optional') %]</span>
<input type="text" class="form-control extra.phone" name="extra.phone" id="form_phone" value="[% report.user.phone | html %]" size="30">
</div>
<label for="form_email">[% loc('Your email') %]</label>
[% IF field_errors.username_register %]
<div class="form-error">[% field_errors.username_register %]</div>
[% END %]
<input type="text" class="form-control required email" name="username_register" id="form_email" [% "disabled" IF c.user.email %] value="[% ( email OR c.user.email ) | html %]" size="30">

<label for="form_category">[% loc('Subject') %]</label>
[% IF field_errors.category %]
<div class="form-error">[% field_errors.category %]</div>
[% END %]
<select class="form-control required" name="category" id="category">
<option value="">[% loc('-- Please select --') %]</option>
[% FOREACH contact IN contacts %]
[% NEXT IF contact.get_extra_field(, 'code', '_fms_disable_').disable_form == 'true' %]
<option value="[% contact.category | html %]" [% "selected" IF report.category == contact.category %]>[% contact.category | html %]</option>
[% END %]
</select>
<div class="form-group">
<label for="form_phone">[% loc('Your phone number') %]</label>
<span class="required-text required-text--optional">[% loc('optional') %]</span>
<input type="text" class="form-control extra.phone" name="extra.phone" id="form_phone" value="[% report.user.phone | html %]" size="30">
</div>

<label for="form_detail">[% loc('Message') %]</label>
[% IF field_errors.detail %]
<div class="form-error">[% field_errors.detail %]</div>
[% END %]
<textarea class="form-control required" name="detail" id="form_detail" rows="7" cols="50">[% report.detail | html %]</textarea>
<label for="form_category">[% loc('Subject') %]</label>
[% IF field_errors.category %]
<div class="form-error">[% field_errors.category %]</div>
[% END %]
<select class="form-control required" name="category" id="category">
<option value="">[% loc('-- Please select --') %]</option>
[% FOREACH contact IN contacts %]
[% NEXT IF contact.get_extra_field(, 'code', '_fms_disable_').disable_form == 'true' %]
<option value="[% contact.category | html %]" [% "selected" IF report.category == contact.category %]>[% contact.category | html %]</option>
[% END %]
</select>

<label for="form_detail">[% loc('Message') %]</label>
[% IF field_errors.detail %]
<div class="form-error">[% field_errors.detail %]</div>
[% END %]
<textarea class="form-control required" name="detail" id="form_detail" rows="7" cols="50">[% report.detail | html %]</textarea>

<input type="hidden" name="upload_fileid" value="[% upload_fileid %]">
<label for="form_photo">
[% loc('Photos/Documents') %]
</label>
<input type="hidden" name="upload_fileid" value="[% upload_fileid %]">
<label for="form_photo">
[% loc('Photos/Documents') %]
</label>

[% IF field_errors.photo %]
<p class='form-error'>[% field_errors.photo %]</p>
[% END %]
[% IF field_errors.photo %]
<p class='form-error'>[% field_errors.photo %]</p>
[% END %]

<div id="form_photos">
[% IF upload_fileid OR report.get_extra_metadata('enquiry_files').keys.count %]
<p>[% loc('You have already attached files to this report. Note that you can attach a maximum of 3 to this report (if you try to upload more, the oldest will be removed).') %]</p>
[% FOREACH id IN upload_fileid.split(',') %]
<img align="right" src="/photo/temp.[% id %]" alt="">
[% END %]
<div id="form_photos">
[% IF upload_fileid OR report.get_extra_metadata('enquiry_files').keys.count %]
<p>[% loc('You have already attached files to this report. Note that you can attach a maximum of 3 to this report (if you try to upload more, the oldest will be removed).') %]</p>
[% FOREACH id IN upload_fileid.split(',') %]
<img align="right" src="/photo/temp.[% id %]" alt="">
[% END %]

[% IF report.get_extra_metadata('enquiry_files') %]
[% FOREACH id IN report.get_extra_metadata('enquiry_files').values %]
[% id %]<br />
[% END %]
<input type="hidden" name="enquiry_files" value="[% enquiry_files | html %]" />
[% END %]
[% END %]
<p><input type="file" name="photo1" id="form_photo"></p>
<p><input type="file" name="photo2" id="form_photo2"></p>
<p><input type="file" name="photo3" id="form_photo3"></p>
</div>
[% IF report.get_extra_metadata('enquiry_files') %]
[% FOREACH id IN report.get_extra_metadata('enquiry_files').values %]
[% id %]<br />
[% END %]
<input type="hidden" name="enquiry_files" value="[% enquiry_files | html %]" />
[% END %]
[% END %]
<p><input type="file" name="photo1" id="form_photo"></p>
<p><input type="file" name="photo2" id="form_photo2"></p>
<p><input type="file" name="photo3" id="form_photo3"></p>
</div>

<input class="final-submit green-btn" type="submit" value="[% loc('Send') %]">
<input class="final-submit green-btn" type="submit" value="[% loc('Send') %]">

</fieldset></form>
</form>

[% INCLUDE 'footer.html' pagefooter = 'yes' %]

0 comments on commit 21c6958

Please sign in to comment.