<h2><%= _('More about this authority')%></h2>

<% if !public_body.calculated_home_page.nil? %>
  <%= link_to _('Home page of authority'), public_body.calculated_home_page %><br>
<% end %>

<% if !public_body.publication_scheme.blank? %>
  <%= link_to _('Publication scheme'), public_body.publication_scheme %><br>
<% end %>

<% unless public_body.disclosure_log.blank? %>
  <%= link_to _('Disclosure log'), public_body.disclosure_log %><br>
<% end %>

<% if public_body.has_tag?('charity') %>
  <% public_body.get_tag_values('charity').each do |tag_value| %>
    <% if tag_value.match(/^SC/) %>
      <%= link_to _('Charity registration'), "http://www.oscr.org.uk/CharityIndexDetails.aspx?id=#{ tag_value }" %><br>
    <% else %>
      <%= link_to _('Charity registration'), "http://www.charity-commission.gov.uk/SHOWCHARITY/RegisterOfCharities/CharityFramework.aspx?RegisteredCharityNumber=#{ tag_value }" %><br>
    <% end %>
  <% end %>
<% end %>

<%= link_to _('View FOI email address'), view_public_body_email_path(public_body.url_name) %><br>

<%= link_to _("Ask us to update FOI email"), new_change_request_body_path(:body => public_body.url_name) %><br>

<h2><%= _('More about this authority')%></h2>

<% if !public_body.calculated_home_page.nil? %>
  <%= link_to _('Home page of authority'), public_body.calculated_home_page %><br>
<% end %>

<% if !public_body.publication_scheme.blank? %>
  <%= link_to _('Publication scheme'), public_body.publication_scheme %><br>
<% end %>

<% unless public_body.disclosure_log.blank? %>
  <%= link_to _('Disclosure log'), public_body.disclosure_log %><br>
<% end %>

<% if public_body.has_tag?('charity') %>
  <% public_body.get_tag_values('charity').each do |tag_value| %>
    <% if tag_value.match(/^SC/) %>
      <%= link_to _('Charity registration'),
                    "https://www.oscr.org.uk/search/charity-details?number=#{ tag_value }" %><br>
    <% else %>
      <%= link_to _('Charity registration'),
                    "http://beta.charitycommission.gov.uk/charity-details/?regid=#{ tag_value }&subid=0" %><br>
    <% end %>
  <% end %>
<% end %>

<%= link_to _('View FOI email address'), view_public_body_email_path(public_body.url_name) %><br>

<%= link_to _("Ask us to update FOI email"), new_change_request_body_path(:body => public_body.url_name) %><br>

Update links to the Charity Commission and Charity Register sites
Update links to the Charity Commission and Charity Register sites

Both sites have updated their URL structure so our current links to
registration pages of charities no longer work. This commit adopts the
current URL structures, although this may be fragile in the case of the
Charity Commission as they are currently linking to a beta subdomain
with a banner indicating that it is a prototype.
