diff options
author | Matthew Somerville <matthew-github@dracos.co.uk> | 2019-03-01 17:04:50 +0000 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2019-03-05 13:08:51 +0000 |
commit | c029ec15c481cfe153670c735a1d4ca35b3153f9 (patch) | |
tree | 774ec135781366875045eb1f218ae9f03310cc14 /templates | |
parent | 86827c23436fef52b6b38d3fbc357fb0bf20f0c6 (diff) |
Use relative report links where possible.
On some UK council cobrands, some reports listed might not have been sent
to that council, so links to those must go to the national site. However,
using absolute URLs for all these reports means that sometimes you change
domain when you don't need to (eg. if you’re on osm.fixmystreet.com or an
aliased version of the site), which can cause confusion. State when we’re
happy to use a relative link (ie. web-facing report links, not emails, or
share links) and do that when we can.
Diffstat (limited to 'templates')
-rw-r--r-- | templates/web/base/maps/pin.html | 2 | ||||
-rw-r--r-- | templates/web/base/report/_item.html | 2 | ||||
-rw-r--r-- | templates/web/base/report/_item_expandable.html | 4 | ||||
-rw-r--r-- | templates/web/base/tokens/confirm_problem.html | 4 | ||||
-rw-r--r-- | templates/web/zurich/tokens/confirm_problem.html | 2 |
5 files changed, 7 insertions, 7 deletions
diff --git a/templates/web/base/maps/pin.html b/templates/web/base/maps/pin.html index e2d1c0021..3a3fb4cf0 100644 --- a/templates/web/base/maps/pin.html +++ b/templates/web/base/maps/pin.html @@ -1,6 +1,6 @@ [% DEFAULT pin_style = 'top:' _ (pin.py - 64) _ 'px; left:' _ (pin.px - 24) _ 'px; position: absolute;' -%] [% IF pin.id %] -<a title="[% pin.title | html %]" href="[% c.cobrand.base_url_for_report( pin.problem ) %][% pin.problem.url %]"> +<a title="[% pin.title | html %]" href="[% c.cobrand.relative_url_for_report( pin.problem ) %][% pin.problem.url %]"> [%- END -%] <img border="0" src="[% start %][% c.cobrand.path_to_pin_icons _ 'pin-' _ pin.colour _ '.png' %]" [% IF js -%] diff --git a/templates/web/base/report/_item.html b/templates/web/base/report/_item.html index 863b87817..200c690a6 100644 --- a/templates/web/base/report/_item.html +++ b/templates/web/base/report/_item.html @@ -30,7 +30,7 @@ <li class="item-list__item item-list--reports__item [% item_extra_class %]" data-report-id="[% problem.id | html %]" data-lastupdate="[% problem.lastupdate %]" id="report-[% problem.id | html %]"> -<a href="[% c.cobrand.base_url_for_report( problem ) %][% problem.url %]"> +<a href="[% c.cobrand.relative_url_for_report( problem ) %][% problem.url %]"> [% IF problem.photo %] <img class="img" height="60" width="90" src="[% problem.photos.first.url_fp %]" alt=""> [% END %] diff --git a/templates/web/base/report/_item_expandable.html b/templates/web/base/report/_item_expandable.html index 6a4fe7191..27682012b 100644 --- a/templates/web/base/report/_item_expandable.html +++ b/templates/web/base/report/_item_expandable.html @@ -18,7 +18,7 @@ id="report-[% problem.id | html %]"> [% IF problem.photo %] - <a href="[% c.cobrand.base_url_for_report( problem ) %][% problem.url %]" class="item-list__item--expandable__hide-when-expanded"> + <a href="[% c.cobrand.relative_url_for_report( problem ) %][% problem.url %]" class="item-list__item--expandable__hide-when-expanded"> <img class="img" height="60" width="90" src="[% problem.photos.first.url_fp %]" alt=""> </a> [% END %] @@ -27,7 +27,7 @@ [% PROCESS 'report/_item_heading.html' %] [% CATCH file %] <h3> - <a href="[% c.cobrand.base_url_for_report( problem ) %][% problem.url %]"> + <a href="[% c.cobrand.relative_url_for_report( problem ) %][% problem.url %]"> [% problem.title | html %] </a> </h3> diff --git a/templates/web/base/tokens/confirm_problem.html b/templates/web/base/tokens/confirm_problem.html index f74517c8a..62053b1bc 100644 --- a/templates/web/base/tokens/confirm_problem.html +++ b/templates/web/base/tokens/confirm_problem.html @@ -2,7 +2,7 @@ <div class="confirmation-header"> - <h1><a href="[% c.cobrand.base_url_for_report( report ) %][% report.url %]">[% report.title %]</a></h1> + <h1><a href="[% c.cobrand.relative_url_for_report( report ) %][% report.url %]">[% report.title %]</a></h1> [% IF c.cobrand.is_council %] [% IF c.cobrand.owns_problem( report ) %] @@ -21,7 +21,7 @@ <b>[% report.body %]</b> </p> <p> - You can follow this problem on <a href="[% c.cobrand.base_url_for_report( report ) %][% report.url %]">FixMyStreet.com</a>. + You can follow this problem on <a href="[% c.cobrand.relative_url_for_report( report ) %][% report.url %]">FixMyStreet.com</a>. </p> [% END %] diff --git a/templates/web/zurich/tokens/confirm_problem.html b/templates/web/zurich/tokens/confirm_problem.html index d2025f124..52376adce 100644 --- a/templates/web/zurich/tokens/confirm_problem.html +++ b/templates/web/zurich/tokens/confirm_problem.html @@ -6,7 +6,7 @@ loc('You have successfully confirmed your email address.'); tprintf( loc( 'You can <a href="%s%s">view the problem on this site</a>.' ), - c.cobrand.base_url_for_report( report ), + c.cobrand.relative_url_for_report( report ), report.url ); %] |