project doesnt respond_to?:can_publish?

project doesnt respond_to?:can_publish?

<%
   object ||= nil
   set_parameters_for_sharing_form object
   disable_advanced_view ||= nil
   show_advanced_permissions = !@resource.respond_to?(:has_advanced_permissions?) || @resource.has_advanced_permissions?
   default_projects_access_type = @resource.is_asset? ? Policy::ACCESSIBLE : Policy::EDITING
   default_consortium_access_type = Policy::VISIBLE
   #@resource.projects = current_user.person.projects if !Seek::Config.is_virtualliver && @resource.new_record? && @resource.errors.empty? && (current_user.person.projects.count == 1)
   can_publish = @resource.respond_to?(:can_publish) ? @resource.can_publish? : true
%>
<%# initialization: required to keep javascript independent of the access type codes, to allow the use the constants instead -%>
<%= render :partial=>"assets/sharing_constants" %>

<%# this hidden input will submit all permission data with the form -%>
<%= hidden_field_tag "sharing[permissions][contributor_types]", "" -%>
<%= hidden_field_tag "sharing[permissions][values]", "" -%>

    <%= help_icon("Here you can specify who can see#{', download' if @resource.is_downloadable?} and edit this #{@resource_type}.") -%>
    Sharing

        Here you can specify who can view the summary of<% if @resource.is_downloadable? %>, get access to the content of,<% end %> and edit the <%= @resource_type -%>.
        <%= link_to_function "More info " + expand_image, visual_effect(:toggle_blind, "more_sharing_info", :duration => 0.3) -%>

          You may:

Keep the <%= @resource_type -%> private, and only visible to yourself.

Share within the selected projects and with all other users that are a member of a <%= Seek::Config.project_name %> project.

Share with the all visitors (including anonymous visitors with no login)

You can share with the all visitors right away if you are the gatekeeper or if the projects associated with this <%= @resource_type -%> have no gatekeeper

Or you can request the gatekeepers for their approval to share with all visitors

          <% if !disable_advanced_view%>

Define more fine-grained sharing in the Advanced sharing: you can share within your Project/Institution only,
 with specific individuals, or set up custom favourite groups for people you regularly need to share with.

          <% end %>

<label for="sharing_scope_<%= Policy::PRIVATE -%>">
            <input type="hidden" id='access_type_select_<%= Policy::PRIVATE -%>' name="sharing[access_type_<%= Policy::PRIVATE -%>]" value="<%= Policy::NO_ACCESS -%>">
            <input <%= 'checked="checked"' if @sharing_mode == Policy::PRIVATE %> id="sharing_scope_<%= Policy::PRIVATE -%>" name="sharing[sharing_scope]"
                                                                                value="<%= Policy::PRIVATE -%>" type="radio" />
            - Keep this <%= @resource_type -%> private (only visible to you)

          <%= additional_advanced_permissions_included @resource, Policy::PRIVATE -%>

Or share it with..

            <input type="radio" <%= 'checked="checked"' if @sharing_mode == Policy::ALL_SYSMO_USERS -%> id="sharing_scope_<%= Policy::ALL_SYSMO_USERS -%>" name="sharing[sharing_scope]" value="<%= Policy::ALL_SYSMO_USERS -%>" />
            - Members of projects associated with this <%= @resource_type -%>:

             <select name="sharing[your_proj_access_type]" id="sharing_your_proj_access_type">
                 <%= policy_selection_options([Policy::VISIBLE,Policy::ACCESSIBLE,Policy::EDITING,Policy::MANAGING], @resource, your_project_access_type(@policy, @resource) || default_projects_access_type) -%>
             </select>

            ... and all other project members:
             <%= render :partial => "assets/sharing_form_access_type_dropdown", :locals => { :access_type_selector_for_scope => Policy::ALL_SYSMO_USERS,
               :sharing_scope => Policy::ALL_SYSMO_USERS, :access_type => (@resource.respond_to?(:policy) && @resource.policy.try(:sharing_scope)==Policy::ALL_SYSMO_USERS ? @access_mode : default_consortium_access_type), :access_type_options=>[Policy::NO_ACCESS,Policy::VISIBLE,Policy::ACCESSIBLE,Policy::EDITING] } -%>
             <%= additional_advanced_permissions_included @resource, Policy::ALL_SYSMO_USERS -%>

          <label for="sharing_scope_<%= Policy::EVERYONE -%>">
            <input type="radio" <%= 'checked="checked"' if @sharing_mode == Policy::EVERYONE -%> id="sharing_scope_<%= Policy::EVERYONE -%>" name="sharing[sharing_scope]"
                   value="<%= Policy::EVERYONE -%>" <%= 'disabled="true"' if !can_publish -%>/>
            - All visitors (including anonymous visitors with no login):

              <%= render :partial => "assets/sharing_form_access_type_dropdown", :locals => { :access_type_selector_for_scope => Policy::EVERYONE,
            :sharing_scope => @sharing_mode, :access_type => @access_mode } -%>
           <%= additional_advanced_permissions_included @resource, Policy::EVERYONE -%>

              <%= check_box_tag 'sharing[request_publish_approval]', 1, false, :disabled => can_publish%>
              - Request approval from the gatekeepers to share with all visitors

    <% if @resource.new_record? && @resource.errors.empty? -%>

    <% end -%>

    <% if !disable_advanced_view %>
      <%= link_to_function "Advanced permissions " + expand_image, :class => 'advanced_sharing_link', :style => "display:" + (show_advanced_permissions ? 'none;' : 'block;'), :id =>'advanced_sharing_expand_image' do |page|
          page.visual_effect :toggle_blind, "advanced sharing", :duration => 0.5
          page["advanced_sharing_expand_image"].toggle
          page["advanced_sharing_collapse_image"].toggle
      end
      -%>
      <%= link_to_function "Advanced permissions " + collapse_image, :class => 'advanced_sharing_link', :style => "display:" + (show_advanced_permissions ? 'block;' : 'none;'), :id =>'advanced_sharing_collapse_image' do |page|
          page.visual_effect :toggle_blind, "advanced sharing", :duration => 0.5
          page["advanced_sharing_expand_image"].toggle
          page["advanced_sharing_collapse_image"].toggle
      end
      -%>

      <div id="advanced sharing" class='sharing_box_form' style="display:<%= show_advanced_permissions ? 'block;' : 'none;' -%>">

Additional fine-grained sharing permissions

              So far you have selected to share this <%= @resource_type -%> with:

              Loading...

              Build up the list of people and groups to share with.
              Select from the options below and click "Add" to apply
              your choices and add collaborators to your current selection:

                <%= image_tag icon_filename_for_key("spinner"), :id => "f_group_deleting_spinner", :alt=>"loading...", :title=>"loading...", :style => "display: none; vertical-align: middle; float: right;" -%>
                <%= help_icon("Here you can choose your favourite groups to share this #{@resource_type} with.") -%>
                Favourite Groups

                  <% favourite_groups = FavouriteGroup.get_all_without_blacklists_and_whitelists(current_user.id) -%>
                  <% f_group_select_options = (favourite_groups.blank? ? "<option value=\"\">You don't have any favourite groups</option>" : options_for_select(favourite_groups)) -%>

                  <%= select_tag "favourite_group_select", f_group_select_options, :style => "width: 82%; vertical-align: middle; margin-right: 0.4em;", :disabled => (favourite_groups.blank?) -%>

                  <%= link_to "Add", "", :id => "add_f_group_link", :style => "font-weight: bold; vertical-align: middle;", :disabled => (favourite_groups.blank?),
                              :onclick => "javascript: if($('favourite_group_select').disabled) return(false); addContributor('FavouriteGroup', $('favourite_group_select').options[$('favourite_group_select').selectedIndex].text, parseInt($('favourite_group_select').options[$('favourite_group_select').selectedIndex].value), #{Policy::DETERMINED_BY_GROUP}); return(false);" -%>

                  <li id="edit_f_group_li" style="display: <%= favourite_groups.blank? ? "none" : "block" -%>; list-style-type: disc; padding: 0;"><%= favourite_group_popup_link_action_edit(@resource.class.name) -%>

                  <li id="delete_f_group_li" style="display: <%= favourite_groups.blank? ? "none" : "block" -%>; list-style-type: disc; padding: 0;">
                    <%= link_to "Delete selected favourite group", delete_favourite_group_path(0), :onclick => "deleteSelectedFavouriteGroup(); return(false);" -%>

