changed wording on sharing form to reflect the change to visible and accessible

<%# 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]", "" -%>

<%# @resource_type -%>
<%# @favourite_groups -%>
<%# @all_projects -%>

<%# @policy_type -%>
<%# @sharing_mode -%>
<%# @access_mode -%>
<%# @use_custom_sharing -%>
<%# @use_whitelist -%>
<%# @use_blacklist -%>

    <%= help_icon("Here you can specify who can view, download and edit this #{@resource_type}.") -%>
    Sharing

        Here you can specify to whom the <%= @resource_type -%> is visible, accessible and editable.
        <%= link_to_function "More info " + expand_image, visual_effect(:toggle_blind, "more_sharing_info", :duration => 0.3) -%>

          Here you may specify the People, Projects or Groups that may View and Edit the details about your <%= @resource_type -%>.

          You may:

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

Share with all other users, including those that are not a member of a Sysmo project.

Share with all other users that are a member of a Sysmo project.

Define more fine-grained sharing, by selecting Custom sharing permissions.
 By using custom sharing permissions 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.

<label for="sharing_scope_<%= Policy::PRIVATE -%>">
        <input type="hidden" name="sharing[access_type_<%= Policy::PRIVATE -%>]" value="<%= Policy::NO_ACCESS -%>">
        <input type="hidden" name="sharing[include_custom_sharing_<%= Policy::PRIVATE -%>]" value="0">

        <input <%= 'checked="checked"' if @sharing_mode == Policy::PRIVATE %> id="sharing_scope_<%= Policy::PRIVATE -%>" name="sharing[sharing_scope]"
                                                                              value="<%= Policy::PRIVATE -%>" type="radio" onclick="javascript:setSharingElementVisibility(<%= Policy::PRIVATE -%>);" />
        - Keep this <%= @resource_type -%> private.

Or share it with..

      <label for="sharing_scope_<%= Policy::ALL_REGISTERED_USERS -%>">
        <input type="radio" <%= 'checked="checked"' if @sharing_mode == Policy::ALL_REGISTERED_USERS -%> id="sharing_scope_<%= Policy::ALL_REGISTERED_USERS -%>" name="sharing[sharing_scope]"
               value="<%= Policy::ALL_REGISTERED_USERS -%>" onclick="javascript:setSharingElementVisibility(<%= Policy::ALL_REGISTERED_USERS -%>);" />
        - All users, including those that are not members of SysMO projects, for

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

      <%= render :partial => "assets/sharing_form_custom_permissions_checkbox", :locals => { :custom_sharing_cb_for_scope => Policy::ALL_REGISTERED_USERS,
        :sharing_scope => @sharing_mode, :use_custom_sharing => @use_custom_sharing } -%>

      <label for="sharing_scope_<%= Policy::ALL_SYSMO_USERS -%>">
        <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 -%>" onclick="javascript:setSharingElementVisibility(<%= Policy::ALL_SYSMO_USERS -%>);" />
        - All registered users that are members of a SysMO project for

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

      <%= render :partial => "assets/sharing_form_custom_permissions_checkbox", :locals => { :custom_sharing_cb_for_scope => Policy::ALL_SYSMO_USERS,
        :sharing_scope => @sharing_mode, :use_custom_sharing => @use_custom_sharing } -%>

      <label for="sharing_scope_<%= Policy::CUSTOM_PERMISSIONS_ONLY -%>">
        <input type="radio" <%= 'checked="checked"' if @sharing_mode == Policy::CUSTOM_PERMISSIONS_ONLY -%> id="sharing_scope_<%= Policy::CUSTOM_PERMISSIONS_ONLY -%>" name="sharing[sharing_scope]"
               value="<%= Policy::CUSTOM_PERMISSIONS_ONLY -%>" onclick="javascript:setSharingElementVisibility(<%= Policy::CUSTOM_PERMISSIONS_ONLY -%>);" />
        - Use custom sharing permissions only

    <div id="specific_sharing" style="display: <%= (@use_custom_sharing || @sharing_mode == Policy::CUSTOM_PERMISSIONS_ONLY) ? "block" : "none" -%>; margin-top: 2em;">

        Custom 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, :onchange => "javascript: replaceFavouriteGroupRedboxActionURL(); return(false);", :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() -%>

              <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() -%>

            <%= 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::VISIBLE,Policy::ACCESSIBLE,Policy::EDITING] -%>
                  </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() -%>

            <%= 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 -%>
                    </select>

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

    <%= "
" unless @enable_black_white_listing %>

Also include people in my..

          <input <%= "disabled" if @sharing_mode == Policy::PRIVATE -%> style="margin-right: 0.3em;" value="1" type="checkbox" name="sharing[use_whitelist]" id="cb_use_whitelist" <%= "checked='checked'" if @use_whitelist -%> />
          - "white list", who always get full access

        <% white_lst = current_user.get_whitelist -%>
        <%= hidden_field_tag "#{FavouriteGroup::WHITELIST_NAME}_group_id", (white_lst ? white_lst.id : "none") -%>
          [
          <span id="<%= FavouriteGroup::WHITELIST_NAME -%>_edit_span" style="display: <%= white_lst ? "inline" : "none" -%>;">
            <%= link_to "edit", "/", :onclick => "editWhitelistBlacklist('#{FavouriteGroup::WHITELIST_NAME}'); return(false);" -%>

          <% unless white_lst -%>
            <span id="<%= FavouriteGroup::WHITELIST_NAME -%>_create_span">
              <%= link_to "create", "/", :onclick => "createWhitelistBlacklist('#{FavouriteGroup::WHITELIST_NAME}'); return(false);" -%>

          <% end -%>
          ]
        <%= image_tag icon_filename_for_key("spinner"), :id => "#{FavouriteGroup::WHITELIST_NAME}_creation_spinner", :alt=>"loading...", :title=>"loading...", :style => "display: none; vertical-align: middle;" -%>

          <input <%= "disabled" if @sharing_mode == Policy::PRIVATE -%> style="margin-right: 0.3em;" value="1" type="checkbox" name="sharing[use_blacklist]" id="cb_use_blacklist" <%= "checked='checked'" if @use_blacklist -%> />
          - "black list", who have no access at all

        <% black_lst = current_user.get_blacklist -%>
        <%= hidden_field_tag "#{FavouriteGroup::BLACKLIST_NAME}_group_id", (black_lst ? black_lst.id : "none") -%>
          [
          <span id="<%= FavouriteGroup::BLACKLIST_NAME -%>_edit_span" style="display: <%= black_lst ? "inline" : "none" -%>;">
            <%= link_to "edit", "/", :onclick => "editWhitelistBlacklist('#{FavouriteGroup::BLACKLIST_NAME}'); return(false);" -%>

          <% unless black_lst -%>
            <span id="<%= FavouriteGroup::BLACKLIST_NAME -%>_create_span">
              <%= link_to "create", "/", :onclick => "createWhitelistBlacklist('#{FavouriteGroup::BLACKLIST_NAME}'); return(false);" -%>

          <% end -%>
          ]
        <%= image_tag icon_filename_for_key("spinner"), :id => "#{FavouriteGroup::BLACKLIST_NAME}_creation_spinner", :alt=>"loading...", :title=>"loading...", :style => "display: none; vertical-align: middle;" -%>

  <%# this DIV is to hold the 'redbox' links generated by a method in application_helper, -%>
  <%# these will be "clicked" by javascript, because hidden divs that are present in the -%>
  <%# generated code causes IE to break layout by inserting extra line break otherwise -%>
        <div id="<%= FavouriteGroup::WHITELIST_NAME -%>_redbox_link_div">
          <%= whitelist_blacklist_edit_popup_link(FavouriteGroup::WHITELIST_NAME) -%>

        <div id="<%= FavouriteGroup::BLACKLIST_NAME -%>_redbox_link_div">
          <%= whitelist_blacklist_edit_popup_link(FavouriteGroup::BLACKLIST_NAME) -%>

    <%= "
" unless @enable_black_white_listing %>

<%# 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]", "" -%>

<%# @resource_type -%>
<%# @favourite_groups -%>
<%# @all_projects -%>

