Fix bug in request follower count

Fix bug in request follower count

<div class="tracking-links-<%= location %>">
    <% follower_count = TrackThing.count(:all, :conditions => ["info_request_id = ?", track_thing.info_request.id]) + 1 %>
    <% if location == 'frontpage' %>

<%= link_to excerpt(track_thing.info_request.title, "", 70), request_url(track_thing.info_request) %>

    <% end %>
    <div class="request-tracker-<%= location %>">

<%= follower_count %>

<%= n_("Persona siguiendo esta petición", "Personas siguiendo esta petición", follower_count) %>

        <%
            if @user
                existing_track = TrackThing.find_by_existing_track(@user, track_thing)
            end
        %>
        <% if own_request %>

<%= _('This is your own request, so you will be automatically emailed when new responses arrive.')%>

        <% elsif existing_track %>
                <% form_tag({:controller => 'track', :action => 'update', :track_id => existing_track.id}, :class => "feed_form feed_form_" + location) do %>

                        <%= track_thing.params[:verb_on_page_already] %>
                        <%= hidden_field_tag 'track_medium', "delete" %>
                        <%= hidden_field_tag 'r', request.request_uri %>
                        <%= submit_tag _("unsubscribe") %>

                <% end %>
        <% elsif track_thing %>
            <div class="feed_link feed_link_<%=location%>">

                    <%= link_to _("También quiero saber"), do_track_url(track_thing) %>

            <% if location != 'frontpage' %>

              <div class="feed_link feed_link_<%=location%>">
                  <%= link_to '', do_track_url(track_thing, 'feed') %>
                  <%= link_to (location == 'sidebar' ? _('RSS feed of updates') : _('RSS feed')),  do_track_url(track_thing, 'feed') %>

            <% end %>
        <% end %>

<div class="tracking-links-<%= location %>">
    <% follower_count = TrackThing.count(:all, :conditions => ["info_request_id = ?", info_request.id]) + 1 %>
    <% if location == 'frontpage' %>

<%= link_to excerpt(track_thing.info_request.title, "", 70), request_url(track_thing.info_request) %>

    <% end %>
    <div class="request-tracker-<%= location %>">

<%= follower_count %>

<%= n_("Persona siguiendo esta petición", "Personas siguiendo esta petición", follower_count) %>

        <%
            if @user
                existing_track = TrackThing.find_by_existing_track(@user, track_thing)
            end
        %>
        <% if own_request %>

<%= _('This is your own request, so you will be automatically emailed when new responses arrive.')%>

        <% elsif existing_track %>
                <% form_tag({:controller => 'track', :action => 'update', :track_id => existing_track.id}, :class => "feed_form feed_form_" + location) do %>

                        <%= track_thing.params[:verb_on_page_already] %>
                        <%= hidden_field_tag 'track_medium', "delete" %>
                        <%= hidden_field_tag 'r', request.request_uri %>
                        <%= submit_tag _("unsubscribe") %>

                <% end %>
        <% elsif track_thing %>
            <div class="feed_link feed_link_<%=location%>">

                    <%= link_to _("También quiero saber"), do_track_url(track_thing) %>

            <% if location != 'frontpage' %>

              <div class="feed_link feed_link_<%=location%>">
                  <%= link_to '', do_track_url(track_thing, 'feed') %>
                  <%= link_to (location == 'sidebar' ? _('RSS feed of updates') : _('RSS feed')),  do_track_url(track_thing, 'feed') %>

            <% end %>
        <% end %>


okay, question mark here

okay, question mark here

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<title><%= AppConfig.param("app_name") %> | <%= @page_title %></title>
 <%= stylesheet_link_tag 'basic' %>

<%= render(:partial => "layout_helpers/resolve_head_content" ) %>

<%= render(:partial => "layout_helpers/resolve_body_open" ) %>

  <%= image_tag('/local/header.gif', :style=>"float: left;")
  %>

  Welcome to the new Find It interface. Feedback on our new interface? Please send to asklib@jhu.edu.

URL:
        <% url = permalink_url(request, @user_request) %>
        <%= link_to url, url %>

    <%= @content_for_layout %>

  FindIt service provided by <%= link_to 'Johns Hopkins Libraries', 'http://webapps.jhu.edu/jhuniverse/libraries/' %> | Powered by <%= link_to 'Umlaut', 'http://umlaut.rubyforge.org/' %>, using services from <%= link_to 'SFX', 'http://www.exlibrisgroup.com/sfx.htm' %>, <%= link_to 'CrossRef', 'http://www.crossref.org' %>, <%= link_to 'Amazon', 'http://www.amazon.com' %>, <%= link_to 'OCLC Worldcat', 'http://www.worldcat.org' %>, <%= link_to 'ISBNdb', 'http://isbndb.com' %> and others.

  <%=
  link_to('[S]', AppConfig.param('main_sfx_base_url') + '?' + (hash_to_querystring(@user_request.original_co_params)), :target=>'_blank') if AppConfig.param('main_sfx_base_url') && @user_request && @user_request.original_co_params%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<title><%= AppConfig.param("app_name") %> | <%= @page_title %></title>
 <%= stylesheet_link_tag 'basic' %>

<%= render(:partial => "layout_helpers/resolve_head_content" ) %>

<%= render(:partial => "layout_helpers/resolve_body_open" ) %>

  <%= image_tag('/local/header.gif', :style=>"float: left;")
  %>

  Welcome to the new Find It interface. Feedback on our new interface? Please send to asklib@jhu.edu.

URL:
        <% url = permalink_url(request, @user_request) %>
        <%= link_to url, url %>

    <%= @content_for_layout %>

  FindIt service provided by <%= link_to 'Johns Hopkins Libraries', 'http://webapps.jhu.edu/jhuniverse/libraries/' %> | Powered by <%= link_to 'Umlaut', 'http://umlaut.rubyforge.org/' %>, using services from <%= link_to 'SFX', 'http://www.exlibrisgroup.com/sfx.htm' %>, <%= link_to 'CrossRef', 'http://www.crossref.org' %>, <%= link_to 'Amazon', 'http://www.amazon.com' %>, <%= link_to 'OCLC Worldcat', 'http://www.worldcat.org' %>, <%= link_to 'ISBNdb', 'http://isbndb.com' %> and others.

  <%=
  link_to('[S]', AppConfig.param('main_sfx_base_url') + (hash_to_querystring(@user_request.original_co_params)), :target=>'_blank') if AppConfig.param('main_sfx_base_url') && @user_request && @user_request.original_co_params%>


changed labels to deleted events

changed labels to deleted events

<%content_for("left") do-%>
<%= render :partial => "layouts/nav_bar", :locals => {:category => @minute.class.to_s.pluralize, :property => "Minutes for #{@minute.event ? @minute.event.title : "[Deleted event]"}"} -%>

<%= link_to "Minutes for #{@minute.event ? @minute.event.title : "[Deleted event]"}", :action => 'show', :id => @minute-%>

  <%= @minute.body -%>

<%if @current_user -%><%= link_to 'Edit', :action => 'edit', :id => @minute %> | <%end-%>
<%= link_to 'Minutes list', :action => 'list' %>
<%end-%>
<%content_for("right") do-%>

<%if @recent_minutes-%>

Recent minutes

    <%for minute in @recent_minutes -%>

