aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2015-07-30 16:41:18 +0100
committerMatthew Somerville <matthew@mysociety.org>2015-07-30 17:42:14 +0100
commit749df1cfe907190632b09e434f9411cf08b5b2cf (patch)
treef90e3a2e8b1a828ee97f50cf213a0555914fd16e
parent26429aa50b9a915de3a9b3042420e1525f55b164 (diff)
Mark users who have moderate permission.
-rw-r--r--t/app/controller/admin.t2
-rw-r--r--templates/web/base/admin/user-form.html3
-rw-r--r--templates/web/base/admin/users.html4
3 files changed, 6 insertions, 3 deletions
diff --git a/t/app/controller/admin.t b/t/app/controller/admin.t
index fb3ab1917..498f1cedc 100644
--- a/t/app/controller/admin.t
+++ b/t/app/controller/admin.t
@@ -1083,7 +1083,7 @@ subtest 'report search' => sub {
subtest 'search abuse' => sub {
$mech->get_ok( '/admin/users?search=example' );
- $mech->content_like(qr{test4\@example.com.*</td>\s*<td>.*?</td>\s*<td>\(Email in abuse table});
+ $mech->content_like(qr{test4\@example.com.*</td>\s*<td>.*?</td>\s*<td>\(Email in abuse table}s);
};
subtest 'show flagged entries' => sub {
diff --git a/templates/web/base/admin/user-form.html b/templates/web/base/admin/user-form.html
index 4a57b05a0..3956e8533 100644
--- a/templates/web/base/admin/user-form.html
+++ b/templates/web/base/admin/user-form.html
@@ -34,8 +34,9 @@
[% FOR body IN bodies %]
<option value="[% body.id %]"[% ' selected' IF body.id == user.from_body.id %]>[% body.name %]</option>
[% END %]
- </li>
</select>
+ [% IF user.from_body AND user.has_permission_to('moderate', user.from_body.id) %]*[% END %]
+ </li>
[% IF c.cobrand.moniker != 'zurich' %]
<li>
<div class="admin-hint">
diff --git a/templates/web/base/admin/users.html b/templates/web/base/admin/users.html
index db97c7d59..19a3de03c 100644
--- a/templates/web/base/admin/users.html
+++ b/templates/web/base/admin/users.html
@@ -24,7 +24,9 @@
<tr>
<td>[% PROCESS value_or_nbsp value=user.name %]</td>
<td><a href="[% c.uri_for( 'reports', search => user.email ) %]">[% PROCESS value_or_nbsp value=user.email %]</a></td>
- <td>[% PROCESS value_or_nbsp value=user.from_body.name %]</td>
+ <td>[% PROCESS value_or_nbsp value=user.from_body.name %]
+ [% IF user.from_body AND user.has_permission_to('moderate', user.from_body.id) %] * [% END %]
+ </td>
[% IF c.cobrand.moniker != 'zurich' %]
<td>[% user.flagged == 2 ? loc('(Email in abuse table)') : user.flagged ? loc('Yes') : '&nbsp;' %]</td>
[% END %]