<%# @policy_type -%>
<%# @sharing_mode -%>
<%# @access_mode -%>
<%# @use_custom_sharing -%>
<%# @use_whitelist -%>
<%# @use_blacklist -%>

    <%= help_icon("Here you can specify who can view, download and edit this #{@resource_type}.") -%>
    Sharing

        Here you can specify who can view, download and edit this <%= @resource_type -%>.
        <%= link_to_function "More info " + expand_image, visual_effect(:toggle_blind, "more_sharing_info", :duration => 0.3) -%>

          Here you may specify the People, Projects or Groups that may View and Edit the details about your <%= @resource_type -%>.

          You may:

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

Share with all other users, including those that are not a member of a Sysmo project.

Share with all other users that are a member of a Sysmo project.

Define more fine-grained sharing, by selecting Custom sharing permissions.
 By using custom sharing permissions 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.

<label for="sharing_scope_<%= Policy::PRIVATE -%>">
        <input type="hidden" name="sharing[access_type_<%= Policy::PRIVATE -%>]" value="<%= Policy::NO_ACCESS -%>">
        <input type="hidden" name="sharing[include_custom_sharing_<%= Policy::PRIVATE -%>]" value="0">

        <input <%= 'checked="checked"' if @sharing_mode == Policy::PRIVATE %> id="sharing_scope_<%= Policy::PRIVATE -%>" name="sharing[sharing_scope]"
                                                                              value="<%= Policy::PRIVATE -%>" type="radio" onclick="javascript:setSharingElementVisibility(<%= Policy::PRIVATE -%>);" />
        - Keep this <%= @resource_type -%> private.

Or share it with..

      <label for="sharing_scope_<%= Policy::ALL_REGISTERED_USERS -%>">
        <input type="radio" <%= 'checked="checked"' if @sharing_mode == Policy::ALL_REGISTERED_USERS -%> id="sharing_scope_<%= Policy::ALL_REGISTERED_USERS -%>" name="sharing[sharing_scope]"
               value="<%= Policy::ALL_REGISTERED_USERS -%>" onclick="javascript:setSharingElementVisibility(<%= Policy::ALL_REGISTERED_USERS -%>);" />
        - All users, including those that are not members of SysMO projects, for

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

      <%= render :partial => "assets/sharing_form_custom_permissions_checkbox", :locals => { :custom_sharing_cb_for_scope => Policy::ALL_REGISTERED_USERS,
        :sharing_scope => @sharing_mode, :use_custom_sharing => @use_custom_sharing } -%>

      <label for="sharing_scope_<%= Policy::ALL_SYSMO_USERS -%>">
        <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 -%>" onclick="javascript:setSharingElementVisibility(<%= Policy::ALL_SYSMO_USERS -%>);" />
        - All registered users that are members of a SysMO project for

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

      <%= render :partial => "assets/sharing_form_custom_permissions_checkbox", :locals => { :custom_sharing_cb_for_scope => Policy::ALL_SYSMO_USERS,
        :sharing_scope => @sharing_mode, :use_custom_sharing => @use_custom_sharing } -%>

      <label for="sharing_scope_<%= Policy::CUSTOM_PERMISSIONS_ONLY -%>">
        <input type="radio" <%= 'checked="checked"' if @sharing_mode == Policy::CUSTOM_PERMISSIONS_ONLY -%> id="sharing_scope_<%= Policy::CUSTOM_PERMISSIONS_ONLY -%>" name="sharing[sharing_scope]"
               value="<%= Policy::CUSTOM_PERMISSIONS_ONLY -%>" onclick="javascript:setSharingElementVisibility(<%= Policy::CUSTOM_PERMISSIONS_ONLY -%>);" />
        - Use custom sharing permissions only

    <div id="specific_sharing" style="display: <%= (@use_custom_sharing || @sharing_mode == Policy::CUSTOM_PERMISSIONS_ONLY) ? "block" : "none" -%>; margin-top: 2em;">

        Custom 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, :onchange => "javascript: replaceFavouriteGroupRedboxActionURL(); return(false);", :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() -%>

              <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() -%>

            <%= 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::VISIBLE,Policy::ACCESSIBLE,Policy::EDITING] -%>
                  </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() -%>

            <%= 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 -%>
                    </select>

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

    <%= "
" unless @enable_black_white_listing %>

Also include people in my..

          <input <%= "disabled" if @sharing_mode == Policy::PRIVATE -%> style="margin-right: 0.3em;" value="1" type="checkbox" name="sharing[use_whitelist]" id="cb_use_whitelist" <%= "checked='checked'" if @use_whitelist -%> />
          - "white list", who always get full access

        <% white_lst = current_user.get_whitelist -%>
        <%= hidden_field_tag "#{FavouriteGroup::WHITELIST_NAME}_group_id", (white_lst ? white_lst.id : "none") -%>
          [
          <span id="<%= FavouriteGroup::WHITELIST_NAME -%>_edit_span" style="display: <%= white_lst ? "inline" : "none" -%>;">
            <%= link_to "edit", "/", :onclick => "editWhitelistBlacklist('#{FavouriteGroup::WHITELIST_NAME}'); return(false);" -%>

          <% unless white_lst -%>
            <span id="<%= FavouriteGroup::WHITELIST_NAME -%>_create_span">
              <%= link_to "create", "/", :onclick => "createWhitelistBlacklist('#{FavouriteGroup::WHITELIST_NAME}'); return(false);" -%>

          <% end -%>
          ]
        <%= image_tag icon_filename_for_key("spinner"), :id => "#{FavouriteGroup::WHITELIST_NAME}_creation_spinner", :alt=>"loading...", :title=>"loading...", :style => "display: none; vertical-align: middle;" -%>

          <input <%= "disabled" if @sharing_mode == Policy::PRIVATE -%> style="margin-right: 0.3em;" value="1" type="checkbox" name="sharing[use_blacklist]" id="cb_use_blacklist" <%= "checked='checked'" if @use_blacklist -%> />
          - "black list", who have no access at all

        <% black_lst = current_user.get_blacklist -%>
        <%= hidden_field_tag "#{FavouriteGroup::BLACKLIST_NAME}_group_id", (black_lst ? black_lst.id : "none") -%>
          [
          <span id="<%= FavouriteGroup::BLACKLIST_NAME -%>_edit_span" style="display: <%= black_lst ? "inline" : "none" -%>;">
            <%= link_to "edit", "/", :onclick => "editWhitelistBlacklist('#{FavouriteGroup::BLACKLIST_NAME}'); return(false);" -%>

          <% unless black_lst -%>
            <span id="<%= FavouriteGroup::BLACKLIST_NAME -%>_create_span">
              <%= link_to "create", "/", :onclick => "createWhitelistBlacklist('#{FavouriteGroup::BLACKLIST_NAME}'); return(false);" -%>

          <% end -%>
          ]
        <%= image_tag icon_filename_for_key("spinner"), :id => "#{FavouriteGroup::BLACKLIST_NAME}_creation_spinner", :alt=>"loading...", :title=>"loading...", :style => "display: none; vertical-align: middle;" -%>

  <%# this DIV is to hold the 'redbox' links generated by a method in application_helper, -%>
  <%# these will be "clicked" by javascript, because hidden divs that are present in the -%>
  <%# generated code causes IE to break layout by inserting extra line break otherwise -%>
        <div id="<%= FavouriteGroup::WHITELIST_NAME -%>_redbox_link_div">
          <%= whitelist_blacklist_edit_popup_link(FavouriteGroup::WHITELIST_NAME) -%>

        <div id="<%= FavouriteGroup::BLACKLIST_NAME -%>_redbox_link_div">
          <%= whitelist_blacklist_edit_popup_link(FavouriteGroup::BLACKLIST_NAME) -%>

    <%= "
" unless @enable_black_white_listing %>


Remove unused orglink partial (which overrides any logo link in the main theme)

<%= link_to image_tag('/alavetelitheme/images/logo.png'), frontpage_url, :id=>'logo' %>


ActionItem364: add "www." to ynternet link

git-svn-id: 43659daf80e124e0b603d67096418e58e4f21099@2048 3f533792-8f58-4932-b0fe-aaf55b0a4547

  <%= _('A Ynternet.org project') %>

  Communication libre pour une société libre

  <%= _('Sponsored by Loterie Romande') %>

  lottery games in Switzerland

<%= language_chooser %>


Allow the page titles to be edited by other parts of the app.


updated the about box