<%= link_to truncate((minute.event ? minute.event.title : "[Deleted event]"),30), :id => minute-%>

    <%end-%>

<%= link_to "Show all", :action => 'list'-%>
<%end-%>

Properties

  <%if @minute.event-%>
Event: <%= link_to @minute.event.title, :controller => 'events', :action => 'show', :id => @minute.event-%>
<%end-%>

Posted by: <%= @minute.author.fullname-%>

Created on: <%= @minute.created_at.strftime("%d %b, %Y")-%>

Published: <%= @minute.published == true ? "Yes" : "No"-%>

<%end-%>

<%content_for("left") do-%>
<%= render :partial => "layouts/nav_bar", :locals => {:category => @minute.class.to_s.pluralize, :property => "Minutes for #{@minute.event.title}"} -%>

<%= link_to "Minutes for #{@minute.event.title}", :action => 'show', :id => @minute-%>

  <%= @minute.body -%>

<%if @current_user -%><%= link_to 'Edit', :action => 'edit', :id => @minute %> | <%end-%>
<%= link_to 'Minutes list', :action => 'list' %>
<%end-%>
<%content_for("right") do-%>

<%if @recent_minutes-%>

Recent minutes

    <%for minute in @recent_minutes -%>

<%= link_to truncate(minute.event.title,30), :id => minute-%>

    <%end-%>

<%= link_to "Show all", :action => 'list'-%>
<%end-%>

Properties

Event: <%= link_to @minute.event.title, :controller => 'events', :action => 'show', :id => @minute.event-%>

Posted by: <%= @minute.author.fullname-%>

Created on: <%= @minute.created_at.strftime("%d %b, %Y")-%>

Published: <%= @minute.published == true ? "Yes" : "No"-%>

<%end-%>


Added continue reading, and posted by footnote.

<%content_for("left") do-%>
<%=render :partial => "events/upcoming"-%>
<%for article in @articles-%>

<%= link_to article.title, :controller => 'articles', :action => 'show', :id => article.id -%>

<%= truncate(article.body, 600) -%>

  <%= link_to("Continue reading", :controller => 'articles', :action => 'show', :id => article.id) if article.body.length >= 600 -%>

Posted by <%= link_to article.author.fullname, :controller => 'people', :action => 'show', :id => article.author.id-%> on <%= article.created_at.strftime("%d %b, %Y")-%>

<%end-%>

<%= link_to "Older articles", :controller => "articles", :action => "list"-%>
<%end-%>
<%content_for("right") do-%>
<%= render :partial => "layouts/categories_nav" -%>
<%= render :partial => "layouts/album" -%>
<%= render :partial => "layouts/about" -%>
<%end-%>

<%content_for("left") do-%>
<%=render :partial => "events/upcoming"-%>
<%for article in @articles-%>

<%= link_to article.title, :controller => 'articles', :action => 'show', :id => article.id -%>

<%= article.body -%>

<%end-%>

<%= link_to "Older articles", :controller => "articles", :action => "list"-%>
<%end-%>
<%content_for("right") do-%>
<%= render :partial => "layouts/categories_nav" -%>
<%= render :partial => "layouts/album" -%>
<%= render :partial => "layouts/about" -%>
<%end-%>


Improve layout of user options page.

Improve layout of user options page.

<%= t 'user.account.my settings' %>

<%= error_messages_for 'user' %>
<% form_for :user, @user do |f| %>

<%= t 'user.new.display name' %>	<%= f.text_field :display_name %>

<%= t 'user.new.email address' %>	<%= f.text_field :email, {:size => 50, :maxlength => 255} %> <%= t 'user.account.email never displayed publicly' %>

<%= t 'user.new.password' %>	<%= f.password_field :pass_crypt, {:value => '', :size => 30, :maxlength => 255} %>

<%= t 'user.new.confirm password' %>	<%= f.password_field :pass_crypt_confirmation, {:value => '', :size => 30, :maxlength => 255} %>

  <%= t 'user.account.public editing.heading' %>

<% if @user.data_public? %>
  <%= t 'user.account.public editing.enabled' %> (<a href="<%= t 'user.account.public editing.enabled link' %>" target="_new"><%= t 'user.account.public editing.enabled link text' %>)
<% else %>
  <%= t 'user.account.public editing.disabled' %>(<%= t 'user.account.public editing.disabled link text' %>)
<% end %>

<%= t 'user.account.profile description' %>	<%= f.text_area :description, :rows => '5', :cols => '60' %>

<%= t 'user.account.preferred languages' %>	<%= f.text_field :languages %>

  <tr id="homerow" <% unless @user.home_lat and @user.home_lon %> class="nohome" <%end%> ><%= t 'user.account.home location' %>	<%= t 'user.account.no home location' %><%= t 'user.account.latitude' %> <%= f.text_field :home_lat, :size => 20, :id => "home_lat" %><%= t 'user.account.longitude' %><%= f.text_field :home_lon, :size => 20, :id => "home_lon" %>

<%= t 'user.account.update home location on click' %> <input type="checkbox" value="1" <% unless @user.home_lat and @user.home_lon %> checked="checked" <% end %> id="updatehome" />

<%= submit_tag t('user.account.save changes button') %>

<% end %>

<%= render :partial => 'friend_map' %>
<% unless @user.data_public? %>

Public editing

  Currently your edits are anonymous and people can't send you messages or see your location. To show what you edited and allow people to contact you through the website, click the button below.
  Since the 0.6 API changeover, only public users can edit map data. (find out why).

  Your email address will not be revealed by becoming public.

  This action cannot be reversed and all new users are now public by default.

  <%= button_to t('user.account.make all my edits public button'), :action => :go_public %>
<% end %>

<%= link_to t('user.account.return to profile'), :controller => 'user', :action => @user.display_name %>


Overlooked the need for an index on the list too.

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

<% i = 0;
for @ror_question in @ror_questions %>
  <%=@ror_question.txt%>

  <%if params[:action] != 'new' %>
	  <input id=new_metareview_score_<%=i%>_comments name=new_metareview_score[<%=i%>][comments] size=70 value = "<%=@ror_review_scores[i].comments.gsub(/\"/,'"')%>" type=text />
  <%else%>
	 <input id=new_metareview_score_<%=i%>_comments name=new_metareview_score[<%=i%>][comments] size=70 type=text />
  <%end%>
  <% if @ror_question.true_false? %>
      <select id=new_score_<%=i%> name=new_score[<%=i%>]>
         <%if params[:action] != 'new' %>
           <option value="<%=@ror_min%>" <%if @ror_min==@ror_review_scores[i].score%>selected="selected"<%end%> ><%=@ror_min%></option>
           <option value="<%=@ror_max%>" <%if @ror_max==@ror_review_scores[i].score%>selected="selected"<%end%> ><%=@ror_max%></option>
         <%else%>
           <option value="<%=@ror_min%>"><%=@ror_min%></option>
           <option value="<%=@ror_max%>"><%=@ror_max%></option>
         <%end%>
      </select>

  <% else %>
      <select id=new_score_<%=i%> name=new_score[<%=i%>]>
          <% for j in @ror_min..@ror_max %>
	     <%if params[:action] != 'new' %>
            	<option value="<%=j%>"<%if j==@ror_review_scores[i].score%> selected="selected"<%end%> ><%=j%></option>
             <%else%>
		<option value="<%=j%>" ><%=j%></option>
	     <%end%>
          <% end %>
      </select>

  <% end %>
  <input id=new_question_<%=i%> name=new_question[<%=i%>] value=<%=@ror_question.id%> type=hidden />