<%= favourite_group_popup_link_action_new(@resource.class.name) -%>

                <%= help_icon("Here you can choose projects, institutions and workgroups to share this #{@resource_type} with.") -%>
                Projects and Institutions

                  <% right_arrow_image = icon_filename_for_key("arrow_right") -%>

                  Step 1
                  <%= image_tag right_arrow_image, :style => "vertical-align: middle; padding: 0 0.8em;" -%>

                  Step 2
                  <%= image_tag right_arrow_image, :style => "vertical-align: middle; padding: 0 0.8em;" -%>

                  Step 3

                    <input type="hidden" id="proj_select_step_index" value="1">

                      <%= image_tag icon_filename_for_key("spinner"), :id => "institutions_loading_spinner", :alt=>"loading...", :title=>"loading...", :style => "display: none; vertical-align: middle; float: right;" -%>
                      Step 1: Select a project
                      <%= select("proj_project", "select",
                                 Project.find(:all).collect { |p| [p.name, p.id] },
                                 {:include_blank => 'All Projects @ Institution (from Step 2)'}, {:style => "width: 100%; vertical-align: middle; margin: 0.3em 0;"}) -%>

                      Step 2: Select scope of the project
                      <%= select_tag("proj_institution_select", nil, {:style => "width: 100%; vertical-align: middle; margin: 0.3em 0;"}) -%>

                      Step 3: Choose access rights, review and
                      submit

                      <select name="proj_access_type_select" id="proj_access_type_select" onchange="javascript: replaceReviewWorkGroupURL();" style="width: 100%; vertical-align: middle; margin: 0.3em 0;">
                        <%= policy_selection_options [Policy::NO_ACCESS, Policy::VISIBLE, Policy::ACCESSIBLE, Policy::EDITING, Policy::MANAGING], @resource -%>
                      </select>

                        <%= link_to "< Previous step", "", :onclick => "javascript: projectInstitutionStepAction(-1); return(false);", :style => "font-weight: bold;" -%>

                        <%= link_to "Next step >", "", :onclick => "javascript: projectInstitutionStepAction(1); return(false);", :style => "font-weight: bold;" -%>

                          <%= link_to "Add immediately", "", :onclick => "javascript: addProjectInstitution(); return(false);", :style => "font-weight: bold; padding: 0;" -%>

<%= workgroup_member_review_popup_link(@resource.class.name) -%>

                <%= help_icon("Here you can specify individual people to share this #{@resource_type} with.") -%>
                Individual People

                    Please type names of people to share this <%= @resource_type -%> with into the box below -
                    suggestions will be displayed as you type.
                    Select access rights from drop-down menu; these will be applied to all chosen people.
                    Clicking "Add" will add selected people to the list.

                          ^_^<input type="text" id="ip_hidden_input" tabindex="-1">

                            <input type="text" size="1" tabindex="" id="ip_autocomplete_input"/>

Type the name of a friend, friend list, or email address

                        <select name="individual_people_access_type_select" id="individual_people_access_type_select" style="width: 344px; vertical-align: middle; margin-top: 0.3em;">
                          <%= policy_selection_options nil, @resource -%>
                        </select>

                        <%= link_to "Add", "", :onclick => "javascript: addIndividualPeople(); return(false);" -%>

  <% end %>

<%
   object ||= nil
   set_parameters_for_sharing_form object
   disable_advanced_view ||= nil
   show_advanced_permissions = !@resource.respond_to?(:has_advanced_permissions?) || @resource.has_advanced_permissions?
   default_projects_access_type = @resource.is_asset? ? Policy::ACCESSIBLE : Policy::EDITING
   default_consortium_access_type = Policy::VISIBLE
   #@resource.projects = current_user.person.projects if !Seek::Config.is_virtualliver && @resource.new_record? && @resource.errors.empty? && (current_user.person.projects.count == 1)
   can_publish = @resource.can_publish?
%>
<%# initialization: required to keep javascript independent of the access type codes, to allow the use the constants instead -%>
<%= render :partial=>"assets/sharing_constants" %>

<%# this hidden input will submit all permission data with the form -%>
<%= hidden_field_tag "sharing[permissions][contributor_types]", "" -%>
<%= hidden_field_tag "sharing[permissions][values]", "" -%>

    <%= help_icon("Here you can specify who can see#{', download' if @resource.is_downloadable?} and edit this #{@resource_type}.") -%>
    Sharing

        Here you can specify who can view the summary of<% if @resource.is_downloadable? %>, get access to the content of,<% end %> and edit the <%= @resource_type -%>.
        <%= link_to_function "More info " + expand_image, visual_effect(:toggle_blind, "more_sharing_info", :duration => 0.3) -%>

          You may:

Keep the <%= @resource_type -%> private, and only visible to yourself.

Share within the selected projects and with all other users that are a member of a <%= Seek::Config.project_name %> project.

Share with the all visitors (including anonymous visitors with no login)

You can share with the all visitors right away if you are the gatekeeper or if the projects associated with this <%= @resource_type -%> have no gatekeeper

Or you can request the gatekeepers for their approval to share with all visitors

          <% if !disable_advanced_view%>

Define more fine-grained sharing in the Advanced sharing: you can share within your Project/Institution only,
 with specific individuals, or set up custom favourite groups for people you regularly need to share with.

          <% end %>

<label for="sharing_scope_<%= Policy::PRIVATE -%>">
            <input type="hidden" id='access_type_select_<%= Policy::PRIVATE -%>' name="sharing[access_type_<%= Policy::PRIVATE -%>]" value="<%= Policy::NO_ACCESS -%>">
            <input <%= 'checked="checked"' if @sharing_mode == Policy::PRIVATE %> id="sharing_scope_<%= Policy::PRIVATE -%>" name="sharing[sharing_scope]"
                                                                                value="<%= Policy::PRIVATE -%>" type="radio" />
            - Keep this <%= @resource_type -%> private (only visible to you)

          <%= additional_advanced_permissions_included @resource, Policy::PRIVATE -%>

Or share it with..

            <input type="radio" <%= 'checked="checked"' if @sharing_mode == Policy::ALL_SYSMO_USERS -%> id="sharing_scope_<%= Policy::ALL_SYSMO_USERS -%>" name="sharing[sharing_scope]" value="<%= Policy::ALL_SYSMO_USERS -%>" />
            - Members of projects associated with this <%= @resource_type -%>:

             <select name="sharing[your_proj_access_type]" id="sharing_your_proj_access_type">
                 <%= policy_selection_options([Policy::VISIBLE,Policy::ACCESSIBLE,Policy::EDITING,Policy::MANAGING], @resource, your_project_access_type(@policy, @resource) || default_projects_access_type) -%>
             </select>

            ... and all other project members:
             <%= render :partial => "assets/sharing_form_access_type_dropdown", :locals => { :access_type_selector_for_scope => Policy::ALL_SYSMO_USERS,
               :sharing_scope => Policy::ALL_SYSMO_USERS, :access_type => (@resource.respond_to?(:policy) && @resource.policy.try(:sharing_scope)==Policy::ALL_SYSMO_USERS ? @access_mode : default_consortium_access_type), :access_type_options=>[Policy::NO_ACCESS,Policy::VISIBLE,Policy::ACCESSIBLE,Policy::EDITING] } -%>
             <%= additional_advanced_permissions_included @resource, Policy::ALL_SYSMO_USERS -%>

          <label for="sharing_scope_<%= Policy::EVERYONE -%>">
            <input type="radio" <%= 'checked="checked"' if @sharing_mode == Policy::EVERYONE -%> id="sharing_scope_<%= Policy::EVERYONE -%>" name="sharing[sharing_scope]"
                   value="<%= Policy::EVERYONE -%>" <%= 'disabled="true"' if !can_publish -%>/>
            - All visitors (including anonymous visitors with no login):

              <%= render :partial => "assets/sharing_form_access_type_dropdown", :locals => { :access_type_selector_for_scope => Policy::EVERYONE,
            :sharing_scope => @sharing_mode, :access_type => @access_mode } -%>
           <%= additional_advanced_permissions_included @resource, Policy::EVERYONE -%>

              <%= check_box_tag 'sharing[request_publish_approval]', 1, false, :disabled => can_publish%>
              - Request approval from the gatekeepers to share with all visitors

    <% if @resource.new_record? && @resource.errors.empty? -%>

    <% end -%>

    <% if !disable_advanced_view %>
      <%= link_to_function "Advanced permissions " + expand_image, :class => 'advanced_sharing_link', :style => "display:" + (show_advanced_permissions ? 'none;' : 'block;'), :id =>'advanced_sharing_expand_image' do |page|
          page.visual_effect :toggle_blind, "advanced sharing", :duration => 0.5
          page["advanced_sharing_expand_image"].toggle
          page["advanced_sharing_collapse_image"].toggle
      end
      -%>
      <%= link_to_function "Advanced permissions " + collapse_image, :class => 'advanced_sharing_link', :style => "display:" + (show_advanced_permissions ? 'block;' : 'none;'), :id =>'advanced_sharing_collapse_image' do |page|
          page.visual_effect :toggle_blind, "advanced sharing", :duration => 0.5
          page["advanced_sharing_expand_image"].toggle
          page["advanced_sharing_collapse_image"].toggle
      end
      -%>

      <div id="advanced sharing" class='sharing_box_form' style="display:<%= show_advanced_permissions ? 'block;' : 'none;' -%>">

Additional fine-grained sharing permissions

              So far you have selected to share this <%= @resource_type -%> with:

              Loading...

              Build up the list of people and groups to share with.
              Select from the options below and click "Add" to apply
              your choices and add collaborators to your current selection:

                <%= image_tag icon_filename_for_key("spinner"), :id => "f_group_deleting_spinner", :alt=>"loading...", :title=>"loading...", :style => "display: none; vertical-align: middle; float: right;" -%>
                <%= help_icon("Here you can choose your favourite groups to share this #{@resource_type} with.") -%>
                Favourite Groups

                  <% favourite_groups = FavouriteGroup.get_all_without_blacklists_and_whitelists(current_user.id) -%>
                  <% f_group_select_options = (favourite_groups.blank? ? "<option value=\"\">You don't have any favourite groups</option>" : options_for_select(favourite_groups)) -%>

                  <%= select_tag "favourite_group_select", f_group_select_options, :style => "width: 82%; vertical-align: middle; margin-right: 0.4em;", :disabled => (favourite_groups.blank?) -%>

                  <%= link_to "Add", "", :id => "add_f_group_link", :style => "font-weight: bold; vertical-align: middle;", :disabled => (favourite_groups.blank?),
                              :onclick => "javascript: if($('favourite_group_select').disabled) return(false); addContributor('FavouriteGroup', $('favourite_group_select').options[$('favourite_group_select').selectedIndex].text, parseInt($('favourite_group_select').options[$('favourite_group_select').selectedIndex].value), #{Policy::DETERMINED_BY_GROUP}); return(false);" -%>

                  <li id="edit_f_group_li" style="display: <%= favourite_groups.blank? ? "none" : "block" -%>; list-style-type: disc; padding: 0;"><%= favourite_group_popup_link_action_edit(@resource.class.name) -%>

                  <li id="delete_f_group_li" style="display: <%= favourite_groups.blank? ? "none" : "block" -%>; list-style-type: disc; padding: 0;">
                    <%= link_to "Delete selected favourite group", delete_favourite_group_path(0), :onclick => "deleteSelectedFavouriteGroup(); return(false);" -%>

