aboutsummaryrefslogtreecommitdiffstats
path: root/templates/web/default/admin
diff options
context:
space:
mode:
Diffstat (limited to 'templates/web/default/admin')
-rw-r--r--templates/web/default/admin/header.html1
-rw-r--r--templates/web/default/admin/list_flagged.html51
-rw-r--r--templates/web/default/admin/problem_row.html30
-rw-r--r--templates/web/default/admin/report_blocks.html10
-rw-r--r--templates/web/default/admin/report_edit.html3
-rw-r--r--templates/web/default/admin/search_abuse.html21
-rw-r--r--templates/web/default/admin/search_reports.html31
-rw-r--r--templates/web/default/admin/stats.html61
-rw-r--r--templates/web/default/admin/update_edit.html1
9 files changed, 178 insertions, 31 deletions
diff --git a/templates/web/default/admin/header.html b/templates/web/default/admin/header.html
index 261f0efb2..e0317cca0 100644
--- a/templates/web/default/admin/header.html
+++ b/templates/web/default/admin/header.html
@@ -5,6 +5,7 @@
dt { clear: left; float: left; font-weight: bold; }
dd { margin-left: 8em; }
.hidden { color: #666666; }
+.error { color: red; }
</style>
</head>
<body>
diff --git a/templates/web/default/admin/list_flagged.html b/templates/web/default/admin/list_flagged.html
new file mode 100644
index 000000000..0b22bccb2
--- /dev/null
+++ b/templates/web/default/admin/list_flagged.html
@@ -0,0 +1,51 @@
+[% INCLUDE 'admin/header.html' title=loc('Search Reports') %]
+[% PROCESS 'admin/report_blocks.html' %]
+
+
+<h2>[% loc( 'Problems' ) %]</h2>
+[% IF problems.size > 0 %]
+<table cellspacing="0" cellpadding="2" border="1">
+ <tr>
+ <th>[% loc('ID') %]</th>
+ <th>[% loc('Title') %]</th>
+ <th>[% loc('Name') %]</th>
+ <th>[% loc('Email') %]</th>
+ <th>[% loc('Council') %]</th>
+ <th>[% loc('Category') %]</th>
+ <th>[% loc('Anonymous') %]</th>
+ <th>[% loc('Cobrand') %]</th>
+ <th>[% loc('Created') %]</th>
+ <th>[% loc('State') %]</th>
+ <th>[% loc('When sent') %]</th>
+ <th>*</th>
+ </tr>
+ [% INCLUDE 'admin/problem_row.html' %]
+</table>
+[% ELSE %]
+<p>
+[% loc('No flagged problems found') %]
+</p>
+[% END %]
+
+<h2>[% loc( 'Users' ) %]</h2>
+[% IF users%]
+<table cellspacing="0" cellpadding="2" border="1">
+ <tr>
+ <th>[% loc('Name') %]</th>
+ <th>[% loc('Email') %]</th>
+ </tr>
+[% WHILE ( user = users.next ) -%]
+ <tr>
+ <td>[% user.name | html %]</td>
+ <td>[% user.email | html %]</td>
+ <td><a href="[% c.uri_for( 'search_reports', search => user.email ) %]">list content</a></td>
+ </tr>
+[%- END %]
+</table>
+[%- ELSE %]
+<p>
+[% loc('No flagged users found') %]
+</p>
+[%- END %]
+
+[% INCLUDE 'admin/footer.html' %]
diff --git a/templates/web/default/admin/problem_row.html b/templates/web/default/admin/problem_row.html
new file mode 100644
index 000000000..664ff1b13
--- /dev/null
+++ b/templates/web/default/admin/problem_row.html
@@ -0,0 +1,30 @@
+[%- FOR problem IN problems %]
+ <tr[% ' class="hidden"' IF problem.state == 'hidden' %]>
+ <td>[%- IF problem.state == 'confirmed' || problem.state == 'fixed' -%]
+ [%- cobrand_data = problem.cobrand_data %]
+ [%- cobrand_data = c.data_for_generic_problem IF !problem.cobrand %]
+ <a href="[% c.uri_for_email( '/report', problem.id, cobrand_data ) %]">[% problem.id %]</a>
+ [%- ELSE %]
+ [%- problem.id %]
+ [%- END -%]</td>
+ <td>[% PROCESS value_or_nbsp value=problem.title %]</td>
+ <td>[% PROCESS value_or_nbsp value=problem.name %]</td>
+ <td>[% PROCESS value_or_nbsp value=problem.user.email %]</td>
+ <td>[%- IF edit_council_contacts -%]
+ <a href="[% c.uri_for('council_contacts', problem.council ) %]">[% PROCESS value_or_nbsp value=problem.council %]</a>
+ [%- ELSE -%]
+ [%- PROCESS value_or_nbsp value=problem.council -%]
+ [%- END -%]</td>
+ <td>[% PROCESS value_or_nbsp value=problem.category %]</td>
+ <td>[% IF problem.anonymous %][% loc('Yes') %][% ELSE %][% loc('No') %][% END %]</td>
+ <td>[% problem.cobrand %]<br>[% problem.cobrand_data | html %]</td>
+ <td>[% PROCESS format_time time=problem.created %]</td>
+ <td>[% problem.state %]<small>
+ [%- IF problem.state == 'fixed' || problem.state == 'confirmed' %]<br>[% loc('Confirmed:' ) %]&nbsp;[% PROCESS format_time time=problem.confirmed %][% END -%]
+ [%- IF problem.state == 'fixed' %]<br>[% loc('Fixed:') %] [% PROCESS format_time time=problem.lastupdate %][% END -%]
+ [%- IF problem.state == 'confirmed' %]<br>[% loc('Last&nbsp;update:') %] [% PROCESS format_time time=problem.lastupdate %][% END -%]</small>
+ </td>
+ <td>[% PROCESS format_time time=problem.whensent %]</td>
+ <td><a href="[% c.uri_for( 'report_edit', problem.id ) %]">[% loc('Edit') %]</a></td>
+ </tr>
+[%- END -%]
diff --git a/templates/web/default/admin/report_blocks.html b/templates/web/default/admin/report_blocks.html
index 1fe650f15..f08529ce7 100644
--- a/templates/web/default/admin/report_blocks.html
+++ b/templates/web/default/admin/report_blocks.html
@@ -5,3 +5,13 @@
[% BLOCK format_time -%]
[%- IF time %][% time.ymd %]&nbsp;[% time.hms %][% ELSE %][% no_time || '&nbsp;' %][% END %][% no_time = '' %]
[%- END %]
+
+[% BLOCK abuse_button -%]
+[% IF allowed_pages.abuse_edit -%]
+[% IF email_in_abuse %]<small>[% loc('(Email in abuse table)') %]</small>[% ELSE %]<input type="submit" name="banuser" value="[% loc('Ban email address') %]" />[% END %]
+[%- END %]
+[%- END %]
+
+[% BLOCK flag_button -%]
+[% IF user.flagged || user_flagged %]<input type="submit" name="removeuserflag" value="[% loc('Remove flag') %]">[% ELSE %]<input type="submit" name="flaguser" value="[% loc('Flag user') %]" />[% END %]
+[%- END %]
diff --git a/templates/web/default/admin/report_edit.html b/templates/web/default/admin/report_edit.html
index 551f80127..470ad311a 100644
--- a/templates/web/default/admin/report_edit.html
+++ b/templates/web/default/admin/report_edit.html
@@ -28,7 +28,7 @@
</select></li>
<li>[% loc('Category:') %] [% problem.category | html %] </li>
<li>[% loc('Name:') %] <input type='text' name='name' id='name' value='[% problem.name | html %]'></li>
-<li>[% loc('Email:') %] <input type='text' id='email' name='email' value='[% problem.user.email | html %]'></li>
+<li>[% loc('Email:') %] <input type='text' id='email' name='email' value='[% problem.user.email | html %]'> [% PROCESS abuse_button %] [% PROCESS flag_button user=problem.user %]</li>
<li>[% loc('Phone:') %] [% problem.user.phone | html %]</li>
<li>[% loc('Created:') %] [% PROCESS format_time time=problem.created %]</li>
<li>[% loc('Confirmed:') %] [% PROCESS format_time time=problem.confirmed no_time='-' %]</li>
@@ -38,6 +38,7 @@
<li>[% loc('Cobrand:') %] [% problem.cobrand %]</li>
<li>[% loc('Cobrand data:') %] [% problem.cobrand_data %]</li>
<li>[% loc('Going to send questionnaire?') %] [% IF problem.send_questionnaire %][% loc('Yes') %][% ELSE %][% loc('No') %][% END %]</li>
+<li><label for="flagged">[% loc('Flagged:') %]</label> <input type="checkbox" name="flagged"[% ' checked' IF problem.flagged %]></li>
[% IF problem.photo %]
[% photo = problem.get_photo_params %]
diff --git a/templates/web/default/admin/search_abuse.html b/templates/web/default/admin/search_abuse.html
new file mode 100644
index 000000000..0984e85cf
--- /dev/null
+++ b/templates/web/default/admin/search_abuse.html
@@ -0,0 +1,21 @@
+[% INCLUDE 'admin/header.html' title=loc('Search Abuse Table') %]
+
+<form method="get" action="[% c.uri_for('search_abuse') %]" enctype="application/x-www-form-urlencoded" accept-charset="utf-8">
+ <label for="search">[% loc('Search:') %]</label> <input type="text" name="search" size="30" id="search">
+</form>
+
+
+[% IF emails.size > 0 %]
+<table cellspacing="0" cellpadding="2" border="1">
+ <tr>
+ <th>[% loc('Email') %]</th>
+ </tr>
+[%- FOREACH foo IN emails %]
+ <tr>
+ <td>[%- foo.email | html -%]</td>
+ </tr>
+[%- END -%]
+</table>
+[% END %]
+
+[% INCLUDE 'admin/footer.html' %]
diff --git a/templates/web/default/admin/search_reports.html b/templates/web/default/admin/search_reports.html
index 3809965f6..9702c16a7 100644
--- a/templates/web/default/admin/search_reports.html
+++ b/templates/web/default/admin/search_reports.html
@@ -22,36 +22,7 @@
<th>[% loc('When sent') %]</th>
<th>*</th>
</tr>
-[%- FOREACH problem IN problems %]
- <tr[% ' class="hidden"' IF problem.state == 'hidden' %]>
- <td>[%- IF problem.state == 'confirmed' || problem.state == 'fixed' -%]
- [%- cobrand_data = problem.cobrand_data %]
- [%- cobrand_data = c.data_for_generic_problem IF !problem.cobrand %]
- <a href="[% c.uri_for_email( '/report', problem.id, cobrand_data ) %]">[% problem.id %]</a>
- [%- ELSE %]
- [%- problem.id %]
- [%- END -%]</td>
- <td>[% PROCESS value_or_nbsp value=problem.title %]</td>
- <td>[% PROCESS value_or_nbsp value=problem.name %]</td>
- <td>[% PROCESS value_or_nbsp value=problem.user.email %]</td>
- <td>[%- IF edit_council_contacts -%]
- <a href="[% c.uri_for('council_contacts', problem.council ) %]">[% PROCESS value_or_nbsp value=problem.council %]</a>
- [%- ELSE -%]
- [%- PROCESS value_or_nbsp value=problem.council -%]
- [%- END -%]</td>
- <td>[% PROCESS value_or_nbsp value=problem.category %]</td>
- <td>[% IF problem.anonymous %][% loc('Yes') %][% ELSE %][% loc('No') %][% END %]</td>
- <td>[% problem.cobrand %]<br>[% problem.cobrand_data | html %]</td>
- <td>[% PROCESS format_time time=problem.created %]</td>
- <td>[% problem.state %]<small>
- [%- IF problem.state == 'fixed' || problem.state == 'confirmed' %]<br>[% loc('Confirmed:' ) %]&nbsp;[% PROCESS format_time time=problem.confirmed %][% END -%]
- [%- IF problem.state == 'fixed' %]<br>[% loc('Fixed:') %] [% PROCESS format_time time=problem.lastupdate %][% END -%]
- [%- IF problem.state == 'confirmed' %]<br>[% loc('Last&nbsp;update:') %] [% PROCESS format_time time=problem.lastupdate %][% END -%]</small>
- </td>
- <td>[% PROCESS format_time time=problem.whensent %]</td>
- <td><a href="[% c.uri_for( 'report_edit', problem.id ) %]">[% loc('Edit') %]</a></td>
- </tr>
-[%- END -%]
+ [% INCLUDE 'admin/problem_row.html' %]
</table>
[% INCLUDE 'admin/list_updates.html' %]
diff --git a/templates/web/default/admin/stats.html b/templates/web/default/admin/stats.html
new file mode 100644
index 000000000..ccd41601a
--- /dev/null
+++ b/templates/web/default/admin/stats.html
@@ -0,0 +1,61 @@
+[% INCLUDE 'admin/header.html' title=loc('Stats') %]
+
+[% IF show_count %]
+<p>
+<strong>[% tprintf( loc( '%sreports between %s and %s' ), ( unconfirmed ? loc( 'All' ) _ ' ' : loc( 'Confirmed' ) _ ' ' ), start_date.ymd, end_date.ymd ) | html %]</strong>
+</p>
+<table>
+ <thead>
+ <td style="width: 8em"><strong>[% loc('Current state') %]</strong></td>
+ <td><strong>[% loc('Count') %]</strong></td>
+ </thead>
+ [% total = 0 %]
+ [% WHILE ( state = states.next ) %]
+ [% total = total + state.get_column( 'count' ) %]
+ <tr>
+ <td>[% state.state | html %]</td>
+ <td>[% state.get_column( 'count' ) %]</td>
+ </tr>
+ [% END %]
+ <tr>
+ <td><strong>[% loc( 'Total' ) %]</strong></td>
+ <td><strong>[% total %]</strong></td>
+ </tr>
+</table>
+
+[% IF unconfirmed %]
+ <p>
+ <small>[% loc( 'Note that when including unconfirmed reports we use the date the report was created which may not be in the same month the report was confirmed so the numbers may jump about a little' ) %]</small>
+ </p>
+[% END %]
+[% END %]
+
+[% IF errors %]
+ [% FOREACH error IN errors %]
+ <p class="error">[% error %]</p>
+ [% END %]
+[% END %]
+
+<form method="post" action="[% c.uri_for('stats') %]" enctype="application/x-www-form-urlencoded" accept-charset="utf-8">
+ <p>
+ <label for="start_date_year">[% loc('Start Year:') %]</label><input type="text" name="start_date_year" id="start_date_year" size="5" value="[% start_date ? start_date.year : '' | html %]" />
+ <label for="start_date_month">[% loc('Start month:') %]</label><input type="text" name="start_date_month" id="start_date_month" size="3" value="[% start_date ? start_date.month : '' | html %]" />
+ <label for="start_date_day">[% loc('Start day:') %]</label><input type="text" name="start_date_day" id="start_date_day" size="3" value="[% start_date ? start_date.day : '' | html %]" />
+ </p>
+
+ <p>
+ <label for="end_date_year">[% loc('End Year:') %]</label><input type="text" name="end_date_year" id="end_date_year" size="5" value="[% end_date ? end_date.year : '' | html %]" />
+ <label for="end_date_month">[% loc('End month:') %]</label><input type="text" name="end_date_month" id="end_date_month" size="3" value="[% end_date ? end_date.month : '' | html %]" />
+ <label for="end_date_day">[% loc('End day:') %]</label><input type="text" name="end_date_day" id="end_date_day" size="3" value="[% end_date ? end_date.day : '' | html %]" />
+ </p>
+
+ <p>
+ <input type="checkbox" name="unconfirmed" id="unconfirmed"[% unconfirmed ? ' checked' : '' %] /><label for="unconfirmed">[% loc('Include unconfirmed reports') %]</label>
+ </p>
+
+ <p>
+ <input type="submit" name="getcounts" size="30" id="getcounts" value="Get Count" />
+ </p>
+</form>
+
+[% INCLUDE 'admin/footer.html' %]
diff --git a/templates/web/default/admin/update_edit.html b/templates/web/default/admin/update_edit.html
index 8746e62c4..e1783fd7c 100644
--- a/templates/web/default/admin/update_edit.html
+++ b/templates/web/default/admin/update_edit.html
@@ -36,6 +36,7 @@
[% ELSIF update.user.id == update.problem.user.id && update.mark_open %]
<li>[% loc('Update reopened problem') %]</li>
[% END %]
+[% PROCESS abuse_button %] [% PROCESS flag_button user=update.user %]</li>
<li>[% loc('Cobrand:') %] [% update.cobrand %]</li>
<li>[% loc('Cobrand data:') %] [% update.cobrand_data %]</li>
<li>[% loc('Created:') %] [% PROCESS format_time time=update.created %]</li>