aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--perllib/FixMyStreet/App/Controller/Auth.pm23
-rw-r--r--templates/web/angus/footer.html4
-rw-r--r--templates/web/angus/main_menu.html24
-rw-r--r--templates/web/angus/post_header_extra.html2
-rw-r--r--templates/web/base/footer.html30
-rw-r--r--templates/web/base/main_nav.html35
-rw-r--r--templates/web/base/main_nav_items.html44
-rw-r--r--templates/web/bristol/footer.html23
-rw-r--r--templates/web/bromley/footer.html15
-rw-r--r--templates/web/eastherts/footer.html27
-rw-r--r--templates/web/greenwich/footer.html17
-rw-r--r--templates/web/greenwich/header_logo.html13
-rw-r--r--templates/web/hart/footer.html13
-rw-r--r--templates/web/oxfordshire/footer.html16
-rw-r--r--templates/web/oxfordshire/header.html28
-rw-r--r--templates/web/seesomething/footer.html10
-rw-r--r--templates/web/seesomething/main_nav_items.html3
-rw-r--r--templates/web/stevenage/footer.html15
-rw-r--r--templates/web/warwickshire/header.html20
-rw-r--r--web/cobrands/bromley/layout.scss18
20 files changed, 135 insertions, 245 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Auth.pm b/perllib/FixMyStreet/App/Controller/Auth.pm
index 825033f21..b41e88209 100644
--- a/perllib/FixMyStreet/App/Controller/Auth.pm
+++ b/perllib/FixMyStreet/App/Controller/Auth.pm
@@ -412,14 +412,33 @@ Used after signing in to take the person back to where they were.
sub redirect_on_signin : Private {
my ( $self, $c, $redirect ) = @_;
- $redirect = 'my' unless $redirect;
- $redirect = 'my' if $redirect =~ /^admin/ && !$c->user->is_superuser;
+ unless ( $redirect ) {
+ $c->detach('redirect_to_categories') if $c->user->from_body && scalar @{ $c->user->categories };
+ $redirect = 'my';
+ }
+ $redirect = 'my' if $redirect =~ /^admin/ && !$c->cobrand->admin_allow_user($c->user);
if ( $c->cobrand->moniker eq 'zurich' ) {
$redirect = 'admin' if $c->user->from_body;
}
$c->res->redirect( $c->uri_for( "/$redirect" ) );
}
+=head2 redirect_to_categories
+
+Redirects the user to their body's reports page, prefiltered to whatever
+categories this user has been assigned to.
+
+=cut
+
+sub redirect_to_categories : Private {
+ my ( $self, $c ) = @_;
+
+ my $categories = join(',', @{ $c->user->categories });
+ my $body_short = $c->cobrand->short_name( $c->user->from_body );
+
+ $c->res->redirect( $c->uri_for( "/reports/" . $body_short, { filter_category => $categories } ) );
+}
+
=head2 redirect
Used when trying to view a page that requires sign in when you're not.
diff --git a/templates/web/angus/footer.html b/templates/web/angus/footer.html
index 9a7e1dd6d..ec91aaa71 100644
--- a/templates/web/angus/footer.html
+++ b/templates/web/angus/footer.html
@@ -4,9 +4,7 @@
<div class="nav-wrapper">
<div class="nav-wrapper-2">
- <div id="main-nav" role="navigation">
- [% INCLUDE 'main_menu.html' extra_class = 'nav-menu--main' %]
- </div>
+ [% INCLUDE "main_nav.html" body_name=c.cobrand.council_area hide_mysoc_link=1 %]
</div>
</div>
</div> <!-- .wrapper -->
diff --git a/templates/web/angus/main_menu.html b/templates/web/angus/main_menu.html
deleted file mode 100644
index 3a07c61cd..000000000
--- a/templates/web/angus/main_menu.html
+++ /dev/null
@@ -1,24 +0,0 @@
-[%
- SET base = "";
- SET base = c.cobrand.base_url IF admin;
-%]
-<ul class="nav-menu [% extra_class %]">
- <li><[% IF c.req.uri.path == '/'
- %]span[% ELSE %]a href="[% base %]/"[% END %] class="report-a-problem-btn"
- >[% loc("Report a problem") %]</[% c.req.uri.path == '/' ? 'span' : 'a' %]></li>[%
- %]<li><[% IF c.req.uri.path == '/my'
- %]span[% ELSE %]a href="[% base %]/my"[% END
- %]>[% loc("Your reports") %]</[% c.req.uri.path == '/my' ? 'span' : 'a' %]></li>[%
- %]<li><[% IF c.req.uri.path == '/reports/Angus'
- %]span[% ELSE %]a href="[% base %]/reports/Angus"[% END
- %]>[% loc("All reports") %]</[% c.req.uri.path == '/reports/Angus' ? 'span' : 'a' %]></li>[%
- %]<li><[% IF c.req.uri.path == '/alert'
- %]span[% ELSE %]a href="[% base %]/alert[% pc ? '/list?pc=' : '' %][% pc | uri %]"[% END
- %]>[% loc("Local alerts") %]</[% c.req.uri.path == '/alert' ? 'span' : 'a' %]></li>[%
- %]<li><[% IF c.req.uri.path == '/faq'
- %]span[% ELSE %]a href="[% base %]/faq"[% END
- %]>[% loc("Help") %]</[% c.req.uri.path == '/faq' ? 'span' : 'a' %]></li>[%
- %]<li class="nav-menu__item--privacy"><[% IF c.req.uri.path == '/privacy'
- %]span[% ELSE %]a href="[% base %]/privacy"[% END
- %]>[% loc("Privacy") %]</[% c.req.uri.path == '/privacy' ? 'span' : 'a' %]></li>
-</ul>
diff --git a/templates/web/angus/post_header_extra.html b/templates/web/angus/post_header_extra.html
index 16a82de3e..43ba8af92 100644
--- a/templates/web/angus/post_header_extra.html
+++ b/templates/web/angus/post_header_extra.html
@@ -9,6 +9,6 @@
<div class="wrapper wrapper__main_menu">
<div class="container">
- [% INCLUDE 'main_menu.html' extra_class = 'nav-menu--breadcrumb' %]
+ [% INCLUDE "main_nav.html" body_name=c.cobrand.council_area hide_mysoc_link=1 ul_class="nav-menu nav-menu--breadcrumb" omit_wrapper=1 %]
</div>
</div>
diff --git a/templates/web/base/footer.html b/templates/web/base/footer.html
index 5fd74b3a1..9f86f7519 100644
--- a/templates/web/base/footer.html
+++ b/templates/web/base/footer.html
@@ -9,35 +9,7 @@
<div class="nav-wrapper">
<div class="nav-wrapper-2">
- <div id="main-nav" role="navigation">
- <ul class="nav-menu nav-menu--mysoc">
- <li><a id="mysoc-logo" href="https://www.mysociety.org/">mySociety</a></li>
- </ul>
-[%
- SET base = "";
- SET base = c.cobrand.base_url IF admin;
-%]
- <ul class="nav-menu nav-menu--main">
- <li><[% IF c.req.uri.path == '/'
- %]span[% ELSE %]a href="[% base %]/"[% END %] class="report-a-problem-btn"
- >[% loc("Report a problem") %]</[% c.req.uri.path == '/' ? 'span' : 'a' %]></li>[%
- %]<li><[% IF c.req.uri.path == '/my'
- %]span[% ELSE %]a href="[% base %]/my"[% END
- %]>[% c.user_exists ? loc("Your account") : loc("Sign in") %]</[% c.req.uri.path == '/my' ? 'span' : 'a' %]></li>[%
- %]<li><[% IF c.req.uri.path == '/reports'
- %]span[% ELSE %]a href="[% base %]/reports[% IF c.user_exists AND c.user.categories.size %]?filter_category=[% c.user.categories.join(",") | uri | html %][% END %]"[% END
- %]>[% loc("All reports") %]</[% c.req.uri.path == '/reports' ? 'span' : 'a' %]></li>[%
- %]<li><[% IF c.req.uri.path == '/alert'
- %]span[% ELSE %]a href="[% base %]/alert[% pc ? '/list?pc=' : '' %][% pc | uri %]"[% END
- %]>[% loc("Local alerts") %]</[% c.req.uri.path == '/alert' ? 'span' : 'a' %]></li>[%
- %]<li><[% IF c.req.uri.path == '/faq'
- %]span[% ELSE %]a href="[% base %]/faq"[% END
- %]>[% loc("Help") %]</[% c.req.uri.path == '/faq' ? 'span' : 'a' %]></li>[%
- %]<li class="nav-menu__item--privacy"><[% IF c.req.uri.path == '/privacy'
- %]span[% ELSE %]a href="[% base %]/privacy"[% END
- %]>[% loc("Privacy") %]</[% c.req.uri.path == '/privacy' ? 'span' : 'a' %]></li>
- </ul>
- </div>
+ [% INCLUDE "main_nav.html" %]
</div>
</div>
</div> <!-- .wrapper -->
diff --git a/templates/web/base/main_nav.html b/templates/web/base/main_nav.html
new file mode 100644
index 000000000..31bd61af5
--- /dev/null
+++ b/templates/web/base/main_nav.html
@@ -0,0 +1,35 @@
+[%
+ SET base = "";
+ SET base = c.cobrand.base_url IF admin;
+
+ # DEFAULT would make sense here, except it treats the empty string as falsy
+ # and some cobrands want to set ul_class to an empty string.
+ SET ul_class="nav-menu nav-menu--main" UNLESS ul_class.defined;
+%]
+[% BLOCK navitem ~%]
+ <li [% liattrs %]>
+ [%~ IF c.req.uri.path == uri ~%]
+ <span [% attrs %]>[% label %]</span>
+ [%~ ELSE ~%]
+ <a href="[% base %][% uri %][% suffix IF suffix %]" [% attrs %]>[% label %]</a>
+ [%~ END ~%]
+ </li>
+[%~ END %]
+
+[% UNLESS omit_wrapper %]
+ <div id="main-nav" role="navigation">
+[% END %]
+
+ [% UNLESS hide_mysoc_link %]
+ <ul class="nav-menu nav-menu--mysoc">
+ <li><a id="mysoc-logo" href="https://www.mysociety.org/">mySociety</a></li>
+ </ul>
+ [% END %]
+
+ <ul class="[% ul_class %]"[% " id='" _ ul_id _ "'" IF ul_id %]>
+ [% INCLUDE 'main_nav_items.html' %]
+ </ul>
+
+[% UNLESS omit_wrapper %]
+ </div>
+[% END %]
diff --git a/templates/web/base/main_nav_items.html b/templates/web/base/main_nav_items.html
new file mode 100644
index 000000000..ca82b6560
--- /dev/null
+++ b/templates/web/base/main_nav_items.html
@@ -0,0 +1,44 @@
+[%~ INCLUDE navitem uri='/' label=loc('Report a problem') attrs='class="report-a-problem-btn"' ~%]
+
+[%~ IF c.user_exists ~%]
+ [%~ INCLUDE navitem uri='/my' label=loc('Your account') ~%]
+[%~ ELSE ~%]
+ [%~ INCLUDE navitem uri='/auth' label=loc('Sign in') ~%]
+[%~ END ~%]
+
+[%~ IF c.user_exists AND c.user.has_body_permission_to('planned_reports') ~%]
+ [%~ INCLUDE navitem uri='/my/planned' label=loc('Shortlist') ~%]
+[%~ END ~%]
+
+
+[%~ UNLESS hide_all_reports_link ~%]
+ [%~
+ IF c.user_exists AND c.user.categories.size;
+ categories = c.user.categories.join(",") | uri;
+ cat_suffix = "?filter_category=" _ categories;
+ END;
+
+ reports_uri = '/reports';
+ IF body_name;
+ body_name = body_name | uri;
+ reports_uri = "${reports_uri}/${body_name}";
+ END;
+
+ INCLUDE navitem uri=reports_uri label=loc('All reports') suffix=cat_suffix;
+ ~%]
+[%~ END ~%]
+
+[%~
+ IF pc;
+ pc_uri = pc | uri;
+ pc_suffix = "/list?pc=" _ pc_uri;
+ END;
+
+ INCLUDE navitem uri='/alert' label=loc('Local alerts') suffix=pc_suffix;
+~%]
+
+[%~ INCLUDE navitem uri='/faq' label=loc('Help') ~%]
+
+[%~ UNLESS hide_privacy_link ~%]
+ [%~ INCLUDE navitem uri='/privacy' label=loc('Privacy') liattrs='class="nav-menu__item--privacy"' ~%]
+[%~ END ~%]
diff --git a/templates/web/bristol/footer.html b/templates/web/bristol/footer.html
index c71d7151b..52f2d50df 100644
--- a/templates/web/bristol/footer.html
+++ b/templates/web/bristol/footer.html
@@ -4,28 +4,7 @@
<div class="nav-wrapper">
<div class="nav-wrapper-2">
- <div id="main-nav" role="navigation">
- <ul class="nav-menu nav-menu--main">
- <li><[% IF c.req.uri.path == '/'
- %]span[% ELSE %]a href="/"[% END %] class="report-a-problem-btn"
- >[% loc("Report a problem") %]</[% c.req.uri.path == '/' ? 'span' : 'a' %]></li>[%
- %]<li><[% IF c.req.uri.path == '/my'
- %]span[% ELSE %]a href="/my"[% END
- %]>[% loc("Your reports") %]</[% c.req.uri.path == '/my' ? 'span' : 'a' %]></li>[%
- %]<li><[% IF c.req.uri.path == '/reports/Bristol'
- %]span[% ELSE %]a href="/reports/Bristol"[% END
- %]>[% loc("All reports") %]</[% c.req.uri.path == '/reports/Bristol' ? 'span' : 'a' %]></li>[%
- %]<li><[% IF c.req.uri.path == '/alert'
- %]span[% ELSE %]a href="/alert[% pc ? '/list?pc=' : '' %][% pc | uri %]"[% END
- %]>[% loc("Local alerts") %]</[% c.req.uri.path == '/alert' ? 'span' : 'a' %]></li>[%
- %]<li><[% IF c.req.uri.path == '/faq'
- %]span[% ELSE %]a href="/faq"[% END
- %]>[% loc("Help") %]</[% c.req.uri.path == '/faq' ? 'span' : 'a' %]></li>[%
- %]<li class="nav-menu__item--privacy"><[% IF c.req.uri.path == '/privacy'
- %]span[% ELSE %]a href="/privacy"[% END
- %]>[% loc("Privacy") %]</[% c.req.uri.path == '/privacy' ? 'span' : 'a' %]></li>
- </ul>
- </div>
+ [% INCLUDE "main_nav.html" body_name=c.cobrand.council_area hide_mysoc_link=1 %]
</div>
</div>
</div> <!-- .wrapper -->
diff --git a/templates/web/bromley/footer.html b/templates/web/bromley/footer.html
index 37ba0641e..f9b844ce5 100644
--- a/templates/web/bromley/footer.html
+++ b/templates/web/bromley/footer.html
@@ -9,20 +9,7 @@
<div class="nav-wrapper">
<div class="nav-wrapper-2">
- <div id="main-nav" role="navigation">
- <ul class="nav-menu nav-menu--main">
- <li><[% IF c.req.uri.path == '/' %]span[% ELSE %]a href="/"[% END
- %]>[% loc("Report a problem") %]</[% c.req.uri.path == '/' ? 'span' : 'a' %]></li>[%
- %]<li><[% IF c.req.uri.path == '/my' %]span[% ELSE %]a href="/my"[% END
- %]>[% c.user_exists ? loc("Your account") : loc("Sign in") %]</[% c.req.uri.path == '/my' ? 'span' : 'a' %]></li>[%
- %]<li><[% IF c.req.uri.path == '/reports' %]span[% ELSE %]a href="/reports"[% END
- %]>[% loc("All reports") %]</[% c.req.uri.path == '/reports' ? 'span' : 'a' %]></li>[%
- %]<li><[% IF c.req.uri.path == '/alert' %]span[% ELSE %]a href="/alert[% pc ? '/list?pc=' : '' %][% pc | uri %]"[% END
- %]>[% loc("Local alerts") %]</[% c.req.uri.path == '/alert' ? 'span' : 'a' %]></li>[%
- %]<li><[% IF c.req.uri.path == '/faq' %]span[% ELSE %]a href="/faq"[% END
- %]>[% loc("Help") %]</[% c.req.uri.path == '/faq' ? 'span' : 'a' %]></li>
- </ul>
- </div>
+ [% INCLUDE "main_nav.html" body_name=c.cobrand.council_area hide_mysoc_link=1 hide_privacy_link=1 %]
</div>
</div>
</div> <!-- .wrapper -->
diff --git a/templates/web/eastherts/footer.html b/templates/web/eastherts/footer.html
index b665153bd..fb39c29c2 100644
--- a/templates/web/eastherts/footer.html
+++ b/templates/web/eastherts/footer.html
@@ -4,32 +4,7 @@
<div class="nav-wrapper">
<div class="nav-wrapper-2">
- <div id="main-nav" role="navigation">
-[%
- SET base = "";
- SET base = c.cobrand.base_url IF admin;
-%]
- <ul class="nav-menu nav-menu--main">
- <li><[% IF c.req.uri.path == '/'
- %]span[% ELSE %]a href="[% base %]/"[% END %] class="report-a-problem-btn"
- >[% loc("Report a problem") %]</[% c.req.uri.path == '/' ? 'span' : 'a' %]></li>[%
- %]<li><[% IF c.req.uri.path == '/my'
- %]span[% ELSE %]a href="[% base %]/my"[% END
- %]>[% loc("Your reports") %]</[% c.req.uri.path == '/my' ? 'span' : 'a' %]></li>[%
- %]<li><[% IF c.req.uri.path == '/reports'
- %]span[% ELSE %]a href="[% base %]/reports"[% END
- %]>[% loc("All reports") %]</[% c.req.uri.path == '/reports' ? 'span' : 'a' %]></li>[%
- %]<li><[% IF c.req.uri.path == '/alert'
- %]span[% ELSE %]a href="[% base %]/alert[% pc ? '/list?pc=' : '' %][% pc | uri %]"[% END
- %]>[% loc("Local alerts") %]</[% c.req.uri.path == '/alert' ? 'span' : 'a' %]></li>[%
- %]<li><[% IF c.req.uri.path == '/faq'
- %]span[% ELSE %]a href="[% base %]/faq"[% END
- %]>[% loc("Help") %]</[% c.req.uri.path == '/faq' ? 'span' : 'a' %]></li>[%
- %]<li class="nav-menu__item--privacy"><[% IF c.req.uri.path == '/privacy'
- %]span[% ELSE %]a href="[% base %]/privacy"[% END
- %]>[% loc("Privacy") %]</[% c.req.uri.path == '/privacy' ? 'span' : 'a' %]></li>
- </ul>
- </div>
+ [% INCLUDE "main_nav.html" body_name=c.cobrand.council_area hide_mysoc_link=1 %]
</div>
</div>
</div> <!-- .wrapper -->
diff --git a/templates/web/greenwich/footer.html b/templates/web/greenwich/footer.html
index 494d5b66b..03dbc0330 100644
--- a/templates/web/greenwich/footer.html
+++ b/templates/web/greenwich/footer.html
@@ -9,22 +9,7 @@
<div class="nav-wrapper">
<div class="nav-wrapper-2">
- <div id="main-nav" role="navigation">
- <ul class="nav-menu nav-menu--main">
- <li><[% IF c.req.uri.path == '/' %]span[% ELSE %]a href="/"[% END %] class="report-a-problem-btn"
- >[% loc("Report a problem") %]</[% c.req.uri.path == '/' ? 'span' : 'a' %]></li>[%
- %]<li><[% IF c.req.uri.path == '/my' %]span[% ELSE %]a href="/my"[% END
- %]>[% c.user_exists ? loc("Your account") : loc("Sign in") %]</[% c.req.uri.path == '/my' ? 'span' : 'a' %]></li>[%
- %]<li><[% IF c.req.uri.path == '/reports/Royal+Borough+of+Greenwich' %]span[% ELSE %]a href="/reports"[% END
- %]>[% loc("All reports") %]</[% c.req.uri.path == '/reports' ? 'span' : 'a' %]></li>[%
- %]<li><[% IF c.req.uri.path == '/alert' %]span[% ELSE %]a href="/alert[% pc ? '/list?pc=' : '' %][% pc | uri %]"[% END
- %]>[% loc("Local alerts") %]</[% c.req.uri.path == '/alert' ? 'span' : 'a' %]></li>[%
- %]<li><[% IF c.req.uri.path == '/faq' %]span[% ELSE %]a href="/faq"[% END
- %]>[% loc("Help") %]</[% c.req.uri.path == '/faq' ? 'span' : 'a' %]></li>[%
- %]<li class="nav-menu__item--privacy"><[% IF c.req.uri.path == '/privacy' %]span[% ELSE %]a href="/privacy"[% END
- %]>[% loc("Privacy") %]</[% c.req.uri.path == '/privacy' ? 'span' : 'a' %]></li>
- </ul>
- </div>
+ [% INCLUDE "main_nav.html" body_name=c.cobrand.council_name hide_mysoc_link=1 %]
</div>
</div>
</div> <!-- .wrapper -->
diff --git a/templates/web/greenwich/header_logo.html b/templates/web/greenwich/header_logo.html
index d788de6f8..6359eba3b 100644
--- a/templates/web/greenwich/header_logo.html
+++ b/templates/web/greenwich/header_logo.html
@@ -15,15 +15,4 @@
<li><a href="/">FixMyStreet</a></li>
</ul>
- <ul id="fms-menu-desktop">
- <li><[% IF c.req.uri.path == '/' %]span[% ELSE %]a href="/"[% END %] class="report-a-problem-btn"
- >[% loc("Report a problem") %]</[% c.req.uri.path == '/' ? 'span' : 'a' %]></li>[%
- %]<li><[% IF c.req.uri.path == '/my' %]span[% ELSE %]a href="/my"[% END
- %]>[% loc("Your reports") %]</[% c.req.uri.path == '/my' ? 'span' : 'a' %]></li>[%
- %]<li><[% IF c.req.uri.path == '/reports' %]span[% ELSE %]a href="/reports"[% END
- %]>[% loc("All reports") %]</[% c.req.uri.path == '/reports' ? 'span' : 'a' %]></li>[%
- %]<li><[% IF c.req.uri.path == '/alert' %]span[% ELSE %]a href="/alert[% pc ? '/list?pc=' : '' %][% pc | uri %]"[% END
- %]>[% loc("Local alerts") %]</[% c.req.uri.path == '/alert' ? 'span' : 'a' %]></li>[%
- %]<li><[% IF c.req.uri.path == '/faq' %]span[% ELSE %]a href="/faq"[% END
- %]>[% loc("Help") %]</[% c.req.uri.path == '/faq' ? 'span' : 'a' %]></li>
- </ul>
+ [% INCLUDE "main_nav.html" body_name=c.cobrand.council_name hide_mysoc_link=1 hide_privacy_link=1 ul_id="fms-menu-desktop" ul_class="" omit_wrapper=1 %]
diff --git a/templates/web/hart/footer.html b/templates/web/hart/footer.html
index fae5bed1a..ce0ae3844 100644
--- a/templates/web/hart/footer.html
+++ b/templates/web/hart/footer.html
@@ -7,18 +7,7 @@
<div class="nav-wrapper clearfix">
<div class="main-menu-wrapper">
<div class="main-menu">
- <ul class="clearfix">
- <li class="home"><[% IF c.req.uri.path == '/' %]span[% ELSE %]a href="/"[% END %] class="report-a-problem-btn"
- >[% "Report" %]</[% c.req.uri.path == '/' ? 'span' : 'a' %]></li>[%
- %]<li><[% IF c.req.uri.path == '/my' OR ( c.req.uri.path == '/auth' AND c.req.params.r == 'my' ) %]span[% ELSE %]a href="/my"[% END
- %]>[% loc("Your reports") %]</[% ( c.req.uri.path == '/my' OR ( c.req.uri.path == '/auth' AND c.req.params.r == 'my' ) ) ? 'span' : 'a' %]></li>[%
- %]<li><[% IF c.req.uri.path == '/reports/Hart' %]span[% ELSE %]a href="/reports/Hart"[% END
- %]>[% loc("All reports") %]</[% c.req.uri.path == '/reports' ? 'span' : 'a' %]></li>[%
- %]<li><[% IF c.req.uri.path == '/alert' %]span[% ELSE %]a href="/alert[% pc ? '/list?pc=' : '' %][% pc | uri %]"[% END
- %]>[% loc("Local alerts") %]</[% c.req.uri.path == '/alert' ? 'span' : 'a' %]></li>[%
- %]<li class="last"><[% IF c.req.uri.path == '/faq' %]span[% ELSE %]a href="/faq"[% END
- %]>[% loc("Help") %]</[% c.req.uri.path == '/faq' ? 'span' : 'a' %]></li>
- </ul>
+ [% INCLUDE "main_nav.html" body_name=c.cobrand.council_area hide_mysoc_link=1 ul_class="clearfix" hide_privacy_link=1 %]
</div>
</div>
<div class="nav-wrapper-2 clearfix">
diff --git a/templates/web/oxfordshire/footer.html b/templates/web/oxfordshire/footer.html
index 89a9f89de..5f117cfd3 100644
--- a/templates/web/oxfordshire/footer.html
+++ b/templates/web/oxfordshire/footer.html
@@ -14,21 +14,7 @@
<li><a id="mysoc-logo" href="https://www.fixmystreet.com/council">Powered by <img src="/cobrands/oxfordshire/images/fms-logo-105x20.png" alt="FixMyStreet"></a></li>
</ul>
- <ul class="nav-menu nav-menu--main">
- <li><[% IF c.req.uri.path == '/' %]span[% ELSE %]a href="/"[% END %] class="report-a-problem-btn"
- >[% loc("Report a problem") %]</[% c.req.uri.path == '/' ? 'span' : 'a' %]></li>[%
- %]<li><[% IF c.req.uri.path == '/my' %]span[% ELSE %]a href="/my"[% END
- %]>[% c.user_exists ? loc("Your account") : loc("Sign in") %]</[% c.req.uri.path == '/my' ? 'span' : 'a' %]></li>[%
- %][% IF c.user_exists AND c.user.has_body_permission_to('planned_reports') %]<li>
- <[% IF c.req.uri.path == '/my/planned' %]span[% ELSE %]a href="/my/planned"[% END
- %]>[% loc('Shortlist') %]</[% c.req.uri.path == '/my/planned' ? 'span' : 'a' %]></li>[%
- %][% END %]<li><[% IF c.req.uri.path == '/reports' %]span[% ELSE %]a href="/reports[% IF c.user_exists AND c.user.categories.size %]?filter_category=[% c.user.categories.join(",") | uri | html %][% END %]"[% END
- %]>[% loc("All reports") %]</[% c.req.uri.path == '/reports' ? 'span' : 'a' %]></li>[%
- %]<li><[% IF c.req.uri.path == '/alert' %]span[% ELSE %]a href="/alert[% pc ? '/list?pc=' : '' %][% pc | uri %]"[% END
- %]>[% loc("Local alerts") %]</[% c.req.uri.path == '/alert' ? 'span' : 'a' %]></li>[%
- %]<li><[% IF c.req.uri.path == '/faq' %]span[% ELSE %]a href="/faq"[% END
- %]>[% loc("Help") %]</[% c.req.uri.path == '/faq' ? 'span' : 'a' %]></li>
- </ul>
+ [% INCLUDE "main_nav.html" body_name=c.cobrand.council_area hide_mysoc_link=1 omit_wrapper=1 hide_privacy_link=1 %]
</div>
</div>
</div>
diff --git a/templates/web/oxfordshire/header.html b/templates/web/oxfordshire/header.html
index d8cb8d4bb..452a71e88 100644
--- a/templates/web/oxfordshire/header.html
+++ b/templates/web/oxfordshire/header.html
@@ -37,33 +37,7 @@
<div id="navigation">
<div class="menubar">
<div class="menu-inner">
- <ul class="menu">
- <li>
- <[% IF c.req.uri.path == '/' %]span[% ELSE %]a href="/"[% END %]>[% "Report" %]</[% c.req.uri.path == '/' ? 'span' : 'a' %]>
- </li>
- <li>
- <[% IF c.req.uri.path == '/my' OR ( c.req.uri.path == '/auth' AND c.req.params.r == 'my' ) %]span[% ELSE %]a href="/my"[% END
- %]>[% c.user_exists ? loc("Your account") : loc("Sign in") %]</[% ( c.req.uri.path == '/my' OR ( c.req.uri.path == '/auth' AND c.req.params.r == 'my' ) ) ? 'span' : 'a' %]>
- </li>
- [% IF c.user_exists AND c.user.has_body_permission_to('planned_reports') %]
- <li>
- <[% IF c.req.uri.path == '/my/planned' %]span[% ELSE %]a href="/my/planned"[% END
- %]>[% loc('Shortlist') %]</[% c.req.uri.path == '/my/planned' ? 'span' : 'a' %]>
- </li>
- [% END %]
- <li>
- <[% IF c.req.uri.path == '/reports/Oxfordshire' %]span[% ELSE %]a href="/reports/Oxfordshire[% IF c.user_exists AND c.user.categories.size %]?filter_category=[% c.user.categories.join(",") | uri | html %][% END %]"[% END
- %]>[% loc("All reports") %]</[% c.req.uri.path == '/reports' ? 'span' : 'a' %]>
- </li>
- <li>
- <[% IF c.req.uri.path == '/alert' %]span[% ELSE %]a href="/alert[% pc ? '/list?pc=' : '' %][% pc | uri %]"[% END
- %]>[% loc("Local alerts") %]</[% c.req.uri.path == '/alert' ? 'span' : 'a' %]>
- </li>
- <li>
- <[% IF c.req.uri.path == '/faq' %]span[% ELSE %]a href="/faq"[% END
- %]>[% loc("Help") %]</[% c.req.uri.path == '/faq' ? 'span' : 'a' %]>
- </li>
- </ul>
+ [% INCLUDE "main_nav.html" body_name=c.cobrand.council_area hide_mysoc_link=1 hide_privacy_link=1 omit_wrapper=1 ul_class="menu" %]
</div>
</div>
</div>
diff --git a/templates/web/seesomething/footer.html b/templates/web/seesomething/footer.html
index 555a01010..6fd0f42b2 100644
--- a/templates/web/seesomething/footer.html
+++ b/templates/web/seesomething/footer.html
@@ -4,15 +4,7 @@
<div class="nav-wrapper">
<div class="nav-wrapper-2">
- <div id="main-nav" role="navigation">
-
- <ul class="nav-menu nav-menu--main">
- <li><[% IF c.req.uri.path == '/' %]span[% ELSE %]a href="/"[% END %] class="report-a-problem-btn"
- >[% loc("Report a problem") %]</[% c.req.uri.path == '/' ? 'span' : 'a' %]></li>[%
- %]<li><[% IF c.req.uri.path == '/faq' %]span[% ELSE %]a href="/faq"[% END
- %]>[% loc("Help") %]</[% c.req.uri.path == '/faq' ? 'span' : 'a' %]></li>
- </ul>
- </div>
+ [% INCLUDE "main_nav.html" hide_mysoc_link=1 %]
</div>
</div>
</div> <!-- .wrapper -->
diff --git a/templates/web/seesomething/main_nav_items.html b/templates/web/seesomething/main_nav_items.html
new file mode 100644
index 000000000..0bfb9576a
--- /dev/null
+++ b/templates/web/seesomething/main_nav_items.html
@@ -0,0 +1,3 @@
+[%~ PROCESS navitem uri='/' label=loc('Report a problem') attrs='class="report-a-problem-btn"' ~%]
+
+[%~ PROCESS navitem uri='/faq' label=loc('Help') ~%]
diff --git a/templates/web/stevenage/footer.html b/templates/web/stevenage/footer.html
index e251a83c2..215ca0eab 100644
--- a/templates/web/stevenage/footer.html
+++ b/templates/web/stevenage/footer.html
@@ -89,20 +89,7 @@
<div class="nav-wrapper-2">
- <div id="main-nav" role="navigation">
- <ul class="nav-menu nav-menu--main">
- <li><[% IF c.req.uri.path == '/' %]span[% ELSE %]a href="/"[% END %] class="report-a-problem-btn"
- >[% loc("Report a problem") %]</[% c.req.uri.path == '/' ? 'span' : 'a' %]></li>[%
- %]<li><[% IF c.req.uri.path == '/my' %]span[% ELSE %]a href="/my"[% END
- %]>[% c.user_exists ? loc("Your account") : loc("Sign in") %]</[% c.req.uri.path == '/my' ? 'span' : 'a' %]></li>[%
- %]<li><[% IF c.req.uri.path == '/reports/Stevenage' %]span[% ELSE %]a href="/reports/Stevenage"[% END
- %]>[% loc("All reports") %]</[% c.req.uri.path == '/reports' ? 'span' : 'a' %]></li>[%
- %]<li><[% IF c.req.uri.path == '/alert' %]span[% ELSE %]a href="/alert[% pc ? '/list?pc=' : '' %][% pc | uri %]"[% END
- %]>[% loc("Local alerts") %]</[% c.req.uri.path == '/alert' ? 'span' : 'a' %]></li>[%
- %]<li><[% IF c.req.uri.path == '/faq' %]span[% ELSE %]a href="/faq"[% END
- %]>[% loc("Help") %]</[% c.req.uri.path == '/faq' ? 'span' : 'a' %]></li>
- </ul>
- </div>
+ [% INCLUDE "main_nav.html" body_name=c.cobrand.council_area hide_mysoc_link=1 hide_privacy_link=1 %]
</div>
</div>
</div> <!-- .wrapper -->
diff --git a/templates/web/warwickshire/header.html b/templates/web/warwickshire/header.html
index 3c74b6d0e..da56719eb 100644
--- a/templates/web/warwickshire/header.html
+++ b/templates/web/warwickshire/header.html
@@ -172,25 +172,7 @@
<div class="container navbar-container">
<div class="navbar" id="mega-menu-navbar">
<div class="navbar-inner">
- <ul id="mega-menu" class="menu nav">
- <li><[% IF c.req.uri.path == '/' %]span[% ELSE %]a href="/"[% END %] class="report-a-problem-btn"
- >[% loc("Report a problem") %]</[% c.req.uri.path == '/' ? 'span' : 'a' %]></li>[%
- %]<li><[% IF c.req.uri.path == '/my' %]span[% ELSE %]a href="/my"[% END
- %]>[% loc("Your reports") %]</[% c.req.uri.path == '/my' ? 'span' : 'a' %]></li>[%
- %]
- <!--
- <li><[% IF c.req.uri.path == '/reports/Warwickshire' %]span[% ELSE %]a href="/reports/Warwickshire"[% END %]>
- [% loc("All reports") %]</[% c.req.uri.path == '/reports' ? 'span' : 'a' %]>
- </li>
- -->
-
- <li><[% IF c.req.uri.path == '/alert' %]span[% ELSE %]a href="/alert[% pc ? '/list?pc=' : '' %][% pc | uri %]"[% END
- %]>[% loc("Local alerts") %]</[% c.req.uri.path == '/alert' ? 'span' : 'a' %]></li>[%
- %]<li><[% IF c.req.uri.path == '/faq' %]span[% ELSE %]a href="/faq"[% END
- %]>[% loc("Help") %]</[% c.req.uri.path == '/faq' ? 'span' : 'a' %]></li>[%
- %]<li class="nav-menu__item--privacy"><[% IF c.req.uri.path == '/privacy' %]span[% ELSE %]a href="/privacy"[% END
- %]>[% loc("Privacy") %]</[% c.req.uri.path == '/privacy' ? 'span' : 'a' %]></li>
- </ul>
+ [% INCLUDE "main_nav.html" body_name=c.cobrand.council_area hide_mysoc_link=1 hide_all_reports_link=1 omit_wrapper=1 ul_class="menu nav" ul_id="mega-menu" %]
</div>
</div>
</div>
diff --git a/web/cobrands/bromley/layout.scss b/web/cobrands/bromley/layout.scss
index 71d7cbc47..2e23d1755 100644
--- a/web/cobrands/bromley/layout.scss
+++ b/web/cobrands/bromley/layout.scss
@@ -23,6 +23,12 @@ body.mappage {
#site-header {
height: 5em;
}
+
+ // Make the report button match the rest of the nav
+ .nav-menu--main a.report-a-problem-btn {
+ padding: 1.4em 0.75em 1.35em;
+ margin: 0;
+ }
}
// We have to specify this again for IE, since FMS overrides it
@@ -49,6 +55,18 @@ body.mappage {
// Override the FMS main menu to give it a background colour
.nav-menu--main {
background-color: $bromley_blue;
+
+ // Bromley doesn't have a special styling for the report button in the nav
+ a.report-a-problem-btn {
+ color: $nav_fg;
+ background: none;
+ padding: 0.75em;
+ margin: 0;
+ @include border-radius(0);
+ &:hover {
+ background: $nav_fg_hover;
+ }
+ }
}
.nav-menu--main span {
color: $nav_fg;