diff options
author | Matthew Somerville <matthew@mysociety.org> | 2014-10-08 16:20:47 +0100 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2014-10-08 17:10:48 +0100 |
commit | cb02a3b83beba71be672795bac8f90c61c1156f4 (patch) | |
tree | 5f73799098ea2560039675f3d00d3777aa19d724 | |
parent | f062193076b5caaceebd9f1dae62c01234c3f3b1 (diff) |
Prevent overhang of admin body categories table.
Group things together more simply. Fixes #738.
-rw-r--r-- | t/app/controller/admin.t | 14 | ||||
-rw-r--r-- | templates/web/base/admin/body.html | 32 |
2 files changed, 25 insertions, 21 deletions
diff --git a/t/app/controller/admin.t b/t/app/controller/admin.t index 2cc88ccc3..1757e386f 100644 --- a/t/app/controller/admin.t +++ b/t/app/controller/admin.t @@ -181,9 +181,9 @@ subtest 'check contact creation' => sub { } } ); $mech->content_contains( 'test category' ); - $mech->content_contains( '<td>test@example.com' ); + $mech->content_contains( 'test@example.com' ); $mech->content_contains( '<td>test note' ); - $mech->content_contains( '<td>Public' ); + $mech->content_contains( 'Private: No' ); $mech->submit_form_ok( { with_fields => { category => 'private category', @@ -193,7 +193,7 @@ subtest 'check contact creation' => sub { } } ); $mech->content_contains( 'private category' ); - $mech->content_contains( '<td>Non Public' ); + $mech->content_contains( 'Private: Yes' ); $mech->submit_form_ok( { with_fields => { category => 'test/category', @@ -215,9 +215,9 @@ subtest 'check contact editing' => sub { } } ); $mech->content_contains( 'test category' ); - $mech->content_contains( '<td>test2@example.com' ); + $mech->content_contains( 'test2@example.com' ); $mech->content_contains( '<td>test2 note' ); - $mech->content_contains( '<td>Public' ); + $mech->content_contains( 'Private: No' ); $mech->get_ok('/admin/body_edit/2650/test%20category'); $mech->submit_form_ok( { with_fields => { @@ -226,7 +226,7 @@ subtest 'check contact editing' => sub { non_public => 'on', } } ); - $mech->content_contains( '<td>Non Public' ); + $mech->content_contains( 'Private: Yes' ); $mech->get_ok('/admin/body_edit/2650/test%20category'); $mech->content_contains( '<td><strong>test2@example.com' ); @@ -242,7 +242,7 @@ subtest 'check contact updating' => sub { $mech->tick( 'confirmed', 'test category' ); $mech->submit_form_ok({form_number => 1}); - $mech->content_like(qr'test2@example.com</td>[^<]*<td>Yes's); + $mech->content_like(qr'test2@example.com</td>[^<]*<td>\s*Confirmed: Yes's); $mech->get_ok('/admin/body_edit/2650/test%20category'); $mech->content_like(qr{test2\@example.com[^<]*</td>[^<]*<td><strong>Yes}s); }; diff --git a/templates/web/base/admin/body.html b/templates/web/base/admin/body.html index bc815ae62..e67cb2b07 100644 --- a/templates/web/base/admin/body.html +++ b/templates/web/base/admin/body.html @@ -1,4 +1,5 @@ [% INCLUDE 'admin/header.html' title=tprintf(loc('Council contacts for %s'), body.name) -%] +[% PROCESS 'admin/report_blocks.html' %] [% IF updated %] <p> @@ -53,27 +54,30 @@ <table cellspacing="0" cellpadding="2" border="1"> <tr> <th>[% loc('Category') %]</th> - <th>[% loc('Email') %]</th> - <th>[% loc('Confirmed') %]</th> - <th>[% loc('Deleted') %]</th> - <th>[% loc('Devolved') %]</th> + <th colspan=2>[% loc('State') %]</th> <th>[% loc('Last editor') %]</th> <th>[% loc('Note') %]</th> - <th>[% loc('Public') %]</th> - <th>[% loc('When edited') %]</th> <th>[% loc('Confirm') %]</th> </tr> [% WHILE ( cat = contacts.next ) %] <tr [% IF cat.deleted %]class="is-deleted"[% END %]> - <td class="contact-category"><a href="[% c.uri_for( 'body_edit', body_id, cat.category ) %]">[% cat.category %]</a></td> - <td>[% cat.email | html %]</td> - <td>[% IF cat.confirmed %][% loc('Yes') %][% ELSE %][% loc('No') %][% END %]</td> - <td>[% IF cat.deleted %]<strong>[% loc('Yes') %]</strong>[% ELSE %][% loc('No') %][% END %]</td> - <td>[% IF body.can_be_devolved && cat.send_method %][% loc('Yes') %][% ELSE %][% loc('No') %][% END %]</td> - <td>[% cat.editor %]</td> + <td class="contact-category"><a href="[% c.uri_for( 'body_edit', body_id, cat.category ) %]">[% cat.category %]</a> + <br>[% cat.email | html %]</td> + <td> + [% loc('Confirmed') %]: + [%- IF cat.confirmed %][% loc('Yes') %][% ELSE %][% loc('No') %][% END %] + <br>[% loc('Deleted') %]: + [%- IF cat.deleted %]<strong>[% loc('Yes') %]</strong>[% ELSE %][% loc('No') %][% END %] + </td> + <td> + [% loc('Private') %]: + [%- cat.non_public ? loc('Yes') : loc('No') %] + <br>[% loc('Devolved') %]: + [%- IF body.can_be_devolved AND cat.send_method %][% loc('Yes') %][% ELSE %][% loc('No') %][% END %] + </td> + <td>[% cat.editor %] + <br><small>[% PROCESS format_time time=cat.whenedited %]</small></td> <td>[% cat.note | html %]</td> - <td>[% cat.non_public ? loc('Non Public') : loc('Public') %]</td> - <td>[% cat.whenedited.ymd _ ' ' _ cat.whenedited.hms %]</td> <td><input type="checkbox" name="confirmed" value="[% cat.category %]"></td> </tr> [% END %] |