diff options
Diffstat (limited to 'templates/web/default/admin')
-rw-r--r-- | templates/web/default/admin/council_contacts.html | 89 | ||||
-rw-r--r-- | templates/web/default/admin/council_contacts.txt | 4 | ||||
-rw-r--r-- | templates/web/default/admin/council_edit.html | 62 | ||||
-rw-r--r-- | templates/web/default/admin/council_list.html | 47 | ||||
-rw-r--r-- | templates/web/default/admin/footer.html | 2 | ||||
-rw-r--r-- | templates/web/default/admin/header.html | 17 | ||||
-rw-r--r-- | templates/web/default/admin/index.html | 42 | ||||
-rw-r--r-- | templates/web/default/admin/list_updates.html | 34 | ||||
-rw-r--r-- | templates/web/default/admin/questionnaire.html | 30 | ||||
-rw-r--r-- | templates/web/default/admin/report_blocks.html | 7 | ||||
-rw-r--r-- | templates/web/default/admin/report_edit.html | 50 | ||||
-rw-r--r-- | templates/web/default/admin/search_reports.html | 61 | ||||
-rw-r--r-- | templates/web/default/admin/timeline.html | 46 | ||||
-rw-r--r-- | templates/web/default/admin/update_edit.html | 38 |
14 files changed, 529 insertions, 0 deletions
diff --git a/templates/web/default/admin/council_contacts.html b/templates/web/default/admin/council_contacts.html new file mode 100644 index 000000000..669f137f9 --- /dev/null +++ b/templates/web/default/admin/council_contacts.html @@ -0,0 +1,89 @@ +[% INCLUDE 'admin/header.html' title=tprintf(loc('Council contacts for %s'), council_name) -%] + +<p> +<em>[% updated %]</em> +</p> + +<p> +[% IF example_pc %] +<a href="[% c.uri_for_email( '/around', { pc => example_pc } ) %]">[% tprintf( loc('Example postcode %s'), example_pc ) | html %]</a> | +[% END %] +<a href="[% c.uri_for_email( '/reports/' _ area_id ) %]">[% loc('List all reported problems' ) %]</a> +<a href="[% c.uri_for( 'council_contacts', area_id, { text => 1 } ) %]">[% loc('Text only version') %]</a> +</p> + +<form method="post" action="[% c.uri_for('council_contacts', area_id ) %]" enctype="application/x-www-form-urlencoded" accept-charset="utf-8"> + + <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('Last editor') %]</th> + <th>[% loc('Note') %]</th> + <th>[% loc('When edited') %]</th> + <th>[% loc('Confirm') %]</th> + </tr> + [% WHILE ( contact = contacts.next ) %] + <tr> + <td><a href="[% c.uri_for( 'council_edit', area_id, contact.category ) %]">[% contact.category %]</a></td> + <td>[% contact.email | html %]</td> + <td>[% IF contact.confirmed %][% loc('Yes') %][% ELSE %][% loc('No') %][% END %]</td> + <td>[% IF contact.deleted %][% loc('Yes') %][% ELSE %][% loc('No') %][% END %]</td> + <td>[% contact.editor %]</td> + <td>[% contact.note | html %]</td> + <td>[% contact.whenedited.ymd _ ' ' _ contact.whenedited.hms %]</td> + <td><input type="checkbox" name="confirmed" value="[% contact.category %]"></td> + </tr> + [% END %] + </table> + + <p> + <input type="hidden" name="area_id" value="[% area_id %]"> + <input type="hidden" name="posted" value="update"> + <input type="hidden" name="token" value="[% token %]"> + <input type="submit" name="Update statuses" value="[% loc('Update statuses') %]"> + </p> + </form> + + <h2>[% loc('Add new category') %]</h2> + + <form method="post" action="[% c.uri_for('council_contacts', area_id ) %]" enctype="application/x-www-form-urlencoded" accept-charset="utf-8"> + + [% IF c.cobrand.moniker != 'emptyhomes' %] + <p> + <strong>[% loc('Category:') %] </strong><input type="text" name="category" size="30"> + </p> + [% END %] + + <p> + <strong>[% loc('Email:') %] </strong><input type="text" name="email" size="30"> + </p> + + <p> + <input type="checkbox" name="confirmed" value="1" id="confirmed"> + <label for="confirmed">[% loc('Confirmed') %]</label> + + <input type="checkbox" name="deleted" value="1"id="deleted"> + <label for="deleted">[% loc('Deleted') %]</label> + </p> + + <p> + <strong>[% loc('Note:') %] </strong> <textarea name="note" rows="3" cols="40"></textarea> + </p> + + <p> + <input type="hidden" name="area_id" value="[% area_id %]" > + <input type="hidden" name="posted" value="new" > + <input type="hidden" name="token" value="[% token %]" > + <input type="submit" name="Create category" value="[% loc('Create category') %]" > + </p> + + <div> + <input type="hidden" name=".cgifields" value="confirmed" > + <input type="hidden" name=".cgifields" value="deleted" > + </div> + </form> + +[% INCLUDE 'admin/footer.html' %] diff --git a/templates/web/default/admin/council_contacts.txt b/templates/web/default/admin/council_contacts.txt new file mode 100644 index 000000000..2d1e04bfa --- /dev/null +++ b/templates/web/default/admin/council_contacts.txt @@ -0,0 +1,4 @@ +[% WHILE ( contact = contacts.next ) -%] +[%- NEXT IF contact.deleted || ! contact.confirmed %] +[% contact.category %] [% contact.email %] +[%- END %] diff --git a/templates/web/default/admin/council_edit.html b/templates/web/default/admin/council_edit.html new file mode 100644 index 000000000..0968d3570 --- /dev/null +++ b/templates/web/default/admin/council_edit.html @@ -0,0 +1,62 @@ +[% INCLUDE 'admin/header.html' title=tprintf(loc('Council contacts for %s'), council_name) -%] + +[% BLOCK highlightchanged_yesno %] +[%- output = loc('No') %] +[%- IF new.$value %][% output = loc('Yes') %][% END %] +[%- IF old && old.$value != new.$value %]<strong>[% output %]</strong>[% ELSE %][% output %][% END %] +[%- END %] + +[% BLOCK highlightchanged %] +[%- IF old && old.$value != new.$value %]<strong>[% new.$value %]</strong>[% ELSE %][% new.$value %][% END %] +[%- END %] +<p> +<em>[% updated %]</em> +</p> + +<p> +[% IF example_pc %] +<a href="[% c.uri_for_email( '/around', { pc => example_pc } ) %]">[% tprintf( loc('Example postcode %s'), example_pc ) | html %]</a> +[% END %] +</p> + +<form method="post" action="[% c.uri_for('council_contacts', area_id ) %]" enctype="application/x-www-form-urlencoded" accept-charset="utf-8"> + <strong>[% loc('Category:') %] </strong>[% contact.category | html %] + <input type="hidden" name="category" value="[% contact.category | html %]" > + <input type="hidden" name="token" value="[% token %]" > + <strong>[% loc('Email:') %] </strong> + <input type="text" name="email" value="[% contact.email | html %]" size="30"> + <input type="checkbox" name="confirmed" value="1" id="confirmed"[% ' checked' IF contact.confirmed %]> <label for="confirmed">[% loc('Confirmed' ) %]</label> + <input type="checkbox" name="deleted" value="1" id="deleted"[% ' checked' IF contact.deleted %]> <label for="deleted">[% loc('Deleted') %]</label><br> + + <strong>[% loc('Note:') %] </strong><textarea name="note" rows="3" cols="40">[% contact.note | html %]</textarea> <br> + + <input type="hidden" name="area_id" value="[% area_id %]"> + <input type="hidden" name="posted" value="new"> + <input type="submit" name="Save changes" value="[% loc('Save changes') %]"> +</form> + +<h2>[% loc('History') %]</h2> +<table border="1"> + <tr> + <th>[% loc('When edited') %]</th> + <th>[% loc('Email') %]</th> + <th>[% loc('Confirmed') %]</th> + <th>[% loc('Deleted') %]</th> + <th>[% loc('Editor') %]</th> + <th>[% loc('Note') %]</th> + </tr> + [%- prev = '' %] + [%- WHILE ( contact = history.next ) %] + <tr> + <td>[% contact.whenedited.ymd _ ' ' _ contact.whenedited.hms %]</td> + <td>[% PROCESS highlightchanged old=prev new=contact value='email' %]</td> + <td>[% PROCESS highlightchanged_yesno old=prev new=contact value='confirmed' %]</td> + <td>[% PROCESS highlightchanged_yesno old=prev new=contact value='deleted' %]</td> + <td>[% contact.editor %]</td> + <td>[% contact.note | html %]</td> + </tr> + [%- prev = contact %] + [%- END %] +</table> + +[% INCLUDE 'admin/footer.html' %] diff --git a/templates/web/default/admin/council_list.html b/templates/web/default/admin/council_list.html new file mode 100644 index 000000000..ac99368fe --- /dev/null +++ b/templates/web/default/admin/council_list.html @@ -0,0 +1,47 @@ +[% INCLUDE 'admin/header.html' title=loc('Council contacts') -%] + +[%- BLOCK details %] +[%- IF councils.size == 0 %] + [%- loc('None') %] +[%- ELSE %] +[%- FOREACH council IN councils %] + [%- IF council.parent_area %] + [%- + p_area = areas.$council.parent_area + parent = ', ' _ areas.$parent.name + %] + [%- ELSE %] + [%- parent = '' %] + [%- END %] + [%- '<ul>' IF loop.first %] + <li><a href="[% c.uri_for( 'council_contacts', council ) %]">[% areas.$council.name %] [% parent %][% tprintf( loc('%d addresses'), counts.$council.c) IF counts.$council && c.cobrand.moniker != 'emptyhomes' %]</a> + [%- '</ul>' IF loop.last %] +[%- END %] +[%- END %] +[%- END %] + +<h2>[% loc('Diligency prize league table') %]</h2> +[% IF edit_activity.count %] +<ul> + [% WHILE ( editor = edit_activity.next ) %] + <li>[% tprintf( loc('%d edits by %s'), editor.get_column('c'), editor.editor ) %]</li> + [% END %] +</ul> +[% ELSE %] +<p> +[% loc('No edits have yet been made.') %] +</p> +[% END %] + +<h2>[% loc('Councils') %]</h2> + +<h3>[% loc('No info at all') %]</h3> +[% PROCESS details councils=no_info %] +<h3>[% loc('Currently has 1+ deleted') %]</h3> +[% PROCESS details councils=one_plus_deleted %] +<h3>[% loc('Some unconfirmeds') %]</h3> +[% PROCESS details councils=unconfirmeds %] +<h3>[% loc('All confirmed') %]</h3> +[% PROCESS details councils=all_confirmed %] + +[% INCLUDE 'admin/footer.html' %] diff --git a/templates/web/default/admin/footer.html b/templates/web/default/admin/footer.html new file mode 100644 index 000000000..308b1d01b --- /dev/null +++ b/templates/web/default/admin/footer.html @@ -0,0 +1,2 @@ +</body> +</html> diff --git a/templates/web/default/admin/header.html b/templates/web/default/admin/header.html new file mode 100644 index 000000000..261f0efb2 --- /dev/null +++ b/templates/web/default/admin/header.html @@ -0,0 +1,17 @@ +<html> +<head> +<title>[% title %] - [% loc('FixMyStreet administration') %]</title> +<style type="text/css"> +dt { clear: left; float: left; font-weight: bold; } +dd { margin-left: 8em; } +.hidden { color: #666666; } +</style> +</head> +<body> + + <strong>[% loc('FixMyStreet admin:') %]</strong> + [%- FOREACH link IN allowed_links %] + <a href="[% c.uri_for( link ) %]">[% allowed_pages.$link.0 %]</a> + [%- END %] + + <h1>[% title %]</h1> diff --git a/templates/web/default/admin/index.html b/templates/web/default/admin/index.html new file mode 100644 index 000000000..d1ed09114 --- /dev/null +++ b/templates/web/default/admin/index.html @@ -0,0 +1,42 @@ +[% INCLUDE 'admin/header.html' title=loc('Summary') -%] + +[%- BLOCK states -%] +<h2>[% title %]</h2> + +[%- FOREACH state IN object.keys.sort %] +[%- '<ul>' IF loop.first %] + <li>[% object.$state %] [% state %]</li> +[%- "\n</ul>" IF loop.last %] +[%- END %] +[% END -%] + + <ul> + <li>[% tprintf( loc('<strong>%d</strong> live problems'), total_problems_live ) %]; + [% tprintf( loc('from %d different users'), total_problems_users ) %]</li> + <li>[% tprintf( loc('%d live updates'), comments.confirmed || 0 ) %]</li> + <li>[% tprintf( loc('%d confirmed alerts, %d unconfirmed'), alerts.1, alerts.0) %]</li> + <li>[% tprintf( loc('%d questionnaires sent – %d answered (%s%%)'), questionnaires.total, questionnaires.1, questionnaires_pc) %]</li> + <li>[% tprintf( loc('%d council contacts – %d confirmed, %d unconfirmed'), contacts.total, contacts.1, contacts.0) %]</li> + </ul> + +[% IF c.cobrand.admin_show_creation_graph -%] + <p> + <a href="">[% loc('Graph of problem creation by status over time') %]</a> + </p> +[% END -%] + +[% PROCESS states title=loc('Problem breakdown by state') object=problems %] + +[% PROCESS states title=loc('Update breakdown by state') object=comments %] + +[% FOREACH category IN categories %] + [% IF loop.first %] + <h2>[% loc('Category fix rate for problems > 4 weeks old') %]</h2> + <table> + <tr><th>[% loc('Category') %]</th><th>[% loc('Total') %]</th><th>[% loc('Fixed') %]</th></tr> + [% END %] + <tr><td>[% category.key %]</td><td>[% category.value.total %]</td><td>[% category.value.fixed / category.value.total * 100 | format('%.1f') %]%</td></tr> + [% '</table>' IF loop.last %] +[% END %] + +[% 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..92f41f348 --- /dev/null +++ b/templates/web/default/admin/list_updates.html @@ -0,0 +1,34 @@ +<h2>[% loc('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>*</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 ) %]">[% loc('Edit') %]</a></td> + <tr> +[% END -%] +</table> diff --git a/templates/web/default/admin/questionnaire.html b/templates/web/default/admin/questionnaire.html new file mode 100644 index 000000000..680e0d214 --- /dev/null +++ b/templates/web/default/admin/questionnaire.html @@ -0,0 +1,30 @@ +[% INCLUDE 'admin/header.html' title=loc('Survey Results') %] + +<table border="1"> + <tr> + <th>[% loc('Reported before') %]</th> + <th>[% loc('Not reported before') %]</th> + </tr> + [% IF questionnaires.total > 0 %] + <tr> + <td>[% questionnaires.1 %] ([% 100 * questionnaires.1 / questionnaires.total | format('%.1f') %]%)</td> + <td>[% questionnaires.0 %] ([% 100 * questionnaires.0 / questionnaires.total | format('%.1f') %]%)</td> + </tr> + [% ELSE %] + <tr> + <td>[% loc('n/a') %]</td> + <td>[% loc('n/a') %]</td> + </tr> + [% END %] +</table> + +<h2>[% loc('Problem state change based on survey results') %]</h2> + +<table> +<tr><th>[% loc('Old state') %]</th><th>[% loc('New state') %]</th><th>[% loc('Total') %]</th></tr> +[% WHILE ( s = state_changes.next ) %] +<tr><td>[% s.old_state %]</td><td>[% s.new_state %]</td><td>[% s.get_column('c') %] ([% 100 * s.get_column('c') / state_changes_count | format('%.1f') %]%)</td></tr> +[% END %] +</table> + +[% INCLUDE 'admin/footer.html' %] 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 %] [% END %] +[%- END %] + +[% BLOCK format_time -%] + [%- IF time %][% time.ymd %] [% time.hms %][% ELSE %][% no_time || ' ' %][% 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..9c38b014e --- /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">[% loc('Yes') %]</option> +<option [% 'selected ' IF !problem.anonymous %]value="0">[% loc('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="[% c.cobrand.base_url %][% 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 new file mode 100644 index 000000000..3809965f6 --- /dev/null +++ b/templates/web/default/admin/search_reports.html @@ -0,0 +1,61 @@ +[% INCLUDE 'admin/header.html' title=loc('Search Reports') %] +[% 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">[% loc('Search:') %]</label> <input type="text" name="search" size="30" id="search"> +</form> + + +[% IF searched %] +<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> +[%- 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:' ) %] [% 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 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 -%] +</table> + +[% INCLUDE 'admin/list_updates.html' %] + +[% END %] + +[% INCLUDE 'admin/footer.html' %] diff --git a/templates/web/default/admin/timeline.html b/templates/web/default/admin/timeline.html new file mode 100644 index 000000000..95120e48c --- /dev/null +++ b/templates/web/default/admin/timeline.html @@ -0,0 +1,46 @@ +[% INCLUDE 'admin/header.html' title=loc('Timeline') %] +[%- USE f = DateTime::Format('DateTime::Format::Strptime', { pattern => "%A, %e %B %Y" }) %] +[%- USE alert_format = DateTime::Format('DateTime::Format::Strptime', { pattern => "%H:%M:%S %e %B %Y" }) %] + +[%- BLOCK problem_name %] + [%- tprintf(loc('by %s'), problem.name) | html %] <[% problem.user.email | html %]>, '[% problem.title | html %]' +[%- END %] + +[%- date = '' %] +[% FOREACH moment IN time.keys.sort.reverse %] + [%- curdate = f.format(time.$moment.0.date) -%] + [%- IF date != curdate %] + [% '</dl>' IF date %] + <h2>[% curdate %]</h2> + + <dl> + [%- date = curdate -%] + [%- END -%] + <dt><b>[% time.$moment.0.date.hms %]</b></dt> + <dd> + [% FOREACH item IN time.$moment %] + [%- SWITCH item.type -%] + [% CASE 'problemCreated' %] + [%- tprintf(loc('Problem %d created'), item.obj.id) %]; [% PROCESS problem_name problem=item.obj -%] + [% CASE 'problemConfirmed' %] + [%- tprintf( loc('Problem %s confirmed'), '<a href="' _ c.uri_for_email( '/report', item.obj.id, c.cobrand_data ) _ '">' _ item.obj.id _ '</a>') %]; [% PROCESS problem_name problem=item.obj -%] + [% CASE 'problemSent' %] + [% tprintf(loc("Problem %s sent to council %s"), '<a href="' _ c.uri_for_email( '/report', item.obj.id, c.cobrand_data ) _ '">' _ item.obj.id _ '</a>', item.obj.council ) %] + [% CASE 'quesSent' %] + [% tprintf(loc("Questionnaire %d sent for problem %d"), item.obj.id, item.obj.problem_id ) %] + [% CASE 'quesAnswered' %] + [% tprintf(loc("Questionnaire %d answered for problem %d, %s to %s"), item.obj.id, item.obj.problem_id, item.obj.old_state, item.obj.new_state ) %] + [% CASE 'update' %] + [% name = ( item.obj.name || 'anonymous' ) | html %] + [% tprintf(loc("Update %s created for problem %d; by %s"), "<a href='" _ c.uri_for_email( '/report', item.obj.problem_id, c.cobrand_data ) _ "#update_" _ item.obj.id _ "'>" _ item.obj.id _ "</a>", item.obj.problem_id, name) %] <[% item.obj.user.email | html %]> + [% CASE 'alertSub' %] + [% tprintf(loc("Alert %d created for %s, type %s, parameters %s / %s"), item.obj.id, item.obj.user.email, item.obj.alert_type.ref, item.obj.parameter, item.obj.parameter2) | html %] + [% CASE 'alertDel' %] + [% tprintf(loc("Alert %d disabled (created %s)"), item.obj.id, alert_format.format( item.obj.whensubscribed_local ) ) %] + [%- END %] + <br /> + [%- END %] + </dd> +[% END %] + +[% INCLUDE 'admin/footer.html' %] diff --git a/templates/web/default/admin/update_edit.html b/templates/web/default/admin/update_edit.html new file mode 100644 index 000000000..d7f212052 --- /dev/null +++ b/templates/web/default/admin/update_edit.html @@ -0,0 +1,38 @@ +[% INCLUDE 'admin/header.html' title=tprintf(loc('Editing update %d'), update.id ) -%] +[% PROCESS 'admin/report_blocks.html' %] + +[% status_message %] + +<form method="post" action="[% c.uri_for( 'update_edit', update.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 = update.cobrand_data %] + [%- cobrand_data = c.data_for_generic_update IF !update.cobrand %] +<li><a href="[% c.uri_for_email( '/report', update.problem_id, cobrand_data ) %]#update_[% update.id %]">[% loc('View report on site' )%]</a></li> +<li><label for='detail'>[% loc('Text:') %]</label><br><textarea name='text' id='text' cols=60 rows=10>[% update.text | html %]</textarea></li> +<li><label for="anonymous">[% loc('Anonymous:') %]</label> <select name="anonymous" id="anonymous"> +<option [% 'selected ' IF update.anonymous %]value="1">[% loc('Yes') %]</option> +<option [% 'selected ' IF !update.anonymous %]value="0">[% loc('No') %]</option> +</select></li> +<li><label for="state">[% loc('State:') %]</label> <select name="state" id="state"> + [% FOREACH state IN [ ['confirmed', loc('Open')], ['hidden', loc('Hidden')], ['unconfirmed',loc('Unconfirmed')] ] %] + <option [% 'selected ' IF state.0 == update.state %] value="[% state.0 %]">[% state.1 %]</option> + [% END %] +</select></li> +<li>[% loc('Name:') %] <input type='text' name='name' id='name' value='[% update.name | html %]'></li> +<li>[% loc('Email:') %] <input type='text' id='email' name='email' value='[% update.user.email | html %]'></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> + +[% IF update.photo %] +[% photo = update.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/footer.html' %] |