<% i += 1;
end %>

<% i = 0;
for @ror_question in @ror_questions %>
  <%=@ror_question.txt%>

  <%if params[:action] != 'new' %>
	  <input id=new_metareview_score_<%=i%>_comments name=new_metareview_score[<%=i%>][comments] size=70 value = "<%=@ror_review_scores[i].comments.gsub(/\"/,'"')%>" type=text />
  <%else%>
	 <input id=new_metareview_score_<%=i%>_comments name=new_metareview_score[<%=i%>][comments] size=70 type=text />
  <%end%>
  <% if @ror_question.true_false? %>
      <select id=new_score_<%=i%> name=new_score[<%=i%>]>
         <%if params[:action] != 'new' %>
           <option value="<%=@ror_min%>" <%if @ror_min==@ror_review_scores.score%>selected="selected"<%end%> ><%=@ror_min%></option>
           <option value="<%=@ror_max%>" <%if @ror_max==@ror_review_scores.score%>selected="selected"<%end%> ><%=@ror_max%></option>
         <%else%>
           <option value="<%=@ror_min%>"><%=@ror_min%></option>
           <option value="<%=@ror_max%>"><%=@ror_max%></option>
         <%end%>
      </select>

  <% else %>
      <select id=new_score_<%=i%> name=new_score[<%=i%>]>
          <% for j in @ror_min..@ror_max %>
	     <%if params[:action] != 'new' %>
            	<option value="<%=j%>"<%if j==@ror_review_scores[i].score%> selected="selected"<%end%> ><%=j%></option>
             <%else%>
		<option value="<%=j%>" ><%=j%></option>
	     <%end%>
          <% end %>
      </select>

  <% end %>
  <input id=new_question_<%=i%> name=new_question[<%=i%>] value=<%=@ror_question.id%> type=hidden />
<% i += 1;
end %>


Put Scottish part of ICO help in better place, make it shorter.

<% @title = "Unhappy about a Freedom of Information request?" %>

<% if !@info_request.nil? %>

Unhappy about the response you got
to your request '<%=request_link(@info_request) %>'?

<% else %>

Unhappy about the response you got?

<% end %>

If ...

You didn't get a reply within 20 working days

You did not get all of the information that you requested or

Your request was rejected, but without a reason valid under the law

... you can

Ask for an internal review at the public authority.

If that doesn't help, complain to the Information Commisioner.

Either way, also use other means to answer your question.

1. Asking for an internal review #

<% if !@info_request.nil? %>
    Choose <%= link_to "request an internal review", show_response_no_followup_url(:id => @info_request.id, :incoming_message_id => nil) + "?internal_review=1#followup" %> and then write a message asking the authority to review your request.
<% else %>
    At the bottom of the relevant request page on WhatDoTheyKnow choose
    "request an internal review". Then write a message asking for an internal
    review of your request. You may want to include a link to the
    request page, to make it clear which request you are talking about.
<% end %>

Internal reviews should be quick. If one takes longer than 20 working days
then the authority should write and let you know, and it should never take
longer than 40 working days (see this
good
practice guide).
You will then either get the information that
you originally requested, or you will be told that the review upholds the
original decision.

2. Complaining to the Information Commissioner #

If you are still unhappy after the public authority has done their internal review,
then you can complain to the Information Commisioner. To do this read
Complaints about Freedom of Information
on the Information Commisioner's website. If you requested information from a Scottish
authority, then  appeal
to the Scottish Information Commissioner.

To make it easier to send the relevant information to the
Information Commisioner, either
<% if !@info_request.nil? %>
    include a link to your request
    <%=h main_url(request_url(@info_request)) %>
<% else %>
    include a link to your request on WhatDoTheyKnow
<% end %>
in your complaint or print out the whole page of your request and all attachments.

WhatDoTheyKnow has no special facilities for handling a request at this stage - it
passes into the Information Commissioner's system. You can leave annotations on your
request keeping people informed of progress.

A warning. There is a backlog of work at the Information Commissioner, and
it can take literally years to get resolution from them. If you reach this point,
you should accept that you won't get the information quickly by this means. Maybe
you want to help the fight to improve Freedom of Information, or maybe
getting the information slowly is still worthwhile. You can also try and
get the information by other means...

3. Using other means to answer your question #

You can try persuing your problem or your research in other ways.

Make a new FOI request for summary information, or for
documentation relating indirectly to matters in your rejected request.
Ask us for ideas if you're stuck.

If any other public authorities or publicly owned companies are involved,
then make FOI requests to them.

Write to your MP or other politician using WriteToThem and ask for their help
finding the answer. MPs can write directly to ministers or departments, and
can ask written questions in the House of Commons. Councillors in local authorities
can talk directly to council officers.

Ask other researchers who are interested in a similar
issue to yours for ideas. You can sometimes find them by browsing this site;
contact any registered user from their page. There may be an Internet
forum or group that they hang out in. If it is a local matter, use GroupsNearYou to find such a
forum.

Start a pledge on PledgeBank to get
others to act together with you. For example, you could arrange a meeting with
staff from the authority. Or you could form a small local campaigns group.

<% @title = "Unhappy about a Freedom of Information request?" %>

<% if !@info_request.nil? %>

Unhappy about the response you got
to your request '<%=request_link(@info_request) %>'?

<% else %>

Unhappy about the response you got?

<% end %>

If ...

You didn't get a reply within 20 working days

You did not get all of the information that you requested or

Your request was rejected, but without a reason valid under the law

... you can

Ask for an internal review at the public authority.

If that doesn't help, complain to the Information Commisioner.

Either way, also use other means to answer your question.

1. Asking for an internal review #

<% if !@info_request.nil? %>
    Choose <%= link_to "request an internal review", show_response_no_followup_url(:id => @info_request.id, :incoming_message_id => nil) + "?internal_review=1#followup" %> and then write a message asking the authority to review your request.
<% else %>
    At the bottom of the relevant request page on WhatDoTheyKnow choose
    "request an internal review". Then write a message asking for an internal
    review of your request. You may want to include a link to the
    request page, to make it clear which request you are talking about.
<% end %>

Internal reviews should be quick. If one takes longer than 20 working days
then the authority should write and let you know, and it should never take
longer than 40 working days (see this
good
practice guide).
You will then either get the information that
you originally requested, or you will be told that the review upholds the
original decision.

2. Complaining to the Information Commissioner #

If you are still unhappy after the public authority has done their internal review,
then you can complain to the Information Commisioner. To do this read
Complaints about Freedom of Information
on the Information Commisioner's website.

To make it easier to send the relevant information to the
Information Commisioner, either
<% if !@info_request.nil? %>
    include a link to your request
    <%=h main_url(request_url(@info_request)) %>
<% else %>
    include a link to your request on WhatDoTheyKnow
<% end %>
in your complaint or print out the whole page of your request and all attachments.

WhatDoTheyKnow has no special facilities for handling a request at this stage - it
passes into the Information Commissioner's system. You can leave annotations on your
request keeping people informed of progress.

