aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2016-05-24 16:54:31 +0100
committerMatthew Somerville <matthew-github@dracos.co.uk>2016-05-24 16:54:31 +0100
commit872545f8a71a98a91951be04515ca491e3cfed1d (patch)
treeb3e506098e49802a28437caabce970199b5bc546
parentcc5613a4108615d7b066b9974038c04b4afbd9e2 (diff)
Add a couple of template hooks to report/_main
This removes the need for the Oxfordshire cobrand to override.
-rw-r--r--templates/web/base/report/_main.html8
-rw-r--r--templates/web/base/report/_main_sent_info.html5
-rw-r--r--templates/web/oxfordshire/report/_main.html101
-rw-r--r--templates/web/oxfordshire/report/_main_after.html7
-rw-r--r--templates/web/oxfordshire/report/_main_sent_info.html3
5 files changed, 18 insertions, 106 deletions
diff --git a/templates/web/base/report/_main.html b/templates/web/base/report/_main.html
index efff314f8..c079b9ebd 100644
--- a/templates/web/base/report/_main.html
+++ b/templates/web/base/report/_main.html
@@ -35,11 +35,7 @@
[%- IF !problem.used_map %]; <strong>([% loc('there is no pin shown as the user did not use the map') %])</strong>[% END %]
</p>
- [% IF problem.bodies_str %]
- [% INCLUDE 'report/_council_sent_info.html' %]
- [% ELSE %]
- <p class="council_sent_info">[% loc('Not reported to council') %]</p>
- [% END %]
+ [% INCLUDE 'report/_main_sent_info.html' %]
[% mlog = problem.latest_moderation_log_entry(); IF mlog %]
<p>Moderated by [% mlog.user.from_body.name %] at [% prettify_dt(mlog.whenedited) %]</p>
[% END %]
@@ -92,4 +88,6 @@
</form>
[% END %]
+
+ [% TRY %][% PROCESS 'report/_main_after.html' %][% CATCH file %][% END %]
</div>
diff --git a/templates/web/base/report/_main_sent_info.html b/templates/web/base/report/_main_sent_info.html
new file mode 100644
index 000000000..3e54ac8ed
--- /dev/null
+++ b/templates/web/base/report/_main_sent_info.html
@@ -0,0 +1,5 @@
+[% IF problem.bodies_str %]
+ [% INCLUDE 'report/_council_sent_info.html' %]
+[% ELSE %]
+ <p class="council_sent_info">[% loc('Not reported to council') %]</p>
+[% END %]
diff --git a/templates/web/oxfordshire/report/_main.html b/templates/web/oxfordshire/report/_main.html
deleted file mode 100644
index 2ff193075..000000000
--- a/templates/web/oxfordshire/report/_main.html
+++ /dev/null
@@ -1,101 +0,0 @@
-[% moderating = c.user && c.user.has_permission_to('moderate', problem.bodies_str) %]
-
-<div class="problem-header cf" problem-id="[% problem.id %]">
-
- [% IF moderating %]
- [% original = problem_original %]
- <form method="post" action="/moderate/report/[% problem.id %]">
- <p class="moderate-display">
- <input type="button" class="btn moderate" value="moderate">
- </p>
- [% END %]
-
- <h1 class="moderate-display">[% problem.title | html %]</h1>
-
- [% IF moderating %]
- <div class="moderate-edit">
- [% IF problem.title != original.title %]
- <label>
- <input type="checkbox" name="problem_revert_title" class="revert-title">
- Revert to original title
- </label>
- [% END %]
- <h1><input type="text" name="problem_title" value="[% problem.title | html %]" data-original-value="[% original.title | html %]"></h1>
- </div>
- [% END %]
-
- <div class="moderate-edit">
- <label>
- <input type="checkbox" name="problem_show_name" [% problem.anonymous ? 'checked' : '' %]>
- Hide reporter&rsquo;s name
- </label>
- </div>
- <p class="report_meta_info">
- [% problem.meta_line(c) | html %]
- [%- IF !problem.used_map %]; <strong>([% loc('there is no pin shown as the user did not use the map') %])</strong>[% END %]
- </p>
-
- [% IF problem.whensent %]
- <p class="council_sent_info">[% problem.duration_string(c) %]</p>
- [% END %]
- [% mlog = problem.latest_moderation_log_entry(); IF mlog %]
- <p>Moderated by [% mlog.user.from_body.name %] at [% prettify_dt(mlog.whenedited) %]</p>
- [% END %]
-
- [% INCLUDE 'report/_support.html' %]
-
- [% IF moderating %]
- [% IF problem.photo or original.photo %]
- <p class="moderate-edit">
- <label>
- <input type="checkbox" name="problem_show_photo" [% problem.photo ? 'checked' : '' %]>
- Show photo
- </label>
- </p>
- [% END %]
- [% END %]
-
- [% INCLUDE 'report/photo.html' object=problem %]
- <div class="moderate-display">
- [% add_links( problem.detail ) | html_para %]
- </div>
-
- [% IF moderating %]
- <p class="moderate-edit">
- [% IF problem.detail != original.detail %]
- <label>
- <input type="checkbox" name="problem_revert_detail" class="revert-textarea">
- Revert to original text
- </label>
- [% END %]
- <textarea name="problem_detail" data-original-value="[% original.detail | html %]">[% problem.detail | html %]</textarea>
- </p>
-
- <div class="moderate-edit">
- <p>
- <label>
- <input type="checkbox" class="hide-document" name="problem_hide" [% problem.hidden ? 'checked' : '' %]>
- Hide entire report
- </label>
- </p>
- <p>
- <label for="moderation_reason">Moderation reason:</label>
- <input type="text" name="moderation_reason" placeholder="Describe why you are moderating this">
- </p>
- <p>
- <input type="submit" class="green-btn" value="Save changes">
- <input type="button" class="btn cancel" value="Discard changes">
- </p>
- </div>
-
- </form>
- [% END %]
-
- [% IF problem.bodies_str %]
- [% INCLUDE 'report/_council_sent_info.html' %]
- [% ELSE %]
- <div class="council_info_box">
- <p>[% loc('Not reported to council') %]</p>
- </div>
- [% END %]
-</div>
diff --git a/templates/web/oxfordshire/report/_main_after.html b/templates/web/oxfordshire/report/_main_after.html
new file mode 100644
index 000000000..16491a556
--- /dev/null
+++ b/templates/web/oxfordshire/report/_main_after.html
@@ -0,0 +1,7 @@
+[% IF problem.bodies_str %]
+ [% INCLUDE 'report/_council_sent_info.html' %]
+[% ELSE %]
+ <div class="council_info_box">
+ <p>[% loc('Not reported to council') %]</p>
+ </div>
+[% END %]
diff --git a/templates/web/oxfordshire/report/_main_sent_info.html b/templates/web/oxfordshire/report/_main_sent_info.html
new file mode 100644
index 000000000..c955a5fae
--- /dev/null
+++ b/templates/web/oxfordshire/report/_main_sent_info.html
@@ -0,0 +1,3 @@
+[% IF problem.whensent %]
+ <p class="council_sent_info">[% problem.duration_string(c) %]</p>
+[% END %]