<%= favourite_group_popup_link_action_new(@resource.class.name) -%>

                <%= help_icon("Here you can choose projects, institutions and workgroups to share this #{@resource_type} with.") -%>
                Projects and Institutions

                  <% right_arrow_image = icon_filename_for_key("arrow_right") -%>

                  Step 1
                  <%= image_tag right_arrow_image, :style => "vertical-align: middle; padding: 0 0.8em;" -%>

                  Step 2
                  <%= image_tag right_arrow_image, :style => "vertical-align: middle; padding: 0 0.8em;" -%>

                  Step 3

                    <input type="hidden" id="proj_select_step_index" value="1">

                      <%= image_tag icon_filename_for_key("spinner"), :id => "institutions_loading_spinner", :alt=>"loading...", :title=>"loading...", :style => "display: none; vertical-align: middle; float: right;" -%>
                      Step 1: Select a project
                      <%= select("proj_project", "select",
                                 Project.find(:all).collect { |p| [p.name, p.id] },
                                 {:include_blank => 'All Projects @ Institution (from Step 2)'}, {:style => "width: 100%; vertical-align: middle; margin: 0.3em 0;"}) -%>

                      Step 2: Select scope of the project
                      <%= select_tag("proj_institution_select", nil, {:style => "width: 100%; vertical-align: middle; margin: 0.3em 0;"}) -%>

                      Step 3: Choose access rights, review and
                      submit

                      <select name="proj_access_type_select" id="proj_access_type_select" onchange="javascript: replaceReviewWorkGroupURL();" style="width: 100%; vertical-align: middle; margin: 0.3em 0;">
                        <%= policy_selection_options [Policy::NO_ACCESS, Policy::VISIBLE, Policy::ACCESSIBLE, Policy::EDITING, Policy::MANAGING], @resource -%>
                      </select>

                        <%= link_to "< Previous step", "", :onclick => "javascript: projectInstitutionStepAction(-1); return(false);", :style => "font-weight: bold;" -%>

                        <%= link_to "Next step >", "", :onclick => "javascript: projectInstitutionStepAction(1); return(false);", :style => "font-weight: bold;" -%>

                          <%= link_to "Add immediately", "", :onclick => "javascript: addProjectInstitution(); return(false);", :style => "font-weight: bold; padding: 0;" -%>

<%= workgroup_member_review_popup_link(@resource.class.name) -%>

                <%= help_icon("Here you can specify individual people to share this #{@resource_type} with.") -%>
                Individual People

                    Please type names of people to share this <%= @resource_type -%> with into the box below -
                    suggestions will be displayed as you type.
                    Select access rights from drop-down menu; these will be applied to all chosen people.
                    Clicking "Add" will add selected people to the list.

                          ^_^<input type="text" id="ip_hidden_input" tabindex="-1">

                            <input type="text" size="1" tabindex="" id="ip_autocomplete_input"/>

Type the name of a friend, friend list, or email address

                        <select name="individual_people_access_type_select" id="individual_people_access_type_select" style="width: 344px; vertical-align: middle; margin-top: 0.3em;">
                          <%= policy_selection_options nil, @resource -%>
                        </select>

                        <%= link_to "Add", "", :onclick => "javascript: addIndividualPeople(); return(false);" -%>

  <% end %>


Remove copyright section, as it is much more complicated than it says. (See email thread "Pseudonyms")

<% @title = "About" %>

Contact us

If your question isn't answered here, or you just wanted to let us know
something about the site, contact us.

Introduction to WhatDoTheyKnow

What is WhatDoTheyKnow for?

To help you find out inside information about what the UK government
is doing.

How does the site work?

You choose the public authority that you would like information from, then
write a brief note describing what you want to know. We then send your request
to the public authority. Any response they make is automatically published on the
website for you and anyone else to find and read.

Why would I bother to do this?

You pay taxes, and then government does things with the money. All sorts of
things that affect your life, from healthcare through to national defence. Some
it does badly, some it does well. The more we find out about how government
works, the better able we are to make suggestions to improve the things that
are done badly, and to celebrate the things that are done well.

Why would the public authority bother to reply?

Under Freedom of Information (FOI) law, they have to respond.

Who makes it?

WhatDoTheyKnow is created and run by mySociety,
and was initially funded by the JRSST Charitable Trust. mySociety is a project of the
registered charity UK Citizens Online Democracy.
If you like what we're doing, then you can
make a donation.

Making requests

You're missing the public authority that I want to request from!

Please contact us with the name of the public authority and,
if you can find it, their contact email address for Freedom of Information requests.
If you'd like to help add a whole category of public authority to the site, for example all
primary care trusts or all schools, then please
edit this shared spreadsheet (Google account required).

How quickly will I get a response?

By law public authorities must respond "promptly", and in any event not later
than 20 working days after receiving your request. The date of that hard limit
is shown on the page for your request. You will be emailed if this date goes by
without a response, so you can send the public authority another note to remind
them that they are breaking the law. Note: If you had to
clarify your request, the clock starts from that date, instead of the date they
received your initial request.

What if I'm not satisfied with the response?

If you didn't get the information you asked for, or you didn't get it in time,
then read our page 'Unhappy about the response you got?'.

Can you tell me more of the nitty gritty about the process of making requests?

Have a look at the
access to official information
pages on the Information Commisioner's website.

Can I request information about myself?

Not using this site. Requests made using WhatDoTheyKnow are public, made under the
Freedom of Information Act, and cannot help you find information about a
private individual. If you would like to know what information a public
authority holds about yourself, you should make a "Subject Access Request" in
private using Data Protection law.  The leaflet Subject
Access - A guide for data subjects (on the Information Commisioner's
website) explains how to do this.

I'd like to keep my request secret! (At least until I publish my story)

WhatDoTheyKnow is currently only designed for public requests. All
responses that we receive are automatically published on the website for anyone
to read.  You should contact the public authority directly if you would like to
make a request in private.  If you're interested in buying a system which helps
you manage FOI requests in secret, then contact us.

Why can I only request information about the environment from some authorities?

Some public authorities, such as South East Water,
don't come under the Freedom of Information Act, but do come under another law called
the Environmental Information Regulations (EIR). It's a very similar law, so you make a request
to them using WhatDoTheyKnow in just the same way as an FOI request. The only difference
is that on the page where you write you request, it reminds you that you can only
request "environmental information" and tells you what that means. It is quite broad.

So can I request information using EIR from other authorities?

Yes, just make a Freedom of Information (FOI) request as normal. The
authority has a duty to work out if the Environmental Information Regulations
(EIR) is the more appropriate legislation to reply under.

Privacy questions

Who gets to see my email address?

We will not disclose your email address to anyone, including the public
authority you are sending a request to, unless we are obliged to by law,
or you ask us to. If you send a message to another user on the site, then
it will reveal your email address to them. You will be told that this
is going to happen.

Will you send nasty, brutish spam to my email address?

Nope. After you sign up to WhatDoTheyKnow we will only send you emails
relating to a request you made, an email alert that you have signed up for,
or for other reasons that you specifically authorise. We will never give or
sell your email addresses to anyone else, unless we are obliged to by law, or
you ask us to.

Why will my name appear publically on the site?

It means that someone researching the same area can get in touch with you,
and maybe give you more information or ideas relating to your request.  Also,
we're going to publish the response with the name of the civil servant who
wrote it, so it seems only fair that your name should be public too!
Therefore, we encourage you to use your real name, but you may use a pseudonym
if you would like to be anonymous.

So I can make an FOI request using a pseudonym?

It is good practice for the public authority to reply to an anonymous request,
except in special circumstances such as if they suspect you of making vexatious
requests. See Freedom of Information Good Practice Guidance No 6
for details.  You should refer to this if a public authority attempts to refuse
a request because you used a pseudonym.

However, there are good reasons to use your real name: see the question
above.  If nothing else, it avoids the risk of an authority being picky,
ignoring the guidance and refusing your request.

They've asked for my postal address!

If a public authority asks you for your full, physical address, reply to them saying
that section 8.1.b of the FOI Act asks for an "address for correspondence",
and that the email address you are using is sufficient.

The Ministry of Justice has guidance
on this –
"As well as hard copy written correspondence, requests that are
transmitted electronically (for example, in emails) are acceptable
... If a request is received by email and no postal address is given, the email
address should be treated as the return address."

As if that isn't enough, the Information Commissioner's
Hints for Practitioners say
"Any correspondence could include a request for information. If it is written (this includes e-mail), legible, gives the name of the applicant, an address for reply (which could be electronic), and includes a description of the information required, then it will fall within the scope of the legislation."