A warning. There is a backlog of work at the Information Commissioner, and
it can take literally years to get resolution from them. If you reach this point,
you should accept that you won't get the information quickly by this means. Maybe
you want to help the fight to improve Freedom of Information, or maybe
getting the information slowly is still worthwhile. You can also try and
get the information by other means...

If you've requested information from a Scottish public authority, then you'll need to complain to
the Scottish Information Commissioner.  They have published guidance on how to make a complaint
to them on their website.

3. Using other means to answer your question #

You can try persuing your problem or your research in other ways.

Make a new FOI request for summary information, or for
documentation relating indirectly to matters in your rejected request.
Ask us for ideas if you're stuck.

If any other public authorities or publicly owned companies are involved,
then make FOI requests to them.

Write to your MP or other politician using WriteToThem and ask for their help
finding the answer. MPs can write directly to ministers or departments, and
can ask written questions in the House of Commons. Councillors in local authorities
can talk directly to council officers.

Ask other researchers who are interested in a similar
issue to yours for ideas. You can sometimes find them by browsing this site;
contact any registered user from their page. There may be an Internet
forum or group that they hang out in. If it is a local matter, use GroupsNearYou to find such a
forum.

Start a pledge on PledgeBank to get
others to act together with you. For example, you could arrange a meeting with
staff from the authority. Or you could form a small local campaigns group.


Link OSM logo in site layout to the site's homepage (default map view).


Remove mobile phone number from help page

<% @title = "Contáctanos" %>

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

Contáctanos

Nos encantaría hablar contigo. Por favor usa una de estos métodos para comunicarte con nosotros:

Correo electrónico (email)

Escribe al equipo de tuderechoasaber.es en: contacto@tuderechoasaber.es

Puedes escribirnos en ingles, francés, alemán o español. Intentamos responder a los mensajes en 24-48 horas.

Teléfono

Puedes llamar a la oficina de Access Info y hablar con nosotros en inglés, francés, alemán o español:

Oficina (10-19 hora de Madrid): +34 91 366 5344

Twitter

        Síguenos en Twitter:
        Sígue a @tuderechoasaber

Dirección postal

Access Info Europe

    Calle Príncipe de Anglona 5, 2c

    28005 Madrid

    España

<% @title = "Contáctanos" %>

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

Contáctanos

Nos encantaría hablar contigo. Por favor usa una de estos métodos para comunicarte con nosotros:

Correo electrónico (email)

Escribe al equipo de tuderechoasaber.es en: contacto@tuderechoasaber.es

Puedes escribirnos en ingles, francés, alemán o español. Intentamos responder a los mensajes en 24-48 horas.

Teléfono

Puedes llamar a la oficina de Access Info y hablar con nosotros en inglés, francés, alemán o español:

Oficina (10-19 hora de Madrid): +34 91 366 5344

Móvil (cualquier hora): + 34 667 685 319

Twitter

        Síguenos en Twitter:
        Sígue a @tuderechoasaber

Dirección postal

Access Info Europe

    Calle Príncipe de Anglona 5, 2c

    28005 Madrid

    España


remove group summary from group banner

remove group summary from group banner

<% if @group.parent_id -%>
  <%- @parent ||= @group.parent -%>

        <%= avatar_for @parent, 'xsmall', :class => '' %>
        <%= link_to_group @parent %>

      <%= mini_search_form %>

        <%= avatar_for @group, 'small', :class => 'child' %>
        <%= link_to_group @group %>

<% else -%>
  <% if @group.new_record? and @parent %>
    <% group = @parent; search = false %>
  <% else %>
    <% group = @group; search = true %>
  <% end %>

    <%= avatar_for group, 'medium' %>

<%= link_to_group group, :display_name => true %>

      <%= mini_search_form if search %>

<% end -%>

<% if @group.parent_id -%>
  <%- @parent ||= @group.parent -%>

        <%= avatar_for @parent, 'xsmall', :class => '' %>
        <%= link_to_group @parent %>

      <%= mini_search_form %>

        <%= avatar_for @group, 'small', :class => 'child' %>
        <%= link_to_group @group %> <%= @group.profiles.public.summary_html %>

<% else -%>
  <% if @group.new_record? and @parent %>
    <% group = @parent; search = false %>
  <% else %>
    <% group = @group; search = true %>
  <% end %>

    <%= avatar_for group, 'medium' %>

<%= link_to_group group, :display_name => true %>

      <%= mini_search_form if search %>

<% end -%>


Added dashboard link to use anchor

Added dashboard link to use anchor

  <% if myself.id %>

    « View Site
    <% if @cms_return_to_site_url -%> |
      <a href='<%= h @cms_return_to_site_url -%>'>« Return to site
    <% end -%>

    <a href='<%= url_for :controller => "/account" %>'><%= "my account".t %>
      |
    <a href='<%= url_for :controller => '/manage/access', :action => 'logout' %>'><%= "logout".t %>
      |
      <%= webiva_search_widget -%>

  <% end -%>

<img src='<%= WEBIVA_LOGO_FILE || theme_src("framework/logo.gif") %>'>

<%  # Foreground, Background
    @menu_colors = { 'website' => [ '#29974e', '#add4b8' ],
                    'files_and_images' => [ '#df5323', "#d4a451" ],
                    'content' => [ '#539424', "#c1d0a1" ],
                    'e_marketing' => [ '#5299c4', "#d3e8ec" ],
                    'options' => [ '#be8806', "#f3e380" ],
                    'system' => [ '#5a514f', "#c9ccce" ],
                    'people' => [ '#8d796a', "#d0c5a3"  ]
                    }
    %>

          <% @menu.each do |mnu| -%>

<a href='<%= mnu[3] %>' style='background-image:url(<%= theme_src("framework/menu_icon/#{mnu[1]}#{@cms_page_info[:section] == mnu[0] ? '_selected' : ''}.gif")  %>); color:<%= @menu_colors[mnu[0]][0] %>'><%= mnu[2].t %>

          <% end -%>

<div id='cms_title_bar' style=' <%= "background-color:#{@menu_colors[@cms_page_info[:section]][1]}; color:#{@menu_colors[@cms_page_info[:section]][0]}" if @menu_colors[@cms_page_info[:section]] %>'>
     <% if  @cms_page_info[:title].is_a?(Array) %>
          <% @cms_page_info[:title].each do |item| %>
            <% if item.is_a?(Array) && item[1] %>
              <a style='<%= "color:#{@menu_colors[@cms_page_info[:section]][0]}" if @menu_colors[@cms_page_info[:section]] %>'  href='<%= item[1] %>'><%= h( item.length > 2 ? sprintf(item[0].t,*item[2..-1]) : item[0].t) %>
            <% else -%>
              <% if item.is_a?(Array) %>
                <%= h(sprintf(item[0].t,*item[2..-1])) %>
              <% else -%>
                <%= h item.t %>
              <% end -%>
            <% end -%>
            <%= ">" unless item == @cms_page_info[:title].last %>
          <% end -%>
      <% else -%>
			 <%= @cms_page_info[:title].t %>
      <% end -%>

        <% if session[:context_translation] && permit?('client_admin') %>
          <a href='javascript:void(0);' onclick='openWindow("<%= url_for :controller => '/manage/translate', :action => 'context' %>","Win",800,600,"yes","yes");'><img src='<%= theme_src("framework/page_title_translate.gif") %>' width='32' height='32' align='absmiddle'/>

        <% end -%>
        <% if @cms_titlebar_handlers && @cms_titlebar_handlers.length > 0 -%>
          <%= @cms_titlebar_handlers.map { |h| h.send(:titlebar_html) }.join("") -%>
        <% end -%>
        <% if @cms_page_info[:menu_js] %>
        <a href='javascript:void(0);' onclick='<%= @cms_page_info[:menu_js] %>'><img src='<%= theme_src("framework/page_title_menu_icon.gif")%>' width='28' height='29'  align='absmiddle' />
        <% end -%>

  <% if flash[:notice] %>

