Explorar el Código

Add page titles

main
Adrian Short hace 6 años
padre
commit
15713c9a38
Se han modificado 2 ficheros con 11 adiciones y 7 borrados
  1. +5
    -5
      lib/site.rb
  2. +6
    -2
      views/layout.haml

+ 5
- 5
lib/site.rb Ver fichero

@@ -28,13 +28,13 @@ class Site
# New applications page
apps = ScraperWiki.select("* from `applications`
order by date_received desc limit 60")
Petrify.page('new-applications', 'new-applications', { apps: apps })
Petrify.page('new-applications', 'new-applications', { apps: apps, title: "New applications" })

# Latest decisions page
apps = ScraperWiki.select("* from `applications`
order by date_decision desc limit 60")
path = 'decisions'
Petrify.page(path, 'decisions', { apps: apps })
Petrify.page(path, 'decisions', { apps: apps, title: "Latest decisions" })
Petrify.csv(path, 'inlink-decisions', apps)
# Appeals page
@@ -58,12 +58,12 @@ class Site
")
path = 'appeals'
Petrify.page(path, 'appeals', { summary: summary, apps: apps })
Petrify.page(path, 'appeals', { summary: summary, apps: apps, title: "Appeals" })
Petrify.csv(path, 'inlink-appeals', apps)

# Media page
stories = CSV.read('media.csv', :headers => true )
Petrify.page('media', 'media', { stories: stories })
Petrify.page('media', 'media', { stories: stories, title: "Media" })

# Authority pages
auths = ScraperWiki.select("distinct(authority_name) as authority_name
@@ -88,7 +88,7 @@ class Site

path = ['authorities', slug(auth['authority_name'])]
Petrify.page(path, 'authority', \
{ apps: apps, auth: auth, summary: summary, stories: this_stories })
{ apps: apps, auth: auth, summary: summary, stories: this_stories, title: auth['authority_name'] })
Petrify.csv(path, slug(auth['authority_name']), apps)
end
end


+ 6
- 2
views/layout.haml Ver fichero

@@ -1,7 +1,12 @@
!!!5
%html
%head
%title InLink kiosks planning applications
%title
- subtitle = "InLink kiosks planning applications"
- if defined? title
= "#{title} · #{subtitle}"
- else
= subtitle
%link{ :href => '/style.css', :rel => 'stylesheet'}
%body
#main
@@ -41,4 +46,3 @@
Data API and bulk download
%a{ :href => 'https://twitter.com/search?f=tweets&vertical=default&q=%23inlink'}<
\#InLink on Twitter

Cargando…
Cancelar
Guardar