diff options
-rw-r--r-- | app/models/public_body.rb | 18 | ||||
-rw-r--r-- | app/views/admin_public_body/_form.rhtml | 4 |
2 files changed, 15 insertions, 7 deletions
diff --git a/app/models/public_body.rb b/app/models/public_body.rb index 8eb1b15b0..e88a7d05e 100644 --- a/app/models/public_body.rb +++ b/app/models/public_body.rb @@ -26,7 +26,7 @@ # Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved. # Email: francis@mysociety.org; WWW: http://www.mysociety.org/ # -# $Id: public_body.rb,v 1.150 2009-09-07 17:31:38 francis Exp $ +# $Id: public_body.rb,v 1.151 2009-09-08 02:47:55 francis Exp $ require 'csv' require 'set' @@ -168,18 +168,26 @@ class PublicBody < ActiveRecord::Base end end + # If tagged "not_apply", then FOI/EIR no longer applies to authority at all + def not_apply? + return self.has_tag?('not_apply') + end + # Can an FOI (etc.) request be made to this body, and if not why not? def is_requestable? if self.request_email.nil? return false end - return !self.request_email.empty? && self.request_email != 'blank' && self.request_email != 'not_apply' && self.request_email != 'defunct' + if self.not_apply? + return false + end + return !self.request_email.empty? && self.request_email != 'blank' && self.request_email != 'defunct' end def not_requestable_reason - if self.request_email.empty? or self.request_email == 'blank' - return 'bad_contact' - elsif self.request_email == 'not_apply' + if self.not_apply? return 'not_apply' + elsif self.request_email.empty? or self.request_email == 'blank' + return 'bad_contact' elsif self.request_email == 'defunct' return 'defunct' else diff --git a/app/views/admin_public_body/_form.rhtml b/app/views/admin_public_body/_form.rhtml index 6b41e698d..a7c60b819 100644 --- a/app/views/admin_public_body/_form.rhtml +++ b/app/views/admin_public_body/_form.rhtml @@ -27,7 +27,7 @@ <p><label for="public_body_short_name">Short name <small>(only put in abbreviations which are really used, otherwise leave blank. Short or long name is used in the URL - don't worry about breaking URLs through renaming, as the history is used to redirect)</small></label><br/> <%= text_field 'public_body', 'short_name', :size => 60 %></p> -<p><label for="public_body_request_email">Request email <small>(set to <strong>blank</strong> (empty string) if can't find an address; to <strong>not_apply</strong> if FOI no longer / never did apply to authority; to <strong>defunct</strong> if the authority no longer exists; these emails are <strong>public</strong> as anyone can view with a CAPTCHA)</small></label><br/> +<p><label for="public_body_request_email">Request email <small>(set to <strong>blank</strong> (empty string) if can't find an address; to <strong>defunct</strong> if the authority no longer exists; these emails are <strong>public</strong> as anyone can view with a CAPTCHA)</small></label><br/> <%= text_field 'public_body', 'request_email', :size => 40 %></p> <p><label for="public_body_home_page">Home page <small>(of whole authority, not just their FOI page; set to <strong>blank</strong> (empty string) to guess it from the email)</small></label><br/> @@ -42,7 +42,7 @@ <p><label for="public_body_notes">Public notes</label> <small>(HTML, for users to consider when making FOI requests to the authority)</small><br/> <%= text_area 'public_body', 'notes', :rows => 3, :cols => 60 %></p> -<p><label for="public_body_tag_string">Tags <small>(space separated; see list of tags on the right)</small></label><br/> +<p><label for="public_body_tag_string">Tags <small>(space separated; see list of tags on the right; also <strong>not_apply</strong> if FOI and EIR no longer apply to authority, <strong>eir_only</strong> if EIR but not FOI applies to authority)</small></label><br/> <%= text_field 'public_body', 'tag_string', :size => 60 %></p> <p><label for="public_body_last_edit_comment"><strong>Comment</strong> for this edit</label> <small>(put URL or other source of new info)</small><br/> |