<%= flash[:notice] %> (Close Notice)

  <% end -%>
  <%= render :partial => '/layouts/wizard_top' if @wizard %>
    <div id='cms_<%=@cms_page_info[:section]%>_content'>
    <%= yield %>

  <%= render :partial => '/layouts/wizard_bottom' if @wizard %>


Use new truncate syntax for new Rails

Use new truncate syntax for new Rails

<% @title = "FOI request - " + h(@info_request.title) %>
<%= javascript_include_tag :defaults %>

<%=@title%>

<% for column in InfoRequest.content_columns %>
  <%= column.human_name %>: <%=h @info_request.send(column.name) %>

<% end %>
Created by: <%= user_both_links(@info_request.user) %>

Public authority: <%= public_body_both_links(@info_request.public_body) %>

Incoming email address: <%= link_to h(@info_request.incoming_email), "mailto:" + @info_request.incoming_email %>

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

Events

  Id
  <% for column in InfoRequestEvent.content_columns %>
    <%= column.human_name %>
  <% end %>
  Actions

<% for info_request_event in @info_request.info_request_events.find(:all, :order => "created_at, id") %>
  <tr class="<%= cycle('odd', 'even') %>">
  <%=h info_request_event.id %>
  <% for column in InfoRequestEvent.content_columns %>

      <% if column.name == 'params_yaml' %>
        <%= info_request_event.params_yaml_as_html %>
      <% elsif column.text? %>
        <%=h (info_request_event.send(column.name) || '').gsub(/_/,' ') %>
      <% else %>
        <%=h info_request_event.send(column.name) %>
      <% end %>

  <% end %>

    <% if info_request_event.described_state != 'waiting_clarification' and info_request_event.event_type == 'response' %>
        <% form_tag '../mark_event_as_clarification' do %>

              <%= hidden_field_tag 'info_request_event_id', info_request_event.id %>
              <%= submit_tag "Was clarification request" %>

        <% end %>
    <% end %>

<% end %>

Outgoing messages

    Id
    <% for column in OutgoingMessage.content_columns %>
      <%= column.human_name %>
    <% end %>
    Actions

<% for outgoing_message in @info_request.outgoing_messages.find(:all, :order => 'created_at') %>
  <tr class="<%= cycle('odd', 'even') %>">
  <%=h outgoing_message.id %>
  <% for column in OutgoingMessage.content_columns.map { |c| c.name } %>

    <% if column == 'body' %>

<%= simple_format( truncate(outgoing_message.body, :length => 400,
                 :omission => link_to_function("...", "$(this).up('td').childElements().invoke('toggle')")
            )) %>

<%= simple_format( outgoing_message.body ) %>

    <% else %>
      <%= simple_format( outgoing_message.send(column) ) %>
    <% end %>

  <% end %>

  <% form_tag '../resend' do %>

          <%= hidden_field_tag 'outgoing_message_id', outgoing_message.id %>
          <%= submit_tag "Resend" %>

  <% end %>
  <%= link_to "Edit", '../edit_outgoing/' + outgoing_message.id.to_s %>

<% end %>

Incoming messages

  Id
  <% for column in IncomingMessage.content_columns %>
    <%= column.human_name %>
  <% end %>
  Actions

<% for incoming_message in @info_request.incoming_messages.find(:all, :order => 'created_at') %>
  <tr class="<%= cycle('odd', 'even') %>" id="incoming-<%=incoming_message.id.to_s%>">
  <%=h incoming_message.id %>
  <% for column in IncomingMessage.content_columns.map { |c| c.name } %>
    <% if column =~ /^cached_.*?$/ %>

<%= simple_format( truncate(incoming_message.send(column), :length => 400,
               :omission => link_to_function("...", "$(this).up('td').childElements().invoke('toggle')")
            )) %>

<%= simple_format( incoming_message.send(column) ) %>

    <% else %>
      <%= simple_format( incoming_message.send(column) ) %>
    <% end %>
  <% end %>

        <% if !incoming_message.raw_email_id.nil? %>

            <%= link_to "View raw email", "../show_raw_email/" + incoming_message.raw_email_id.to_s %>

        <% end %>
        <%= render :partial => 'incoming_message_actions', :locals => { :incoming_message => incoming_message } %>

<% end %>

Annotations

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

    Id
    Posted by
    <% for column in Comment.content_columns %>
      <%= column.human_name %>
    <% end %>
    Actions

  <% for comment in @info_request.comments %>
    <tr class="<%= cycle('odd', 'even') %>">
    <%=h comment.id %>
    <%= user_both_links(comment.user) %>
    <% for column in Comment.content_columns.map { |c| c.name } %>
      <% if column == 'body' && !comment.visible %>
          <s><%=h comment.send(column) %></s>
      <% else %>
          <%=h comment.send(column) %>
      <% end %>
    <% end %>

        <%= link_to "Edit", '../edit_comment/' + comment.id.to_s %>

  <% 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 - " + h(@info_request.title) %>
<%= javascript_include_tag :defaults %>

<%=@title%>

<% for column in InfoRequest.content_columns %>
  <%= column.human_name %>: <%=h @info_request.send(column.name) %>

<% end %>
Created by: <%= user_both_links(@info_request.user) %>

Public authority: <%= public_body_both_links(@info_request.public_body) %>

Incoming email address: <%= link_to h(@info_request.incoming_email), "mailto:" + @info_request.incoming_email %>

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

Events

  Id
  <% for column in InfoRequestEvent.content_columns %>
    <%= column.human_name %>
  <% end %>
  Actions

<% for info_request_event in @info_request.info_request_events.find(:all, :order => "created_at, id") %>
  <tr class="<%= cycle('odd', 'even') %>">
  <%=h info_request_event.id %>
  <% for column in InfoRequestEvent.content_columns %>

      <% if column.name == 'params_yaml' %>
        <%= info_request_event.params_yaml_as_html %>
      <% elsif column.text? %>
        <%=h (info_request_event.send(column.name) || '').gsub(/_/,' ') %>
      <% else %>
        <%=h info_request_event.send(column.name) %>
      <% end %>

  <% end %>

    <% if info_request_event.described_state != 'waiting_clarification' and info_request_event.event_type == 'response' %>
        <% form_tag '../mark_event_as_clarification' do %>

              <%= hidden_field_tag 'info_request_event_id', info_request_event.id %>
              <%= submit_tag "Was clarification request" %>

        <% end %>
    <% end %>

<% end %>

Outgoing messages

    Id
    <% for column in OutgoingMessage.content_columns %>
      <%= column.human_name %>
    <% end %>
    Actions