updated the about box

  <title>The Best of ... on Hacker News</title>
  <meta name="description" content="The best comments on Hacker News, charts, PDF export.">
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

            <form action="" method="POST" id="target">
              The best
              <select name="limit" id="limit">
                <option value="10">10</option>
                <option value="25">25</option>
                <option value="50">50</option>
                <option value="75">75</option>
                <option value="100" selected>100</option>
              </select>
              comments by <input type="text" id="username" name="username">
              <input class="not-field" name="show-html" type="submit" onclick="hn.generateChart(); return false;" value="Show" />
              <input class="not-field" name="show-pdf" type="button" onclick="$('#target').submit();" value="PDF E-book" />
            </form>

          about

      powered by
      hnsearch and
      pdfcrowd |
      source |
      feedback: redpill27@gmail.com

      <% if (c.error !== undefined) { %>
        <%= c.error %>
      <% } %>

        This page requires JavaScript enabled.

Distribution of Comments

The markers are clickable, the size is proportional to the comment length.

  <title>The Best of ... on Hacker News</title>
  <meta name="description" content="The best comments on Hacker News, charts, PDF export.">
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

            <form action="" method="POST" id="target">
              The best
              <select name="limit" id="limit">
                <option value="10">10</option>
                <option value="25">25</option>
                <option value="50">50</option>
                <option value="75">75</option>
                <option value="100" selected>100</option>
              </select>
              comments by <input type="text" id="username" name="username">
              <input name="show-html" type="submit" onclick="hn.generateChart();return false;" value="Show" />
              <input name="show-pdf" type="button" onclick="$('#target').submit();" value="PDF E-book" />
            </form>

          about

      powered by
      hnsearch and
      pdfcrowd |
      source |
      feedback: redpill27@gmail.com

      <% if (c.error !== undefined) { %>
        <%= c.error %>
      <% } %>

        This page requires JavaScript enabled.

Distribution of Comments

The markers are clickable, the size is proportional to the comment length.


corrected typo

corrected typo

<% form_tag :action=> "signup" do -%>

<% if @error_tos%>

<%=t("madb_error_saving_account")%>

<% if @error_tos %>

<%=t("tos_acceptance_needed")%>

<%end%>

<% end -%>

    <%= country_select "account", "country", { t("madb_choose") => 0}%>

<%= t("madb_administrator_user")%>

<% if @user.errors.count>0 %>

<%=t("madb_error_saving_user")%>

    <% done = [] %>
    <% @user.errors.each do |attr,e| %>
      <% next if done.include? e %>
      <% done.push e %>

<%= t(e) %>

    <% end %>

<%end%>

    <%= t("madb_login_email") %>:

    <%= text_field "user", "login", :size => 30 %>

<%if false %>
    <%= t("madb_email_confirmation") %>:

    <%= text_field "user", "login_confirmation", :size => 30 %>

<% end %>
    <%= t("madb_choose_password_creation") %>:

    <%= password_field "user", "password", :size => 30, :value => "" %>

    <%= t("madb_confirm_password_creation") %>:

    <%= password_field "user", "password_confirmation", :size => 30, :value => "" %>

    <input type="checkbox" name="tos_accepted" ><%= t("madb_tos_accepted")%>

      <%= submit_tag t("madb_signup") %>

<% end -%>


* app/views/page/show.rhtml: Make sure we only lose the comments on
  the front page.

git-svn-id: ce004a3be656e491f060c65e2aab8dd2a5477e8b@35 f7b17897-190c-4688-811d-8cf59fb8cab0

<% @title = @page.title %>
<% @title = Siteinfo.main.name if @page.title == "Home" %>
<% @tab = "home" if @page.title == "Home" %>
<% @tab = "about" if @page.title == "About" %>

    <%= @page.content_html %>

  <%= link_to('Edit this page', :action => 'edit', :title => @page.title) -%>

  <%= link_to('What links here?', :action => 'refer', :title => @page.title) -%>

    Revision: #<%= @page.revisions.length %> -
    <%= link_to "View page edit history", :action => 'history', :title => @page.title %>

<% if @title == "Home" && Siteinfo.frontpagecomments? -%>

Comments

    <%= render :partial => '/comment/comments' %>

<% end %>

<% @title = @page.title %>
<% @title = Siteinfo.main.name if @page.title == "Home" %>
<% @tab = "home" if @page.title == "Home" %>
<% @tab = "about" if @page.title == "About" %>

    <%= @page.content_html %>

  <%= link_to('Edit this page', :action => 'edit', :title => @page.title) -%>

  <%= link_to('What links here?', :action => 'refer', :title => @page.title) -%>

    Revision: #<%= @page.revisions.length %> -
    <%= link_to "View page edit history", :action => 'history', :title => @page.title %>

<% if Siteinfo.frontpagecomments? -%>

Comments

    <%= render :partial => '/comment/comments' %>

<% end %>


more cage details like owner, food now available

<% if @list_all %>
Listing all cages
<% else %>
Listing current cages
<% end %>

    Name
    Bats
    Food
    Owner
    Fed by
    Created
    <% if @list_all %>
      Destroyed
    <% end %>

<% for cage in @cages %>

      <%= link_to cage.name, :action => 'show', :id => cage %>

	<%=h cage.bats.count %>
    <%=h cage.food %>g
    <%=h cage.user ? cage.user.name : "NP" %>
    <%=h cage.fed_by %>
	<%=h nice_date(cage.date_created) %>
  <% if @list_all %>
  <%=h nice_date(cage.date_destroyed) %>
<% end %>
    <%= link_to 'Edit', :action => 'edit', :id => cage %>

	<% if cage.date_destroyed == nil %>
	<%= link_to 'Deactivate', { :action => 'deactivate', :id => cage }, :confirm => 'Are you sure?', :post => true %>
	<% else %>
	<%=  link_to 'Reactivate', { :action => 'reactivate', :id => cage }, :confirm => 'Are you sure?', :post => true %>
    <% end %>

<% end %>

<%= link_to 'Previous page', { :page => @cage_pages.current.previous } if @cage_pages.current.previous %>
<%= link_to 'Next page', { :page => @cage_pages.current.next } if @cage_pages.current.next %>

<%= link_to 'New Cage', :action => 'new' %>
<% if @list_all %>
<%= link_to 'List Current Cages', :action => 'list' %>
<% else %>
<%= link_to 'List All Cages', :action => 'list_all' %>
<% end %>

<% if @list_all %>
Listing all cages
<% else %>
Listing current cages
<% end %>

    Name
    Bats
    Created
    <% if @list_all %>
      Destroyed
    <% end %>

<% for cage in @cages %>

      <%= link_to cage.name, :action => 'show', :id => cage %>

	<%=h cage.bats.count %>
	<%=h nice_date(cage.date_created) %>
  <% if @list_all %>
  <%=h nice_date(cage.date_destroyed) %>
<% end %>
    <%= link_to 'Edit', :action => 'edit', :id => cage %>

	<% if cage.date_destroyed == nil %>
	<%= link_to 'Deactivate', { :action => 'deactivate', :id => cage }, :confirm => 'Are you sure?', :post => true %>
	<% else %>
	<%=  link_to 'Reactivate', { :action => 'reactivate', :id => cage }, :confirm => 'Are you sure?', :post => true %>
    <% end %>

<% end %>

<%= link_to 'Previous page', { :page => @cage_pages.current.previous } if @cage_pages.current.previous %>
<%= link_to 'Next page', { :page => @cage_pages.current.next } if @cage_pages.current.next %>

<%= link_to 'New Cage', :action => 'new' %>
<% if @list_all %>
<%= link_to 'List Current Cages', :action => 'list' %>
<% else %>
<%= link_to 'List All Cages', :action => 'list_all' %>
<% end %>


Don't load pngfix.js on IE7 as it isn't needed.


Fixed table links to view & editor w/ segment

<%
   segment_action = @segment && @segment.segment_type == 'custom' ? ['Remove Users from List', 'remove_users'] : ['Add Users to List','js','MemberEditor.addUsersToList();']

   active_table_for :email_targets_table, @active_table_output,
                    :refresh_url => url_for(:action => 'display_targets_table', :path => @segment ? @segment.id : nil, :terms => @search.terms, :offsets => @search.offsets.empty? ? nil : @search.offsets),
                    :class => 'active_table',
                    :width => '100%',
                    :next => @search.user_segment && @search.terms ? 'more' : '>',
                    :actions => [['Add Tags','js','MemberEditor.addTags();'],
                                 ['Remove Tags','js','MemberEditor.removeTags();'],
                                 segment_action
                                ],
                    :more_actions => [['Delete Targets','delete','Delete the selected users?']],
                    :update => 'targets_table' do |t| %>
