From cc5613a4108615d7b066b9974038c04b4afbd9e2 Mon Sep 17 00:00:00 2001
From: Matthew Somerville
Date: Tue, 24 May 2016 16:52:30 +0100
Subject: Move processed_summary_string function to template
Fixes #694.
---
templates/web/base/report/_council_sent_info.html | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
(limited to 'templates')
diff --git a/templates/web/base/report/_council_sent_info.html b/templates/web/base/report/_council_sent_info.html
index 4496611e0..affc73414 100644
--- a/templates/web/base/report/_council_sent_info.html
+++ b/templates/web/base/report/_council_sent_info.html
@@ -1,5 +1,17 @@
[% IF problem.whensent || problem.can_display_external_id %]
- [% problem.processed_summary_string(c) %]
+ [% SET duration_clause = problem.duration_string(c) IF problem.whensent %]
+ [%- IF problem.can_display_external_id %]
+ [%- IF duration_clause %]
+ [%- external_ref_clause = tprintf(loc('Council ref: %s'), problem.external_id) %]
+ [%- ELSE %]
+ [%- external_ref_clause = tprintf(loc('%s ref: %s'), problem.external_body, problem.external_id) %]
+ [%- END %]
+ [%- END -%]
+ [% duration_clause %]
+ [%- IF external_ref_clause %]
+ [%- IF duration_clause %]. [% END %]
+ [% external_ref_clause %].
+ [%- END %]
[% END %]
--
cgit v1.2.3
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
(limited to 'templates')
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) %]
-
-
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