<% for outgoing_message in @info_request.outgoing_messages.find(:all, :order => 'created_at') %>
  <tr class="<%= cycle('odd', 'even') %>">
  <%=h outgoing_message.id %>
  <% for column in OutgoingMessage.content_columns.map { |c| c.name } %>

    <% if column == 'body' %>

<%= simple_format( truncate(outgoing_message.body, 400,
                  link_to_function("...", "$(this).up('td').childElements().invoke('toggle')")
            )) %>

<%= simple_format( outgoing_message.body ) %>

    <% else %>
      <%= simple_format( outgoing_message.send(column) ) %>
    <% end %>

  <% end %>

  <% form_tag '../resend' do %>

          <%= hidden_field_tag 'outgoing_message_id', outgoing_message.id %>
          <%= submit_tag "Resend" %>

  <% end %>
  <%= link_to "Edit", '../edit_outgoing/' + outgoing_message.id.to_s %>

<% end %>

Incoming messages

  Id
  <% for column in IncomingMessage.content_columns %>
    <%= column.human_name %>
  <% end %>
  Actions

<% for incoming_message in @info_request.incoming_messages.find(:all, :order => 'created_at') %>
  <tr class="<%= cycle('odd', 'even') %>" id="incoming-<%=incoming_message.id.to_s%>">
  <%=h incoming_message.id %>
  <% for column in IncomingMessage.content_columns.map { |c| c.name } %>
    <% if column =~ /^cached_.*?$/ %>

<%= simple_format( truncate(incoming_message.send(column), 400,
                  link_to_function("...", "$(this).up('td').childElements().invoke('toggle')")
            )) %>

<%= simple_format( incoming_message.send(column) ) %>

    <% else %>
      <%= simple_format( incoming_message.send(column) ) %>
    <% end %>
  <% end %>

        <% if !incoming_message.raw_email_id.nil? %>

            <%= link_to "View raw email", "../show_raw_email/" + incoming_message.raw_email_id.to_s %>

        <% end %>
        <%= render :partial => 'incoming_message_actions', :locals => { :incoming_message => incoming_message } %>

<% end %>

Annotations

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

    Id
    Posted by
    <% for column in Comment.content_columns %>
      <%= column.human_name %>
    <% end %>
    Actions

  <% for comment in @info_request.comments %>
    <tr class="<%= cycle('odd', 'even') %>">
    <%=h comment.id %>
    <%= user_both_links(comment.user) %>
    <% for column in Comment.content_columns.map { |c| c.name } %>
      <% if column == 'body' && !comment.visible %>
          <s><%=h comment.send(column) %></s>
      <% else %>
          <%=h comment.send(column) %>
      <% end %>
    <% end %>

        <%= link_to "Edit", '../edit_comment/' + comment.id.to_s %>

  <% 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 } %>


A little more metadata for the collapsed view of Events

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

          <%= link_to("".html_safe, user_admin_url(@info_request.user)) %>
          <%= user_link(@info_request.user) %>
          <%= 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:

          <%= link_to("".html_safe, public_body_admin_url(@info_request.public_body)) %>
          <%= public_body_link(@info_request.public_body) %>
          <%= 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 'Generate 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 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 %><% if !info_request_event.calculated_state.nil? %>; state: <%= info_request_event.calculated_state %><% end %>

        <%= info_request_event.created_at%>

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

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

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

       <%= link_to("".html_safe, "../edit_outgoing/#{outgoing_message.id}") %>
        <a 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" %>
                <% end %>

            <% 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%> -- <%= h(incoming_message.mail_from) %> <%=_("at")%> <%=admin_value(incoming_message.sent_at)%>

	  <%= simple_format(truncate(incoming_message.cached_main_body_text_folded.gsub('FOLDED_QUOTED_SECTION', ''), :length => 400)) %>

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

                <%= render :partial => 'incoming_message_actions', :locals => { :incoming_message => incoming_message } %>
                <% unless incoming_message.raw_email_id.nil? %>

<%= link_to "View raw email", "../show_raw_email/#{incoming_message.raw_email_id}", :class => "btn" %>
                <% end %>

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

  <% end %>

Annotations

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

    <% for comment in @info_request.comments %>

          <%= link_to("".html_safe, "../edit_comment/#{comment.id}") %>
          <a href="#comment_<%=comment.id%>" data-toggle="collapse" data-parent="comments">
            #<%=comment.id%>
            --
            <%=h(comment.user.name)%>
            <%=admin_value(comment.created_at)%>

	  <%= simple_format(truncate(comment.body, :length => 400)) %>

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

                 By <%= link_to("".html_safe, user_admin_url(comment.user)) %>

                  <%= user_link(comment.user) %>

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

          <%= link_to("".html_safe, user_admin_url(@info_request.user)) %>
          <%= user_link(@info_request.user) %>
          <%= 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:

          <%= link_to("".html_safe, public_body_admin_url(@info_request.public_body)) %>
          <%= public_body_link(@info_request.public_body) %>
          <%= 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 'Generate 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%>

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

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

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

       <%= link_to("".html_safe, "../edit_outgoing/#{outgoing_message.id}") %>
        <a 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" %>
                <% end %>

            <% 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%> -- <%= h(incoming_message.mail_from) %> <%=_("at")%> <%=admin_value(incoming_message.sent_at)%>

	  <%= simple_format(truncate(incoming_message.cached_main_body_text_folded.gsub('FOLDED_QUOTED_SECTION', ''), :length => 400)) %>

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

                <%= render :partial => 'incoming_message_actions', :locals => { :incoming_message => incoming_message } %>
                <% unless incoming_message.raw_email_id.nil? %>

<%= link_to "View raw email", "../show_raw_email/#{incoming_message.raw_email_id}", :class => "btn" %>
                <% end %>

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

  <% end %>

Annotations

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

    <% for comment in @info_request.comments %>

          <%= link_to("".html_safe, "../edit_comment/#{comment.id}") %>
          <a href="#comment_<%=comment.id%>" data-toggle="collapse" data-parent="comments">
            #<%=comment.id%>
            --
            <%=h(comment.user.name)%>
            <%=admin_value(comment.created_at)%>

	  <%= simple_format(truncate(comment.body, :length => 400)) %>

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

                 By <%= link_to("".html_safe, user_admin_url(comment.user)) %>

                  <%= user_link(comment.user) %>

              <% 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 } %>


removed accidental displaying of resource_type in sharing form

<% set_parameters_for_sharing_form %>
<%# 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 = text_for_resource(@resource_type) -%>

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

        Here you can specify who can view the summary of, get access to the content of, 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 with all other users, including those that are not a member of a <%= Seek::Config.project_name %> project.

Share with all other users that are a member of a <%= Seek::Config.project_name %> 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 <%= Seek::Config.project_name %> 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 <%= Seek::Config.project_name %> 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 %>

<% set_parameters_for_sharing_form %>
<%# 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 = text_for_resource(@resource_type) -%>

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

        Here you can specify who can view the summary of, get access to the content of, 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 with all other users, including those that are not a member of a <%= Seek::Config.project_name %> project.

Share with all other users that are a member of a <%= Seek::Config.project_name %> 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 <%= Seek::Config.project_name %> 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 <%= Seek::Config.project_name %> 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 %>


