Updated to fix minor bug when CO is null and include optional functionality to open search result in new window.

<%
  # save the conversion to hash on every call!
  ref_meta = @current_context_object.referent.metadata
%>

<%
atitle_label = nil
title_label = nil
if ! ref_meta["atitle"].blank? %>

<%
unless ref_meta['genre'].blank?
	case ref_meta["genre"]
		when /article|journal|issue/
			atitle_label = 'Article Title'
			title_label = 'Journal Title'
		when /bookitem|book/
			atitle_label = 'Chapter/Part Title'
			title_label = 'Book Title'
		when /proceeding|conference/
			atitle_label = 'Proceeding Title'
			title_label = 'Conference Name'
		when 'report'
			atitle_label = 'Report Title'
			title_label = 'Report'
	end
else
	if @current_context_object.referent.format == 'book'
		atitle_label = 'Chapter/Part Title'
	elsif @current_context_object.referent.format == 'journal'
		atitle_label = 'Article Title'
	end
	title_label = 'Title'
end

%>

<%= atitle_label %>:

<%= ref_meta["atitle"] %>

<% unless @context_object.nil? or ref_meta["atitle"] == @context_object.referent.metadata["atitle"]%>
	<%=
  link_to( image_tag('http://sfx.galib.uga.edu/sfx_git1/sfx.gif', :border=>0), url_for_with_co( {:controller=>'resolve'}, @current_context_object)) %>
<% end%>

<%
@page_title = ref_meta["atitle"]
end
author_row = ''
title_row = ''
unless ref_meta["au"].nil? and ref_meta['aulast'].nil?
author_row = '

Author:
	'
	unless ref_meta["au"].nil?
		author_row += ref_meta["au"]
	else
	author_row += ref_meta["aulast"]
	unless ref_meta["aufirst"].nil?
		author_row += ',	'+ref_meta["aufirst"]
	else
		unless ref_meta["auinit"].nil?
			author_row += ',	'+ref_meta["auinit"]
		else
			unless ref_meta["auinit1"].nil?
				author_row += ',	'+ref_meta["auinit1"]
			end
			unless ref_meta["auinitm"].nil?
				author_row += ref_meta["auinitm"]
			end
		end
	end
	end
	author_row += '
'
end
 if ref_meta.has_key?("jtitle")  or ref_meta.has_key?("title") or ref_meta.has_key?("btitle")
    @co = OpenURL::ContextObject.new
    @co.import_context_object(@current_context_object)
    #@co.referent.metadata["atitle"] = nil
    #@co.referent.metadata["volume"] = nil
    #@co.referent.metadata["spage"] = nil
    #@co.referent.metadata["epage"] = nil
    #@co.referent.metadata["issue"] = nil
    #@co.referent.metadata["date"] = nil
    #@co.referent.metadata["aulast"] = nil
    #@co.referent.metadata["au"] = nil
    #@co.referent.metadata["auinit"] = nil
    #@co.referent.metadata["auinit1"] = nil
    # @co.referent.set_identifier(nil)
    if ! @co.referent.metadata["title"].blank?
      title = @co.referent.metadata["title"]
    elsif ! @co.referent.metadata["btitle"].blank?
      title = @co.referent.metadata["btitle"]
    elsif ! @co.referent.metadata["jtitle"].blank?
      title = @co.referent.metadata["jtitle"]
    end
		if title_label.nil?
			unless ref_meta['genre'].blank?
				case ref_meta["genre"]
					when /article|journal|issue/
						title_label = 'Journal Title'
					when /bookitem|book/
						title_label = 'Book Title'
					when /proceeding|conference/
						title_label = 'Conference Name'
					when 'report'
						title_label = 'Report Title'
				end
			else
				title_label = 'Title'
			end
		end

style = 'largeText'
unless ref_meta['atitle'].nil?
	style = 'smallText'
end
title_row = '

'+title_label+':	'

title_row += link_to(title, url_for_with_co({:controller => 'resolve'}, @co), {:target => search_result_target_window})

title_row += '
'
  unless @page_title
   @page_title = title
  end
end
unless ref_meta['atitle'].blank? %>
<%= author_row.to_s + title_row.to_s %>
<% else %>
<%= title_row.to_s+author_row.to_s %>
<%
end
if ref_meta.has_key?("issn") %>

ISSN:

<%=ref_meta["issn"] %>

<%
end

if ref_meta.has_key?("isbn") %>

ISBN:

<%=ref_meta["isbn"] %>

<%
end
pub = []
if ref_meta.has_key?("date")
	pub << date_format(ref_meta["date"].to_s)
end
if ref_meta.has_key?("volume")
	pub << 'Volume:  '+ref_meta["volume"].to_s
end
if ref_meta.has_key?("issue")
	pub << 'Issue:  '+ref_meta["issue"].to_s
end

if ref_meta.has_key?("spage")
	pub << 'Page:  '+ref_meta["spage"].to_s
end
if ref_meta.has_key?("epage")
	pub << '-  '+ref_meta["epage"].to_s
end
%>

<%
 unless ref_meta['pub'].blank? &&
        ref_meta['place'].blank? %>

Publisher:

  <% unless ref_meta['place'].blank?  %>
      <%= ref_meta['place'] %> :
  <% end %>
  <%= ref_meta['pub'] %>

<% end %>

	<%= resolver_link(@current_context_object, {:target => search_result_target_window}) %>

<%
  # save the conversion to hash on every call!
  ref_meta = @current_context_object.referent.metadata
%>

<%
atitle_label = nil
title_label = nil
if ! ref_meta["atitle"].blank? %>

<%
unless ref_meta['genre'].blank?
	case ref_meta["genre"]
		when /article|journal|issue/
			atitle_label = 'Article Title'
			title_label = 'Journal Title'
		when /bookitem|book/
			atitle_label = 'Chapter/Part Title'
			title_label = 'Book Title'
		when /proceeding|conference/
			atitle_label = 'Proceeding Title'
			title_label = 'Conference Name'
		when 'report'
			atitle_label = 'Report Title'
			title_label = 'Report'
	end
else
	if @current_context_object.referent.format == 'book'
		atitle_label = 'Chapter/Part Title'
	elsif @current_context_object.referent.format == 'journal'
		atitle_label = 'Article Title'
	end
	title_label = 'Title'
end

%>

<%= atitle_label %>:

<%= ref_meta["atitle"] %>

<% unless ref_meta["atitle"] == @context_object.referent.metadata["atitle"]%>
	<%=
  link_to( image_tag('http://sfx.galib.uga.edu/sfx_git1/sfx.gif', :border=>0), url_for_with_co( {:controller=>'resolve'}, @current_context_object)) %>
<% end%>

<%
@page_title = ref_meta["atitle"]
end
author_row = ''
title_row = ''
unless ref_meta["au"].nil? and ref_meta['aulast'].nil?
author_row = '

Author:
	'
	unless ref_meta["au"].nil?
		author_row += ref_meta["au"]
	else
	author_row += ref_meta["aulast"]
	unless ref_meta["aufirst"].nil?
		author_row += ',	'+ref_meta["aufirst"]
	else
		unless ref_meta["auinit"].nil?
			author_row += ',	'+ref_meta["auinit"]
		else
			unless ref_meta["auinit1"].nil?
				author_row += ',	'+ref_meta["auinit1"]
			end
			unless ref_meta["auinitm"].nil?
				author_row += ref_meta["auinitm"]
			end
		end
	end
	end
	author_row += '
'
end
 if ref_meta.has_key?("jtitle")  or ref_meta.has_key?("title") or ref_meta.has_key?("btitle")
    @co = OpenURL::ContextObject.new
    @co.import_context_object(@current_context_object)
    #@co.referent.metadata["atitle"] = nil
    #@co.referent.metadata["volume"] = nil
    #@co.referent.metadata["spage"] = nil
    #@co.referent.metadata["epage"] = nil
    #@co.referent.metadata["issue"] = nil
    #@co.referent.metadata["date"] = nil
    #@co.referent.metadata["aulast"] = nil
    #@co.referent.metadata["au"] = nil
    #@co.referent.metadata["auinit"] = nil
    #@co.referent.metadata["auinit1"] = nil
    # @co.referent.set_identifier(nil)
    if ! @co.referent.metadata["title"].blank?
      title = @co.referent.metadata["title"]
    elsif ! @co.referent.metadata["btitle"].blank?
      title = @co.referent.metadata["btitle"]
    elsif ! @co.referent.metadata["jtitle"].blank?
      title = @co.referent.metadata["jtitle"]
    end
		if title_label.nil?
			unless ref_meta['genre'].blank?
				case ref_meta["genre"]
					when /article|journal|issue/
						title_label = 'Journal Title'
					when /bookitem|book/
						title_label = 'Book Title'
					when /proceeding|conference/
						title_label = 'Conference Name'
					when 'report'
						title_label = 'Report Title'
				end
			else
				title_label = 'Title'
			end
		end

