diff options
author | Matthew Somerville <matthew@mysociety.org> | 2011-06-03 15:20:39 +0100 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2011-06-03 15:20:39 +0100 |
commit | 34e78aa47e8cad5ba237705dd8a2fa1d1403ff20 (patch) | |
tree | 8e898360c4e5faa676cdc2ed99f0bc06ce15cbe2 | |
parent | 7b405637a1ac3436cf90acc7d5ad46f1b80c8250 (diff) |
Better alert page title handling.
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Alert.pm | 3 | ||||
-rw-r--r-- | t/app/controller/alert.t | 2 | ||||
-rw-r--r-- | templates/web/default/alert/list.html | 15 | ||||
-rw-r--r-- | templates/web/default/footer.html | 8 |
4 files changed, 17 insertions, 11 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Alert.pm b/perllib/FixMyStreet/App/Controller/Alert.pm index b8b7cce40..98e1236e1 100644 --- a/perllib/FixMyStreet/App/Controller/Alert.pm +++ b/perllib/FixMyStreet/App/Controller/Alert.pm @@ -332,9 +332,6 @@ sub prettify_pc : Private { my $pretty_pc_text = $pretty_pc; $pretty_pc_text =~ s/ //g; $c->stash->{pretty_pc_text} = $pretty_pc_text; - - # this may be better done in template - $pretty_pc =~ s/ / /; } $c->stash->{pretty_pc} = $pretty_pc; diff --git a/t/app/controller/alert.t b/t/app/controller/alert.t index 45257b31b..3e2dedd53 100644 --- a/t/app/controller/alert.t +++ b/t/app/controller/alert.t @@ -22,7 +22,7 @@ $mech->content_contains('html lang="en-gb"'); $mech->get_ok('/alert/list?pc=EH99 1SP'); $mech->title_like(qr/^Local RSS feeds and email alerts/); -$mech->content_contains('Local RSS feeds and email alerts for ‘EH99 1SP’'); +$mech->content_contains('Here are the types of local problem alerts for ‘EH99 1SP’'); $mech->content_contains('html lang="en-gb"'); $mech->content_contains('Problems within 8.5km'); $mech->content_contains('rss/pc/EH991SP/2'); diff --git a/templates/web/default/alert/list.html b/templates/web/default/alert/list.html index 931636f06..a8f962c5d 100644 --- a/templates/web/default/alert/list.html +++ b/templates/web/default/alert/list.html @@ -1,9 +1,18 @@ -[% title = loc('Local RSS feeds and email alerts') %] +[% + IF pretty_pc; + title = tprintf( loc("Local RSS feeds and email alerts for ā%sā"), pretty_pc ); + ELSE; + title = loc('Local RSS feeds and email alerts'); + END; +%] [% INCLUDE 'header.html', title => title %] [% IF pretty_pc %] -[% title = tprintf( loc('Local RSS feeds and email alerts for ‘%s’'), pretty_pc ) %] + [% + pretty_pc = pretty_pc | html | replace(' ', ' '); + title = tprintf( loc("Local RSS feeds and email alerts for ā%sā"), pretty_pc ); + %] [% END %] @@ -24,7 +33,7 @@ <p> [% IF pretty_pc %] - [% tprintf( loc('Here are the types of local problem alerts for ‘%s’.'), pretty_pc ) | html %] + [% tprintf( loc('Here are the types of local problem alerts for ‘%s’.'), pretty_pc ) %] [% END %] [% loc('Select which type of alert you\'d like and click the button for an RSS feed, or enter your email address to subscribe to an email alert') %] </p> diff --git a/templates/web/default/footer.html b/templates/web/default/footer.html index 71aaba365..19af59198 100644 --- a/templates/web/default/footer.html +++ b/templates/web/default/footer.html @@ -3,11 +3,11 @@ <h2 class="v">[% loc('Navigation') %]</h2> <ul id="navigation"> -<li><a href="/report/new" >[% loc("Report a problem") %]</a></li> -<li><a href="/reports" >[% loc("All reports") %]</a></li> +<li><a href="/">[% loc("Report a problem") %]</a></li> +<li><a href="/reports">[% loc("All reports") %]</a></li> <li><a href="/alert[% pc ? '/list?pc=' : '' %][% pc | uri %]">[% loc("Local alerts") %]</a></li> -<li><a href="/faq" >[% loc("Help") %]</a></li> -<li><a href="/contact" >[% loc("Contact") %]</a></li> +<li><a href="/faq">[% loc("Help") %]</a></li> +<li><a href="/contact">[% loc("Contact") %]</a></li> </ul> [% loc('<a href="http://www.mysociety.org/"><img id="logo" width="133" height="26" src="/i/mysociety-dark.png" alt="View mySociety.org"><span id="logoie"></span></a>') %] |