<% user_url = url_for(:action => 'view',  :path => [ t.id, @segment ? @segment.id : nil].compact) %>
<tr <%= highlight_row "user",t.id %>  >

    <%= entry_checkbox 'user',t.id %>

    <%= t.editor? ? '' : link_to(theme_image_tag('icons/actions/edit.gif'), :action => 'edit', :path => [ t.id, @segment ? @segment.id : nil ].compact) %>

    <%= image = t.image ? t.image.image_tag(:icon) : ''
        t.editor? ? image : link_to(image,user_url)
    %>

    <%= t.editor? ? h(t.name) : link_to(t.name, user_url) %>

    <%= email = t.email.blank? ? 'No Email'.t : t.email
        t.editor? ? h(email) : link_to(email, user_url)
    %>

  <% if @fields -%>
    <% @fields.each do |field| -%>
      <%=
          info = UserSegment::FieldHandler.display_fields[field.to_sym]
          next unless info
          value = info[:handler].field_output(t, @handlers_data[info[:handler].to_s], field.to_sym)
          "#{value}	"
      %>
    <% end -%>
  <% end -%>

<% end -%>

<%
   segment_action = @segment && @segment.segment_type == 'custom' ? ['Remove Users from List', 'remove_users'] : ['Add Users to List','js','MemberEditor.addUsersToList();']

   active_table_for :email_targets_table, @active_table_output,
                    :refresh_url => url_for(:action => 'display_targets_table', :path => @segment ? @segment.id : nil, :terms => @search.terms, :offsets => @search.offsets.empty? ? nil : @search.offsets),
                    :class => 'active_table',
                    :width => '100%',
                    :next => @search.user_segment && @search.terms ? 'more' : '>',
                    :actions => [['Add Tags','js','MemberEditor.addTags();'],
                                 ['Remove Tags','js','MemberEditor.removeTags();'],
                                 segment_action
                                ],
                    :more_actions => [['Delete Targets','delete','Delete the selected users?']],
                    :update => 'targets_table' do |t| %>
<% user_url = url_for(:action => 'view',  :path => [ t.id, @segment.id ]) %>
<tr <%= highlight_row "user",t.id %>  >

    <%= entry_checkbox 'user',t.id %>

    <%= t.editor? ? '' : link_to(theme_image_tag('icons/actions/edit.gif'), :action => 'edit', :path => [ t.id, @segment.id ]) %>

    <%= image = t.image ? t.image.image_tag(:icon) : ''
        t.editor? ? image : link_to(image,user_url)
    %>

    <%= t.editor? ? h(t.name) : link_to(t.name, user_url) %>

    <%= email = t.email.blank? ? 'No Email'.t : t.email
        t.editor? ? h(email) : link_to(email, user_url)
    %>

  <% if @fields -%>
    <% @fields.each do |field| -%>
      <%=
          info = UserSegment::FieldHandler.display_fields[field.to_sym]
          next unless info
          value = info[:handler].field_output(t, @handlers_data[info[:handler].to_s], field.to_sym)
          "#{value}	"
      %>
    <% end -%>
  <% end -%>

<% end -%>


- Intergrated patch from ticket #15909 by kopia robocza.

git-svn-id: c56bb3f9cb1c9468aec8fd62c717d587012de106@190 1e8d30c7-b1cd-4b0d-952e-12ddc4cacc65

<%
  @page_title = 'Overview'
  @tabbed_navigation_items = project_tabbed_navigation(0)
  @bread_crumbs = project_crumbs("Overview")

  @page_actions = []

  if ProjectMessage.can_be_created_by(@logged_user, @active_project)
    @page_actions << {:title =>'Add message', :url=> "/project/#{@active_project.id}/message/add"}
  end

  if ProjectTaskList.can_be_created_by(@logged_user, @active_project)
    @page_actions << {:title =>'Add task list', :url=> "/project/#{@active_project.id}/task/add_list"}
  end

  if ProjectMilestone.can_be_created_by(@logged_user, @active_project)
    @page_actions << {:title =>'Add milestone', :url=> "/project/#{@active_project.id}/milestone/add"}
  end

  if ProjectFile.can_be_created_by(@logged_user, @active_project)
    @page_actions << {:title =>'Add file', :url=> "/project/#{@active_project.id}/files/add_file"}
  end

  @additional_stylesheets = ['project/project_log', 'application_logs']
%>
<% if @active_project.description.chop and @active_project.show_description_in_overview %>

<%= h @active_project.name %>

<%= textilize @active_project.description %>

<% end %>

<% if @late_milestones.length > 0 || @today_milestones.length > 0 || @upcomming_milestones.length > 0 %>

<%= "Milestones" %>

<% end %>

<% if @late_milestones.length > 0 || @today_milestones.length > 0 %>

<%= "Late milestones" %> / <%= "Todays milestones" %>

<% @late_milestones.each do |late_milestone| -%>
<% if not late_milestone.assigned_to.nil? %>

<%= h late_milestone.assigned_to.object_name %>: <%= link_to (h late_milestone.name), :controller => 'milestone', :action => 'view', :id => late_milestone.id %> (<%= format_usertime(late_milestone.due_date, "%A, %d %B") %> - <%= "#{late_milestone.days_late} days late" %>)

<% else %>

<%= link_to (h late_milestone.name), :controller => 'milestone', :action => 'view', :id => late_milestone.id %> (<%= format_usertime(late_milestone.due_date, "%A, %d %B") %> - <%= "#{late_milestone.days_late} days late" %>)

<% end %>
<% end %>

<% @today_milestones.each do |today_milestone| -%>
<% if not today_milestone.assigned_to.nil? %>

<%= h today_milestone.assigned_to.object_name %>: <%= link_to (h today_milestone.name), :controller => 'milestone', :action => 'view', :id => today_milestone.id %> (<%= "Today" %>)

<% else %>

<%= link_to (h today_milestone.name), :controller => 'milestone', :action => 'view', :id => today_milestone.id %> (<%= "Today" %>)

<% end %>
<% end %>

<% end %>

<% if @upcomming_milestones.length > 0 %>

<%= "Upcomming milestones" %>

<% @upcomming_milestones.each do |upcomming_milestone| -%>

<% if upcomming_milestone.days_left <= 30 %>

<% if not upcomming_milestone.assigned_to.nil? %>

<%= h upcomming_milestone.assigned_to.object_name %>: <%= link_to (h upcomming_milestone.name), :controller => 'milestone', :action => 'view', :id => upcomming_milestone.id %> (<%= format_usertime(upcomming_milestone.due_date, "%A, %d %B") %> - <%= "#{upcomming_milestones.days_late} days left" %>)

<% else %>

<%= link_to (h upcomming_milestone.name), :controller => 'milestone', :action => 'view', :id => upcomming_milestone.id %> (<%= format_usertime(upcomming_milestone.due_date, "%A, %d %B") %> - <%= "#{upcomming_milestone.days_left} days left" %>)

<% end %>

<% else %>

<%= link_to "» Show all #{@upcomming_milestones.length} upcomming milestones", :controller => 'milestone', :action => 'index', :active_project => @active_project.id %>

<% break %>
<% end %>

<% end %>

<% end %>

<%= "Recent activities" %>

<% cache "user#{@logged_user.id}_#{@active_project.id}_dblog" do %>
<% if @project_log_entries.length > 0 %>

    <%= "Details" %>
    <%= "Date" %>

	<%= render :partial => 'layouts/application_logs', :collection => @project_log_entries, :locals => {:show_project_column => false} %>

<% else %>
No recent activities
<% end %>
<% end %>

