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/index.html36
-rw-r--r--templates/web/default/admin/list_updates.html34
-rw-r--r--templates/web/default/admin/report_blocks.html7
-rw-r--r--templates/web/default/admin/report_edit.html50
-rw-r--r--templates/web/default/admin/search_reports.html43
5 files changed, 111 insertions, 59 deletions
diff --git a/templates/web/default/admin/index.html b/templates/web/default/admin/index.html
index 277d2ea76..85b8c264f 100644
--- a/templates/web/default/admin/index.html
+++ b/templates/web/default/admin/index.html
@@ -1,31 +1,31 @@
-[% INCLUDE 'admin/header.html' title=loc('Summary') %]
+[% INCLUDE 'admin/header.html' title=loc('Summary') -%]
-[% BLOCK states %]
+[%- BLOCK states -%]
<h2>[% title %]</h2>
-[% FOREACH state IN object.keys.sort %]
-[% '<ul>' IF loop.first %]
+[%- FOREACH state IN object.keys.sort %]
+[%- '<ul>' IF loop.first %]
<li>[% object.$state %] [% state %]</li>
-[% '</ul>' IF loop.last %]
-[% END %]
-[% END %]
+[%- "\n</ul>" IF loop.last %]
+[%- END %]
+[% END -%]
-<ul>
- <li>[% tprintf( loc('<strong>%d</strong> live problems'), total_problems_live ) %]</li>
- <li>[% tprintf( loc('%d live updates'), comments.confirmed ) %]</li>
- <li>[% tprintf( loc('%d confirmed alerts, %d unconfirmed'), alerts.1, alerts.0) %]</li>
- <li>[% tprintf( loc('%d questionnaires sent &ndash; %d answered (%s%%)'), questionnaires.total, questionnaires.1, questionnaires_pc) %]</li>
- <li>[% tprintf( loc('%d council contacts &ndash; %d confirmed, %d unconfirmed'), contacts.total, contacts.1, contacts.0) %]</li>
-</ul>
+ <ul>
+ <li>[% tprintf( loc('<strong>%d</strong> live problems'), total_problems_live ) %]</li>
+ <li>[% tprintf( loc('%d live updates'), comments.confirmed ) %]</li>
+ <li>[% tprintf( loc('%d confirmed alerts, %d unconfirmed'), alerts.1, alerts.0) %]</li>
+ <li>[% tprintf( loc('%d questionnaires sent &ndash; %d answered (%s%%)'), questionnaires.total, questionnaires.1, questionnaires_pc) %]</li>
+ <li>[% tprintf( loc('%d council contacts &ndash; %d confirmed, %d unconfirmed'), contacts.total, contacts.1, contacts.0) %]</li>
+ </ul>
-[% IF c.cobrand.admin_show_creation_graph %]
+[% IF c.cobrand.admin_show_creation_graph -%]
<p>
<a href="">[% loc('Graph of problem creation by status over time') %]</a>
</p>
-[% END %]
+[% END -%]
-[% PROCESS states title=loc('Problem breakdown by state') object=problems %]</h2>
+[% PROCESS states title=loc('Problem breakdown by state') object=problems %]
-[% PROCESS states title=loc('Update breakdown by state') object=comments %]</h2>
+[% PROCESS states title=loc('Update breakdown by state') object=comments %]
[% INCLUDE 'admin/footer.html' %]
diff --git a/templates/web/default/admin/list_updates.html b/templates/web/default/admin/list_updates.html
new file mode 100644
index 000000000..a2936d354
--- /dev/null
+++ b/templates/web/default/admin/list_updates.html
@@ -0,0 +1,34 @@
+<h2>Updates</h2>
+
+<table cellspacing="0" cellpadding="2" border="1">
+ <tr>
+ <th>[% loc('ID') %]</th>
+ <th>[% loc('State') %]</th>
+ <th>[% loc('Name') %]</th>
+ <th>[% loc('Email') %]</th>
+ <th>[% loc('Created') %]</th>
+ <th>[% loc('Anonymous') %]</th>
+ <th>[% loc('Cobrand') %]</th>
+ <th>[% loc('Text') %]</th>
+ <th>[% loc('*') %]</th>
+ </tr>
+[% FOREACH update IN updates -%]
+ <tr[% ' class="hidden"' IF update.state == 'hidden' || ( problem.state && problem.state == 'hidden' ) %]>
+ <td>[%- IF update.state == 'confirmed' -%]
+ [%- cobrand_data = update.cobrand_data %]
+ [%- cobrand_data = c.data_for_generic_update IF !update.cobrand %]
+ <a href="[% c.uri_for_email( '/report', update.problem.id, cobrand_data ) %]#update_[% update.id %]">[% update.id %]</a>
+ [%- ELSE %]
+ [%- update.id %]
+ [%- END -%]</td>
+ <td>[% update.state %]</td>
+ <td>[% update.name | html %]</td>
+ <td>[% update.user.email | html %]</td>
+ <td>[% PROCESS format_time time=update.created %]</td>
+ <td>[% IF update.anonymous %][% loc('Yes') %][% ELSE %][% loc('No') %][% END %]</td>
+ <td>[% update.cobrand %]<br>[% update.cobrand_data | html %]</td>
+ <td>[% update.text | html %]</td>
+ <td><a href="[% c.uri_for( 'update_edit', update.id ) %]">Edit</a></td>
+ <tr>
+[% END -%]
+</table>
diff --git a/templates/web/default/admin/report_blocks.html b/templates/web/default/admin/report_blocks.html
new file mode 100644
index 000000000..1fe650f15
--- /dev/null
+++ b/templates/web/default/admin/report_blocks.html
@@ -0,0 +1,7 @@
+[% BLOCK value_or_nbsp -%]
+ [%- IF value %][% value | html %][% ELSE %]&nbsp;[% END %]
+[%- END %]
+
+[% BLOCK format_time -%]
+ [%- IF time %][% time.ymd %]&nbsp;[% time.hms %][% ELSE %][% no_time || '&nbsp;' %][% END %][% no_time = '' %]
+[%- END %]
diff --git a/templates/web/default/admin/report_edit.html b/templates/web/default/admin/report_edit.html
new file mode 100644
index 000000000..1a03da7e1
--- /dev/null
+++ b/templates/web/default/admin/report_edit.html
@@ -0,0 +1,50 @@
+[% INCLUDE 'admin/header.html' title=tprintf(loc('Editing problem %d'), problem.id ) -%]
+[% PROCESS 'admin/report_blocks.html' %]
+
+[% status_message %]
+
+<form method="post" action="[% c.uri_for( 'report_edit', problem.id ) %]" enctype="application/x-www-form-urlencoded" accept-charset="utf-8">
+ <input type="hidden" name="token" value="[% token %]" >
+ <input type="hidden" name="submit" value="1" >
+<ul>
+ [%- cobrand_data = problem.cobrand_data %]
+ [%- cobrand_data = c.data_for_generic_problem IF !problem.cobrand %]
+<li><a href="[% c.uri_for_email( '/report', problem.id, cobrand_data ) %]">[% loc('View report on site' )%]</a></li>
+<li><label for='title'>[% loc('Subject:') %]</label> <input size=60 type='text' id='title' name='title' value='[% problem.title | html %]'></li>
+<li><label for='detail'>[% loc('Details:') %]</label><br><textarea name='detail' id='detail' cols=60 rows=10>[% problem.detail | html %]</textarea></li>
+<li>[% loc('Co-ordinates:') %] [% problem.latitude %], [% problem.longitude %] ( [% loc('originally entered') %] [% problem.postcode | html %] , [% IF problem.used_map %][% loc('used map') %][% ELSE %][% loc("didn't use map") %][% END %])</li>
+<li>[% loc('For council(s):') %] [% IF problem.council %][% problem.council %][% ELSE %]<em>[% loc('None' ) %]</em>[% END %] ([% loc('other areas:') %] [% problem.areas | remove('^,') | remove( ',$' ) %])</li>
+<li><label for="anonymous">[% loc('Anonymous:') %]</label> <select name="anonymous" id="anonymous">
+<option [% 'selected ' IF problem.anonymous %]value="1">Yes</option>
+<option [% 'selected ' IF !problem.anonymous %]value="0">No</option>
+</select></li>
+<li><label for="state">[% loc('State:') %]</label> <select name="state" id="state">
+ [% FOREACH state IN [ ['confirmed', loc('Open')], ['fixed', loc('Fixed')], ['hidden', loc('Hidden')], ['partial', loc('Partial')],['unconfirmed',loc('Unconfirmed')] ] %]
+ <option [% 'selected ' IF state.0 == problem.state %] value="[% state.0 %]">[% state.1 %]</option>
+ [% END %]
+</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('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>
+<li>[% loc('Sent:') %] [% PROCESS format_time time=problem.whensent %] [% IF problem.state == 'confirmed' %]<input onclick="return confirm('[% loc('You really want to resend?') %]')" type="submit" name="resend" value="[% loc('Resend report') %]">[% END %]</li>
+<li>[% loc('Last update:') %] [% PROCESS format_time time=problem.lastupdate %]</li>
+<li>[% loc('Service:') %] [% problem.service %]</li>
+<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>
+
+[% IF problem.photo %]
+[% photo = problem.get_photo_params %]
+<li><img alt="" height="[% photo.height %]" width="[% photo.width %]" src="[% photo.url %]">
+<input type="checkbox" id="remove_photo" name="remove_photo" value="1">
+<label for="remove_photo">[% loc("Remove photo (can't be undone!)") %]</label></li>
+[% END %]
+</ul>
+<input type="submit" name="Submit changes" value="[% loc('Submit changes') %]" ></form>
+
+[% INCLUDE 'admin/list_updates.html' %]
+
+[% INCLUDE 'admin/footer.html' %]
diff --git a/templates/web/default/admin/search_reports.html b/templates/web/default/admin/search_reports.html
index e2769e5ca..3c8b21a71 100644
--- a/templates/web/default/admin/search_reports.html
+++ b/templates/web/default/admin/search_reports.html
@@ -1,12 +1,5 @@
[% INCLUDE 'admin/header.html' title=loc('Search Reports') %]
-
-[% BLOCK value_or_nbsp -%]
- [%- IF value %][% value | html %][% ELSE %]&nbsp;[% END %]
-[%- END %]
-
-[% BLOCK format_time -%]
- [%- IF time %][% time.ymd %]&nbsp;[% time.hms %][% ELSE %]&nbsp;[% END %]
-[%- END %]
+[% PROCESS 'admin/report_blocks.html' %]
<form method="get" action="[% c.uri_for('search_reports') %]" enctype="application/x-www-form-urlencoded" accept-charset="utf-8">
<label for="search">Search:</label> <input type="text" name="search" size="30" id="search">
@@ -61,40 +54,8 @@
[%- END -%]
</table>
-<h2>Updates</h2>
+[% INCLUDE 'admin/list_updates.html' %]
-<table cellspacing="0" cellpadding="2" border="1">
- <tr>
- <th>[% loc('ID') %]</th>
- <th>[% loc('State') %]</th>
- <th>[% loc('Name') %]</th>
- <th>[% loc('Email') %]</th>
- <th>[% loc('Created') %]</th>
- <th>[% loc('Anonymous') %]</th>
- <th>[% loc('Cobrand') %]</th>
- <th>[% loc('Text') %]</th>
- <th>[% loc('*') %]</th>
- </tr>
-[% FOREACH update IN updates -%]
- <tr[% ' class="hidden"' IF update.state == 'hidden' || ( problem.state && problem.state == 'hidden' ) %]>
- <td>[%- IF update.state == 'confirmed' -%]
- [%- cobrand_data = update.cobrand_data %]
- [%- cobrand_data = c.data_for_generic_update IF !update.cobrand %]
- <a href="[% c.uri_for_email( '/report', update.problem.id, cobrand_data ) %]#update_[% update.id %]">[% update.id %]</a>
- [%- ELSE %]
- [%- update.id %]
- [%- END -%]</td>
- <td>[% update.state %]</td>
- <td>[% update.name | html %]</td>
- <td>[% update.user.email | html %]</td>
- <td>[% PROCESS format_time time=update.created %]</td>
- <td>[% IF update.anonymous %][% loc('Yes') %][% ELSE %][% loc('No') %][% END %]</td>
- <td>[% update.cobrand %]<br>[% update.cobrand_data | html %]</td>
- <td>[% update.text | html %]</td>
- <td><a href="[% c.uri_for( 'update_edit', update.id ) %]">Edit</a></td>
- <tr>
-[% END -%]
-</table>
[% END %]
[% INCLUDE 'admin/footer.html' %]