diff options
-rw-r--r-- | CHANGELOG.md | 1 | ||||
-rw-r--r-- | perllib/FixMyStreet/Cobrand/UK.pm | 7 | ||||
-rw-r--r-- | templates/web/base/admin/category-checkboxes.html | 17 | ||||
-rw-r--r-- | templates/web/base/admin/responsepriorities/edit.html | 7 | ||||
-rw-r--r-- | templates/web/base/admin/template_edit.html | 7 | ||||
-rw-r--r-- | templates/web/base/admin/users/form.html | 60 | ||||
-rw-r--r-- | templates/web/bromley/admin/category-checkboxes.html | 17 | ||||
-rw-r--r-- | web/cobrands/sass/_admin.scss | 26 | ||||
-rw-r--r-- | web/cobrands/sass/_base.scss | 3 |
9 files changed, 89 insertions, 56 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 3967b8d92..ebcf7c1dc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ - Allow searching for <email> in admin. - Make staff JavaScript more self-contained. - Alow staff user to be associated with multiple areas. + - Improvements to admin checkbox display. - Bugfixes: - Check cached reports do still have photos before being shown. #2374 - Delete cache photos upon photo moderation. #2374 diff --git a/perllib/FixMyStreet/Cobrand/UK.pm b/perllib/FixMyStreet/Cobrand/UK.pm index 0eb350311..1c6ebe29a 100644 --- a/perllib/FixMyStreet/Cobrand/UK.pm +++ b/perllib/FixMyStreet/Cobrand/UK.pm @@ -290,7 +290,9 @@ sub council_rss_alert_options { rss_text => sprintf( _('RSS feed of %s, within %s ward'), $district->{name}, $d_ward->{name}), text => sprintf( _('Reports sent to %s, within %s ward'), $district->{name}, $d_ward->{name}), uri => $c->uri_for( '/rss/reports/' . $district->{short_name} . '/' . $d_ward->{short_name} ), - }, { + } + if $body_dis; + push @reported_to_options, { type => 'council', id => sprintf( 'council:%s:%s', $body_cty->id, $county->{id_name} ), text => sprintf( _('Reports sent to %s'), $county->{name} ), @@ -302,7 +304,8 @@ sub council_rss_alert_options { rss_text => sprintf( _('RSS feed of %s, within %s ward'), $county->{name}, $c_ward->{name}), text => sprintf( _('Reports sent to %s, within %s ward'), $county->{name}, $c_ward->{name}), uri => $c->uri_for( '/rss/reports/' . $county->{short_name} . '/' . $c_ward->{short_name} ), - }; + } + if $body_cty; } else { throw Error::Simple('An area with three tiers of council? Impossible! '. join('|',keys %$all_areas)); diff --git a/templates/web/base/admin/category-checkboxes.html b/templates/web/base/admin/category-checkboxes.html index f2167e955..eacd1a398 100644 --- a/templates/web/base/admin/category-checkboxes.html +++ b/templates/web/base/admin/category-checkboxes.html @@ -1,7 +1,13 @@ - <p> - <strong>[% loc('Categories:') %]</strong> - </p> - <ul> +<fieldset> + <legend> + [% IF hint %] + <div class="admin-hint"> + <p>[% hint %]</p> + </div> + [% END %] + [% loc('Categories:') %] + </legend> + <ul class="no-bullets no-margin"> <li> [% loc('Select:') %] <a href="#" data-select-all>[% loc('all') %]</a> / @@ -9,10 +15,11 @@ </li> [% FOR contact IN contacts %] <li> - <label title="[% contact.email | html %]"> + <label class="inline" title="[% contact.email | html %]"> <input type="checkbox" name="contacts[[% contact.id %]]" [% 'checked' IF contact.active %]/> [% contact.category %] </label> </li> [% END %] </ul> +</fieldset> diff --git a/templates/web/base/admin/responsepriorities/edit.html b/templates/web/base/admin/responsepriorities/edit.html index 608f19e74..02661fd14 100644 --- a/templates/web/base/admin/responsepriorities/edit.html +++ b/templates/web/base/admin/responsepriorities/edit.html @@ -40,12 +40,7 @@ </label> </p> - <div class="admin-hint"> - <p> - [% loc('If you only want this priority to be an option for specific categories, pick them here. By default they will show for all categories.') %] - </p> - </div> - [% INCLUDE 'admin/category-checkboxes.html' %] + [% INCLUDE 'admin/category-checkboxes.html' hint=loc('If you only want this priority to be an option for specific categories, pick them here. By default they will show for all categories.') %] <p> <label> diff --git a/templates/web/base/admin/template_edit.html b/templates/web/base/admin/template_edit.html index 0cfd5406a..2945e36c5 100644 --- a/templates/web/base/admin/template_edit.html +++ b/templates/web/base/admin/template_edit.html @@ -34,12 +34,7 @@ <textarea class="form-control" name="text" class="required">[% rt.text | html %]</textarea> </p> - <div class="admin-hint"> - <p> - [% loc('If you only want this template to be an option for specific categories, pick them here. By default they will show for all categories.') %] - </p> - </div> - [% INCLUDE 'admin/category-checkboxes.html' %] + [% INCLUDE 'admin/category-checkboxes.html' hint=loc('If you only want this template to be an option for specific categories, pick them here. By default they will show for all categories.') %] [% IF errors.state %] <div class="form-error">[% errors.state %]</div> diff --git a/templates/web/base/admin/users/form.html b/templates/web/base/admin/users/form.html index bc64a79c7..8f0f9ad6e 100644 --- a/templates/web/base/admin/users/form.html +++ b/templates/web/base/admin/users/form.html @@ -93,14 +93,7 @@ [% IF contacts AND c.cobrand.moniker != 'zurich'%] <li class="js-user-categories"> - <div class="admin-hint"> - <p> - [% loc( - "Authorised staff users can be associated with the categories in which they operate.") - %] - </p> - </div> - [% INCLUDE 'admin/category-checkboxes.html' %] + [% INCLUDE 'admin/category-checkboxes.html' hint=loc("Authorised staff users can be associated with the categories in which they operate.") %] </li> [% END %] @@ -162,33 +155,38 @@ [% IF available_permissions AND NOT user.is_superuser %] <li> - <div class="admin-hint"> - <p> - [% loc("Users can perform the following actions within their assigned body or area.") %] - </p> - </div> - <p>[% loc('Permissions:') %]</p> - <ul> - [% FOREACH group IN available_permissions.pairs %] - <li> - [% group.key %] - <ul class="no-bullets"> - <li> - (<a href="#" data-select-all>[% loc('all') %]</a> / - <a href="#" data-select-none>[% loc('none') %]</a>) - </li> - [% FOREACH permission IN group.value %] + <fieldset> + <legend> + <div class="admin-hint"> + <p> + [% loc("Users can perform the following actions within their assigned body or area.") %] + </p> + </div> + [% loc('Permissions:') %] + </legend> + <ul class="permissions-checkboxes"> + [% FOREACH group IN available_permissions.pairs %] <li> - <label class="inline"> - <input type="checkbox" id="perms_[% permission.key %]" name="permissions[[% permission.key %]]" [% "checked" IF NOT user.is_superuser AND user.has_body_permission_to(permission.key) %]> - [% permission.value %] - </label> + [% group.key %] + <ul class="no-bullets no-margin"> + <li> + (<a href="#" data-select-all>[% loc('all') %]</a> / + <a href="#" data-select-none>[% loc('none') %]</a>) + </li> + [% FOREACH permission IN group.value %] + <li> + <label class="inline"> + <input type="checkbox" id="perms_[% permission.key %]" name="permissions[[% permission.key %]]" [% "checked" IF NOT user.is_superuser AND user.has_body_permission_to(permission.key) %]> + [% permission.value %] + </label> + </li> + [% END %] + </ul> </li> [% END %] </ul> - </li> - [% END %] - </ul> + </fieldset> + </li> [% END %] [% END %] [% TRY %][% INCLUDE 'admin/users/form-extra-fields.html' %][% CATCH file %][% END %] diff --git a/templates/web/bromley/admin/category-checkboxes.html b/templates/web/bromley/admin/category-checkboxes.html index ce4b489e8..756f2d1ff 100644 --- a/templates/web/bromley/admin/category-checkboxes.html +++ b/templates/web/bromley/admin/category-checkboxes.html @@ -1,7 +1,13 @@ - <p> - <strong>[% loc('Categories:') %]</strong> - </p> - <ul> +<fieldset> + <legend> + [% IF hint %] + <div class="admin-hint"> + <p>[% hint %]</p> + </div> + [% END %] + [% loc('Categories:') %] + </legend> + <ul class="no-bullets no-margin"> <li> [% loc('Select:') %] <a href="#" data-select-all>[% loc('all') %]</a> / @@ -9,10 +15,11 @@ </li> [% FOR contact IN c.cobrand.add_admin_subcategories # Bromley-specific function %] <li> - <label title="[% contact.email | html %]"> + <label class="inline" title="[% contact.email | html %]"> <input type="checkbox" name="contacts[[% contact.id %]]" [% 'checked' IF contact.active %]/> [% contact.category %] </label> </li> [% END %] </ul> +</fieldset> diff --git a/web/cobrands/sass/_admin.scss b/web/cobrands/sass/_admin.scss index 0a9789161..1f55c62df 100644 --- a/web/cobrands/sass/_admin.scss +++ b/web/cobrands/sass/_admin.scss @@ -67,6 +67,9 @@ $button_bg_col: #a1a1a1; // also search bar (tables) list-style: none; } } + .no-margin { + margin: 0; + } } .js #admin_contacts tr.is-deleted { @@ -214,3 +217,26 @@ $button_bg_col: #a1a1a1; // also search bar (tables) .danger-zone { text-align: #{$right}; } + +.permissions-checkboxes { + margin: 0; + + & > li { + border-top: 1px solid $table_border_color; + list-style: none; + padding: 0; + margin: 1em 0; + padding-top: 1em; + font-weight: bold; + + @media (min-width: 48em) { + display: grid; + grid-template-columns: 10em auto; + grid-column-gap: 1em; + } + } + + ul { + font-weight: normal; + } +} diff --git a/web/cobrands/sass/_base.scss b/web/cobrands/sass/_base.scss index 14d5d2607..5a1cf8fe7 100644 --- a/web/cobrands/sass/_base.scss +++ b/web/cobrands/sass/_base.scss @@ -273,7 +273,8 @@ textarea { min-height: 5em; } -label{ +label, +legend { display: block; margin-top: 1.25em; margin-bottom: 0.5em; |