<%
  @page_title = 'Overview'
  @tabbed_navigation_items = project_tabbed_navigation(0)
  @bread_crumbs = project_crumbs("Overview")

  @page_actions = []

  if ProjectMessage.can_be_created_by(@logged_user, @active_project)
    @page_actions << {:title =>'Add message', :url=> "/project/#{@active_project.id}/message/add"}
  end

  if ProjectTaskList.can_be_created_by(@logged_user, @active_project)
    @page_actions << {:title =>'Add task list', :url=> "/project/#{@active_project.id}/task/add_list"}
  end

  if ProjectMilestone.can_be_created_by(@logged_user, @active_project)
    @page_actions << {:title =>'Add milestone', :url=> "/project/#{@active_project.id}/milestone/add"}
  end

  if ProjectFile.can_be_created_by(@logged_user, @active_project)
    @page_actions << {:title =>'Add file', :url=> '/project/#{@active_project.id}/files/add'}
  end

  @additional_stylesheets = ['project/project_log', 'application_logs']
%>
<% if @active_project.description.chop and @active_project.show_description_in_overview %>

<%= h @active_project.name %>

<%= textilize @active_project.description %>

<% end %>

<% if @late_milestones.length > 0 || @today_milestones.length > 0 || @upcomming_milestones.length > 0 %>

<%= "Milestones" %>

<% end %>

<% if @late_milestones.length > 0 || @today_milestones.length > 0 %>

<%= "Late milestones" %> / <%= "Todays milestones" %>

<% @late_milestones.each do |late_milestone| -%>
<% if not late_milestone.assigned_to.nil? %>

<%= h late_milestone.assigned_to.object_name %>: <%= link_to (h late_milestone.name), :controller => 'milestone', :action => 'view', :id => late_milestone.id %> (<%= format_usertime(late_milestone.due_date, "%A, %d %B") %> - <%= "#{late_milestone.days_late} days late" %>)

<% else %>

<%= link_to (h late_milestone.name), :controller => 'milestone', :action => 'view', :id => late_milestone.id %> (<%= format_usertime(late_milestone.due_date, "%A, %d %B") %> - <%= "#{late_milestone.days_late} days late" %>)

<% end %>
<% end %>

<% @today_milestones.each do |today_milestone| -%>
<% if not today_milestone.assigned_to.nil? %>

<%= h today_milestone.assigned_to.object_name %>: <%= link_to (h today_milestone.name), :controller => 'milestone', :action => 'view', :id => today_milestone.id %> (<%= "Today" %>)

<% else %>

<%= link_to (h today_milestone.name), :controller => 'milestone', :action => 'view', :id => today_milestone.id %> (<%= "Today" %>)

<% end %>
<% end %>

<% end %>

<% if @upcomming_milestones.length > 0 %>

<%= "Upcomming milestones" %>

<% @upcomming_milestones.each do |upcomming_milestone| -%>

<% if upcomming_milestone.days_left <= 30 %>

<% if not upcomming_milestone.assigned_to.nil? %>

<%= h upcomming_milestone.assigned_to.object_name %>: <%= link_to (h upcomming_milestone.name), :controller => 'milestone', :action => 'view', :id => upcomming_milestone.id %> (<%= format_usertime(upcomming_milestone.due_date, "%A, %d %B") %> - <%= "#{upcomming_milestones.days_late} days left" %>)

<% else %>

<%= link_to (h upcomming_milestone.name), :controller => 'milestone', :action => 'view', :id => upcomming_milestone.id %> (<%= format_usertime(upcomming_milestone.due_date, "%A, %d %B") %> - <%= "#{upcomming_milestone.days_left} days left" %>)

<% end %>

<% else %>

<%= link_to "» Show all #{@upcomming_milestones.length} upcomming milestones", :controller => 'milestone', :action => 'index', :active_project => @active_project.id %>

<% break %>
<% end %>

<% end %>

<% end %>

<%= "Recent activities" %>

<% cache "user#{@logged_user.id}_#{@active_project.id}_dblog" do %>
<% if @project_log_entries.length > 0 %>

    <%= "Details" %>
    <%= "Date" %>

	<%= render :partial => 'layouts/application_logs', :collection => @project_log_entries, :locals => {:show_project_column => false} %>

<% else %>
No recent activities
<% end %>
<% end %>


Make it clear to somebody reading this FAQ out of context that we encourage people to use real names.

<% @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 made 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?

Yes, you can (although we encourage you to use your real name,
see the question just above). 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.  Saying that, you can avoid the problem
by simply making your pseudonym look like a real person's name, as there is no
general obligation to prove your identity.

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."

FOI officer questions

Why are you publishing responses to FOI requests?

Freedom of Information responses contain public information, which anybody could
easily request again from the public authority. Therefore,
there is no reason they shouldn't be published on the Internet. There are lots
of benefits - everything from preventing duplicate requests, to getting the public
more involved and interested in the work of government.

Are the people making requests real people?

Yes. This website is a service to help ordinary members of the public
make FOI requests, and easily track the responses. The people are real
people, for whom we have a verified email address unique to each person.

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.

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 of copyright law, 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.

<% @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 made 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?

Yes, you can. It is good practice for the public authority to reply to such
a 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.
Saying that, you can avoid the problem by simply making your pseudonym look like a real person's name,
as there is no general obligation to prove your identity.

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."

FOI officer questions

Why are you publishing responses to FOI requests?

Freedom of Information responses contain public information, which anybody could
easily request again from the public authority. Therefore,
there is no reason they shouldn't be published on the Internet. There are lots
of benefits - everything from preventing duplicate requests, to getting the public
more involved and interested in the work of government.

Are the people making requests real people?

Yes. This website is a service to help ordinary members of the public
make FOI requests, and easily track the responses. The people are real
people, for whom we have a verified email address unique to each person.

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.

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 of copyright law, 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.


Changed label from Destroy to delete to make it with consistent with naming used in the system

git-svn-id: f67d969b640da65cb7bc1d229e09fd6d2db44ae1@439 392d7b7b-3f31-0410-9dc3-c95a9635ea79

Roles

    Name	Description	Created At
    Updated At

<% for role in @roles %>

    <%= link_to role.name, :action => 'show', :id => role %>
    <%= role.description %>
    <%= role.created_at.to_s(:short) %>
    <%= role.updated_at.to_s(:short) %>

<% end %>

<%= link_to 'New role', :action => 'new' %>


ActionItem928: more objective and visible text

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<%= html_language %>" lang="<%= html_language %>">

  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <%=
      stylesheet_import( %w( media_listing button ) ) + "\n" +
      stylesheet_import( %w( media_listing button ), :themed_source => true )
  %>
  <%= javascript_include_tag :defaults %>
  <%= javascript_include_tag 'lowpro' %>
  <%= stylesheet_link_tag '/designs/icons/default/style.css' %>

<%= _('Images') %>

      <%= select_folder('folder', 'image_folder_id', @image_folders, {}, :onchange => remote_function(:with => "'image_folder_id=' + value + '&ipage=1'", :url => { :action => :media_listing, :format => 'js' }) ) %>
      <%= render :partial => 'image_thumb', :locals => { :images => @images } %>

<%= _('Documents') %>

      <%= select_folder('folder', 'document_folder_id', @document_folders, {}, :onchange => remote_function(:with => "'document_folder_id=' + value + '&dpage=1'", :url => { :action => :media_listing }) ) %>
      <%= render :partial => 'document_link', :locals => { :documents => @documents } %>

<big><%= _('Drag images and documents to add them to the text.') %></big>

      <% unless flash[:notice].nil? %>
        <%= flash[:notice] unless flash[:notice].nil? %>
        <%= javascript_tag(visual_effect( :appear, 'notice')) %>
      <% end %>

    <% form_for('uploaded_file', :url => {:action => 'upload_files'}, :html => {:multipart => true}) do |f| %>
      <%= hidden_field_tag('back_to', @back_to) %>
      <%= render :partial => 'upload_file_form', :locals => { :size => '30' } %>
    <% end %>

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<%= html_language %>" lang="<%= html_language %>">

  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <%=
      stylesheet_import( %w( media_listing button ) ) + "\n" +
      stylesheet_import( %w( media_listing button ), :themed_source => true )
  %>
  <%= javascript_include_tag :defaults %>
  <%= javascript_include_tag 'lowpro' %>
  <%= stylesheet_link_tag '/designs/icons/default/style.css' %>

<%= _('Images') %>

      <%= select_folder('folder', 'image_folder_id', @image_folders, {}, :onchange => remote_function(:with => "'image_folder_id=' + value + '&ipage=1'", :url => { :action => :media_listing, :format => 'js' }) ) %>
      <%= render :partial => 'image_thumb', :locals => { :images => @images } %>

