From e2238ffd3f16abbb41bc18fc33f88b9df14acc0f Mon Sep 17 00:00:00 2001 From: Adrian Short Date: Thu, 11 Aug 2016 16:15:23 +0100 Subject: [PATCH] Add Guides tab to top nav. Fix #28 --- app.rb | 8 ++++++-- views/about.haml | 8 -------- views/election.haml | 3 +++ views/guides.haml | 9 +++++++++ views/layout.haml | 3 ++- views/parliament.haml | 5 ++++- 6 files changed, 24 insertions(+), 12 deletions(-) create mode 100644 views/guides.haml diff --git a/app.rb b/app.rb index 6dca717..74dc4ae 100644 --- a/app.rb +++ b/app.rb @@ -293,11 +293,11 @@ get '/bodies/:body/:districts_name/:district' do haml :district end -get '/how-the-council-election-works' do +get '/guides/how-the-council-election-works' do haml :election end -get '/how-the-parliament-election-works' do +get '/guides/how-the-parliament-election-works' do haml :parliament end @@ -305,6 +305,10 @@ get '/error' do haml :error end +get '/guides' do + haml :guides +end + get '/about' do haml :about end diff --git a/views/about.haml b/views/about.haml index 9b40d80..7fb4991 100644 --- a/views/about.haml +++ b/views/about.haml @@ -15,11 +15,3 @@ and %a{ :href => "http://www.ordnancesurvey.co.uk/business-and-government/products/code-point-open.html" } Ordnance Survey. - -%ul - %li.pure-menu-item - %a{ :href => '/how-the-parliament-election-works' } - About parliamentary elections - %li.pure-menu-item - %a{ :href => '/how-the-council-election-works' } - About council elections diff --git a/views/election.haml b/views/election.haml index 10b7c67..36147e0 100644 --- a/views/election.haml +++ b/views/election.haml @@ -1,3 +1,6 @@ +%nav + %a{ :href => '/guides'} « Guides + %h1= @page_title = "How council elections work" %p diff --git a/views/guides.haml b/views/guides.haml new file mode 100644 index 0000000..b0e1bb5 --- /dev/null +++ b/views/guides.haml @@ -0,0 +1,9 @@ +%h1= @page_title = "Guides" + +%ul + %li + %a{ :href => '/guides/how-the-parliament-election-works' } + How parliamentary elections work + %li + %a{ :href => '/guides/how-the-council-election-works' } + How council elections work diff --git a/views/layout.haml b/views/layout.haml index 6e12910..b34bd33 100644 --- a/views/layout.haml +++ b/views/layout.haml @@ -20,9 +20,10 @@ %li.pure-menu-item %a{ :href => "/bodies/#{body.slug}" } = body.name - elections %li.pure-menu-item %a{ :href => '/candidates' } Candidates + %li.pure-menu-item + %a{ :href => '/guides' } Guides %li.pure-menu-item %a{ :href => '/about' } About diff --git a/views/parliament.haml b/views/parliament.haml index f3e1e15..684a57a 100644 --- a/views/parliament.haml +++ b/views/parliament.haml @@ -1,4 +1,7 @@ -%h1= @page_title = "How parliament elections work" +%nav + %a{ :href => '/guides'} « Guides + +%h1= @page_title = "How parliamentary elections work" %p In parliament elections you can vote for your local member of parliament (MP) and help to decide who governs the UK.