@@ -56,6 +56,10 @@ def gen_new | |||||
apps = ScraperWiki.select("* from `applications` order by date_received desc limit 30") | apps = ScraperWiki.select("* from `applications` order by date_received desc limit 30") | ||||
write_page('new', 'new', { apps: apps }) | write_page('new', 'new', { apps: apps }) | ||||
end | end | ||||
def gen_decisions | |||||
apps = ScraperWiki.select("* from `applications` order by date_decision desc limit 30") | |||||
write_page('decisions', 'decisions', { apps: apps }) | |||||
end | end | ||||
def gen_authorities | def gen_authorities | ||||
@@ -89,4 +93,5 @@ puts @working_dir | |||||
create_output_dir | create_output_dir | ||||
gen_homepage | gen_homepage | ||||
gen_new | gen_new | ||||
gen_decisions | |||||
gen_authorities | gen_authorities |
@@ -0,0 +1,22 @@ | |||||
%h1 Latest decisions | |||||
%table | |||||
%thead | |||||
%tr | |||||
%th Authority | |||||
%th Reference | |||||
%th Decided | |||||
%th Address | |||||
%th Decision | |||||
%tbody | |||||
- apps.each do |app| | |||||
%tr | |||||
%td | |||||
%a{ href: authority_url(app['authority_name']) } | |||||
= app['authority_name'] | |||||
%td | |||||
%a{ href: app['info_url']} | |||||
= app['council_reference'] | |||||
%td= short_date(app['date_decision']) | |||||
%td= app['address'] | |||||
%td= app['decision'] | |||||
@@ -12,9 +12,16 @@ | |||||
%li | %li | ||||
%a{ :href => '/' } | %a{ :href => '/' } | ||||
Home | Home | ||||
-# | |||||
%li | |||||
%a{ :href => '/authorities/' } | |||||
Authorities | |||||
%li | %li | ||||
%a{ :href => '/new/' } | %a{ :href => '/new/' } | ||||
New applications | New applications | ||||
%li | |||||
%a{ :href => '/decisions/' } | |||||
Latest decisions | |||||
= yield | = yield | ||||
#footer | #footer | ||||