<%= _('Documents') %>

      <%= select_folder('folder', 'document_folder_id', @document_folders, {}, :onchange => remote_function(:with => "'document_folder_id=' + value + '&dpage=1'", :url => { :action => :media_listing }) ) %>
      <%= render :partial => 'document_link', :locals => { :documents => @documents } %>

<%= _('If you want to add images or links to files in your article, click on the file you want, drag it to the text area and drop the file.') %>

      <% unless flash[:notice].nil? %>
        <%= flash[:notice] unless flash[:notice].nil? %>
        <%= javascript_tag(visual_effect( :appear, 'notice')) %>
      <% end %>

    <% form_for('uploaded_file', :url => {:action => 'upload_files'}, :html => {:multipart => true}) do |f| %>
      <%= hidden_field_tag('back_to', @back_to) %>
      <%= render :partial => 'upload_file_form', :locals => { :size => '30' } %>
    <% end %>


ActionItem85: fixed a bug with my enterprises views

git-svn-id: 43659daf80e124e0b603d67096418e58e4f21099@774 3f533792-8f58-4932-b0fe-aaf55b0a4547

<%= _('Listing memberships')%>

<% form_tag 'membership_editor/search' do %>
  <%= _('Search') %> <%= text_field_tag 'query' %>
<% end %>

<% @memberships.each do |m|%>

    <%= link_to_homepage m.name, m.identifier %>
    <%= link_to_myprofile  _('Manage') , {:controller => 'profile_editor'}, m.identifier %>

<% end %>

<%= link_to _('New enterprise'), :action => 'new_enterprise' %>

<%= _('Listing memberships')%>

<% form_tag 'membership_editor/search' do %>
  <%= _('Search') %> <%= text_field_tag 'query' %>
<% end %>

<% @memberships.each do |m|%>

    <%= link_to_homepage m.name, m.identifier %>
    <%= link_to_myprofile  _('Manage') , {}, m.identifier %>

<% end %>

<%= link_to _('New enterprise'), :action => 'new_enterprise' %>


input validation more relaxed

input validation more relaxed

<% begin %><% require './macports' %><% message="" %><%
cgi = CGI.new
if cgi['portname']!=''
  portname = cgi['portname']
  if portname=~/[\\\/]/ or portname=~/\.\./
    puts '<blink>evil haXX0r alert</blink>'
  else
    portname = portname.clone.untaint
    pi = MacPorts::PortIndex.new
    pi.dotpath = "/opt/local/bin"
    if pi.port(portname).nil?
      puts 'no such port'
    else
      graph = pi.dep_graph(portname)
      fn = '/tmp/mp-depgrapher'+Process.pid.to_s+Time.now.to_i.to_s+portname+'.png'
      graph.output(:output=>'png', :file=>fn)
      #puts "
graph has been created"
      cgi.out('Content-Type'=> 'image/png'){ File.open(fn){|f| f.read} }
    end
  end
else
%>

<title>macports dependency grapher</title>

<form method="get" action="index.rhtml">
    Portname: <input name="portname" size="20" type="text" value="" />
    <input type="submit" value="Graph"/>
</form>

<%= message %>

<% end %>

<%rescue Exception=>ex
puts "
#{ex.class}: #{ex}
"
puts ex.backtrace.join('
')

puts "
"+$LOAD_PATH.join('
')
end%>

<% begin %><% require './macports' %><% message="" %><%
cgi = CGI.new
if cgi['portname']!=''
  portname = cgi['portname']
  if portname=~/[\\\/\.]/
    puts '<blink>evil haXX0r alert</blink>'
  else
    portname = portname.clone.untaint
    pi = MacPorts::PortIndex.new
    pi.dotpath = "/opt/local/bin"
    if pi.port(portname).nil?
      puts 'no such port'
    else
      graph = pi.dep_graph(portname)
      fn = '/tmp/mp-depgrapher'+Process.pid.to_s+Time.now.to_i.to_s+portname+'.png'
      graph.output(:output=>'png', :file=>fn)
      #puts "
graph has been created"
      cgi.out('Content-Type'=> 'image/png'){ File.open(fn){|f| f.read} }
    end
  end
else
%>

<title>macports dependency grapher</title>

<form method="get" action="index.rhtml">
    Portname: <input name="portname" size="20" type="text" value="" />
    <input type="submit" value="Graph"/>
</form>

<%= message %>

<% end %>

<%rescue Exception=>ex
puts "
#{ex.class}: #{ex}
"
puts ex.backtrace.join('
')

puts "
"+$LOAD_PATH.join('
')
end%>


added css styles for contextmenu

added css styles for contextmenu

<% context_menu_js = capture do %>
	var context_menu_one = new Control.ContextMenu('container_one');
	context_menu_one.addItem({
		label: 'Left Image, Item 1',
		callback: function(){
			log('Left Image, item one picked.');
		}
	});
	context_menu_one.addItem({
		label: 'Left Image, Item 2',
		callback: function(){
			log('Left Image, item two picked.');
		}
	});

	var context_menu_two = new Control.ContextMenu('container_two',{
		leftClick: true
	});
	context_menu_two.addItem({
		label: 'Right Image, Item 1',
		callback: function(){
			log('Right Image, item one picked.');
		}
	});
	context_menu_two.addItem({
		label: 'Right Image, Item 2',
		callback: function(){
			log('Right Image, item two picked.');
		},
		enabled: false
	});
	context_menu_two.addItem({
		label: function(){
			//return value can be modified to reflect application state
			return 'Right Image, Item 3';
		},
		condition: function(){
			return $('show_third_item').checked;
		},
		callback: function(){
			log('Right Image, item three picked.');
		}
	});

<% end %>
<% context_menu_css = capture do %>
	#control_contextmenu {
		border:1px solid #666;
		background-color:#eee;
		min-width:150px;
	}

	#control_contextmenu ul {
		list-style:none;
		padding:0;
		margin:0;
		cursor:pointer;
	}

	#control_contextmenu ul li {
		text-align:left;
		padding:3px 10px 3px 5px;
		margin:0;
		cursor:pointer;
		font-family:"Lucida Grande",Verdana;
		text-decoration:none;
		color:#333;
		font-size:12px;
		font-weight:bold;
		border-top:1px solid #fff;
		border-left:1px solid #fff;
		border-bottom:1px solid #999;
		border-right:1px solid #999;
	}

	#control_contextmenu ul li.selected,
	#control_contextmenu ul li:hover {
		color:#fff;
		background-color:#3875d7;
		cursor:pointer;
	}

	#control_contextmenu ul li.selected:hover {
		color:#333;
		background-color:#eee;
		cursor:pointer;
	}

	#control_contextmenu ul li.disabled,
	#control_contextmenu ul li:hover.disabled {
		background-color: #eee;
		color:#999;
		cursor:pointer;
	}
<% end %>

<% content_for :head do %>

<% end %>

<%= header 'Control.ContextMenu' %>
<%= introduction 'Pure JavaScript/CSS contextual menus for Prototype.' %>
<% @title = 'Control.ContextMenu : Pure JavaScript/CSS contextual menus for Prototype' %>

<% tabs 'main_tabs' do |tabs| %>
	<% tabs.tab 'tutorial', 'Tutorial' %>
	<% tabs.tab 'api', 'API' %>
	<% tabs.source 'http://github.com/saucytiger/livepipe-ui/tree/master/src/contextmenu.js' %>
<% end %>

<% section 'tutorial' do %>
	<% paragraph 'Introduction' do %>Control.ContextMenu provides a simple API for programming contextual menus with Prototype. You can attach a context menu to the entire document or any Element. Menus can be triggered via a right click (default), or left click.<% end %>

Right Click on Image

Left Click on Image

Show third menu item? <input id="show_third_item" type="checkbox"/>

	<%= subhead 'Consoleclear', :border => false %>
	<textarea id="text_console" readonly="true"></textarea>

	<% paragraph 'Adding Context: Conditional Menu Items & Labels' do %>You can modify the contents of the label by passing a function that returns a string into the label option instead of string. This function will be called each time the menu is opened. An optional condition function option can be used as well. If this condition returns false, the menu item will not appear in the menu. If no items meet the condition checks, the menu will not open. You can also pass an enabled parameter, that can be a boolean or a function that returns a boolean. If enabled returns false, a class name of "disabled" will be added to the menu item.<% end %>

	<% javascript 'JavaScript' do %><%= context_menu_js %><% end %>

	<% css 'CSS' do %><%= context_menu_css %><% end %>