style = 'largeText'
unless ref_meta['atitle'].nil?
	style = 'smallText'
end
title_row = '

'+title_label+':	'

title_row += link_to(title, url_for_with_co({:controller => 'resolve'}, @co), {:target => search_result_target_window})

title_row += '
'
  unless @page_title
   @page_title = title
  end
end
unless ref_meta['atitle'].blank? %>
<%= author_row.to_s + title_row.to_s %>
<% else %>
<%= title_row.to_s+author_row.to_s %>
<%
end
if ref_meta.has_key?("issn") %>

ISSN:

<%=ref_meta["issn"] %>

<%
end

if ref_meta.has_key?("isbn") %>

ISBN:

<%=ref_meta["isbn"] %>

<%
end
pub = []
if ref_meta.has_key?("date")
	pub << date_format(ref_meta["date"].to_s)
end
if ref_meta.has_key?("volume")
	pub << 'Volume:  '+ref_meta["volume"].to_s
end
if ref_meta.has_key?("issue")
	pub << 'Issue:  '+ref_meta["issue"].to_s
end

if ref_meta.has_key?("spage")
	pub << 'Page:  '+ref_meta["spage"].to_s
end
if ref_meta.has_key?("epage")
	pub << '-  '+ref_meta["epage"].to_s
end
%>

<%
 unless ref_meta['pub'].blank? &&
        ref_meta['place'].blank? %>

Publisher:

  <% unless ref_meta['place'].blank?  %>
      <%= ref_meta['place'] %> :
  <% end %>
  <%= ref_meta['pub'] %>

<% end %>

	<%= resolver_link(@current_context_object) %>


