aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Arter <davea@mysociety.org>2016-10-18 15:42:58 +0100
committerDave Arter <davea@mysociety.org>2016-10-19 14:46:16 +0100
commit6b0712422ee13384da68f5cae8ef2f5274aa6318 (patch)
treed1b11e3a846dbdf785b14230022d0d9c578e0a41
parent255d42b042d06c2a4da39e1a1a73c331862a1c62 (diff)
Clarify category behaviour for response priorities
- Priorities with no categories selected are available to all categories - Display active categories in response priorities table
-rw-r--r--perllib/FixMyStreet/DB/Result/Problem.pm2
-rw-r--r--templates/web/base/admin/responsepriorities/list.html10
2 files changed, 11 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/DB/Result/Problem.pm b/perllib/FixMyStreet/DB/Result/Problem.pm
index 855732f83..13fd74807 100644
--- a/perllib/FixMyStreet/DB/Result/Problem.pm
+++ b/perllib/FixMyStreet/DB/Result/Problem.pm
@@ -681,7 +681,7 @@ sub response_priorities {
return $self->result_source->schema->resultset('ResponsePriority')->search(
{
'me.body_id' => $self->bodies_str_ids,
- 'contact.category' => $self->category,
+ 'contact.category' => [ $self->category, undef ],
},
{
order_by => 'name',
diff --git a/templates/web/base/admin/responsepriorities/list.html b/templates/web/base/admin/responsepriorities/list.html
index a269ff909..4c05ca14d 100644
--- a/templates/web/base/admin/responsepriorities/list.html
+++ b/templates/web/base/admin/responsepriorities/list.html
@@ -5,6 +5,7 @@
<tr>
<th> [% loc('Name') %] </th>
<th> [% loc('Description') %] </th>
+ <th> [% loc('Categories') %] </th>
<th> &nbsp; </th>
</tr>
</thead>
@@ -13,6 +14,15 @@
<tr [% 'class="is-deleted"' IF p.deleted %]>
<td> [% p.name | html %] </td>
<td> [% p.description | html %] </td>
+ <td>
+ [% UNLESS p.contacts.size %]
+ <em>[% loc('All categories') %]</em>
+ [% ELSE %]
+ [% FOR contact IN p.contacts %]
+ [% contact.category %][% ',' UNLESS loop.last %]
+ [% END %]
+ [% END %]
+ </td>
<td> <a href="[% c.uri_for('', body.id, p.id) %]" class="btn">[% loc('Edit') %]</a> </td>
</tr>
[% END %]