<% end %>

<% section 'api' do %>
	<% paragraph 'DOM Modifications' do %>Control.ContextMenu.load() will insert a div#control_contextmenu as a child of document.body.<% end %>
	<% api_table 'Class' do |api| %>
		<% api.item :returns => 'null', :signature => 'load([bool capture_all])', :description => 'capture_all defaults to false, and will stop all context menu events if true. If you want to capture_all you must explicitly call load before creating any Control.ContextMenu instances.' %>
		<% api.item :returns => 'null', :signature => 'enable()', :description => 'Called by load()' %>
		<% api.item :returns => 'null', :signature => 'disable()', :description => '' %>
		<% api.item :returns => 'array', :signature => 'menus', :description => '' %>
		<% api.item :returns => 'mixed', :signature => 'current', :description => 'Returns false or open Control.ContextMenu instance.' %>
		<% api.item :returns => 'bool', :signature => 'enabled', :description => '' %>
		<% api.item :returns => 'number', :signature => 'offset', :description => 'Defaults to 4. How many pixels from the edge of the screen the menu can be positioned.' %>
	<% end %>
	<% api_table 'Instance' do |api| %>
		<% api.item :returns => 'Control.ContextMenu', :signature => 'initialize(Element container [,Hash options])', :description => 'container is the element that the ContextMenu is attached to.' %>
		<% api.item :returns => 'Control.ContextMenu', :signature => 'addItem(Hash item)', :description => 'See Item Hash below. Returns "this", for chaining.' %>
		<% api.item :returns => 'bool', :signature => 'open(Event)', :description => 'To manually open the menu you must pass a mouse event.' %>
		<% api.item :returns => 'bool', :signature => 'close([Event])', :description => '' %>
		<% api.item :returns => 'null', :signature => 'destroy()', :description => '' %>
	<% end %>
	<% section 'item_hash' do %>
		<% api_table 'Item Hash Structure','Type','Key','Description' do |api| %>
			<% api.item :type => 'bool', :key => 'enabled', :description => 'Wether the menu item is enabled. Defaults to true. Can be a function that returns bool.' %>
			<% api.item :type => 'string', :key => 'label', :description => 'Text that will appear in the menu. Can be a function that returns a string.' %>
			<% api.item :type => 'function', :key => 'callback', :description => 'Will be called when the menu item is selected.' %>
			<% api.item :type => 'function', :key => 'condition', :description => 'Optional condition that will be called each time the menu is opened to see if the item will be included in the menu.' %>
		<% end %>
	<% end %>
	<% options_table 'Options' do |options| %>
		<% options.item :type => 'bool', :name => 'leftClick', :default => 'false', :description => 'Will open the context menu with a left click, instead of right click.' %>
		<% options.item :type => 'bool', :name => 'disableOnShiftKey', :default => 'true', :description => 'Allows browser context menu to open if shift key is pressed.' %>
		<% options.item :type => 'bool', :name => 'disableOnAltKey', :default => 'true', :description => 'Allows browser context menu to open if alt key is pressed.' %>
		<% options.item :type => 'string', :name => 'selectedClassName', :default => "'selected'", :description => '' %>
		<% options.item :type => 'string', :name => 'activatedClassName', :default => "'activated'", :description => 'Added to the menu item once it has been selected, not toggled during animation.' %>
		<% options.item :type => 'bool', :name => 'animation', :default => 'true', :description => 'Toggles selectedClassName animationCycles * 2 times over animationLength.' %>
		<% options.item :type => 'number', :name => 'animationCycles', :default => '2', :description => '' %>
		<% options.item :type => 'number', :name => 'animationLength', :default => '300', :description => 'Length of animationCycles combined in milliseconds.' %>
		<% options.item :type => 'bool', :name => 'delayCallback', :default => 'true', :description => 'Wether to call the callback immediately, or after the animation is complete.' %>
	<% end %>
	<% events_table 'Events' do |events| %>
		<% events.item :signature => 'beforeOpen()', :description => 'Throwing $break inside an observer will prevent the menu from opening.' %>
		<% events.item :signature => 'afterOpen()', :description => '' %>
		<% events.item :signature => 'beforeClose()', :description => 'Throwing $break inside an observer will prevent the menu from closing.' %>
		<% events.item :signature => 'afterClose()', :description => '' %>
	<% end %>
<% end %>

<% context_menu_js = capture do %>
	var context_menu_one = new Control.ContextMenu('container_one');
	context_menu_one.addItem({
		label: 'Left Image, Item 1',
		callback: function(){
			log('Left Image, item one picked.');
		}
	});
	context_menu_one.addItem({
		label: 'Left Image, Item 2',
		callback: function(){
			log('Left Image, item two picked.');
		}
	});

	var context_menu_two = new Control.ContextMenu('container_two',{
		leftClick: true
	});
	context_menu_two.addItem({
		label: 'Right Image, Item 1',
		callback: function(){
			log('Right Image, item one picked.');
		}
	});
	context_menu_two.addItem({
		label: 'Right Image, Item 2',
		callback: function(){
			log('Right Image, item two picked.');
		}
	});
	context_menu_two.addItem({
		label: function(){
			//return value can be modified to reflect application state
			return 'Right Image, Item 3';
		},
		condition: function(){
			return $('show_third_item').checked;
		},
		callback: function(){
			log('Right Image, item three picked.');
		}
	});

<% end %>
<% context_menu_css = capture do %>
	#control_contextmenu {
		border:1px solid #666;
		background-color:#eee;
		min-width:150px;
	}

	#control_contextmenu ul {
		list-style:none;
		padding:0;
		margin:0;
		cursor:hand;
	}

	#control_contextmenu ul li {
		text-align:left;
		padding:3px 10px 3px 5px;
		margin:0;
		cursor:pointer;
		cursor:hand;
		font-family:"Lucida Grande",Verdana;
		text-decoration:none;
		color:#333;
		font-size:12px;
		font-weight:bold;
		border-top:1px solid #fff;
		border-left:1px solid #fff;
		border-bottom:1px solid #999;
		border-right:1px solid #999;
	}

	#control_contextmenu ul li.selected,
	#control_contextmenu ul li:hover {
		color:#fff;
		background-color:#3875d7;
		cursor:hand;
	}

	#control_contextmenu ul li.selected:hover {
		color:#333;
		background-color:#eee;
		cursor:hand;
	}
<% end %>

<% content_for :head do %>

<% end %>

<%= header 'Control.ContextMenu' %>
<%= introduction 'Pure JavaScript/CSS contextual menus for Prototype.' %>
<% @title = 'Control.ContextMenu : Pure JavaScript/CSS contextual menus for Prototype' %>

<% tabs 'main_tabs' do |tabs| %>
	<% tabs.tab 'tutorial', 'Tutorial' %>
	<% tabs.tab 'api', 'API' %>
	<% tabs.source 'http://github.com/saucytiger/livepipe-ui/tree/master/src/contextmenu.js' %>
<% end %>

<% section 'tutorial' do %>
	<% paragraph 'Introduction' do %>Control.ContextMenu provides a simple API for programming contextual menus with Prototype. You can attach a context menu to the entire document or any Element. Menus can be triggered via a right click (default), or left click.<% end %>

Right Click on Image

Left Click on Image

Show third menu item? <input id="show_third_item" type="checkbox"/>

	<%= subhead 'Consoleclear', :border => false %>
	<textarea id="text_console" readonly="true"></textarea>

	<% paragraph 'Adding Context: Conditional Menu Items & Labels' do %>You can modify the contents of the label by passing a function that returns a string into the label option instead of string. This function will be called each time the menu is opened. An optional condition function option can be used as well. If this condition returns false, the menu item will not appear in the menu. If no items meet the condition checks, the menu will not open. You can also pass an enabled parameter, that can be a boolean or a function that returns a boolean. If enabled returns false, a class name of "disabled" will be added to the menu item.<% end %>

	<% javascript 'JavaScript' do %><%= context_menu_js %><% end %>

	<% css 'CSS' do %><%= context_menu_css %><% end %>
<% end %>

