aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorFrancis Irving <francis@mysociety.org>2010-07-26 19:33:38 +0100
committerFrancis Irving <francis@mysociety.org>2010-07-26 19:33:38 +0100
commitf58bcfec0bb12efb64e7f4ff20afebded64b501c (patch)
treed40cdd096de69d6011435f1bf3f2742e9d2b932d /app
parentbe771d62480640c5f97ce590fa33c9401a345d07 (diff)
Use machine tag instead of special charity field
Diffstat (limited to 'app')
-rw-r--r--app/controllers/public_body_controller.rb2
-rw-r--r--app/views/admin_public_body/_form.rhtml5
-rw-r--r--app/views/public_body/show.rhtml8
3 files changed, 5 insertions, 10 deletions
diff --git a/app/controllers/public_body_controller.rb b/app/controllers/public_body_controller.rb
index 591081fe9..f46e55014 100644
--- a/app/controllers/public_body_controller.rb
+++ b/app/controllers/public_body_controller.rb
@@ -114,7 +114,6 @@ class PublicBodyController < ApplicationController
'Tags',
'Home page',
'Publication scheme',
- 'Charity number',
'Created at',
'Updated at',
'Version',
@@ -129,7 +128,6 @@ class PublicBodyController < ApplicationController
public_body.tag_string,
public_body.calculated_home_page,
public_body.publication_scheme,
- public_body.charity_number,
public_body.created_at,
public_body.updated_at,
public_body.version,
diff --git a/app/views/admin_public_body/_form.rhtml b/app/views/admin_public_body/_form.rhtml
index 744d7de64..b1516be2e 100644
--- a/app/views/admin_public_body/_form.rhtml
+++ b/app/views/admin_public_body/_form.rhtml
@@ -30,7 +30,7 @@
<p><label for="public_body_request_email">Request email <small>(set to <strong>blank</strong> (empty string) if can't find an address; 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_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, <strong>defunct</strong> if the authority no longer exists)</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, <strong>defunct</strong> if the authority no longer exists; charity:NUMBER if a registered charity)</small></label><br/>
<%= text_field 'public_body', 'tag_string', :size => 60 %></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/>
@@ -39,9 +39,6 @@
<p><label for="public_body_publication_scheme">Publication scheme URL</label><br/>
<%= text_field 'public_body', 'publication_scheme', :size => 60 %></p>
-<p><label for="public_body_charity_number">Charity Registration Number <small>(if a registered charity)</small></label><br/>
-<%= text_field 'public_body', 'charity_number', :size => 60 %></p>
-
<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>
diff --git a/app/views/public_body/show.rhtml b/app/views/public_body/show.rhtml
index 56d4cd75c..83cfe317c 100644
--- a/app/views/public_body/show.rhtml
+++ b/app/views/public_body/show.rhtml
@@ -10,11 +10,11 @@
<% if !@public_body.publication_scheme.empty? %>
<%= link_to "Publication scheme", @public_body.publication_scheme %><br>
<% end %>
- <% if !@public_body.charity_number.empty? %>
- <% if @public_body.charity_number.match(/^SC/) %>
- <%= link_to "Charity overview", "http://www.oscr.org.uk/CharityIndexDetails.aspx?id=" + @public_body.charity_number %><br>
+ <% if !@public_body.has_tag?("charity") %>
+ <% if @public_body.get_tag_value("charity").match(/^SC/) %>
+ <%= link_to "Charity overview", "http://www.oscr.org.uk/CharityIndexDetails.aspx?id=" + @public_body.get_tag_value("charity") %><br>
<% else %>
- <%= link_to "Charity overview", "http://www.charity-commission.gov.uk/SHOWCHARITY/RegisterOfCharities/CharityFramework.aspx?RegisteredCharityNumber=" + @public_body.charity_number %><br>
+ <%= link_to "Charity overview", "http://www.charity-commission.gov.uk/SHOWCHARITY/RegisterOfCharities/CharityFramework.aspx?RegisteredCharityNumber=" + @public_body.get_tag_value("charity") %><br>
<% end %>
<% end %>
<%= link_to "View FOI email address", view_public_body_email_url(@public_body.url_name) %><br>