No no, they need a postal address to send a paper response!

If an authority only has a paper copy of the information that you want,
they may ask you for a postal address. To start with, try persuading them
to scan in the documents for you. You can even offer to gift them a scanner, which in that particular case
embarrassed the authority into finding one they had already.

If that doesn't work, and you want to provide your postal address privately
in order to receive the documents, then please contact
us.

How do you moderate request annotations?

Annotations on WhatDoTheyKnow are to help
people get the information they want, or to give them pointers to places they
can go to help them act on it. We reserve the right to remove anything else.

Endless, political discussions are not allowed.
Post a link to a suitable forum or campaign site elsewhere.

FOI officer questions

I just got here from bottom of an FOI request, what is going on?

WhatDoTheyKnow is a service run by a charity. It helps ordinary members
of the public make FOI requests, and easily track and share the responses.

The FOI request you received was made by someone using WhatDoTheyKnow. You can
simply reply to the request as you would any other request from an individual.
The only difference is that your response will be automatically published on
the Internet.

If you have privacy or other concerns, please read the answers below.
You might also like to read this page from the top to find out more about what
the site does from the point of view of a user. You can also search the
site to find the authority that you work for, and view the status of
any requests made using the site.

Finally, we welcome comments and
thoughts from FOI officers, please get in touch.

Why are you publishing responses to FOI requests?

We think there are lots of benefits. Most importantly it will encourage the
public to be more interested and involved in the work of government. We
also hope that it will reduce the number of duplicate requests on any
subject that a public body will receive. Given that Freedom of Information
responses contain public information, which anybody could easily request
again from the public authority, we think there should be no reason not to
publish it widely.

Are the people making requests real people?

Yes. For the purposes of keeping track of responses we use
computer-generated email addresses for each request. However, before
they can send a request, each user must register on the site with a
unique email address that we then verify. You can search this site and
find a page listing all requests that each person has made.

An email isn't a sufficient address for an FOI request!

Yes it is. This
letter from the ICO to Rother District Council gives guidance on the matter, specifically
in the context of requests made via WhatDoTheyKnow.

Aren't you making lots of vexatious requests?

WhatDoTheyKnow is not making any requests. We are sending requests on
behalf of our users, who are real people making the requests.

Look at it like this - if lots of different people made requests from
different Hotmail email addresses, then you would not think that Microsoft were
making vexatious requests. It is exactly the same if lots of requests are made
via WhatDoTheyKnow. Moreover, since all requests are public it is much easier
for you to see if one of our users is making vexatious requests, and for us to
block them when that happens.

If that isn't enough for you, the
letter from the ICO to Rother District Council gives some guidance on the matter.

Isn't it a problem that you publish the names of civil servants
and the text of emails?

Officers or servants responding to requests are doing so on behalf of the
public as part of their job, and we publish their response on that
basis. Usually the names and phone numbers of FOI officers are already
available on authority websites. We also encourage our users to give their real
name too, so it is fair both ways.

Do you publish email addresses or mobile phone numbers?

We automatically remove email addresses and labelled mobile phone numbers
that are in the email part of responses from public authorities. Please
contact us if we've missed one. We don't currently
remove these from attachments,
such as Word documents.

Can you take down private information about me?

If you see any information on the site which you'd like us to remove or
hide, then please let us know. We'll then
remove it, provided it is genuinely private information.

Credit where credit is due

Which people made WhatDoTheyKnow?

