Browse Source

Widen scope to identify more appeals

Some authorities put appeal status in their standard status field.
main
Adrian Short 5 years ago
parent
commit
3d2b58dcc5
2 changed files with 14 additions and 6 deletions
  1. +10
    -6
      lib/site.rb
  2. +4
    -0
      views/appeals.haml

+ 10
- 6
lib/site.rb View File

@@ -35,17 +35,21 @@ class Site
# Appeals page
summary = ScraperWiki.select("
authority_name, appeal_status, appeal_decision, count(*) as applications
authority_name, status, decision, appeal_status, appeal_decision, count(*) as applications
from applications
where appeal_status is not null
and appeal_status != 'Unknown'
group by authority_name, appeal_status, appeal_decision
where (appeal_status is not null
and appeal_status != 'Unknown')
or status like '%appeal%'
group by authority_name, appeal_status, appeal_decision
collate nocase
")
apps = ScraperWiki.select("
* from applications
where appeal_status is not null
and appeal_status != 'Unknown'
where (appeal_status is not null
and appeal_status != 'Unknown')
or status like '%appeal%'
collate nocase
")
path = 'appeals'


+ 4
- 0
views/appeals.haml View File

@@ -21,6 +21,8 @@
%thead
%tr
%th Authority
%th Status
%th Decision
%th Appeal status
%th Appeal decision
%th Applications
@@ -30,6 +32,8 @@
%td.nowrap
%a{ href: authority_url(row['authority_name']) }
= row['authority_name']
%td= cleanup(row['status'])
%td= cleanup(row['decision'])
%td= cleanup(row['appeal_status'])
%td= cleanup(row['appeal_decision'])
%td.right= row['applications']


Loading…
Cancel
Save