[macro-support-review] Fixing article_comments_list div

  <div class="comment_group_<%= group_id %>" style="float: left">

    <%= link_to_remote(image_tag("/plugins/comment_group/images/comments.gif"),
        :url => { :profile => profile_identifier, :controller => 'comment_group_plugin_profile', :action => 'view_comments', :group_id => group_id, :article_id => article_id},
        :loaded => visual_effect(:highlight, "comments_list_group_#{group_id}"),
        :method => :post,
        :condition => "!toggleGroup(#{group_id})",
        :complete => "loadCompleted(#{group_id})")%>

    <div id="comments_group_count_<%= group_id %>" style="float: right; vertical-align: middle; padding-left: 3px; padding-right: 5px; color: #5AC1FC"><span id="comment-count-<%= group_id %>" class='comment-count'><%= count %>

    <%= inner_html %>

  <div class="comment-group-loading-<%= group_id %>"/>

  <div class="comments_list_toggle_group_<%= group_id %>" style="display:none">
    <div class="article-comments-list" id="comments_list_group_<%= group_id %>">

    <div id="page-comment-form-<%= group_id %>" class='post_comment_box closed'><%= render :partial => 'comment/comment_form', :locals => {:comment => Comment.new, :display_link => true, :cancel_triggers_hide => true, :group_id => group_id}%>

  <div class="comment_group_<%= group_id %>" style="float: left">

    <%= link_to_remote(image_tag("/plugins/comment_group/images/comments.gif"),
        :url => { :profile => profile_identifier, :controller => 'comment_group_plugin_profile', :action => 'view_comments', :group_id => group_id, :article_id => article_id},
        :loaded => visual_effect(:highlight, "comments_list_group_#{group_id}"),
        :method => :post,
        :condition => "!toggleGroup(#{group_id})",
        :complete => "loadCompleted(#{group_id})")%>

    <div id="comments_group_count_<%= group_id %>" style="float: right; vertical-align: middle; padding-left: 3px; padding-right: 5px; color: #5AC1FC"><span id="comment-count-<%= group_id %>" class='comment-count'><%= count %>

    <%= inner_html %>

  <div class="comment-group-loading-<%= group_id %>"/>

  <div class="comments_list_toggle_group_<%= group_id %>" style="display:none">

      <div id="comments_list_group_<%= group_id %>">

    <div id="page-comment-form-<%= group_id %>" class='post_comment_box closed'><%= render :partial => 'comment/comment_form', :locals => {:comment => Comment.new, :display_link => true, :cancel_triggers_hide => true, :group_id => group_id}%>


Fix XML Syndication configuration to auto-select active format

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

<%= form_tag({},{:id => 'configure_'+@sidebar.id.to_s, :class=>'configblock'}) %>
  <input type="checkbox" id="configure_<%= @sidebar.id.to_s %>_articles" name="configure[articles]" <% if @sidebar.staged_config['articles'] %>checked="checked"<% end %>/>
  <label for="configure_<%= @sidebar.id.to_s %>_articles">Show Articles feed

  <input type="checkbox" id="configure_<%= @sidebar.id.to_s %>_comments" name="configure[comments]" <% if @sidebar.staged_config['comments'] %>checked="checked"<% end %>/>
  <label for="configure_<%= @sidebar.id.to_s %>_comments">Show Comments feed

  <input type="checkbox" id="configure_<%= @sidebar.id.to_s %>_trackbacks" name="configure[trackbacks]" <% if @sidebar.staged_config['trackbacks'] %>checked="checked"<% end %>/>
  <label for="configure_<%= @sidebar.id.to_s %>_trackbacks">Show Trackbacks feed

  Format:

  <input type="radio" id="configure_<%= @sidebar.id.to_s %>_format1" name="configure[format]" value="rss20" <% if @sidebar.staged_config['format'] == 'rss20' %>checked="checked"<% end %>/>
  <label for="configure_<%= @sidebar.id.to_s %>_format1">RSS 2.0

  <input type="radio" id="configure_<%= @sidebar.id.to_s %>_format2" name="configure[format]" value="atom10" <% if @sidebar.staged_config['format'] == 'atom10' %>checked="checked"<% end %>/>
  <label for="configure_<%= @sidebar.id.to_s %>_format2">Atom 1.0

  <input type="radio" id="configure_<%= @sidebar.id.to_s %>_format3" name="configure[format]" value="atom03" <% if @sidebar.staged_config['format'] == 'atom03' %>checked="checked"<% end %>/>
  <label for="configure_<%= @sidebar.id.to_s %>_format3">Atom 0.3
<%= end_form_tag %>

<%= observe_form "configure_"+@sidebar.id.to_s,
    :url => { :action => "save_config", :id=>@sidebar.id},
    :with => 'value'
 %>

<%= form_tag({},{:id => 'configure_'+@sidebar.id.to_s, :class=>'configblock'}) %>
  <input type="checkbox" id="configure_<%= @sidebar.id.to_s %>_articles" name="configure[articles]" <% if @sidebar.staged_config['articles'] %>checked="checked"<% end %>/>
  <label for="configure_<%= @sidebar.id.to_s %>_articles">Show Articles feed

  <input type="checkbox" id="configure_<%= @sidebar.id.to_s %>_comments" name="configure[comments]" <% if @sidebar.staged_config['comments'] %>checked="checked"<% end %>/>
  <label for="configure_<%= @sidebar.id.to_s %>_comments">Show Comments feed

  <input type="checkbox" id="configure_<%= @sidebar.id.to_s %>_trackbacks" name="configure[trackbacks]" <% if @sidebar.staged_config['trackbacks'] %>checked="checked"<% end %>/>
  <label for="configure_<%= @sidebar.id.to_s %>_trackbacks">Show Trackbacks feed

  Format:

  <input type="radio" id="configure_<%= @sidebar.id.to_s %>_format1" name="configure[format]" value="rss20" <% if @sidebar.staged_config['type'] %>checked="checked"<% end %>/>
  <label for="configure_<%= @sidebar.id.to_s %>_format1">RSS 2.0

  <input type="radio" id="configure_<%= @sidebar.id.to_s %>_format2" name="configure[format]" value="atom10" <% if @sidebar.staged_config['type'] %>checked="checked"<% end %>/>
  <label for="configure_<%= @sidebar.id.to_s %>_format2">Atom 1.0

  <input type="radio" id="configure_<%= @sidebar.id.to_s %>_format3" name="configure[format]" value="atom03" <% if @sidebar.staged_config['type'] %>checked="checked"<% end %>/>
  <label for="configure_<%= @sidebar.id.to_s %>_format3">Atom 0.3
<%= end_form_tag %>

<%= observe_form "configure_"+@sidebar.id.to_s,
    :url => { :action => "save_config", :id=>@sidebar.id},
    :with => 'value'
 %>


Listing production costs on catalog

Listing production costs on catalog

(ActionItem2111)

<% extra_content = [] %>
<% extra_content_list = [] %>

<%= _('Products/Services') %>

  <% @products.each do |product| %>
    <% extra_content = @plugins.map(:catalog_item_extras, product).collect { |content| instance_eval(&content) } %>
    <% extra_content_list = @plugins.map(:catalog_list_item_extras, product).collect { |content| instance_eval(&content) } %>

    <li class="product <%= "not-available" unless product.available %>">

          <% if product.image %>

              <%= link_to_product product, :class => 'product-big', :style => "background-image: url(#{product.default_image(:big)})" %>
              <%= link_to content_tag(:span, _('Zoom in')), product.default_image(:big).gsub('_big',''), :class => 'zoomify-image' %>

          <% else %>

