浏览代码

Add last updated timestamp to homepage

main
Adrian Short 5 年前
父节点
当前提交
1fdb34ab07
共有 2 个文件被更改,包括 13 次插入1 次删除
  1. +9
    -1
      lib/site.rb
  2. +4
    -0
      views/index.haml

+ 9
- 1
lib/site.rb 查看文件

@@ -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 查看文件

@@ -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')


正在加载...
取消
保存