Fixed nesting bug in del.icio.us sidebar (closes #306 again) [ryanabrams at gmail.com]

git-svn-id: 70ab0960c3db1cbf656efd6df54a8f3de72dc710@576 820eb932-12ee-0310-9ca8-eeb645f39767

<% if @delicious -%>

<a href="http://<%= @delicious.title %>" alt="<%= @delicious.title %>"><%= @delicious.title %>

    <% (@sb_config['groupdate'] ? @delicious.days : [{ :container => @delicious.items }]).each do |group| -%>

      <% if @sb_config['groupdate'] -%>
      <%= group[:date].to_s.to_date.strftime("%b %d") %>
      <% end -%>
      <% for item in group[:container] %>

        <a href="<%= item.link %>" title="<%= item.title%>"><%= item.title %>
        <% if @sb_config['description'] -%>

<%= @sb_config['desclink'] ? item.description_link : item.description %>
        <% end -%>

      <% end -%>

    <% end -%>

<% end -%>

<% if @delicious -%>

<a href="http://<%= @delicious.title %>" alt="<%= @delicious.title %>"><%= @delicious.title %>

    <% (@sb_config['groupdate'] ? @delicious.days : [{ :container => @delicious.items }]).each do |group| -%>

      <% if @sb_config['groupdate'] -%>
      <%= group[:date].to_s.to_date.strftime("%b %d") %>
      <% end -%>
      <% for item in group[:container] %>

        <a href="<%= item.link %>" title="<%= item.title%>"><%= item.title %>
        <% if @sb_config['description'] -%>

<%= @sb_config['desclink'] ? item.description_link : item.description %>
        <% end %>

      <% end %>
    <% end -%>

<% end -%>


renamed txt column to additional_comments and user_id column to author_id and updated all references to them

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

Edit Review

<% specs = @assgt.spec_location
if (specs != nil && specs != "")
%>

<a href = "<%= specs %>">Assignment Specification

<%end%>
<%= render :partial => 'wiki' %>
<%if(ReviewFeedback.find(:first,:conditions =>["review_id = ? and assignment_id = ?", @review.id, @assgt.id]))
                        review_feedback_text = ReviewFeedback.find(:first,:conditions =>["review_id = ? and assignment_id = ?", @review.id, @assgt.id]).additional_comments
%>

Author's feedback:

<%=review_feedback_text%>

<% end%>
<%= start_form_tag :action => 'update_review' %>
<%= render :partial => 'reviewContent' %>
<%= hidden_field_tag('review_id', @review.id) %>
    <%= hidden_field_tag('mapping_id', @mapping.id) %>
    <%= hidden_field_tag('assgt_id', @assgt.id) %>

    <%= submit_tag "Edit Review", :name=>"save" %>
<%= end_form_tag %>
<%= link_to 'Back', :action => 'list_reviews', :id => @assgt.id %>

Edit Review

<% specs = @assgt.spec_location
if (specs != nil && specs != "")
%>

<a href = "<%= specs %>">Assignment Specification

<%end%>
<%= render :partial => 'wiki' %>
<%if(ReviewFeedback.find(:first,:conditions =>["review_id = ? and assignment_id = ?", @review.id, @assgt.id]))
                        review_feedback_text = ReviewFeedback.find(:first,:conditions =>["review_id = ? and assignment_id = ?", @review.id, @assgt.id]).additional_comment
%>

Author's feedback:

<%=review_feedback_text%>

<% end%>
<%= start_form_tag :action => 'update_review' %>
<%= render :partial => 'reviewContent' %>
<%= hidden_field_tag('review_id', @review.id) %>
    <%= hidden_field_tag('mapping_id', @mapping.id) %>
    <%= hidden_field_tag('assgt_id', @assgt.id) %>

    <%= submit_tag "Edit Review", :name=>"save" %>
<%= end_form_tag %>
<%= link_to 'Back', :action => 'list_reviews', :id => @assgt.id %>


Call hidden_field_tag correctly. Give option of signin link on contact page if not signed in.

<% @title = "Contact us" %>

<%= foi_error_messages_for :contact %>

<% form_for :contact do |f| %>

Contact the WhatDoTheyKnow team

        We'd love to hear how you found using the site.

        Please read the  about page first, as it may
        answer your question quicker.

        Note: This is for contacting the WhatDoTheyKnow
        team only. If you are trying to send a new Freedom of Information
        request to a public body, then go here.

    <% if not @user %>

            Your name:
            <%= f.text_field :name, :size => 20 %>
            (or <%= link_to "sign in", signin_url(:r => request.request_uri) %>)

            Your email:
            <%= f.text_field :email, :size => 20 %>

    <% end %>

        Subject:
        <%= f.text_field :subject, :size => 50 %>

        Message:
        <%= f.text_area :message, :rows => 5, :cols => 50 %>

        <%= hidden_field_tag(:submitted_contact_form, 1) %>
        <%= submit_tag "Send message" %>

<% end %>

<% @title = "Contact us" %>

<%= foi_error_messages_for :contact %>

<% form_for :contact do |f| %>

Contact the WhatDoTheyKnow team

        We'd love to hear how you found using the site.

        Please read the  about page first, as it may
        answer your question quicker.

        Note: This is for contacting the WhatDoTheyKnow
        team only. If you are trying to send a new Freedom of Information
        request to a public body, then go here.

    <% if not @user %>

            Your name:
            <%= f.text_field :name, :size => 20 %>

            Your email:
            <%= f.text_field :email, :size => 20 %>

    <% end %>

        Subject:
        <%= f.text_field :subject, :size => 50 %>

        Message:
        <%= f.text_area :message, :rows => 5, :cols => 50 %>

        <%= hidden_field_tag(:submitted_contact_form, { :value => 1 } ) %>
        <%= submit_tag "Send message" %>

<% end %>


Move admin link so clearly associated with the request, not the body or user

<% @title = h(@info_request.title) %>

<% if @info_request.awaiting_description || @requires_admin_describe %>

    <%= render :partial => 'describe_state', :locals => { :id_suffix => "1" } %>

<% end %>

Track this request

     <%= render :partial => 'track/tracking_links', :locals => { :track_thing => @track_thing, :own_request => @info_request.user == @user, :location => 'sidebar' } %>

Act on what you've learnt

        <%= link_to '', "http://www.writetothem.com"%>
        <%= link_to 'Write to your politician', "http://www.writetothem.com"%>

        <%= link_to '', "http://www.pledgebank.com"%>
        <%= link_to 'Join others with a pledge', "http://www.pledgebank.com"%>

    <% if !@xapian_similar.nil? && @xapian_similar.results.size > 0 %>

Similar requests

        <% for result in @xapian_similar.results %>
            <%= render :partial => 'request/request_listing_via_event', :locals => { :event => result[:model], :info_request => result[:model].info_request } %>
        <% end %>
        <% if @xapian_similar_more %>

<%= link_to "More similar requests", request_similar_url(@info_request) %>

        <% end %>

     <% end %>

<%=@title%>

    <%=h @info_request.law_used_with_a%>
    <% if !@user.nil? && @user.admin_page_links? %>
        (<%= link_to "admin", request_admin_url(@info_request) %>)
    <% end %>
    to
    <%= public_body_link(@info_request.public_body) %>
    by
    <%= user_link(@info_request.user) %>

    <% if @info_request.awaiting_description %>
        <% if @is_owning_user %>
            Please answer the question above so we know whether the
            <%= MySociety::Format.fancy_pluralize(@new_responses_count, 'recent response contains', 'recent responses contain') %> useful information.
        <% else %>
            This request has an unknown status. We're waiting for
            <%= user_link(@info_request.user) %> to read
            <%= MySociety::Format.fancy_pluralize(@new_responses_count, 'a recent response', 'recent responses') %>
            and update the status.
        <% end %>
    <% elsif @status == 'waiting_response' %>
        Currently waiting for a response from <%= public_body_link(@info_request.public_body) %>,
        they <%= link_to "must respond", about_url + "#quickly_response" %>
        promptly but no later than <%= simple_date(@info_request.date_response_required_by) %>.
    <% elsif @status == 'waiting_response_overdue' %>
        Currently overdue a response from <%=
        public_body_link(@info_request.public_body) %>. By law,
        the response had to be
        <%= link_to "no later", about_url + "#quickly_response" %>
        than <%= simple_date(@info_request.date_response_required_by) %>.
    <% elsif @status == 'not_held' %>
        <%= public_body_link(@info_request.public_body) %> did not have the information requested.
    <% elsif @status == 'rejected' %>
        The request was rejected by <%= public_body_link(@info_request.public_body) %>.
    <% elsif @status == 'successful' %>
        The request was successful.
    <% elsif @status == 'partially_successful' %>
        The request was partially successful.
    <% elsif @status == 'waiting_clarification' %>
        <% if @is_owning_user %>
            <%=h @info_request.public_body.name %> is waiting for your clarification.
            Please
            <%= link_to "send a follow up message", show_response_url(:id => @info_request.id, :incoming_message_id => @info_request.get_last_response.id) + "#followup" %>.
        <% else %>
            The request is waiting for clarification.
            If you are
            <%= user_link(@info_request.user) %>, please
            <%= link_to "sign in", signin_url(:r => request.request_uri) %> to send a follow up message.
        <% end %>
    <% elsif @status == 'requires_admin' %>
        This request has had an unusual response, and requires attention from the WhatDoTheyKnow team.
    <% else %>
        <% raise "unknown status " + @status %>
    <% end %>

    <% for info_request_event in @info_request_events %>
        <% if info_request_event.visible %>
            <%= render :partial => 'correspondence', :locals => { :info_request_event => info_request_event } %>
        <% end %>
    <% end %>

    <% if @info_request.awaiting_description %>

        <%= render :partial => 'describe_state', :locals => { :id_suffix => "2" } %>

    <% end %>

Things to do with this request

        <%= link_to "Add an annotation", new_comment_url(:url_title => @info_request.url_title) %> (to help
        the requester or others)

        <% if @last_response.nil? %>
            <%= link_to "Send follow up to " + RequestMailer.name_for_followup(@info_request, @last_response), show_response_no_followup_url(:id => @info_request.id, :incoming_message_id => nil) + "#followup" %>
        <% else %>
            <%= link_to "Reply to " + RequestMailer.name_for_followup(@info_request, @last_response), show_response_url(:id => @info_request.id, :incoming_message_id => @last_response.id) + "#followup" %>
        <% end %>
        (<%=h @info_request.user.name %> only)

        <%= link_to "Respond to request", upload_response_url(:url_title => @info_request.url_title) %> (FOI
        officers only)

<% @title = h(@info_request.title) %>

<% if @info_request.awaiting_description || @requires_admin_describe %>

    <%= render :partial => 'describe_state', :locals => { :id_suffix => "1" } %>

<% end %>

Track this request

     <%= render :partial => 'track/tracking_links', :locals => { :track_thing => @track_thing, :own_request => @info_request.user == @user, :location => 'sidebar' } %>

Act on what you've learnt

        <%= link_to '', "http://www.writetothem.com"%>
        <%= link_to 'Write to your politician', "http://www.writetothem.com"%>

        <%= link_to '', "http://www.pledgebank.com"%>
        <%= link_to 'Join others with a pledge', "http://www.pledgebank.com"%>

    <% if !@xapian_similar.nil? && @xapian_similar.results.size > 0 %>

Similar requests

        <% for result in @xapian_similar.results %>
            <%= render :partial => 'request/request_listing_via_event', :locals => { :event => result[:model], :info_request => result[:model].info_request } %>
        <% end %>
        <% if @xapian_similar_more %>

<%= link_to "More similar requests", request_similar_url(@info_request) %>

        <% end %>

     <% end %>

<%=@title%>

<%=h @info_request.law_used_with_a%> to
    <%= public_body_link(@info_request.public_body) %>
    by
    <%= user_link(@info_request.user) %>
    <% if !@user.nil? && @user.admin_page_links? %>
    (<%= link_to "admin", request_admin_url(@info_request) %>)
    <% end %>

    <% if @info_request.awaiting_description %>
        <% if @is_owning_user %>
            Please answer the question above so we know whether the
            <%= MySociety::Format.fancy_pluralize(@new_responses_count, 'recent response contains', 'recent responses contain') %> useful information.
        <% else %>
            This request has an unknown status. We're waiting for
            <%= user_link(@info_request.user) %> to read
            <%= MySociety::Format.fancy_pluralize(@new_responses_count, 'a recent response', 'recent responses') %>
            and update the status.
        <% end %>
    <% elsif @status == 'waiting_response' %>
        Currently waiting for a response from <%= public_body_link(@info_request.public_body) %>,
        they <%= link_to "must respond", about_url + "#quickly_response" %>
        promptly but no later than <%= simple_date(@info_request.date_response_required_by) %>.
    <% elsif @status == 'waiting_response_overdue' %>
        Currently overdue a response from <%=
        public_body_link(@info_request.public_body) %>. By law,
        the response had to be
        <%= link_to "no later", about_url + "#quickly_response" %>
        than <%= simple_date(@info_request.date_response_required_by) %>.
    <% elsif @status == 'not_held' %>
        <%= public_body_link(@info_request.public_body) %> did not have the information requested.
    <% elsif @status == 'rejected' %>
        The request was rejected by <%= public_body_link(@info_request.public_body) %>.
    <% elsif @status == 'successful' %>
        The request was successful.
    <% elsif @status == 'partially_successful' %>
        The request was partially successful.
    <% elsif @status == 'waiting_clarification' %>
        <% if @is_owning_user %>
            <%=h @info_request.public_body.name %> is waiting for your clarification.
            Please
            <%= link_to "send a follow up message", show_response_url(:id => @info_request.id, :incoming_message_id => @info_request.get_last_response.id) + "#followup" %>.
        <% else %>
            The request is waiting for clarification.
            If you are
            <%= user_link(@info_request.user) %>, please
            <%= link_to "sign in", signin_url(:r => request.request_uri) %> to send a follow up message.
        <% end %>
    <% elsif @status == 'requires_admin' %>
        This request has had an unusual response, and requires attention from the WhatDoTheyKnow team.
    <% else %>
        <% raise "unknown status " + @status %>
    <% end %>

    <% for info_request_event in @info_request_events %>
        <% if info_request_event.visible %>
            <%= render :partial => 'correspondence', :locals => { :info_request_event => info_request_event } %>
        <% end %>
    <% end %>

    <% if @info_request.awaiting_description %>

        <%= render :partial => 'describe_state', :locals => { :id_suffix => "2" } %>

    <% end %>

Things to do with this request

        <%= link_to "Add an annotation", new_comment_url(:url_title => @info_request.url_title) %> (to help
        the requester or others)

        <% if @last_response.nil? %>
            <%= link_to "Send follow up to " + RequestMailer.name_for_followup(@info_request, @last_response), show_response_no_followup_url(:id => @info_request.id, :incoming_message_id => nil) + "#followup" %>
        <% else %>
            <%= link_to "Reply to " + RequestMailer.name_for_followup(@info_request, @last_response), show_response_url(:id => @info_request.id, :incoming_message_id => @last_response.id) + "#followup" %>
        <% end %>
        (<%=h @info_request.user.name %> only)

        <%= link_to "Respond to request", upload_response_url(:url_title => @info_request.url_title) %> (FOI
        officers only)


Hides "must be a member to post" message for private replies

git-svn-id: 96bd6241e080dd4199045f7177cf3384e2eaed71@651 2d86388d-c40f-0410-ad6a-a69da6a65d20

<% @page_title = "Mailing Lists: #{@mailing_list.friendly_name}" %>

  <%= error_messages_for "mailing_list_post" %>

  <%= start_form_tag :action => "post" %>
  <%= hidden_field("mailing_list_post", "mailing_list_id") %>
  <%= hidden_field("reply_to", 'id') %>

      To:

		<% if @reply_to %>
		<%= h(@reply_to.sender_obscured) %>
		<% else %>
		<%= @mailing_list.friendly_name %>
		<% end %>

      Your Name:
      <%= text_field("mailing_list_post", "from_name", :size => "40") %>

      Your Email Address:
      <%= text_field("mailing_list_post", "from_email_address", :size => "40") %>

      Subject:
      <%= text_field("mailing_list_post", "subject", :size => "40") %>

      <%= text_area("mailing_list_post", "body", :rows => "14", :cols => "65") %>

      <% unless @reply_to %>You must be a subscriber to post<% end %>

		<% if @reply_to %>
	    	<%= submit_tag("Send") %>
		<% else %>
    	<%= submit_tag("Post") %>
		<% end %>

  <%= end_form_tag %>

      <%= render("shared/mailing_list_links", :mailing_list => @mailing_list) %>

<% @page_title = "Mailing Lists: #{@mailing_list.friendly_name}" %>

  <%= error_messages_for "mailing_list_post" %>

  <%= start_form_tag :action => "post" %>
  <%= hidden_field("mailing_list_post", "mailing_list_id") %>
  <%= hidden_field("reply_to", 'id') %>

      To:

		<% if @reply_to %>
		<%= h(@reply_to.sender_obscured) %>
		<% else %>
		<%= @mailing_list.friendly_name %>
		<% end %>

      Your Name:
      <%= text_field("mailing_list_post", "from_name", :size => "40") %>

      Your Email Address:
      <%= text_field("mailing_list_post", "from_email_address", :size => "40") %>

      Subject:
      <%= text_field("mailing_list_post", "subject", :size => "40") %>

      <%= text_area("mailing_list_post", "body", :rows => "14", :cols => "65") %>

      You must be a subscriber to post

		<% if @reply_to %>
	    	<%= submit_tag("Send") %>
		<% else %>
    	<%= submit_tag("Post") %>
		<% end %>

  <%= end_form_tag %>

      <%= render("shared/mailing_list_links", :mailing_list => @mailing_list) %>


assignment_id passed with new team creation

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

Teams for <%= @assignment.name %>

<%
   column_definitions = Array.new
   column_definitions << {:name => 'Team Name',      :type => 'display',        :field => 'name'}
   column_definitions << {:name => 'Edit Name',      :action => 'edit',         :controller => 'team', :hidden => {:id => @assignment.id, :name => 'assignment_id'} }
   column_definitions << {:name => 'Modify Members', :action => 'list',         :controller => 'teams_users'}
   column_definitions << {:name => 'Delete Team',    :action => 'delete_team',  :controller => 'team', :hidden => {:id => @assignment.id, :name => 'assignment_id'} }
%>
<%= render :partial => 'shared_scripts/selectTable', :locals => {:column_definitions => column_definitions, :elements => @teams} %>

<%= render :partial => 'import_teams' %>

<%= link_to 'New Team', :action => 'new', :assignment_id=>params[:id] %>

Teams for <%= @assignment.name %>

<%
   column_definitions = Array.new
   column_definitions << {:name => 'Team Name',      :type => 'display',        :field => 'name'}
   column_definitions << {:name => 'Edit Name',      :action => 'edit',         :controller => 'team', :hidden => {:id => @assignment.id, :name => 'assignment_id'} }
   column_definitions << {:name => 'Modify Members', :action => 'list',         :controller => 'teams_users'}
   column_definitions << {:name => 'Delete Team',    :action => 'delete_team',  :controller => 'team', :hidden => {:id => @assignment.id, :name => 'assignment_id'} }
%>
<%= render :partial => 'shared_scripts/selectTable', :locals => {:column_definitions => column_definitions, :elements => @teams} %>

<%= render :partial => 'import_teams' %>

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


Support git (no branch) better

Support git (no branch) better

If we’re not on a branch, let’s not try to link to the branch.

<% @title = "Debug" %>

<%=@title%>

You are <%= h @http_auth_user %>

Version numbers

Alaveteli version: <%= link_to @current_version, @github_origin + @current_version %>

<% if @current_branch == "(no branch)" %>
  Alaveteli branch: (no branch)
<% else %>
  Alaveteli branch: <%= link_to @current_branch, @github_origin + @current_branch %>
<% end %>

Alaveteli commit: <%= link_to @current_commit, @github_origin + @current_commit %>

RUBY_VERSION <%=h RUBY_VERSION %>

Rails::VERSION::STRING <%=h Rails::VERSION::STRING%>

TMail::VERSION::STRING <%=h TMail::VERSION::STRING%>

Xapian::version_string <%=h Xapian::version_string%>

Configuration

environment: <%=h Rails::configuration.environment %>

environment_path: <%=h Rails::configuration.environment_path %>

framework_paths: <%=h Rails::configuration.framework_paths.to_yaml %>

Environment variables

<% for k,v in @request_env %>

<%=h k%>	<%=h v%>

<% end %>

Parameters

<% for k,v in params %>

<%=h k%>	<%=h v%>

<% end %>

Session

<% for k,v in session %>

<%=h k%>	<%=h v%>

<% end %>

<% @title = "Debug" %>

<%=@title%>

You are <%= h @http_auth_user %>

Version numbers

Alaveteli version: <%= link_to @current_version, @github_origin + @current_version %>

Alaveteli branch: <%= link_to @current_branch, @github_origin + @current_branch %>

Alaveteli commit: <%= link_to @current_commit, @github_origin + @current_commit %>

RUBY_VERSION <%=h RUBY_VERSION %>

Rails::VERSION::STRING <%=h Rails::VERSION::STRING%>

TMail::VERSION::STRING <%=h TMail::VERSION::STRING%>

Xapian::version_string <%=h Xapian::version_string%>

Configuration

environment: <%=h Rails::configuration.environment %>

environment_path: <%=h Rails::configuration.environment_path %>

framework_paths: <%=h Rails::configuration.framework_paths.to_yaml %>

Environment variables

<% for k,v in @request_env %>

<%=h k%>	<%=h v%>

<% end %>

Parameters

<% for k,v in params %>

<%=h k%>	<%=h v%>

<% end %>

Session

<% for k,v in session %>

<%=h k%>	<%=h v%>

<% end %>


configuring url_for to not escape ampersands for the add_new_url in association footers (the 'create another' button's url)

<%
begin
  remote_controller = active_scaffold_controller_for(column.association.klass)
rescue ActiveScaffold::ControllerNotFound
  remote_controller = nil
end

show_add_existing = (!column.through_association? and options_for_association_count(column.association) > 0)

show_add_new = !column.through_association? and (column.plural_association? or (column.singular_association? and not associated.empty?))
show_add_new = false unless @record.class.authorized_for?(:action => :create)

edit_associated_url = url_for(:action => 'edit_associated', :id => parent_record.id, :association => column.name, :associated_id => '--ID--', :_method => :get, :escape => false)
add_new_url = url_for(:action => 'edit_associated', :id => parent_record.id, :association => column.name, :_method => :get, :escape => false);

return unless show_add_new or show_add_existing

-%>

    <% if show_add_new -%>
    <% add_label = column.plural_association? ? as_('Create Another') : as_('Replace With New') -%>
    <%= button_to_function add_label, "new Ajax.Request(#{add_new_url.to_json}, {asynchronous: true, evalScripts: true, onFailure: function(){ActiveScaffold.report_500_response(#{active_scaffold_id.to_json})}})" %>
    <% end -%>

    <%= '|' if show_add_new and show_add_existing %>

    <% if show_add_existing -%>
      <% if remote_controller and remote_controller.respond_to? :uses_record_select? and remote_controller.uses_record_select? -%>
        <%= link_to_record_select as_('Add Existing'), remote_controller.controller_path, :onselect => "new Ajax.Request(#{edit_associated_url.to_json}.sub('--ID--', id), {asynchronous: true, evalScripts: true, onFailure: function(){ActiveScaffold.report_500_response(#{active_scaffold_id})}});" -%>
      <% else -%>
        <% select_options = options_for_select(options_for_association(column.association)) unless column.through_association? -%>
        <%= select_tag 'associated_id', '<option value="">' + as_('- select -') + '</option>' + select_options %>
        <%= button_to_function as_('Add Existing'), "new Ajax.Request(#{edit_associated_url.to_json}.sub('--ID--', Element.previous(this).value), {asynchronous: true, evalScripts: true, onFailure: function(){ActiveScaffold.report_500_response(#{active_scaffold_id})}})" %>
      <% end -%>
    <% end -%>

<%
begin
  remote_controller = active_scaffold_controller_for(column.association.klass)
rescue ActiveScaffold::ControllerNotFound
  remote_controller = nil
end

show_add_existing = (!column.through_association? and options_for_association_count(column.association) > 0)

show_add_new = !column.through_association? and (column.plural_association? or (column.singular_association? and not associated.empty?))
show_add_new = false unless @record.class.authorized_for?(:action => :create)

edit_associated_url = url_for(:action => 'edit_associated', :id => parent_record.id, :association => column.name, :associated_id => '--ID--', :_method => :get, :escape => false)
add_new_url = url_for(:action => 'edit_associated', :id => parent_record.id, :association => column.name, :_method => :get);

return unless show_add_new or show_add_existing

-%>

    <% if show_add_new -%>
    <% add_label = column.plural_association? ? as_('Create Another') : as_('Replace With New') -%>
    <%= button_to_function add_label, "new Ajax.Request(#{add_new_url.to_json}, {asynchronous: true, evalScripts: true, onFailure: function(){ActiveScaffold.report_500_response(#{active_scaffold_id.to_json})}})" %>
    <% end -%>

    <%= '|' if show_add_new and show_add_existing %>

    <% if show_add_existing -%>
      <% if remote_controller and remote_controller.respond_to? :uses_record_select? and remote_controller.uses_record_select? -%>
        <%= link_to_record_select as_('Add Existing'), remote_controller.controller_path, :onselect => "new Ajax.Request(#{edit_associated_url.to_json}.sub('--ID--', id), {asynchronous: true, evalScripts: true, onFailure: function(){ActiveScaffold.report_500_response(#{active_scaffold_id})}});" -%>
      <% else -%>
        <% select_options = options_for_select(options_for_association(column.association)) unless column.through_association? -%>
        <%= select_tag 'associated_id', '<option value="">' + as_('- select -') + '</option>' + select_options %>
        <%= button_to_function as_('Add Existing'), "new Ajax.Request(#{edit_associated_url.to_json}.sub('--ID--', Element.previous(this).value), {asynchronous: true, evalScripts: true, onFailure: function(){ActiveScaffold.report_500_response(#{active_scaffold_id})}})" %>
      <% end -%>
    <% end -%>


Remove for good reference to UK law, previously hidden

<% @title = "Information for EU Officials" %>

<%= render :partial => 'sidebar' %>

Information for EU Officials

What is AsktheEU.org?

Processing Requests

Privacy Issues

What is AsktheEU.org?

I just got here from bottom of a documents request, what is going on?

AsktheEU.org is a website run by a non-governmental human rights organisation, Access Info Europe. It helps ordinary members of the public make requests for documents and information to EU bodies and shares the responses with the wider public.

The request you received was made by someone using AsktheEU.org.

You should simply reply to the request as you would any other request for documents. The only difference is that your response will be automatically published on the Internet.

If you have privacy or other concerns, please read the answers below.

You might also like to read the <%= link_to 'About AsktheEU.org', help_about_path %> section to find out more about what the site does from the point of view of a user.

You can also search the site to find the authority that you work for, and view the status of any requests made using the site.

Finally, we welcome comments and thoughts from FOI officers, please <%= link_to 'get in touch', help_contact_path %>.

Why are you publishing responses to FOI requests?

We think there are lots of benefits. Most importantly it will encourage the public to be more interested and involved in the work of the European Union.

We also hope that it will reduce the number of duplicate requests on any subject that each EU body will receive.

Given that responses to access to documents requests contain public information, which anybody could easily request again from the public authority, there is no reason not to publish this information widely.

Are the people making requests real people?

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

AsktheEU.org is making a very large number of requests!

AsktheEU.org is not making any requests. We are sending requests on behalf of our users, who are real people making the requests for information they are interested in.

Processing Requests

I can see a request on AsktheEU.org, but we never got it by email!

If a request appears on the site, then we have attempted to send it to the relevant EU body by email. Any delivery failure messages will automatically appear on the site.

You can check the address we're using with the "View email address" link which appears on the page for EU body authority.

Please kindly <%= link_to 'contact us', help_contact_path %> if there is a better address we can use.

Requests are sometimes get blocked by "spam filters". To make sure that this doesn't happen by asking your IT departments to "whitelist" any email from @asktheeu.org.

If you ask us we will resend any request, and/or give technical details of delivery so an IT department can chase up what happened to the message.

How do you calculate the deadline shown on request pages?

We calculate 15 working days in line with Regulation 1049/2001 which obliges many EU institutions.

We start calculating days on the first working day after the delivery of the request. If the request is sent on a working day, we start counting the next working day.

Reminder: this is the maximum timeframe because Regulation 1049/2001 says: <q>An application for access to a document shall be handled promptly.</q> (Article 7.1)

It then says: <q>An acknowledgement of receipt shall be sent to the applicant.</q> (Article 7.1)

And then comes the maximum timeframe: <q>Within 15 working days from registration of the application, the institution shall either grant access to the document requested and provide access in accordance with Article 10 within that period or, in a written reply, state the reasons for the total or partial refusal and inform the applicant of his or her right to make a confirmatory application in accordance with paragraph 2 of this Article.</q> (Article 7.1)

How do you handle extensions?

Extensions are permitted by EU law, for a maximum of 15 additional working days:

<q>In exceptional cases, for example in the event of an application relating to a very long document or to a very large number of documents, the time-limit provided for in paragraph 1 may be extended by 15 working days, provided that the applicant is notified in advance and that detailed reasons are given.</q> (Article 7.3)

Note that you have to notify the requester – a quick email with a sentence or two saying what is happening is a legal obligation; this should be sent as soon as possible, not on day 14 after the request is received.

We know that EU officials often have to do a lot of hard work to answer requests, and this is hidden from the public. Letting the public know about this regular communications with requesters will help everyone by making that complexity visible.

How do I answer the request?

Just reply to the email in the normal way. The request will be delivered to the requester as well as being published on the AsktheEU.org website.

How can I send a large file, which won't go by email?

Instead of email, you can respond to a request directly from your web browser, including uploading a file. To do this, choose "respond to request" at the bottom of the request's page. Contact us if it is too big for even that (more than, say, 50Mb).

Privacy Issues

Why do you publish the names of civil servants and the text of emails?

We consider what officers or servants do in the course of their employment to be public information. We will only remove content in exceptional circumstances, see our <%= link_to 'take down policy', help_privacy_path(:anchor=>'takedown') %>.

Do you publish email addresses or mobile phone numbers?

To prevent spam, we automatically remove most emails and some mobile numbers from responses to requests. Please <%= link_to 'contact us', help_contact_path %> if we've missed one. For technical reasons we don't always remove them from attachments, such as certain PDFs.

If you need to know what an address was that we've removed, please <%= link_to 'get in touch with us', help_contact_path %>. Occasionally, an email address forms an important part of a response and we will post it up in an obscured form in an annotation.

<% @title = "Information for EU Officials" %>

<%= render :partial => 'sidebar' %>

Information for EU Officials

What is AsktheEU.org?

Processing Requests

Privacy Issues

What is AsktheEU.org?

I just got here from bottom of a documents request, what is going on?

AsktheEU.org is a website run by a non-governmental human rights organisation, Access Info Europe. It helps ordinary members of the public make requests for documents and information to EU bodies and shares the responses with the wider public.

The request you received was made by someone using AsktheEU.org.

You should simply reply to the request as you would any other request for documents. The only difference is that your response will be automatically published on the Internet.

If you have privacy or other concerns, please read the answers below.

You might also like to read the <%= link_to 'About AsktheEU.org', help_about_path %> section to find out more about what the site does from the point of view of a user.

You can also search the site to find the authority that you work for, and view the status of any requests made using the site.

Finally, we welcome comments and thoughts from FOI officers, please <%= link_to 'get in touch', help_contact_path %>.

Why are you publishing responses to FOI requests?

We think there are lots of benefits. Most importantly it will encourage the public to be more interested and involved in the work of the European Union.

We also hope that it will reduce the number of duplicate requests on any subject that each EU body will receive.

Given that responses to access to documents requests contain public information, which anybody could easily request again from the public authority, there is no reason not to publish this information widely.

Are the people making requests real people?

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

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

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

AsktheEU.org is making a very large number of requests!

AsktheEU.org is not making any requests. We are sending requests on behalf of our users, who are real people making the requests for information they are interested in.

Processing Requests

I can see a request on AsktheEU.org, but we never got it by email!

If a request appears on the site, then we have attempted to send it to the relevant EU body by email. Any delivery failure messages will automatically appear on the site.

You can check the address we're using with the "View email address" link which appears on the page for EU body authority.

Please kindly <%= link_to 'contact us', help_contact_path %> if there is a better address we can use.

Requests are sometimes get blocked by "spam filters". To make sure that this doesn't happen by asking your IT departments to "whitelist" any email from @asktheeu.org.

If you ask us we will resend any request, and/or give technical details of delivery so an IT department can chase up what happened to the message.

How do you calculate the deadline shown on request pages?

We calculate 15 working days in line with Regulation 1049/2001 which obliges many EU institutions.

We start calculating days on the first working day after the delivery of the request. If the request is sent on a working day, we start counting the next working day.

Reminder: this is the maximum timeframe because Regulation 1049/2001 says: <q>An application for access to a document shall be handled promptly.</q> (Article 7.1)

It then says: <q>An acknowledgement of receipt shall be sent to the applicant.</q> (Article 7.1)

And then comes the maximum timeframe: <q>Within 15 working days from registration of the application, the institution shall either grant access to the document requested and provide access in accordance with Article 10 within that period or, in a written reply, state the reasons for the total or partial refusal and inform the applicant of his or her right to make a confirmatory application in accordance with paragraph 2 of this Article.</q> (Article 7.1)

How do you handle extensions?

Extensions are permitted by EU law, for a maximum of 15 additional working days:

<q>In exceptional cases, for example in the event of an application relating to a very long document or to a very large number of documents, the time-limit provided for in paragraph 1 may be extended by 15 working days, provided that the applicant is notified in advance and that detailed reasons are given.</q> (Article 7.3)

Note that you have to notify the requester – a quick email with a sentence or two saying what is happening is a legal obligation; this should be sent as soon as possible, not on day 14 after the request is received.

We know that EU officials often have to do a lot of hard work to answer requests, and this is hidden from the public. Letting the public know about this regular communications with requesters will help everyone by making that complexity visible.

How do I answer the request?

Just reply to the email in the normal way. The request will be delivered to the requester as well as being published on the AsktheEU.org website.

How can I send a large file, which won't go by email?

Instead of email, you can respond to a request directly from your web browser, including uploading a file. To do this, choose "respond to request" at the bottom of the request's page. Contact us if it is too big for even that (more than, say, 50Mb).

Privacy Issues

Why do you publish the names of civil servants and the text of emails?

We consider what officers or servants do in the course of their employment to be public information. We will only remove content in exceptional circumstances, see our <%= link_to 'take down policy', help_privacy_path(:anchor=>'takedown') %>.

Do you publish email addresses or mobile phone numbers?

To prevent spam, we automatically remove most emails and some mobile numbers from responses to requests. Please <%= link_to 'contact us', help_contact_path %> if we've missed one. For technical reasons we don't always remove them from attachments, such as certain PDFs.

If you need to know what an address was that we've removed, please <%= link_to 'get in touch with us', help_contact_path %>. Occasionally, an email address forms an important part of a response and we will post it up in an obscured form in an annotation.


updated the link to github

updated the link to github

  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  <title>The Best of $username on Hacker News</title>
  <meta name="description" content="Create an E-book from the best comments on Hacker News">

The Best of

      <form action="" method="post">
        Username <input id="username-input" type="text" name="username" />

        <% if (c.debug === "1") { %>

HTML <input type="radio" name="output" value="html" />
        PDF <input type="radio" name="output" value="pdf" checked />

        <% } %>

        <input type="submit" value="Create E-book" />
      </form>

on Hacker News

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

      source *
      feedback *
      powered by hnsearch and
      pdfcrowd


Fix template typo/bug that caused 500 error when a request had comments

<% @title = _("FOI request - {{title}}", :title => h(@info_request.title)) %>
<%= javascript_include_tag :defaults %>

<%=@title%>

<% form_tag '../move_request', { :class => "form form-horizontal" } do %>
  <%= hidden_field_tag 'info_request_id', @info_request.id %>

      <% @info_request.for_admin_column do |name, value, type, column_name|%>

            <%= name %>:

            <% if type == 'datetime' %>
              <%= I18n.l(value, :format => "%e %B %Y %H:%M:%S") %>
              (<%= _('{{length_of_time}} ago', :length_of_time => time_ago_in_words(value)) %>)
            <% else %>
              <%= h value %>
            <% end %>
            <% if column_name == 'described_state' %>

Initial request last sent at: <%= @info_request.calculate_status %>

Initial request last sent at: <%=@info_request.date_initial_request_last_sent_at.to_date %>

Date response required by: <%= @info_request.date_response_required_by %>

Very overdue after: <%= @info_request.date_very_overdue_after %>

            <% end %>

      <% end %>

          Created by

          <%= user_link(@info_request.user, "btn btn-mini") %>
          <%= link_to _("admin"), user_admin_url(@info_request.user), :class => "btn btn-mini btn-warning" %>
          <%= link_to _("move..."), "#", :class => "btn btn-mini btn-warning toggle-hidden" %>

              url_name of new user:
              <%= text_field_tag 'user_url_name', "", { :size => 20 } %>
              <%= submit_tag "Move request to user", :class => "btn btn-info" %>

          Public authority:

          <%= public_body_link(@info_request.public_body, "btn btn-mini") %>
          <%= link_to _("admin"), public_body_admin_url(@info_request.public_body), :class => "btn btn-mini btn-warning" %>
          <%= link_to "move...", "#", :class => "btn btn-mini btn-warning toggle-hidden" %>

            url_name of new authority:
            <%= text_field_tag 'public_body_url_name', "", { :size => 20 } %>
            <%= submit_tag "Move request to authority", :class => "btn btn-info" %>

          <%=_("Incoming email address")%>

          <%= link_to h(@info_request.incoming_email), "mailto:#{@info_request.incoming_email}" %>

          <%=_("Tags")%>

          <%= render :partial => 'tags', :locals => { :info_request => @info_request} %>

<% end %>

<%= link_to 'Public page', main_url(request_url(@info_request)), :class => "btn" %>
<%= link_to 'Edit', '../edit/' + @info_request.id.to_s, :class => "btn" %>
<%= link_to 'FOI officer upload URL', '../generate_upload_url/' + @info_request.id.to_s, :class => "btn btn-warning" %> (see also links on incoming messages below)

Events

  <% for info_request_event in @info_request.info_request_events.find(:all, :order => "created_at, id") %>

        <a class="accordion-toggle" href="#event_<%=info_request_event.id%>" data-toggle="collapse" data-parent="events">
          <%= _("Event {{id}}", :id => info_request_event.id) %>
          --
          <%=h info_request_event.event_type.humanize %>
          <%= admin_date info_request_event.created_at%>
          <% if info_request_event.described_state != 'waiting_clarification' and info_request_event.event_type == 'response' %>
            <% form_tag '../mark_event_as_clarification', :class => "form form-inline admin-table-form admin-inline-form pull-right" do %>
              <%= hidden_field_tag 'info_request_event_id', info_request_event.id %>
              <%= submit_tag "Was clarification request", :class => "btn btn-mini btn-primary" %>
            <% end %>
          <% end %>

      <div id="event_<%=info_request_event.id%>" class="accordion-body collapse">

            <% info_request_event.for_admin_column do |name, value, type, column_name| %>

                  <%=h name%>

                  <% if column_name == 'params_yaml' %>
                    <%= info_request_event.params_yaml_as_html %>
                  <% elsif value.nil? %>
                    nil
                  <% elsif %w(text string).include?(type) %>
                    <%=h value.humanize %>
                  <% elsif type == 'datetime' %>
                    <%= admin_date value %>
                  <% else %>
                    <%=h value %>
                  <% end %>

            <% end %>

  <% end %>

Outgoing messages

  <% for outgoing_message in @info_request.outgoing_messages.find(:all, :order => 'created_at') %>

        <a class="accordion-toggle" href="#outgoing_<%=outgoing_message.id%>" data-toggle="collapse" data-parent="outgoing_messages">
          #<%= outgoing_message.id %> -- <%= outgoing_message.status.humanize %> <%= outgoing_message.message_type.humanize %>

      <div id="outgoing_<%=outgoing_message.id%>" class="accordion-body collapse">

                <% form_tag '../resend', :class => "admin-table-form" do %>
                  <%= hidden_field_tag 'outgoing_message_id', outgoing_message.id %>
                  <%= submit_tag "Resend", :class => "btn btn-warning" %>
                <% end %>
                <%= link_to "Edit", "../edit_outgoing/#{outgoing_message.id}", :class => "btn btn-warning" %>

            <% outgoing_message.for_admin_column do |name, value, type, column_name| %>

                  <%=name%>

                  <% if column_name == 'body' %>
                    <%= simple_format(truncate(outgoing_message.body, :length => 400, :omission => link_to("...", "#", :class => "toggle-hidden" ))) %>

<%= simple_format( outgoing_message.body ) %>

                  <% else %>
                    <%= admin_value(value) %>
                  <% end %>

            <% end %>

  <% end %>

Incoming messages

  <% for incoming_message in @info_request.incoming_messages.find(:all, :order => 'created_at') %>

        <a class="accordion-toggle" href="#incoming_<%=incoming_message.id%>" data-toggle="collapse" data-parent="incoming_messages">
          <%=incoming_message.id%> -- <%=incoming_message.mail_from%> <%=_("at")%> <%=admin_value(incoming_message.sent_at)%>

      <div id="incoming_<%=incoming_message.id%>" class="accordion-body collapse">

            <% incoming_message.for_admin_column do |name, value, type, column_name| %>

                  <%=name%>

                  <% if column_name =~ /^cached_.*?$/ %>
                    <%= simple_format( truncate(value, :length => 400, :omission => link_to("...", "#", :class => "toggle-hidden"))) %>

<%= simple_format(value) %>

                  <% else %>
                    <%= simple_format(value) %>
                  <% end %>

            <% end %>

                <% unless incoming_message.raw_email_id.nil? %>
                  <%= link_to "View raw email", "../show_raw_email/#{incoming_message.raw_email_id}", :class => "btn btn-mini" %>
                <% end %>
                <%= render :partial => 'incoming_message_actions', :locals => { :incoming_message => incoming_message } %>

  <% end %>

Annotations

<% if @info_request.comments.size > 0 %>

    <% for comment in @info_request.comments %>

          <a class="accordion-toggle" href="#comment_<%=comment.id%>" data-toggle="collapse" data-parent="comments">
            #<%=comment.id%>
            --
            <%=comment.user.name%>
            <%=admin_value(comment.created_at)%>

        <div id="comment_<%=comment.id%>" class="accordion-body collapse">

                  <%= user_link(comment.user, "btn btn-mini")%>
                  <%= link_to("admin #{comment.user.name}", user_admin_url(comment.user), :class => "btn btn-mini") %>
                  <%= link_to "Edit", "../edit_comment/#{comment.id}", :class => "btn btn-warning btn-mini" %>

              <% comment.for_admin_column do |name, value, type, column_name |%>

                    <%=name%>

                    <% if column_name == 'body' && !comment.visible %>
                      <s><%=h comment.send(column_name) %></s>
                    <% else %>
                      <%=h comment.send(column_name) %>
                    <% end %>

              <% end %>

    <% end %>

<% else %>

None yet.

<% end %>

Exim delivery logs

(Lines containing the request incoming email address, updated hourly.)

<% for exim_log_done_id, exim_logs in @info_request.exim_logs.group_by(&:exim_log_done_id) %>

<% for exim_log in exim_logs %><%=h exim_log.line%><% end %>

<% end %>
<% if @info_request.exim_logs.size == 0 %>

None (perhaps this is an old or a very new request)

<% end %>

Censor rules

<%= render :partial => 'admin_censor_rule/show', :locals => { :censor_rules => @info_request.censor_rules, :info_request => @info_request } %>

<% @title = _("FOI request - {{title}}", :title => h(@info_request.title)) %>
<%= javascript_include_tag :defaults %>

<%=@title%>

<% form_tag '../move_request', { :class => "form form-horizontal" } do %>
  <%= hidden_field_tag 'info_request_id', @info_request.id %>

      <% @info_request.for_admin_column do |name, value, type, column_name|%>

            <%= name %>:

            <% if type == 'datetime' %>
              <%= I18n.l(value, :format => "%e %B %Y %H:%M:%S") %>
              (<%= _('{{length_of_time}} ago', :length_of_time => time_ago_in_words(value)) %>)
            <% else %>
              <%= h value %>
            <% end %>
            <% if column_name == 'described_state' %>

Initial request last sent at: <%= @info_request.calculate_status %>

Initial request last sent at: <%=@info_request.date_initial_request_last_sent_at.to_date %>

Date response required by: <%= @info_request.date_response_required_by %>

Very overdue after: <%= @info_request.date_very_overdue_after %>

            <% end %>

      <% end %>

          Created by

          <%= user_link(@info_request.user, "btn btn-mini") %>
          <%= link_to _("admin"), user_admin_url(@info_request.user), :class => "btn btn-mini btn-warning" %>
          <%= link_to _("move..."), "#", :class => "btn btn-mini btn-warning toggle-hidden" %>

              url_name of new user:
              <%= text_field_tag 'user_url_name', "", { :size => 20 } %>
              <%= submit_tag "Move request to user", :class => "btn btn-info" %>

          Public authority:

          <%= public_body_link(@info_request.public_body, "btn btn-mini") %>
          <%= link_to _("admin"), public_body_admin_url(@info_request.public_body), :class => "btn btn-mini btn-warning" %>
          <%= link_to "move...", "#", :class => "btn btn-mini btn-warning toggle-hidden" %>

            url_name of new authority:
            <%= text_field_tag 'public_body_url_name', "", { :size => 20 } %>
            <%= submit_tag "Move request to authority", :class => "btn btn-info" %>

          <%=_("Incoming email address")%>

          <%= link_to h(@info_request.incoming_email), "mailto:#{@info_request.incoming_email}" %>

          <%=_("Tags")%>

          <%= render :partial => 'tags', :locals => { :info_request => @info_request} %>

<% end %>

<%= link_to 'Public page', main_url(request_url(@info_request)), :class => "btn" %>
<%= link_to 'Edit', '../edit/' + @info_request.id.to_s, :class => "btn" %>
<%= link_to 'FOI officer upload URL', '../generate_upload_url/' + @info_request.id.to_s, :class => "btn btn-warning" %> (see also links on incoming messages below)

Events

  <% for info_request_event in @info_request.info_request_events.find(:all, :order => "created_at, id") %>

        <a class="accordion-toggle" href="#event_<%=info_request_event.id%>" data-toggle="collapse" data-parent="events">
          <%= _("Event {{id}}", :id => info_request_event.id) %>
          --
          <%=h info_request_event.event_type.humanize %>
          <%= admin_date info_request_event.created_at%>
          <% if info_request_event.described_state != 'waiting_clarification' and info_request_event.event_type == 'response' %>
            <% form_tag '../mark_event_as_clarification', :class => "form form-inline admin-table-form admin-inline-form pull-right" do %>
              <%= hidden_field_tag 'info_request_event_id', info_request_event.id %>
              <%= submit_tag "Was clarification request", :class => "btn btn-mini btn-primary" %>
            <% end %>
          <% end %>

      <div id="event_<%=info_request_event.id%>" class="accordion-body collapse">

            <% info_request_event.for_admin_column do |name, value, type, column_name| %>

                  <%=h name%>

                  <% if column_name == 'params_yaml' %>
                    <%= info_request_event.params_yaml_as_html %>
                  <% elsif value.nil? %>
                    nil
                  <% elsif %w(text string).include?(type) %>
                    <%=h value.humanize %>
                  <% elsif type == 'datetime' %>
                    <%= admin_date value %>
                  <% else %>
                    <%=h value %>
                  <% end %>

            <% end %>

  <% end %>

Outgoing messages

  <% for outgoing_message in @info_request.outgoing_messages.find(:all, :order => 'created_at') %>

        <a class="accordion-toggle" href="#outgoing_<%=outgoing_message.id%>" data-toggle="collapse" data-parent="outgoing_messages">
          #<%= outgoing_message.id %> -- <%= outgoing_message.status.humanize %> <%= outgoing_message.message_type.humanize %>

      <div id="outgoing_<%=outgoing_message.id%>" class="accordion-body collapse">

                <% form_tag '../resend', :class => "admin-table-form" do %>
                  <%= hidden_field_tag 'outgoing_message_id', outgoing_message.id %>
                  <%= submit_tag "Resend", :class => "btn btn-warning" %>
                <% end %>
                <%= link_to "Edit", "../edit_outgoing/#{outgoing_message.id}", :class => "btn btn-warning" %>

            <% outgoing_message.for_admin_column do |name, value, type, column_name| %>

                  <%=name%>

                  <% if column_name == 'body' %>
                    <%= simple_format(truncate(outgoing_message.body, :length => 400, :omission => link_to("...", "#", :class => "toggle-hidden" ))) %>

<%= simple_format( outgoing_message.body ) %>

                  <% else %>
                    <%= admin_value(value) %>
                  <% end %>

            <% end %>

  <% end %>

Incoming messages

  <% for incoming_message in @info_request.incoming_messages.find(:all, :order => 'created_at') %>

        <a class="accordion-toggle" href="#incoming_<%=incoming_message.id%>" data-toggle="collapse" data-parent="incoming_messages">
          <%=incoming_message.id%> -- <%=incoming_message.mail_from%> <%=_("at")%> <%=admin_value(incoming_message.sent_at)%>

      <div id="incoming_<%=incoming_message.id%>" class="accordion-body collapse">

            <% incoming_message.for_admin_column do |name, value, type, column_name| %>

                  <%=name%>

                  <% if column_name =~ /^cached_.*?$/ %>
                    <%= simple_format( truncate(value, :length => 400, :omission => link_to("...", "#", :class => "toggle-hidden"))) %>

<%= simple_format(value) %>

                  <% else %>
                    <%= simple_format(value) %>
                  <% end %>

            <% end %>

                <% unless incoming_message.raw_email_id.nil? %>
                  <%= link_to "View raw email", "../show_raw_email/#{incoming_message.raw_email_id}", :class => "btn btn-mini" %>
                <% end %>
                <%= render :partial => 'incoming_message_actions', :locals => { :incoming_message => incoming_message } %>

  <% end %>

Annotations

<% if @info_request.comments.size > 0 %>

    <% for comment in @info_request.comments %>

          <a class="accordion-toggle" href="#comment_<%=comment.id%>" data-toggle="collapse" data-parent="comments">
            #<%=comment.id%>
            --
            <%=comment.user.name%>
            <%=admin_value(comment.created_at)%>

        <div id="comment_<%=comment.id%>" class="accordion-body collapse">

                  <%= user_link(comment.user, "btn btn-mini")%>
                  <%= link_to("admin #{comment.user.name}", user_admin_url(comment.user), :class => "btn btn-mini") %>
                  <%= link_to "Edit", "../edit_comment/#{comment.id}", :class => "btn btn-warning btn-mini" %>

              <% comment.for_admin_column do |name, value, type, column_name |%>

                    <%=name%>

                    <% if column_name == 'body' && !comment.visible %>
                      <s><%=h comment.send(column) %></s>
                    <% else %>
                      <%=h comment.send(column) %>
                    <% end %>

              <% end %>

    <% end %>

<% else %>

None yet.

<% end %>

Exim delivery logs

(Lines containing the request incoming email address, updated hourly.)

<% for exim_log_done_id, exim_logs in @info_request.exim_logs.group_by(&:exim_log_done_id) %>

<% for exim_log in exim_logs %><%=h exim_log.line%><% end %>

<% end %>
<% if @info_request.exim_logs.size == 0 %>

None (perhaps this is an old or a very new request)

<% end %>

Censor rules

<%= render :partial => 'admin_censor_rule/show', :locals => { :censor_rules => @info_request.censor_rules, :info_request => @info_request } %>


The message about the permissions is stupid

Sidan <%=h @page.title -%> skapades.

Glöm inte bort att ställa in vettiga rättigheter.


Add Filter field back in to comments edit page. [#200 state:resolved]

      Author
      <%= f.text_field :author, :class => "regular" %>

      Title
      <%= f.text_field :author_email, :class => "regular" %>

      Rating
      <%= f.text_field :rating, :class => "regular" %>

      Review
      <%= f.text_area :content, :rows => 10, :class => "regular" %>

        Filter

        <%= f.select :filter_id, [['<none>', '']] + TextFilter.descendants.map { |s| s.filter_name }.sort %>

  <%= submit_tag("Save review", :class => "button", :id => "comment_submit_button") %>

  <%= f.hidden_field :page_id %>

      Author
      <%= f.text_field :author, :class => "regular" %>

      Title
      <%= f.text_field :author_email, :class => "regular" %>

      Rating
      <%= f.text_field :rating, :class => "regular" %>

      Review
      <%= f.text_area :content, :rows => 10, :class => "regular" %>

  <%= submit_tag("Save review", :class => "button", :id => "comment_submit_button") %>

  <%= f.hidden_field :page_id %>


fix (again) to sharing form for projects, which do not have a policy

<%
   set_parameters_for_sharing_form
   show_advanced_permissions = !@resource.respond_to?(:has_advanced_permissions?) || @resource.has_advanced_permissions?
   default_projects_access_type = @resource.is_isa? ? Policy::EDITING : Policy::ACCESSIBLE
   default_consortium_access_type = Policy::VISIBLE
%>
<%# initialization: required to keep javascript independent of the access type codes, to allow the use the constants instead -%>
<%= render :partial=>"assets/sharing_constants" %>

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

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

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

          You may:

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

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

          <% if try_block{@resource.can_publish?} %>

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

          <% end %>

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

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

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

Or share it with..

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

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

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

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

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

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

    <% end -%>

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

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

Additional fine-grained sharing permissions

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

              Loading...

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

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

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

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

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

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

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

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

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

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

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

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

                  Step 3

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

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

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

                      Step 3: Choose access rights, review and submit

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

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

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

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

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

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

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

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

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

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

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

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

<%
   set_parameters_for_sharing_form
   show_advanced_permissions = !@resource.respond_to?(:has_advanced_permissions?) || @resource.has_advanced_permissions?
   default_projects_access_type = @resource.is_isa? ? Policy::EDITING : Policy::ACCESSIBLE
   default_consortium_access_type = Policy::VISIBLE
%>
<%# initialization: required to keep javascript independent of the access type codes, to allow the use the constants instead -%>
<%= render :partial=>"assets/sharing_constants" %>

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

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

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

          You may:

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

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

          <% if try_block{@resource.can_publish?} %>

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

          <% end %>

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

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

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

Or share it with..

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

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

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

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

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

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

    <% end -%>

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

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

Additional fine-grained sharing permissions

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

              Loading...

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

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

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

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

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

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

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

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

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

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

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

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

                  Step 3

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

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

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

                      Step 3: Choose access rights, review and submit

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

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

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

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

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

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

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

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

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

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

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

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