Oh, nearly everyone (and maybe you too)!

    Heather Brooke
    (vampy!) has
    been pushing the idea of a UK FOI archive for years now.

    Both Phil Rodgers and Francis Irving
    entered it in a mySociety competition for ideas for public interest websites to build.

    It won,
    and then Chris Lightfoot (RIP :()
    thought up the wheeze of intercepting email responses to requests and
    automatically publishing them.

    Tom Steinberg got the cash to pay for the site from
    a dead chocolate mogul (thank you!) ...

    ... so that Francis Irving, Angie Ahl, Tommy Martin, Louise Crow, Matthew Somerville
    and Tom Steinberg could do the complex mixture of design and coding to build
    what you see today.

    Thanks particularly to Julian Todd (great blog!),
    Francis Davey, and Etienne Pollard for using the site early on and giving
    feedback (and/or legal advice!), and also to all our other users and
    testers.

    Lots of people have been looking up FOI email addresses, and a few
    volunteering to run the site - most especially Adam McGreggor, Alex
    Skene, John Cross and Tony Bowden.

Finally we couldn't do any of this without those
crazy people who volunteer,
amongst many other things, to do the accounts and fill in our VAT return.

You're all stars.

<% @title = "About" %>

Contact us

If your question isn't answered here, or you just wanted to let us know
something about the site, contact us.

Introduction to WhatDoTheyKnow

What is WhatDoTheyKnow for?

To help you find out inside information about what the UK government
is doing.

How does the site work?

You choose the public authority that you would like information from, then
write a brief note describing what you want to know. We then send your request
to the public authority. Any response they make is automatically published on the
website for you and anyone else to find and read.

Why would I bother to do this?

You pay taxes, and then government does things with the money. All sorts of
things that affect your life, from healthcare through to national defence. Some
it does badly, some it does well. The more we find out about how government
works, the better able we are to make suggestions to improve the things that
are done badly, and to celebrate the things that are done well.

Why would the public authority bother to reply?

Under Freedom of Information (FOI) law, they have to respond.

Who makes it?

WhatDoTheyKnow is created and run by mySociety,
and was initially funded by the JRSST Charitable Trust. mySociety is a project of the
registered charity UK Citizens Online Democracy.
If you like what we're doing, then you can
make a donation.

Making requests

You're missing the public authority that I want to request from!

Please contact us with the name of the public authority and,
if you can find it, their contact email address for Freedom of Information requests.
If you'd like to help add a whole category of public authority to the site, for example all
primary care trusts or all schools, then please
edit this shared spreadsheet (Google account required).

How quickly will I get a response?

By law public authorities must respond "promptly", and in any event not later
than 20 working days after receiving your request. The date of that hard limit
is shown on the page for your request. You will be emailed if this date goes by
without a response, so you can send the public authority another note to remind
them that they are breaking the law. Note: If you had to
clarify your request, the clock starts from that date, instead of the date they
received your initial request.

What if I'm not satisfied with the response?

If you didn't get the information you asked for, or you didn't get it in time,
then read our page 'Unhappy about the response you got?'.

Can you tell me more of the nitty gritty about the process of making requests?

Have a look at the
access to official information
pages on the Information Commisioner's website.

Can I request information about myself?

Not using this site. Requests made using WhatDoTheyKnow are public, made under the
Freedom of Information Act, and cannot help you find information about a
private individual. If you would like to know what information a public
authority holds about yourself, you should make a "Subject Access Request" in
private using Data Protection law.  The leaflet Subject
Access - A guide for data subjects (on the Information Commisioner's
website) explains how to do this.

I'd like to keep my request secret! (At least until I publish my story)

WhatDoTheyKnow is currently only designed for public requests. All
responses that we receive are automatically published on the website for anyone
to read.  You should contact the public authority directly if you would like to
make a request in private.  If you're interested in buying a system which helps
you manage FOI requests in secret, then contact us.

Why can I only request information about the environment from some authorities?

Some public authorities, such as South East Water,
don't come under the Freedom of Information Act, but do come under another law called
the Environmental Information Regulations (EIR). It's a very similar law, so you make a request
to them using WhatDoTheyKnow in just the same way as an FOI request. The only difference
is that on the page where you write you request, it reminds you that you can only
request "environmental information" and tells you what that means. It is quite broad.

So can I request information using EIR from other authorities?

Yes, just make a Freedom of Information (FOI) request as normal. The
authority has a duty to work out if the Environmental Information Regulations
(EIR) is the more appropriate legislation to reply under.

Privacy questions

Who gets to see my email address?

We will not disclose your email address to anyone, including the public
authority you are sending a request to, unless we are obliged to by law,
or you ask us to. If you send a message to another user on the site, then
it will reveal your email address to them. You will be told that this
is going to happen.

Will you send nasty, brutish spam to my email address?

Nope. After you sign up to WhatDoTheyKnow we will only send you emails
relating to a request you made, an email alert that you have signed up for,
or for other reasons that you specifically authorise. We will never give or
sell your email addresses to anyone else, unless we are obliged to by law, or
you ask us to.

Why will my name appear publically on the site?

It means that someone researching the same area can get in touch with you,
and maybe give you more information or ideas relating to your request.  Also,
we're going to publish the response with the name of the civil servant who
wrote it, so it seems only fair that your name should be public too!
Therefore, we encourage you to use your real name, but you may use a pseudonym
if you would like to be anonymous.

So I can make an FOI request using a pseudonym?

It is good practice for the public authority to reply to an anonymous request,
except in special circumstances such as if they suspect you of making vexatious
requests. See Freedom of Information Good Practice Guidance No 6
for details.  You should refer to this if a public authority attempts to refuse
a request because you used a pseudonym.

However, there are good reasons to use your real name: see the question
above.  If nothing else, it avoids the risk of an authority being picky,
ignoring the guidance and refusing your request.

They've asked for my postal address!

If a public authority asks you for your full, physical address, reply to them saying
that section 8.1.b of the FOI Act asks for an "address for correspondence",
and that the email address you are using is sufficient.

The Ministry of Justice has guidance
on this –
"As well as hard copy written correspondence, requests that are
transmitted electronically (for example, in emails) are acceptable
... If a request is received by email and no postal address is given, the email
address should be treated as the return address."

As if that isn't enough, the Information Commissioner's
Hints for Practitioners say
"Any correspondence could include a request for information. If it is written (this includes e-mail), legible, gives the name of the applicant, an address for reply (which could be electronic), and includes a description of the information required, then it will fall within the scope of the legislation."

No no, they need a postal address to send a paper response!

If an authority only has a paper copy of the information that you want,
they may ask you for a postal address. To start with, try persuading them
to scan in the documents for you. You can even offer to gift them a scanner, which in that particular case
embarrassed the authority into finding one they had already.

If that doesn't work, and you want to provide your postal address privately
in order to receive the documents, then please contact
us.

How do you moderate request annotations?

Annotations on WhatDoTheyKnow are to help
people get the information they want, or to give them pointers to places they
can go to help them act on it. We reserve the right to remove anything else.

Endless, political discussions are not allowed.
Post a link to a suitable forum or campaign site elsewhere.

FOI officer questions

I just got here from bottom of an FOI request, what is going on?

WhatDoTheyKnow is a service run by a charity. It helps ordinary members
of the public make FOI requests, and easily track and share the responses.

The FOI request you received was made by someone using WhatDoTheyKnow. You can
simply reply to the request as you would any other request from an individual.
The only difference is that your response will be automatically published on
the Internet.

If you have privacy or copyright concerns, please read the answers below.
You might also like to read this page from the top to find out more about what
the site does from the point of view of a user. You can also search the
site to find the authority that you work for, and view the status of
any requests made using the site.

Finally, we welcome comments and
thoughts from FOI officers, please get in touch.

Why are you publishing responses to FOI requests?

We think there are lots of benefits. Most importantly it will encourage the
public to be more interested and involved in the work of government. We
also hope that it will reduce the number of duplicate requests on any
subject that a public body will receive. Given that Freedom of Information
responses contain public information, which anybody could easily request
again from the public authority, we think there should be no reason not to
publish it widely.

Are the people making requests real people?

Yes. For the purposes of keeping track of responses we use
computer-generated email addresses for each request. However, before
they can send a request, each user must register on the site with a
unique email address that we then verify. You can search this site and
find a page listing all requests that each person has made.

An email isn't a sufficient address for an FOI request!

Yes it is. This
letter from the ICO to Rother District Council gives guidance on the matter, specifically
in the context of requests made via WhatDoTheyKnow.

Aren't you making lots of vexatious requests?

WhatDoTheyKnow is not making any requests. We are sending requests on
behalf of our users, who are real people making the requests.

Look at it like this - if lots of different people made requests from
different Hotmail email addresses, then you would not think that Microsoft were
making vexatious requests. It is exactly the same if lots of requests are made
via WhatDoTheyKnow. Moreover, since all requests are public it is much easier
for you to see if one of our users is making vexatious requests, and for us to
block them when that happens.

If that isn't enough for you, the
letter from the ICO to Rother District Council gives some guidance on the matter.

Won't I be breaking copyright law by sending a response that you then publish?

No, you will simply be replying to an FOI request by email (the "expressed
preference" of the requester, under
section
11(1) of the Freedom of Information Act). That we are later republishing your
response is a separate matter, and not something which FOIA lists as a reason
for rejecting a request.

Isn't it a problem that you publish the names of civil servants
and the text of emails?

Officers or servants responding to requests are doing so on behalf of the
public as part of their job, and we publish their response on that
basis. Usually the names and phone numbers of FOI officers are already
available on authority websites. We also encourage our users to give their real
name too, so it is fair both ways.

Do you publish email addresses or mobile phone numbers?

We automatically remove email addresses and labelled mobile phone numbers
that are in the email part of responses from public authorities. Please
contact us if we've missed one. We don't currently
remove these from attachments,
such as Word documents.

Can you take down private information about me?

If you see any information on the site which you'd like us to remove or
hide, then please let us know. We'll then
remove it, provided it is genuinely private information.

Credit where credit is due

Which people made WhatDoTheyKnow?

Oh, nearly everyone (and maybe you too)!

    Heather Brooke
    (vampy!) has
    been pushing the idea of a UK FOI archive for years now.

    Both Phil Rodgers and Francis Irving
    entered it in a mySociety competition for ideas for public interest websites to build.

    It won,
    and then Chris Lightfoot (RIP :()
    thought up the wheeze of intercepting email responses to requests and
    automatically publishing them.

    Tom Steinberg got the cash to pay for the site from
    a dead chocolate mogul (thank you!) ...

    ... so that Francis Irving, Angie Ahl, Tommy Martin, Louise Crow, Matthew Somerville
    and Tom Steinberg could do the complex mixture of design and coding to build
    what you see today.

    Thanks particularly to Julian Todd (great blog!),
    Francis Davey, and Etienne Pollard for using the site early on and giving
    feedback (and/or legal advice!), and also to all our other users and
    testers.

    Lots of people have been looking up FOI email addresses, and a few
    volunteering to run the site - most especially Adam McGreggor, Alex
    Skene, John Cross and Tony Bowden.

Finally we couldn't do any of this without those
crazy people who volunteer,
amongst many other things, to do the accounts and fill in our VAT return.

You're all stars.


having the image load right away....no timing, but proof of concept

<iframe src="<%= @link.website_url %>" width='100%' height='100%' frameborder='0' marginheight='0' marginwidth='0' scrolling='auto'>


Fixed bad link on show_user page.

Fixed bad link on show_user page.

<%
  @title = :show_user_title.t(:user => @user_data[:name])

  id   = @user_data[:id]
  name = @user_data[:name]

  links = {
    'images'        => url_for(:controller => 'image', :action => 'images_by_user', :id => id),
    'species_lists' => url_for(:controller => 'species_list', :action => 'species_lists_by_user', :id => id),
    'comments'      => url_for(:controller => 'comment', :action => 'show_comments_by_user', :id => id),
    'observations'  => url_for(:controller => 'observer', :action => 'show_user_observations', :id => id),
  }

  new_tab_set do
    add_tab(:show_user_contributors.t, :controller => 'observer', :action => 'users_by_contribution')
    if @show_user == @user
      add_tab(:show_user_your_observations.t, links['observations'])
      add_tab(:show_user_comments_for_you.t, links['comments'])
      add_tab(:show_user_your_notifications.t, :controller => "observer", :action => "list_notifications")
      add_tab(:show_user_edit_profile.t, :controller => "account", :action => "profile")
    else
      add_tab(:show_user_observations_by.t(:name => name), links['observations'])
      add_tab(:show_user_comments_for.t(:name => name), links['comments'])
      add_tab(:show_user_email_to.t(:name => name), :controller => "observer", :action => "ask_user_question", :id => id)
    end
    if @user && @user.id == 0
      add_tab(:change_user_bonuses.t, :controller => "observer", :action => "change_user_bonuses", :id => @show_user.id)
    end
  end
%>

<%= if @show_user.image
  link_to(image_tag(sprintf("thumb/%d.jpg", @show_user.image_id), :border => 0, :style => "float:right"),
          :controller => "image", :action => "show_image", :id => @show_user.image_id)
end %>

<% if @show_user.location %>
  <%= :show_user_primary_location.t %>: <%= location_link(nil, @show_user.location.id) %>

<% end %>
<% if @show_user.mailing_address != '' %>
  <%= :show_user_mailing_address.t %>: <%= @show_user.mailing_address %>

<% end %>
<% if !@show_user.notes.empty? %>

<% end %>
<%= if !@show_user.notes.empty?
  sanitize(@show_user.notes).tpl
end %>

      <% obs_length = 0
      if @observations
        obs_length = @observations.length
      end

      if obs_length > 3 %>

          <% for obs in @observations[3,3] %>
            <%= link_to(image_tag(sprintf("thumb/%d.jpg", obs.thumb_image_id), :class => 'site_stats_image'),
                        :action => 'show_observation', :id => obs.id) %>

          <% end %>

      <% end %>

          <% total = 0
          for field in ALL_FIELDS
            count = @user_data[field]
            if count %>

                  <%= str = "site_stats_#{field}".to_sym.t
                  if url = links[field.to_s]
                    link_to(str, url)
                  else
                    str
                  end %>

                  <%= count %>*<%= FIELD_WEIGHTS[field]%>

                =

                  <% weight = count*FIELD_WEIGHTS[field]
                  total += weight %>
                  <%= weight %>

            <% end %>
          <% end
          if @show_user.bonuses
            for points, reason in @show_user.bonuses
              total += points.to_i %>

                <%= reason.to_s.tl %>
                =
                <%= points.to_i %>

            <% end
          end
          if total > 0 %>

                <%= :show_user_total.t %>

              =

                <%= total %>

          <% end %>

      <% if obs_length > 0 %>

          <% for obs in @observations[0,3] %>
            <%= link_to(image_tag(sprintf("thumb/%d.jpg", obs.thumb_image_id), :class => 'site_stats_image'),
                        :action => 'show_observation', :id => obs.id) %>

          <% end %>

      <% end %>

<%
  @title = :show_user_title.t(:user => @user_data[:name])

  id   = @user_data[:id]
  name = @user_data[:name]

  links = {
    'images'        => url_for(:controller => 'image', :action => 'images_by_user', :id => id),
    'species_lists' => url_for(:controller => 'species_list', :action => 'species_lists_by_user', :id => id),
    'comments'      => url_for(:controller => 'comment', :action => 'show_comments_by_user', :id => id),
    'observations'  => url_for(:controller => 'observer', :action => 'show_user_observations', :id => id),
  }

  new_tab_set do
    add_tab(:show_user_contributors.t, :controller => 'observer', :action => 'users_by_contribution')
    if @show_user == @user
      add_tab(:show_user_your_observations.t, links['observations'])
      add_tab(:show_user_comments_for_you.t, :controller => "comment", :action => "show_comments_for_user", :id => id)
      add_tab(:show_user_your_notifications.t, :controller => "observer", :action => "list_notifications")
      add_tab(:show_user_edit_profile.t, :controller => "account", :action => "profile")
    else
      add_tab(:show_user_observations_by.t(:name => name), 'observations')
      add_tab(:show_user_comments_for.t(:name => name), :controller => "comment", :action => "show_comments_for_user", :id => id)
      add_tab(:show_user_email_to.t(:name => name), :controller => "observer", :action => "ask_user_question", :id => id)
    end
    if @user && @user.id == 0
      add_tab(:change_user_bonuses.t, :controller => "observer", :action => "change_user_bonuses", :id => @show_user.id)
    end
  end
%>

<%= if @show_user.image
  link_to(image_tag(sprintf("thumb/%d.jpg", @show_user.image_id), :border => 0, :style => "float:right"),
          :controller => "image", :action => "show_image", :id => @show_user.image_id)
end %>

<% if @show_user.location %>
  <%= :show_user_primary_location.t %>: <%= location_link(nil, @show_user.location.id) %>

<% end %>
<% if @show_user.mailing_address != '' %>
  <%= :show_user_mailing_address.t %>: <%= @show_user.mailing_address %>

<% end %>
<% if !@show_user.notes.empty? %>

<% end %>
<%= if !@show_user.notes.empty?
  sanitize(@show_user.notes).tpl
end %>

      <% obs_length = 0
      if @observations
        obs_length = @observations.length
      end

      if obs_length > 3 %>

          <% for obs in @observations[3,3] %>
            <%= link_to(image_tag(sprintf("thumb/%d.jpg", obs.thumb_image_id), :class => 'site_stats_image'),
                        :action => 'show_observation', :id => obs.id) %>

          <% end %>

      <% end %>

          <% total = 0
          for field in ALL_FIELDS
            count = @user_data[field]
            if count %>

                  <%= str = "site_stats_#{field}".to_sym.t
                  if url = links[field.to_s]
                    link_to(str, url)
                  else
                    str
                  end %>

                  <%= count %>*<%= FIELD_WEIGHTS[field]%>

                =

                  <% weight = count*FIELD_WEIGHTS[field]
                  total += weight %>
                  <%= weight %>

            <% end %>
          <% end
          if @show_user.bonuses
            for points, reason in @show_user.bonuses
              total += points.to_i %>

                <%= reason.to_s.tl %>
                =
                <%= points.to_i %>

            <% end
          end
          if total > 0 %>

                <%= :show_user_total.t %>

              =

                <%= total %>

          <% end %>

      <% if obs_length > 0 %>

          <% for obs in @observations[0,3] %>
            <%= link_to(image_tag(sprintf("thumb/%d.jpg", obs.thumb_image_id), :class => 'site_stats_image'),
                        :action => 'show_observation', :id => obs.id) %>

          <% end %>

      <% end %>


Explicitly sort old versions by id (versions() doesn't seem to always order correctly. See BBC for example)

<% @title = "Public authority - " + h(@public_body.name) %>

<%=@title%>

<%
   columns = PublicBody.content_columns
   columns.delete_if {|c| ['last_edit_comment'].include?(c.name)}

   for column in columns %>
  <%= column.human_name %>:
  <% if column.name == 'home_page' and !column.name.empty? %>
    <%= link_to(h(@public_body.send(column.name)), @public_body.send(column.name))  %>
  <% elsif column.name == 'request_email' and !column.name.empty? %>
    <%= link_to(h(@public_body.send(column.name)), "mailto:" + @public_body.send(column.name))  %>
  <% else %>
      <%=h @public_body.send(column.name) %>
  <% end %>

<% end %>
Calculated home page:
<% if !@public_body.calculated_home_page.nil? %>
    <%= link_to(h(@public_body.calculated_home_page), @public_body.calculated_home_page) %>
<% else %>
    *unknown*
<% end %>

Tags: <%= @public_body.public_body_tags.map { |t|
        link_to(h(t.name), list_public_bodies_url(:tag => t.name)) +
        ' (admin)' }.join(' ') %>

    <%= link_to 'Public page', main_url(public_body_url(@public_body)) %>
    | <%= link_to 'Edit', '../edit/' + @public_body.id.to_s %>

History

<%
    history_columns = PublicBody.content_columns
    history_columns.delete_if {|c| ['created_at', 'updated_at', 'first_letter'].include?(c.name)}
    for column in history_columns %>
  <%= column.human_name %>
<% end %>
Updated at

<% for historic_public_body in @public_body.versions.sort { |a,b| b.id <=> a.id } %>
      <tr class="<%= cycle('odd', 'even') %>">
    <% for column in history_columns %>
      <%
        value = h(historic_public_body.send(column.name))
        if column.name == 'last_edit_comment'
            value = historic_public_body.last_edit_comment_for_html_display
        end
        # Highlight entries which have changed since previous version
        changed = (not ['version', 'last_edit_editor', 'last_edit_comment'].include?(column.name)) && ((historic_public_body.send(column.name) != @public_body.versions[historic_public_body.version - 2].send(column.name)) || (historic_public_body.version == 1)) %>
      <td <%= changed ? ' class="entry_changed" ': '' %> >
      <%=value%>

    <% end %>
      <%=h historic_public_body.updated_at %>

<% end %>

Requests

<%= render :partial => 'admin_request/some_requests', :locals => { :info_requests => @public_body.info_requests } %>

Track things

<%= render :partial => 'admin_track/some_tracks', :locals => { :track_things => @public_body.track_things } %>

<% @title = "Public authority - " + h(@public_body.name) %>

<%=@title%>

<%
   columns = PublicBody.content_columns
   columns.delete_if {|c| ['last_edit_comment'].include?(c.name)}

   for column in columns %>
  <%= column.human_name %>:
  <% if column.name == 'home_page' and !column.name.empty? %>
    <%= link_to(h(@public_body.send(column.name)), @public_body.send(column.name))  %>
  <% elsif column.name == 'request_email' and !column.name.empty? %>
    <%= link_to(h(@public_body.send(column.name)), "mailto:" + @public_body.send(column.name))  %>
  <% else %>
      <%=h @public_body.send(column.name) %>
  <% end %>

<% end %>
Calculated home page:
<% if !@public_body.calculated_home_page.nil? %>
    <%= link_to(h(@public_body.calculated_home_page), @public_body.calculated_home_page) %>
<% else %>
    *unknown*
<% end %>

Tags: <%= @public_body.public_body_tags.map { |t|
        link_to(h(t.name), list_public_bodies_url(:tag => t.name)) +
        ' (admin)' }.join(' ') %>

    <%= link_to 'Public page', main_url(public_body_url(@public_body)) %>
    | <%= link_to 'Edit', '../edit/' + @public_body.id.to_s %>

History

<%
    history_columns = PublicBody.content_columns
    history_columns.delete_if {|c| ['created_at', 'updated_at', 'first_letter'].include?(c.name)}
    for column in history_columns %>
  <%= column.human_name %>
<% end %>
Updated at

<% for historic_public_body in @public_body.versions.reverse %>
      <tr class="<%= cycle('odd', 'even') %>">
    <% for column in history_columns %>
      <%
        value = h(historic_public_body.send(column.name))
        if column.name == 'last_edit_comment'
            value = historic_public_body.last_edit_comment_for_html_display
        end
        # Highlight entries which have changed since previous version
        changed = (not ['version', 'last_edit_editor', 'last_edit_comment'].include?(column.name)) && ((historic_public_body.send(column.name) != @public_body.versions[historic_public_body.version - 2].send(column.name)) || (historic_public_body.version == 1)) %>
      <td <%= changed ? ' class="entry_changed" ': '' %> >
      <%=value%>

    <% end %>
      <%=h historic_public_body.updated_at %>

<% end %>

Requests

<%= render :partial => 'admin_request/some_requests', :locals => { :info_requests => @public_body.info_requests } %>

Track things

<%= render :partial => 'admin_track/some_tracks', :locals => { :track_things => @public_body.track_things } %>


Fix broken link

Fix broken link

<%= body.public_body_tags.map { |t|
        link_to(h(t.name), main_url(list_public_bodies_url(:tag => t.name, :only_path => true))) +
            ' (admin)'
    }.join(' ') %>

<%= body.public_body_tags.map { |t|
        link_to(h(t.name), list_public_bodies_url(:tag => t.name)) +
            ' (admin)'
    }.join(' ') %>


Put date on each piece of correspondence.

<%
@last_email = nil
if !info_request_event.nil? && info_request_event.event_type == 'response'
    incoming_message = info_request_event.incoming_message
end

if not incoming_message.nil?
%>
    <div class="correspondence" id="incoming-<%=incoming_message.id.to_s%>">

<%= simple_date(incoming_message.sent_at) %>

        <%= render :partial => 'bubble', :locals => { :incoming_message => incoming_message, :body => incoming_message.get_body_for_html_display(@collapse_quotes), :attachments => incoming_message.get_attachments_for_display }  %>

            <% if !incoming_message.safe_mail_from.nil? %>
                <%= incoming_message.safe_mail_from %> of
            <% end %>
            <%= public_body_link(@info_request.public_body) %> replied
            (<%= link_to "link to this", show_response_url(:id => incoming_message.info_request.id, :incoming_message_id => incoming_message.id) %>,
            <%= link_to "reply", show_response_url(:id => incoming_message.info_request.id, :incoming_message_id => incoming_message.id) + "#show_response_followup" %>)

<%
elsif info_request_event.event_type == 'sent' || info_request_event.event_type == 'followup_sent'
    outgoing_message = info_request_event.outgoing_message
    %>
    <div class="correspondence" id="outgoing-<%=outgoing_message.id.to_s%>">

<%= simple_date(info_request_event.created_at) %>

        <%= render :partial => 'bubble', :locals => { :body => outgoing_message.get_body_for_html_display(), :attachments => nil }  %>

            <%= user_link(@info_request.user) %>
            <% if outgoing_message.message_type == 'initial_request' %>
                <% if outgoing_message.status == 'sent' %>
                    sent the initial request
                    to <%= public_body_link(@info_request.public_body) %>
                <% elsif outgoing_message.status == 'ready' %>
                     wrote the initial request, but it has not yet been sent
                <% else raise "unknown outgoing_message.status" %>
                <% end %>
            <% elsif outgoing_message.message_type == 'followup' %>
                <% if outgoing_message.status == 'sent' %>
                    wrote to
                    <% if !outgoing_message.incoming_message_followup.nil? && !outgoing_message.incoming_message_followup.safe_mail_from.nil? %>
                        <%= outgoing_message.incoming_message_followup.safe_mail_from %> of
                    <% end %>
                    <%= public_body_link(@info_request.public_body) %>
                <% elsif outgoing_message.status == 'ready' %>
                     wrote a follow up message, but it has not yet been sent
                <% else raise "unknown outgoing_message.status" %>
                <% end %>
            <% else raise "unknown outgoing_message.message_type" %>
            <% end %>
            (<%= link_to "send follow up", show_response_no_followup_url(:id => outgoing_message.info_request.id, :incoming_message_id => nil) + "#show_response_followup" %>)

<% elsif info_request_event.event_type == 'resent' %>

            Sent to <%= public_body_link(@info_request.public_body) %>
            again (perhaps to a new contact address)

<%
end

if !info_request_event.nil?
    if ['sent', 'resent'].include?(info_request_event.event_type)
         @last_email = info_request_event.params[:email]
    end
end
%>

<%
@last_email = nil
if !info_request_event.nil? && info_request_event.event_type == 'response'
    incoming_message = info_request_event.incoming_message
end

if not incoming_message.nil?
%>
    <div class="correspondence" id="incoming-<%=incoming_message.id.to_s%>">
        <% if @previous_date.nil? or (@previous_date != incoming_message.sent_at.to_date) %>

<%= simple_date(incoming_message.sent_at) %>

        <% end
        @previous_date = incoming_message.sent_at.to_date %>

        <%= render :partial => 'bubble', :locals => { :incoming_message => incoming_message, :body => incoming_message.get_body_for_html_display(@collapse_quotes), :attachments => incoming_message.get_attachments_for_display }  %>

            <% if !incoming_message.safe_mail_from.nil? %>
                <%= incoming_message.safe_mail_from %> of
            <% end %>
            <%= public_body_link(@info_request.public_body) %> replied
            (<%= link_to "link to this", show_response_url(:id => incoming_message.info_request.id, :incoming_message_id => incoming_message.id) %>,
            <%= link_to "reply", show_response_url(:id => incoming_message.info_request.id, :incoming_message_id => incoming_message.id) + "#show_response_followup" %>)

<%
elsif info_request_event.event_type == 'sent' || info_request_event.event_type == 'followup_sent'
    outgoing_message = info_request_event.outgoing_message
    %>
    <div class="correspondence" id="outgoing-<%=outgoing_message.id.to_s%>">
        <% if @previous_date.nil? or (@previous_date != info_request_event.created_at.to_date) %>

<%= simple_date(info_request_event.created_at) %>

        <% end
        @previous_date = info_request_event.created_at.to_date %>

        <%= render :partial => 'bubble', :locals => { :body => outgoing_message.get_body_for_html_display(), :attachments => nil }  %>

            <%= user_link(@info_request.user) %>
            <% if outgoing_message.message_type == 'initial_request' %>
                <% if outgoing_message.status == 'sent' %>
                    sent the initial request
                    to <%= public_body_link(@info_request.public_body) %>
                <% elsif outgoing_message.status == 'ready' %>
                     wrote the initial request, but it has not yet been sent
                <% else raise "unknown outgoing_message.status" %>
                <% end %>
            <% elsif outgoing_message.message_type == 'followup' %>
                <% if outgoing_message.status == 'sent' %>
                    wrote to
                    <% if !outgoing_message.incoming_message_followup.nil? && !outgoing_message.incoming_message_followup.safe_mail_from.nil? %>
                        <%= outgoing_message.incoming_message_followup.safe_mail_from %> of
                    <% end %>
                    <%= public_body_link(@info_request.public_body) %>
                <% elsif outgoing_message.status == 'ready' %>
                     wrote a follow up message, but it has not yet been sent
                <% else raise "unknown outgoing_message.status" %>
                <% end %>
            <% else raise "unknown outgoing_message.message_type" %>
            <% end %>
            (<%= link_to "send follow up", show_response_no_followup_url(:id => outgoing_message.info_request.id, :incoming_message_id => nil) + "#show_response_followup" %>)

<% elsif info_request_event.event_type == 'resent' %>

            Sent to <%= public_body_link(@info_request.public_body) %>
            again (perhaps to a new contact address)

<%
end

if !info_request_event.nil?
    if ['sent', 'resent'].include?(info_request_event.event_type)
         @last_email = info_request_event.params[:email]
    end
end
%>


Properly escape HTML when displaying safe_mail_from

<%
if !info_request_event.nil? && info_request_event.event_type == 'response'
    incoming_message = info_request_event.incoming_message
end

# XXX disable this caching for now until we invalidate it properly - maybe do
# it at a higher level anyway.
# cache against all the parameters that there are to this partial
#cache_name = ""
#if !info_request_event.nil?
#    cache_name = cache_name + "correspondence/" + info_request_event.id.to_s
#end
#if !incoming_message.nil?
#    cache_name = cache_name + "/incoming_message/" + incoming_message.id.to_s
#end
#if !@collapse_quotes.nil? && !@collapse_quotes
#    cache_name = cache_name + "/collapse/false"
#else
#    cache_name = cache_name + "/collapse/true" # default is true
#end
## yeuch, must be nicer way of telling cache just to use this cache_name, than
## putting it falsely in list action
#cache(:controller => 'request', :action => 'list', :extra => cache_name) do

if not incoming_message.nil?
%>
    <div class="correspondence" id="incoming-<%=incoming_message.id.to_s%>">

            <% if !incoming_message.safe_mail_from.nil? && incoming_message.safe_mail_from.strip != @info_request.public_body.name.strip %>
                <%=h incoming_message.safe_mail_from %>

            <% end %>
            <% if incoming_message.safe_mail_from.nil? || (incoming_message.mail_from_domain == @info_request.public_body.request_email_domain) %>
                <%=h @info_request.public_body.name %>

            <% end %>

<%= simple_date(incoming_message.sent_at) %>

        <%= render :partial => 'bubble', :locals => { :incoming_message => incoming_message, :body => incoming_message.get_body_for_html_display(@collapse_quotes), :attachments => incoming_message.get_attachments_for_display }  %>

            <% if !@user.nil? && @user.admin_page_links? %>
                <%= link_to "Admin", admin_url("request/show_raw_email/" + incoming_message.raw_email_id.to_s) %> |
            <% end %>
            <%= link_to "Link to this", incoming_message_url(incoming_message) %> |
            <%= link_to "Reply to this message", show_response_url(:id => incoming_message.info_request.id, :incoming_message_id => incoming_message.id) + "#followup" %>

<%
elsif info_request_event.event_type == 'sent' || info_request_event.event_type == 'followup_sent'
    outgoing_message = info_request_event.outgoing_message
    %>
    <div class="correspondence" id="outgoing-<%=outgoing_message.id.to_s%>">

        <%=h @info_request.user.name %>

<%= simple_date(info_request_event.created_at) %>

        <%= render :partial => 'bubble', :locals => { :body => outgoing_message.get_body_for_html_display(), :attachments => nil }  %>

            <% if outgoing_message.status == 'ready' %>
                 Warning: This message has not yet been sent for an unknown reason.
            <% end %>

            <%= link_to "Link to this", outgoing_message_url(outgoing_message) %> |
            <%= link_to "Send follow up", show_response_no_followup_url(:id => outgoing_message.info_request.id, :incoming_message_id => nil) + "#followup" %>

<% elsif [ 'resent', 'followup_resent' ].include?(info_request_event.event_type) %>

            <%= simple_date(info_request_event.created_at) %>

            Sent
            <% if info_request_event.outgoing_message.message_type == 'initial_request' %>
                request
            <% elsif info_request_event.outgoing_message.message_type == 'followup' %>
                a follow up
            <% else %>
                <% raise "unknown message_type" %>
            <% end %>

            to <%= public_body_link(@info_request.public_body) %> again<% if not info_request_event.same_email_as_previous_send? %>, using a new contact address<% end %>.

<% elsif info_request_event.event_type == 'comment'
    comment = info_request_event.comment
%>
    <%= render :partial => 'comment/single_comment', :locals => { :comment => comment } %>
<%
end

%>

<% # end %>

<%
if !info_request_event.nil? && info_request_event.event_type == 'response'
    incoming_message = info_request_event.incoming_message
end

# XXX disable this caching for now until we invalidate it properly - maybe do
# it at a higher level anyway.
# cache against all the parameters that there are to this partial
#cache_name = ""
#if !info_request_event.nil?
#    cache_name = cache_name + "correspondence/" + info_request_event.id.to_s
#end
#if !incoming_message.nil?
#    cache_name = cache_name + "/incoming_message/" + incoming_message.id.to_s
#end
#if !@collapse_quotes.nil? && !@collapse_quotes
#    cache_name = cache_name + "/collapse/false"
#else
#    cache_name = cache_name + "/collapse/true" # default is true
#end
## yeuch, must be nicer way of telling cache just to use this cache_name, than
## putting it falsely in list action
#cache(:controller => 'request', :action => 'list', :extra => cache_name) do

if not incoming_message.nil?
%>
    <div class="correspondence" id="incoming-<%=incoming_message.id.to_s%>">

            <% if !incoming_message.safe_mail_from.nil? && incoming_message.safe_mail_from.strip != @info_request.public_body.name.strip %>
                <%= incoming_message.safe_mail_from %>

            <% end %>
            <% if incoming_message.safe_mail_from.nil? || (incoming_message.mail_from_domain == @info_request.public_body.request_email_domain) %>
                <%=h @info_request.public_body.name %>

            <% end %>

<%= simple_date(incoming_message.sent_at) %>

        <%= render :partial => 'bubble', :locals => { :incoming_message => incoming_message, :body => incoming_message.get_body_for_html_display(@collapse_quotes), :attachments => incoming_message.get_attachments_for_display }  %>

            <% if !@user.nil? && @user.admin_page_links? %>
                <%= link_to "Admin", admin_url("request/show_raw_email/" + incoming_message.raw_email_id.to_s) %> |
            <% end %>
            <%= link_to "Link to this", incoming_message_url(incoming_message) %> |
            <%= link_to "Reply to this message", show_response_url(:id => incoming_message.info_request.id, :incoming_message_id => incoming_message.id) + "#followup" %>

<%
elsif info_request_event.event_type == 'sent' || info_request_event.event_type == 'followup_sent'
    outgoing_message = info_request_event.outgoing_message
    %>
    <div class="correspondence" id="outgoing-<%=outgoing_message.id.to_s%>">

        <%=h @info_request.user.name %>

<%= simple_date(info_request_event.created_at) %>

        <%= render :partial => 'bubble', :locals => { :body => outgoing_message.get_body_for_html_display(), :attachments => nil }  %>

            <% if outgoing_message.status == 'ready' %>
                 Warning: This message has not yet been sent for an unknown reason.
            <% end %>

            <%= link_to "Link to this", outgoing_message_url(outgoing_message) %> |
            <%= link_to "Send follow up", show_response_no_followup_url(:id => outgoing_message.info_request.id, :incoming_message_id => nil) + "#followup" %>

<% elsif [ 'resent', 'followup_resent' ].include?(info_request_event.event_type) %>

            <%= simple_date(info_request_event.created_at) %>

            Sent
            <% if info_request_event.outgoing_message.message_type == 'initial_request' %>
                request
            <% elsif info_request_event.outgoing_message.message_type == 'followup' %>
                a follow up
            <% else %>
                <% raise "unknown message_type" %>
            <% end %>

            to <%= public_body_link(@info_request.public_body) %> again<% if not info_request_event.same_email_as_previous_send? %>, using a new contact address<% end %>.

<% elsif info_request_event.event_type == 'comment'
    comment = info_request_event.comment
%>
    <%= render :partial => 'comment/single_comment', :locals => { :comment => comment } %>
<%
end

%>

<% # end %>


Single column searchs

Single column searchs

<div id="search-results" class="<%= 'only-one-result-box' if @results.size == 1 %>">

<% @order.each do |name| %>
  <% results = @results[name] %>
  <% if !results.nil? and !results.empty? %>
    <div class="search-results-<%= name %> search-results-box">
      <% if @controller.action_name != 'assets' %>
        <% if @results.size != 1 %>

            <%= @names[name] %>

        <% end %>
        <%# FIXME: don't hardcode an asset like this %>
        <% if name == :most_commented_articles %>
          <%= link_to( results.respond_to?(:total_entries) ? _('see all (%d)') % results.total_entries : _('see all...'),
                       params.merge(:action => 'index',
                       :asset => 'articles' ),
                       :class => 'see-more' ) if @results.size > 1 %>

        <% else %>
          <%= link_to( results.respond_to?(:total_entries) ? _('see all (%d)') % results.total_entries : _('see all...'),
                       params.merge(:action => 'index',
                       :asset => name ),
                       :class => 'see-more' ) if @results.size > 1 %>
        <% end %>
      <% end %>
      <% partial = partial_for_class results.first.class %>
      <div class="search-results-innerbox search-results-type-<%= partial %> <%= 'common-profile-list-block' if partial == 'profile' %>">

          <% results.each do |hit| %>
            <% next if hit.respond_to?(:visible) && !hit.visible? %>
            <%= render :partial => partial_for_class(hit.class), :object => hit %>
          <% end %>

  <% else %>
    <div class="search-results-<%= name %> search-results-empty search-results-box">
      <% if @controller.action_name != 'assets' %>
        <% if @results.size != 1 %>

<%= @names[name] %>

        <% end %>
      <% end %>

 <%= _('None') %>

  <% end %>
<% end %>

<div id="search-results" class="<%= 'only-one-result-box' if @results.size == 1 %>">

<%
  pos2 = :odd  # allow to format in a two columns layout
  pos3 = 3     # allow to format in a thre columns layout
%>
<% @order.each do |name| %>
  <% results = @results[name] %>
  <%
    pos3 += 1;  pos3 = 1 if pos3 > 3
    pos2==:odd ? pos2=:even : pos2=:odd
  %>
  <% if !results.nil? and !results.empty? %>
    <div class="search-results-<%= name %> search-results-box <%= pos2 %> <%= 'col%s_of3' % pos3.to_s %>">
      <% if @controller.action_name != 'assets' %>
        <% if @results.size != 1 %>

            <%= @names[name] %>

        <% end %>
        <%# FIXME: don't hardcode an asset like this %>
        <% if name == :most_commented_articles %>
          <%= link_to( results.respond_to?(:total_entries) ? _('see all (%d)') % results.total_entries : _('see all...'),
                       params.merge(:action => 'index',
                       :asset => 'articles' ),
                       :class => 'see-more' ) if @results.size > 1 %>

        <% else %>
          <%= link_to( results.respond_to?(:total_entries) ? _('see all (%d)') % results.total_entries : _('see all...'),
                       params.merge(:action => 'index',
                       :asset => name ),
                       :class => 'see-more' ) if @results.size > 1 %>
        <% end %>
      <% end %>
      <% partial = partial_for_class results.first.class %>
      <div class="search-results-innerbox search-results-type-<%= partial %> <%= 'common-profile-list-block' if partial == 'profile' %>">

          <% hit_pos = 0 %>
          <% results.each do |hit| %>
            <% next if hit.respond_to?(:visible) && !hit.visible?  %>
            <%= render :partial => partial_for_class(hit.class),

                       :object => hit,
                       :locals => { :pos => ( hit_pos += 1 ) } %>
          <% end %>

  <% else %>
    <div class="search-results-<%= name %> search-results-empty search-results-box <%= pos2 %> <%= 'col%s_of3' % pos3.to_s %>">
      <% if @controller.action_name != 'assets' %>
        <% if @results.size != 1 %>

<%= @names[name] %>

        <% end %>
      <% end %>

 <%= _('None') %>

  <% end %>
<% end %>


Adding id on "Contact us" button of enterprise

(ActionItem1320)

  <%if logged_in? %>
    <%if !user.favorite_enterprises.include?(profile) %>

<%= link_to content_tag('span', _('Add as favorite')), { :profile => user.identifier, :controller => 'favorite_enterprises', :action => 'add', :id => profile.id }, :class => 'button with-text icon-add', :title => __('Add enterprise as favorite') %>

    <% end %>
  <% end %>
  <% if profile.enable_contact? %>

 <%= link_to content_tag('span', _('Contact us')), {:profile => profile.identifier, :controller => 'contact', :action => 'new'}, {:id => 'enterprise-contact-button', :class => 'button with-text icon-menu-mail'} %>

  <% end %>

  <%if logged_in? %>
    <%if !user.favorite_enterprises.include?(profile) %>

<%= link_to content_tag('span', _('Add as favorite')), { :profile => user.identifier, :controller => 'favorite_enterprises', :action => 'add', :id => profile.id }, :class => 'button with-text icon-add', :title => __('Add enterprise as favorite') %>

    <% end %>
  <% end %>
  <% if profile.enable_contact? %>

 <%= link_to content_tag('span', _('Contact us')), {:profile => profile.identifier, :controller => 'contact', :action => 'new'}, :class => 'button with-text icon-menu-mail' %>

  <% end %>