|
@@ -8,18 +8,18 @@ class Site |
|
|
from applications |
|
|
from applications |
|
|
group by authority_name, status, decision, appeal_status, appeal_decision |
|
|
group by authority_name, status, decision, appeal_status, appeal_decision |
|
|
") |
|
|
") |
|
|
Petrify.write_page('.', 'index', { summary: summary }) |
|
|
|
|
|
|
|
|
Petrify.page('.', 'index', { summary: summary }) |
|
|
|
|
|
|
|
|
# Summary CSV file |
|
|
# Summary CSV file |
|
|
Petrify.write_csv('.', 'inlink-summary', summary) |
|
|
|
|
|
|
|
|
Petrify.csv('.', 'inlink-summary', summary) |
|
|
|
|
|
|
|
|
# New applications page |
|
|
# New applications page |
|
|
apps = ScraperWiki.select("* from `applications` order by date_received desc limit 30") |
|
|
apps = ScraperWiki.select("* from `applications` order by date_received desc limit 30") |
|
|
Petrify.write_page('new-applications', 'new-applications', { apps: apps }) |
|
|
|
|
|
|
|
|
Petrify.page('new-applications', 'new-applications', { apps: apps }) |
|
|
|
|
|
|
|
|
# Latest decisions page |
|
|
# Latest decisions page |
|
|
apps = ScraperWiki.select("* from `applications` order by date_decision desc limit 30") |
|
|
apps = ScraperWiki.select("* from `applications` order by date_decision desc limit 30") |
|
|
Petrify.write_page('decisions', 'decisions', { apps: apps }) |
|
|
|
|
|
|
|
|
Petrify.page('decisions', 'decisions', { apps: apps }) |
|
|
|
|
|
|
|
|
# Page and CSV file for each authority |
|
|
# Page and CSV file for each authority |
|
|
auths = ScraperWiki.select("distinct(authority_name) as authority_name from applications") |
|
|
auths = ScraperWiki.select("distinct(authority_name) as authority_name from applications") |
|
@@ -34,8 +34,8 @@ class Site |
|
|
|
|
|
|
|
|
apps = ScraperWiki.select("* from applications where authority_name = ? order by date_received", auth['authority_name']) |
|
|
apps = ScraperWiki.select("* from applications where authority_name = ? order by date_received", auth['authority_name']) |
|
|
path = ['authorities', slug(auth['authority_name'])] |
|
|
path = ['authorities', slug(auth['authority_name'])] |
|
|
Petrify.write_page(path, 'authority', { apps: apps, auth: auth, summary: summary }) |
|
|
|
|
|
Petrify.write_csv(path, slug(auth['authority_name']), apps) |
|
|
|
|
|
|
|
|
Petrify.page(path, 'authority', { apps: apps, auth: auth, summary: summary }) |
|
|
|
|
|
Petrify.csv(path, slug(auth['authority_name']), apps) |
|
|
end |
|
|
end |
|
|
end |
|
|
end |
|
|
end |
|
|
end |