From ef4464d90bb325a6d45166458adfa989fcc5070d Mon Sep 17 00:00:00 2001 From: Adrian Short Date: Sat, 6 Oct 2018 13:56:39 +0100 Subject: [PATCH] Add CSV download to decisions page --- lib/site.rb | 4 +++- views/decisions.haml | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/site.rb b/lib/site.rb index 9e9fba0..2b032aa 100644 --- a/lib/site.rb +++ b/lib/site.rb @@ -20,7 +20,9 @@ class Site # Latest decisions page apps = ScraperWiki.select("* from `applications` order by date_decision desc limit 30") - Petrify.page('decisions', 'decisions', { apps: apps }) + path = 'decisions' + Petrify.page(path, 'decisions', { apps: apps }) + Petrify.csv(path, 'inlink-decisions', apps) # Appeals page summary = ScraperWiki.select(" diff --git a/views/decisions.haml b/views/decisions.haml index 09836a5..dd3ff59 100644 --- a/views/decisions.haml +++ b/views/decisions.haml @@ -1,4 +1,7 @@ %h1 Latest decisions + += download_button('inlink-decisions.csv') + %table %thead %tr