From 872545f8a71a98a91951be04515ca491e3cfed1d Mon Sep 17 00:00:00 2001 From: Matthew Somerville Date: Tue, 24 May 2016 16:54:31 +0100 Subject: Add a couple of template hooks to report/_main This removes the need for the Oxfordshire cobrand to override. --- templates/web/base/report/_main.html | 8 +- templates/web/base/report/_main_sent_info.html | 5 + templates/web/oxfordshire/report/_main.html | 101 --------------------- templates/web/oxfordshire/report/_main_after.html | 7 ++ .../web/oxfordshire/report/_main_sent_info.html | 3 + 5 files changed, 18 insertions(+), 106 deletions(-) create mode 100644 templates/web/base/report/_main_sent_info.html delete mode 100644 templates/web/oxfordshire/report/_main.html create mode 100644 templates/web/oxfordshire/report/_main_after.html create mode 100644 templates/web/oxfordshire/report/_main_sent_info.html 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 %]; ([% loc('there is no pin shown as the user did not use the map') %])[% END %]

- [% IF problem.bodies_str %] - [% INCLUDE 'report/_council_sent_info.html' %] - [% ELSE %] -

[% loc('Not reported to council') %]

- [% END %] + [% INCLUDE 'report/_main_sent_info.html' %] [% mlog = problem.latest_moderation_log_entry(); IF mlog %]

Moderated by [% mlog.user.from_body.name %] at [% prettify_dt(mlog.whenedited) %]

[% END %] @@ -92,4 +88,6 @@ [% END %] + + [% TRY %][% PROCESS 'report/_main_after.html' %][% CATCH file %][% END %] 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 %] +

[% loc('Not reported to council') %]

+[% 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) %] - -
- - [% IF moderating %] - [% original = problem_original %] -
-

- -

- [% END %] - -

[% problem.title | html %]

- - [% IF moderating %] -
- [% IF problem.title != original.title %] - - [% END %] -

-
- [% END %] - -
- -
-

- [% problem.meta_line(c) | html %] - [%- IF !problem.used_map %]; ([% loc('there is no pin shown as the user did not use the map') %])[% END %] -

- - [% IF problem.whensent %] -

[% problem.duration_string(c) %]

- [% END %] - [% mlog = problem.latest_moderation_log_entry(); IF mlog %] -

Moderated by [% mlog.user.from_body.name %] at [% prettify_dt(mlog.whenedited) %]

- [% END %] - - [% INCLUDE 'report/_support.html' %] - - [% IF moderating %] - [% IF problem.photo or original.photo %] -

- -

- [% END %] - [% END %] - - [% INCLUDE 'report/photo.html' object=problem %] -
- [% add_links( problem.detail ) | html_para %] -
- - [% IF moderating %] -

- [% IF problem.detail != original.detail %] - - [% END %] - -

- -
-

- -

-

- - -

-

- - -

-
- -
- [% END %] - - [% IF problem.bodies_str %] - [% INCLUDE 'report/_council_sent_info.html' %] - [% ELSE %] -
-

[% loc('Not reported to council') %]

-
- [% END %] -
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 %] +
+

[% loc('Not reported to council') %]

+
+[% 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 %] +

[% problem.duration_string(c) %]

+[% END %] -- cgit v1.2.3