Browse Source

Add last updated timestamp to homepage

main
Adrian Short 5 years ago
parent
commit
1fdb34ab07
2 changed files with 13 additions and 1 deletions
  1. +9
    -1
      lib/site.rb
  2. +4
    -0
      views/index.haml

+ 9
- 1
lib/site.rb View File

@@ -9,9 +9,17 @@ class Site
from applications
group by authority_name, status, decision, appeal_status, appeal_decision
")
q = ScraperWiki.select("
scraped_at
from applications
order by scraped_at desc
limit 1")

last_updated = DateTime.parse(q[0]['scraped_at'])

path = '.'
Petrify.page(path, 'index', { summary: summary })
Petrify.page(path, 'index', { summary: summary, last_updated: last_updated })
Petrify.csv(path, 'inlink-summary', summary)

# New applications page


+ 4
- 0
views/index.haml View File

@@ -1,5 +1,9 @@
%h1 Summary

%p
Last updated:
= last_updated.strftime("%d %B %Y at %l:%M%P")

%p.warning There are typically two applications per kiosk: one for full planning permission or telecoms prior approval, and one for advertisement consent. So the number of kiosks applied for is half the number of applications.

%p= download_button('inlink-summary.csv')


Loading…
Cancel
Save