<%= _('No image') %>

          <% end %>

<%= extra_content.join("\n") %>

<%= link_to_product product %>

          <% unless product.discount.blank? or product.discount == 0 %>

              <%= _('from ') + price_span(product.price) %>
              <%= _('by ') %>

          <% end %>
          <% unless product.price.blank? or product.price == 0 %>

              <%= price_span product.price_with_discount, :class => "product-price #{'with-discount' unless product.discount}" %>
              <%= _(' / ') + (product.unit ? product.unit.singular : _('unit')) %>

          <% end %>

        <% if product.description %>

            <%= _('description') %>

<%= txt2html(product.description || '') %>

        <% end %>

        <% if product.price_described? %>

            <%= _('price composition') %>

                <% product.inputs.each do |i| %>

<%= i.product_category.name %>

                    <%= price_span i.cost, :class => 'search-product-input-price' %>

                <% end %>
                <% product.price_details.each do |i| %>

<%= i.production_cost.name %>

                    <%= price_span i.price, :class => 'search-product-input-price' %>

                <% end %>

        <% end %>

        <% if product.inputs.count > 0 %>

            <%= _('inputs and raw materials') %>

                <% product.inputs.each do |i| %>

                    <%= _('%{amount_used} %{unit} of') % {:amount_used => i.amount_used, :unit => i.unit.singular} + ' ' if i.has_all_price_details? %>
                    <%= i.product_category.name %>

                <% end %>

        <% end %>

        <% unless product.qualifiers.blank? %>

            <%= _('qualifiers') if product.product_qualifiers.count > 0 %>

<%= render :partial => 'shared/product/qualifiers', :locals => {:product => product} %>

        <% end %>

        <% extra_content_list.map do |content| %>

<%= content %>

        <% end %>

<%= _('product unavailable') unless product.available %>

  <% end %>

<%= pagination_links @products, :params => {:controller => :catalog, :action => :index, :profile => profile.identifier} %>

<%= add_zoom_to_images %>

<% extra_content = [] %>
<% extra_content_list = [] %>

<%= _('Products/Services') %>

  <% @products.each do |product| %>
    <% extra_content = @plugins.map(:catalog_item_extras, product).collect { |content| instance_eval(&content) } %>
    <% extra_content_list = @plugins.map(:catalog_list_item_extras, product).collect { |content| instance_eval(&content) } %>

    <li class="product <%= "not-available" unless product.available %>">

          <% if product.image %>

              <%= link_to_product product, :class => 'product-big', :style => "background-image: url(#{product.default_image(:big)})" %>
              <%= link_to content_tag(:span, _('Zoom in')), product.default_image(:big).gsub('_big',''), :class => 'zoomify-image' %>

          <% else %>

<%= _('No image') %>

          <% end %>

<%= extra_content.join("\n") %>

<%= link_to_product product %>

          <% unless product.discount.blank? or product.discount == 0 %>

              <%= _('from ') + price_span(product.price) %>
              <%= _('by ') %>

          <% end %>
          <% unless product.price.blank? or product.price == 0 %>

              <%= price_span product.price_with_discount, :class => "product-price #{'with-discount' unless product.discount}" %>
              <%= _(' / ') + (product.unit ? product.unit.singular : _('unit')) %>

          <% end %>

        <% if product.description %>

            <%= _('description') %>

<%= txt2html(product.description || '') %>

        <% end %>

        <% if product.price_described? %>

            <%= _('price composition') %>

                <% product.inputs.each do |i| %>

<%= i.product_category.name %>

                    <%= price_span i.cost, :class => 'search-product-input-price' %>

                <% end %>

        <% end %>

        <% if product.inputs.count > 0 %>

            <%= _('inputs and raw materials') %>

                <% product.inputs.each do |i| %>

                    <%= _('%{amount_used} %{unit} of') % {:amount_used => i.amount_used, :unit => i.unit.singular} + ' ' if i.has_all_price_details? %>
                    <%= i.product_category.name %>

                <% end %>

        <% end %>

        <% unless product.qualifiers.blank? %>

            <%= _('qualifiers') if product.product_qualifiers.count > 0 %>

<%= render :partial => 'shared/product/qualifiers', :locals => {:product => product} %>

        <% end %>

        <% extra_content_list.map do |content| %>

<%= content %>

        <% end %>

<%= _('product unavailable') unless product.available %>

  <% end %>

<%= pagination_links @products, :params => {:controller => :catalog, :action => :index, :profile => profile.identifier} %>

<%= add_zoom_to_images %>


Fix unknown from email template

Fix unknown from email template

<%= @from %> is not a known email address. Only user email addresses and
email addresses receiving notifications are allowed.
--
Message automatically generated by ClockingIT
http://<%= @subdomain %>.<%= $CONFIG[:domain] %>

<%= from %> is not a known email address. Only user email addresses and
email addresses receiving notifications are allowed.
--
Message automatically generated by ClockingIT
http://<%= subdomain %>.<%= $CONFIG[:domain] %>


Added conformation before remove playright booking

Mina spelrätt bokning

    <% if current_user.play_right_bookings.size == 0 %>

Du har ingen bokning

    <% else %>

Du har följande bokning.

          Golf banan
	        Datum

        <%current_user.play_right_bookings.each do | booking | %>

	        <%= h(booking.play_right.name) %>
          <%= booking.booked_on %>

            <%= link_to "Ta bort", {:action => "remove", :id => booking.id},
              :confirm => "Är du säker du vill ta bort bokningen den #{booking.booked_on} på #{booking.play_right.name}?",
              :method => :post %>

        <% end %>

    <% end %>

Boka nytt spelrätt

Här kan du boka golf banan. Du får bara har ett utstående bokning per gång.

    <% semantic_form_for [:member, PlayRightBooking.new] do |form| %>
      <% form.inputs do %>
        <%= form.input :play_right, :label => 'Golfsbanan', :include_blank => false %>
        <%= form.input :booked_on, :label => 'Datum' %>
        <%= form.input :num_of_resource, :as => :hidden, :value => "1" %>
      <% end %>
      <% form.buttons do %>
        <%= form.commit_button :label => "Boka" %>
      <% end %>
    <% end %>

Mina spelrätt bokning

    <% if current_user.play_right_bookings.size == 0 %>

Du har ingen bokning

    <% else %>

Du har följande bokning.

          Golf banan
	        Datum

        <%current_user.play_right_bookings.each do | booking | %>

	        <%= h(booking.play_right.name) %>
          <%= booking.booked_on %>

            <%= link_to "Ta bort", {:action => "remove",
                    :id => booking.id}, :method => :post %>

        <%end %>

    <% end %>

Boka nytt spelrätt

Här kan du boka golf banan. Du får bara har ett utstående bokning per gång.

    <% semantic_form_for [:member, PlayRightBooking.new] do |form| %>
      <% form.inputs do %>
        <%= form.input :play_right, :label => 'Golfsbanan', :include_blank => false %>
        <%= form.input :booked_on, :label => 'Datum' %>
        <%= form.input :num_of_resource, :as => :hidden, :value => "1" %>
      <% end %>
      <% form.buttons do %>
        <%= form.commit_button :label => "Boka" %>
      <% end %>
    <% end %>