diff options
author | Matthew Somerville <matthew@mysociety.org> | 2015-10-05 13:58:09 +0100 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2015-10-08 14:50:23 +0100 |
commit | 50b8576284de8ebb1fc59bdeb4b6f98e58358333 (patch) | |
tree | f63cc71e1de93c4374d579cfa7c16b5e550e513e | |
parent | ef0c07ba692b8046fe865d9849104324d4f40977 (diff) |
[Bromley/Greenwich/Oxfordshire] Tidy overrides.
Have the around, my, and reports pages use the same low level template
for individual list items, which can then be overridden for these
cobrands, meaning they no longer need to override higher level
templates.
The logic in 2b9178d was incorrect; fix this so that the correct
information is included in those templates.
19 files changed, 18 insertions, 106 deletions
diff --git a/templates/web/base/around/on_map_list_items.html b/templates/web/base/around/on_map_list_items.html index 5de0f9216..90f836fc8 100644 --- a/templates/web/base/around/on_map_list_items.html +++ b/templates/web/base/around/on_map_list_items.html @@ -5,7 +5,7 @@ dist = tprintf("%.1f", (problem.distance || 0) ); problem = problem.problem; END %] - [% INCLUDE 'report/_item.html' %] + [% INCLUDE 'reports/_list-entry.html' %] [% END %] [% ELSE %] <li class="empty"> diff --git a/templates/web/base/front/_list-entry.html b/templates/web/base/front/_list-entry.html new file mode 100755 index 000000000..2fcf5f296 --- /dev/null +++ b/templates/web/base/front/_list-entry.html @@ -0,0 +1 @@ +[% INCLUDE 'report/_item.html' no_fixed = 1 %] diff --git a/templates/web/base/front/recent.html b/templates/web/base/front/recent.html index 5275cef43..de74f3326 100644 --- a/templates/web/base/front/recent.html +++ b/templates/web/base/front/recent.html @@ -15,7 +15,7 @@ <section class="full-width"> <ul class="issue-list-a"> [% FOREACH problem IN recent_photos %] - [% INCLUDE 'report/_item.html', no_fixed = 1 %] + [% INCLUDE 'front/_list-entry.html' %] [% END %] </ul> </section> diff --git a/templates/web/base/my/_problem-list.html b/templates/web/base/my/_problem-list.html index b8a3f07a2..4b5fc73d6 100644 --- a/templates/web/base/my/_problem-list.html +++ b/templates/web/base/my/_problem-list.html @@ -1,7 +1,7 @@ <ul class='issue-list-a full-width'> [% IF problems.size %] - [% FOREACH p = problems %] - [% INCLUDE 'report/_item.html', problem = p, no_fixed = 1 %] + [% FOREACH problem = problems %] + [% INCLUDE 'reports/_list-entry.html' no_fixed = 1 %] [% END %] [% ELSE %] <li class="empty"> diff --git a/templates/web/base/report/_item.html b/templates/web/base/report/_item.html index 6ac18b534..2fcfa9fb8 100644 --- a/templates/web/base/report/_item.html +++ b/templates/web/base/report/_item.html @@ -13,7 +13,7 @@ [%- prettify_dt( problem.confirmed) %] [%- END %] [%- IF dist %], [% dist %]km[% END %] - [%- IF NOT exclude_lastupdate AND problem.confirmed != problem.lastupdate AND problem.whensent != problem.lastupdate %], + [%- IF problem.confirmed != problem.lastupdate AND problem.whensent != problem.lastupdate %], [% tprintf(loc('last updated %s'), prettify_dt( problem.lastupdate, 1 ) ) %] [%- END %] [% IF include_sentinfo %] diff --git a/templates/web/base/reports/_list-entry.html b/templates/web/base/reports/_list-entry.html index 4c0abd337..dbf0a576e 100755 --- a/templates/web/base/reports/_list-entry.html +++ b/templates/web/base/reports/_list-entry.html @@ -1 +1 @@ -[% INCLUDE 'report/_item.html' include_sentinfo = 1 %] +[% INCLUDE 'report/_item.html' %] diff --git a/templates/web/base/reports/_problem-list.html b/templates/web/base/reports/_problem-list.html index 45746e309..a4c78877a 100644 --- a/templates/web/base/reports/_problem-list.html +++ b/templates/web/base/reports/_problem-list.html @@ -8,7 +8,7 @@ <ul class="issue-list-a"> [% IF problems %] [% FOREACH problem IN problems %] - [% INCLUDE 'reports/_list-entry.html' %] + [% INCLUDE 'reports/_list-entry.html' include_sentinfo = 1 include_lastupdate = 1 %] [% END %] [% ELSE %] <li class="empty"> diff --git a/templates/web/bromley/around/on_map_list_items.html b/templates/web/bromley/around/on_map_list_items.html deleted file mode 100644 index 893f5c698..000000000 --- a/templates/web/bromley/around/on_map_list_items.html +++ /dev/null @@ -1,11 +0,0 @@ -[% all_reports = on_map.merge(around_map) %] -[% IF all_reports.size %] - [% FOREACH problem IN all_reports %] - [% UNLESS problem.title; problem = problem.problem; END %] - [% INCLUDE "reports/_list-entry.html" %] - [% END %] -[% ELSE %] - <li class="empty"> - <p>[% loc('There are no reports to show.') %]</p> - </li> -[% END %] diff --git a/templates/web/bromley/report/_item.html b/templates/web/bromley/report/_item.html index 9e9c05bcb..6398f698e 100644 --- a/templates/web/bromley/report/_item.html +++ b/templates/web/bromley/report/_item.html @@ -8,7 +8,7 @@ <span>[% problem.title | html %]</span><br /> <small>[% prettify_dt( problem.confirmed, 1 ) %] [%- IF dist %], [% dist %]km[% END %] - [%- IF NOT exclude_lastupdate AND problem.confirmed != problem.lastupdate AND problem.whensent != problem.lastupdate %], + [%- IF include_lastupdate AND problem.confirmed != problem.lastupdate AND problem.whensent != problem.lastupdate %], [% tprintf(loc('last updated %s'), prettify_dt( problem.lastupdate, 1 ) ) %] [%- END %] [% IF include_sentinfo %] diff --git a/templates/web/bromley/reports/_list-entry.html b/templates/web/bromley/reports/_list-entry.html deleted file mode 100755 index 070048af6..000000000 --- a/templates/web/bromley/reports/_list-entry.html +++ /dev/null @@ -1 +0,0 @@ -[% INCLUDE 'report/_item.html' include_sentinfo = 1 exclude_lastupdate = 1 %] diff --git a/templates/web/fixmystreet-uk-councils/report/_item-with-pin.html b/templates/web/fixmystreet-uk-councils/report/_item-with-pin.html new file mode 100644 index 000000000..cd70410d3 --- /dev/null +++ b/templates/web/fixmystreet-uk-councils/report/_item-with-pin.html @@ -0,0 +1,6 @@ +<li class="[% c.cobrand.pin_colour(problem) %]"> + <a href="[% c.uri_for('/report', problem.id ) %]" class="[% problem.category %]"> + <h3>[% problem.title | html %]</h3> + <p>Reported [%- prettify_dt( problem.confirmed, 1 ) %]</p> + </a> +</li> diff --git a/templates/web/greenwich/around/on_map_list_items.html b/templates/web/greenwich/around/on_map_list_items.html deleted file mode 100644 index 893f5c698..000000000 --- a/templates/web/greenwich/around/on_map_list_items.html +++ /dev/null @@ -1,11 +0,0 @@ -[% all_reports = on_map.merge(around_map) %] -[% IF all_reports.size %] - [% FOREACH problem IN all_reports %] - [% UNLESS problem.title; problem = problem.problem; END %] - [% INCLUDE "reports/_list-entry.html" %] - [% END %] -[% ELSE %] - <li class="empty"> - <p>[% loc('There are no reports to show.') %]</p> - </li> -[% END %] diff --git a/templates/web/greenwich/my/_problem-list.html b/templates/web/greenwich/my/_problem-list.html deleted file mode 100644 index 1ff69f9fb..000000000 --- a/templates/web/greenwich/my/_problem-list.html +++ /dev/null @@ -1,25 +0,0 @@ -<ul class='issue-list-a full-width'> - [% IF problems.all %] - [% FOREACH p = problems.all %] - [% INCLUDE 'reports/_list-entry.html', problem = p, no_fixed =1 %] - [% END %] - [% ELSE %] - <li class="empty"> - <p>[% loc('There are no reports to show.') %]</p> - </li> - [% END %] -</ul> - -[% IF ! problems.size %] -<!-- Preserve behaviour of map filters despite map not being shown --> -<script type="text/javascript"> - (function($) { - $(function() { - $(".report-list-filters [type=submit]").hide(); - $(".report-list-filters select").change(function() { - $(this).closest("form").submit(); - }); - }) - })(window.jQuery); -</script> -[% END %] diff --git a/templates/web/greenwich/reports/_list-entry.html b/templates/web/greenwich/reports/_list-entry.html index cd70410d3..b24ef2260 100644 --- a/templates/web/greenwich/reports/_list-entry.html +++ b/templates/web/greenwich/reports/_list-entry.html @@ -1,6 +1 @@ -<li class="[% c.cobrand.pin_colour(problem) %]"> - <a href="[% c.uri_for('/report', problem.id ) %]" class="[% problem.category %]"> - <h3>[% problem.title | html %]</h3> - <p>Reported [%- prettify_dt( problem.confirmed, 1 ) %]</p> - </a> -</li> +[% INCLUDE 'report/_item-with-pin.html' %] diff --git a/templates/web/oxfordshire/around/on_map_list_items.html b/templates/web/oxfordshire/around/on_map_list_items.html deleted file mode 100644 index 893f5c698..000000000 --- a/templates/web/oxfordshire/around/on_map_list_items.html +++ /dev/null @@ -1,11 +0,0 @@ -[% all_reports = on_map.merge(around_map) %] -[% IF all_reports.size %] - [% FOREACH problem IN all_reports %] - [% UNLESS problem.title; problem = problem.problem; END %] - [% INCLUDE "reports/_list-entry.html" %] - [% END %] -[% ELSE %] - <li class="empty"> - <p>[% loc('There are no reports to show.') %]</p> - </li> -[% END %] diff --git a/templates/web/oxfordshire/my/_problem-list.html b/templates/web/oxfordshire/my/_problem-list.html deleted file mode 100644 index 1ff69f9fb..000000000 --- a/templates/web/oxfordshire/my/_problem-list.html +++ /dev/null @@ -1,25 +0,0 @@ -<ul class='issue-list-a full-width'> - [% IF problems.all %] - [% FOREACH p = problems.all %] - [% INCLUDE 'reports/_list-entry.html', problem = p, no_fixed =1 %] - [% END %] - [% ELSE %] - <li class="empty"> - <p>[% loc('There are no reports to show.') %]</p> - </li> - [% END %] -</ul> - -[% IF ! problems.size %] -<!-- Preserve behaviour of map filters despite map not being shown --> -<script type="text/javascript"> - (function($) { - $(function() { - $(".report-list-filters [type=submit]").hide(); - $(".report-list-filters select").change(function() { - $(this).closest("form").submit(); - }); - }) - })(window.jQuery); -</script> -[% END %] diff --git a/templates/web/oxfordshire/reports/_list-entry.html b/templates/web/oxfordshire/reports/_list-entry.html index cd70410d3..b24ef2260 100644 --- a/templates/web/oxfordshire/reports/_list-entry.html +++ b/templates/web/oxfordshire/reports/_list-entry.html @@ -1,6 +1 @@ -<li class="[% c.cobrand.pin_colour(problem) %]"> - <a href="[% c.uri_for('/report', problem.id ) %]" class="[% problem.category %]"> - <h3>[% problem.title | html %]</h3> - <p>Reported [%- prettify_dt( problem.confirmed, 1 ) %]</p> - </a> -</li> +[% INCLUDE 'report/_item-with-pin.html' %] diff --git a/templates/web/zurich/report/_item.html b/templates/web/zurich/report/_item.html index 816afd0ff..22b39a2c8 100644 --- a/templates/web/zurich/report/_item.html +++ b/templates/web/zurich/report/_item.html @@ -12,7 +12,7 @@ [% END %] <small>[% prettify_dt( problem.created, 'zurich' ) %] [%- IF dist %], [% dist %]km[% END %] - [%- IF NOT exclude_lastupdate AND problem.created != problem.lastupdate AND problem.whensent != problem.lastupdate %], + [%- IF include_lastupdate AND problem.created != problem.lastupdate AND problem.whensent != problem.lastupdate %], [% tprintf(loc('last updated %s'), prettify_dt( problem.lastupdate, 'zurich' ) ) %] [%- END %] [% IF NOT no_fixed AND problem.is_fixed %] diff --git a/templates/web/zurich/reports/_list-entry.html b/templates/web/zurich/reports/_list-entry.html deleted file mode 100755 index 070048af6..000000000 --- a/templates/web/zurich/reports/_list-entry.html +++ /dev/null @@ -1 +0,0 @@ -[% INCLUDE 'report/_item.html' include_sentinfo = 1 exclude_lastupdate = 1 %] |