<% section 'api' do %>
	<% paragraph 'DOM Modifications' do %>Control.ContextMenu.load() will insert a div#control_contextmenu as a child of document.body.<% end %>
	<% api_table 'Class' do |api| %>
		<% api.item :returns => 'null', :signature => 'load([bool capture_all])', :description => 'capture_all defaults to false, and will stop all context menu events if true. If you want to capture_all you must explicitly call load before creating any Control.ContextMenu instances.' %>
		<% api.item :returns => 'null', :signature => 'enable()', :description => 'Called by load()' %>
		<% api.item :returns => 'null', :signature => 'disable()', :description => '' %>
		<% api.item :returns => 'array', :signature => 'menus', :description => '' %>
		<% api.item :returns => 'mixed', :signature => 'current', :description => 'Returns false or open Control.ContextMenu instance.' %>
		<% api.item :returns => 'bool', :signature => 'enabled', :description => '' %>
		<% api.item :returns => 'number', :signature => 'offset', :description => 'Defaults to 4. How many pixels from the edge of the screen the menu can be positioned.' %>
	<% end %>
	<% api_table 'Instance' do |api| %>
		<% api.item :returns => 'Control.ContextMenu', :signature => 'initialize(Element container [,Hash options])', :description => 'container is the element that the ContextMenu is attached to.' %>
		<% api.item :returns => 'Control.ContextMenu', :signature => 'addItem(Hash item)', :description => 'See Item Hash below. Returns "this", for chaining.' %>
		<% api.item :returns => 'bool', :signature => 'open(Event)', :description => 'To manually open the menu you must pass a mouse event.' %>
		<% api.item :returns => 'bool', :signature => 'close([Event])', :description => '' %>
		<% api.item :returns => 'null', :signature => 'destroy()', :description => '' %>
	<% end %>
	<% section 'item_hash' do %>
		<% api_table 'Item Hash Structure','Type','Key','Description' do |api| %>
			<% api.item :type => 'bool', :key => 'enabled', :description => 'Wether the menu item is enabled. Defaults to true. Can be a function that returns bool.' %>
			<% api.item :type => 'string', :key => 'label', :description => 'Text that will appear in the menu. Can be a function that returns a string.' %>
			<% api.item :type => 'function', :key => 'callback', :description => 'Will be called when the menu item is selected.' %>
			<% api.item :type => 'function', :key => 'condition', :description => 'Optional condition that will be called each time the menu is opened to see if the item will be included in the menu.' %>
		<% end %>
	<% end %>
	<% options_table 'Options' do |options| %>
		<% options.item :type => 'bool', :name => 'leftClick', :default => 'false', :description => 'Will open the context menu with a left click, instead of right click.' %>
		<% options.item :type => 'bool', :name => 'disableOnShiftKey', :default => 'true', :description => 'Allows browser context menu to open if shift key is pressed.' %>
		<% options.item :type => 'bool', :name => 'disableOnAltKey', :default => 'true', :description => 'Allows browser context menu to open if alt key is pressed.' %>
		<% options.item :type => 'string', :name => 'selectedClassName', :default => "'selected'", :description => '' %>
		<% options.item :type => 'string', :name => 'activatedClassName', :default => "'activated'", :description => 'Added to the menu item once it has been selected, not toggled during animation.' %>
		<% options.item :type => 'bool', :name => 'animation', :default => 'true', :description => 'Toggles selectedClassName animationCycles * 2 times over animationLength.' %>
		<% options.item :type => 'number', :name => 'animationCycles', :default => '2', :description => '' %>
		<% options.item :type => 'number', :name => 'animationLength', :default => '300', :description => 'Length of animationCycles combined in milliseconds.' %>
		<% options.item :type => 'bool', :name => 'delayCallback', :default => 'true', :description => 'Wether to call the callback immediately, or after the animation is complete.' %>
	<% end %>
	<% events_table 'Events' do |events| %>
		<% events.item :signature => 'beforeOpen()', :description => 'Throwing $break inside an observer will prevent the menu from opening.' %>
		<% events.item :signature => 'afterOpen()', :description => '' %>
		<% events.item :signature => 'beforeClose()', :description => 'Throwing $break inside an observer will prevent the menu from closing.' %>
		<% events.item :signature => 'afterClose()', :description => '' %>
	<% end %>
<% end %>


better comments

better comments

<% # Can actually be probably used for other service types than full text.
   # But anyway, displays a typical full text element in typical markup.
   # pass in a ServiceType object for the response as :object

   #optional argument, :locals =>
   #    :li_class => class to add to

   #    :show_source => default false, if true display the source of the link
   li_class ||= "fulltextlink"
   show_source ||= false

   # passed in in :object or :collection
   view_data = fulltext_element.view_data
%>

<li class="<%= li_class %>">

  <% if view_data[:link_supports_ajax_call] && ! generating_embed_partials?
  # Generate a hyperlink that will call our standard service action
  # link with format=>js in a javascript context. With fallback to straight
  # html on the href. Weird that Rails doesn't do this fallback for us.
  %>
      <%= link_to_remote(view_data[:display_text],
      :url=> {:controller=>'link_router',
              :id=>fulltext_element.id,
              :format => "js"},
     :html=> {:id => "svctype_link_#{fulltext_element.id}",
              :href => url_for(:controller=>'link_router',
                               :id=>fulltext_element.id,
                               :format => "html"),
              :target => "_blank" }) %>
  <% else
    # Ordinary href link.
  %>
    <%= link_to view_data[:display_text], {:controller=>'link_router', :id=>fulltext_element.id}, 'target'=>"_blank", 'id' => "svctype_link_#{fulltext_element.id}" %>
  <% end %>

<% if show_source %>

from <%= view_data[:source] || fulltext_element.service_response.service.display_name %>

<% end %>

<% unless view_data[:coverage].blank? %>

  <%= view_data[:coverage] %>

<% end
%>
<% unless view_data[:notes].blank? %>

<%= view_data[:notes] %>

<% end %>
<% unless view_data[:authentication].blank? %>

Authentication: <%= view_data[:authentication] %>

<% end %>

<% if (!view_data[:match_reliability].blank?) && view_data[:match_reliability] != ServiceResponse::MatchExact %>

    Edition information <%= view_data[:edition_str] %>

<% end %>

  Debug info: <%= fulltext_element.service_response.service.id %>

  <% unless view_data[:debug_info].blank? %>
    ; <%= view_data[:debug_info] %>
  <% end %>

<% # Can actually be probably used for other service types than full text.
   # But anyway, displays a typical full text element in typical markup.
   # pass in a ServiceType object for the response as :object

   #optional argument, :locals => {:li_class => 'whatever'}
   li_class ||= "fulltextlink"
   show_source ||= false

   # passed in in :object or :collection
   view_data = fulltext_element.view_data
%>

<li class="<%= li_class %>">

  <% if view_data[:link_supports_ajax_call] && ! generating_embed_partials?
  # Generate a hyperlink that will call our standard service action
  # link with format=>js in a javascript context. With fallback to straight
  # html on the href. Weird that Rails doesn't do this fallback for us.
  %>
      <%= link_to_remote(view_data[:display_text],
      :url=> {:controller=>'link_router',
              :id=>fulltext_element.id,
              :format => "js"},
     :html=> {:id => "svctype_link_#{fulltext_element.id}",
              :href => url_for(:controller=>'link_router',
                               :id=>fulltext_element.id,
                               :format => "html"),
              :target => "_blank" }) %>
  <% else
    # Ordinary href link.
  %>
    <%= link_to view_data[:display_text], {:controller=>'link_router', :id=>fulltext_element.id}, 'target'=>"_blank", 'id' => "svctype_link_#{fulltext_element.id}" %>
  <% end %>

<% if show_source %>

from <%= view_data[:source] || fulltext_element.service_response.service.display_name %>

<% end %>

<% unless view_data[:coverage].blank? %>

  <%= view_data[:coverage] %>

<% end
%>
<% unless view_data[:notes].blank? %>

<%= view_data[:notes] %>

<% end %>
<% unless view_data[:authentication].blank? %>

Authentication: <%= view_data[:authentication] %>

<% end %>

<% if (!view_data[:match_reliability].blank?) && view_data[:match_reliability] != ServiceResponse::MatchExact %>

    Edition information <%= view_data[:edition_str] %>

<% end %>

  Debug info: <%= fulltext_element.service_response.service.id %>

  <% unless view_data[:debug_info].blank? %>
    ; <%= view_data[:debug_info] %>
  <% end %>