| @@ -21,6 +21,10 @@ def authority_url(authority_name) | |||||
| "/authorities/#{slug(authority_name)}/" | "/authorities/#{slug(authority_name)}/" | ||||
| end | end | ||||
| def download_button(filename, label='Download CSV data') | |||||
| "<a class=button href=#{filename} download=#{filename}>#{label}</a>" | |||||
| end | |||||
| def normalise_decision(d) | def normalise_decision(d) | ||||
| # https://schemas.opendata.esd.org.uk/PlanningApplications/LocalOpenDataIncentiveSchemePlanningApplicationsSchemaGuidance.pdf | # https://schemas.opendata.esd.org.uk/PlanningApplications/LocalOpenDataIncentiveSchemePlanningApplicationsSchemaGuidance.pdf | ||||
| @@ -36,10 +36,7 @@ | |||||
| %h2 Appealed applications | %h2 Appealed applications | ||||
| %p | |||||
| - csv_fn = 'inlink-appeals.csv' | |||||
| %a.button{ :href => csv_fn, :download => csv_fn } | |||||
| Download CSV data | |||||
| %p= download_button('inlink-appeals.csv') | |||||
| %table#applications | %table#applications | ||||
| %thead | %thead | ||||
| @@ -23,10 +23,7 @@ | |||||
| %h2 Applications | %h2 Applications | ||||
| %p | |||||
| - csv_fn = slug(auth['authority_name']) + '.csv' | |||||
| %a.button{ :href => csv_fn, :download => csv_fn } | |||||
| Download CSV data | |||||
| %p= download_button(slug(auth['authority_name']) + '.csv') | |||||
| %table#applications | %table#applications | ||||
| %thead | %thead | ||||
| @@ -2,10 +2,7 @@ | |||||
| %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.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 | |||||
| - csv_fn = 'inlink-summary.csv' | |||||
| %a.button{ :href => csv_fn, :download => csv_fn } | |||||
| Download summary CSV data | |||||
| %p= download_button('inlink-summary.csv') | |||||
| %table#summary | %table#summary | ||||
| %thead | %thead | ||||