Removed extra html form block

Removed extra html form block

This will add a set of questions to the page that allow the user to enter a reference.

<% if @controller.action_name == 'show_element_form'  # create
      @current_element = @element
   else # update
      @current_element = element
   end
-%>

  <%= # let apps use their own form choice if they want
    render :partial => 'reference_form_questionnaire' %>

  <% if @controller.action_name != 'show_element_form' -%>
    <%= observe_field('element_questionnaire_id',
                      :url => set_questionnaire_id_reference_element_url(@questionnaire, @page, @current_element),
    									:with => 'value',
    									:loading => "Element.show('spinner2')",
                      :loaded => "Element.hide('spinner2')")%>
    <%= image_tag "spinner.gif", :id => 'spinner2', :style => 'display:none' %>

      <%
      # we use the variable @current_element instead of @element to avoid poluting recursion
      @current_element = element -%>
      Text: (click to change):
      <%= in_place_editor_field :current_element, :text, {}, :url => set_element_text_element_url(@questionnaire, @page, @current_element) %>

  <% else -%>
    <%= text_field :element, :text %>
  <% end -%>

This will add a set of questions to the page that allow the user to enter a reference.

<% if @controller.action_name == 'show_element_form'  # create
      @current_element = @element
   else # update
      @current_element = element
   end
-%>

<% form_tag elements_url(@questionnaire, @page) do -%>

  <%= # let apps use their own form choice if they want
    render :partial => 'reference_form_questionnaire' %>

  <% if @controller.action_name != 'show_element_form' -%>
    <%= observe_field('element_questionnaire_id',
                      :url => set_questionnaire_id_reference_element_url(@questionnaire, @page, @current_element),
    									:with => 'value',
    									:loading => "Element.show('spinner2')",
                      :loaded => "Element.hide('spinner2')")%>
    <%= image_tag "spinner.gif", :id => 'spinner2', :style => 'display:none' %>

      <%
      # we use the variable @current_element instead of @element to avoid poluting recursion
      @current_element = element -%>
      Text: (click to change):
      <%= in_place_editor_field :current_element, :text, {}, :url => set_element_text_element_url(@questionnaire, @page, @current_element) %>

  <% else -%>
    <%= text_field :element, :text %>
  <% end -%>
<% end -%>


Added proper entity quoting to dc:title in article partial (fixes #88 - again)

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

    <%= article_link article.title, article %>

Posted by <%=h article.author %> <%= distance_of_time_in_words_to_now article.created_at %> ago

  <%= article.body_html %>


Submenu appears under highlights block

Submenu appears under highlights block

(ActionItem1744)

<%= block_title(block.title) %>
<% if !block.featured_images.empty? %>

      <% block.featured_images.each do |img| %>
        <a href="<%= img[:address] %>" title="<%= img[:title] %>" class="highlights-image-link">
          <%= content_tag :img, nil, :src => img[:image_src], :alt => img[:title] %>

<%= img[:title] %>

      <% end %>

    <% if block.navigation %>

    <% end %>

<% else %>
  <%= _('Please, edit this block and choose some images') %>
<% end %>


Questionnaires were not being created correctly. Updated action list to correct this.

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

<%= link_to 'Create Public '+node.get_name, :controller=>'questionnaire', :action=>'new_questionnaire', :type_id => node.node_object_id, :private => 0 %>

<%= link_to 'Create Private '+node.get_name, :controller=>'questionnaire', :action=>'new_questionnaire', :type_id => node.node_object_id, :private => 1 %>

<%= link_to 'Create Public '+node.get_name, :controller=>'questionnaire', :action=>'new_questionnaire', :type_id => Node.find(node.parent_id).node_object_id, :private => 0 %>

<%= link_to 'Create Private '+node.get_name, :controller=>'questionnaire', :action=>'new_questionnaire', :type_id => Node.find(node.parent_id).node_object_id, :private => 1 %>


SLight tweak.

SLight tweak.

Make or explore Freedom of Information requests

    <% form_tag({:action => "search_redirect"}, {:id => "search_form"}) do %>

           First, type in the name of the UK public authority you'd

like information from. By law, they have to send it to you
           (why?).

           <%= text_field_tag 'query', params[:query], { :size => 30 } %>
           <%= hidden_field_tag 'bodies', 1 %>
           <%= submit_tag "Search" %>

           e.g. <%=link_to 'Liverpool', search_url('liverpool', 'bodies')%>, <%=link_to 'MRSA', search_url('mrsa', 'bodies')%>, <%=link_to 'Treasury', search_url('treasury', 'bodies')%>

           OR, search for information others have requested.

    <% end %>

    <% if @popular_bodies.size > 0 %>

            <% for popular_body in @popular_bodies %>

<%=public_body_link(popular_body)%>

            <% end%>

                <%= link_to "More authorities...", list_public_bodies_default %>

    <% end %>

    <% if @successful_requests.size > 0 %>

            <% for request in @successful_requests %>

<%=link_to h(excerpt(request.title, "", 35)), request_url(request)%>

            <% end %>

More successful requests...

    <% end %>

Make or explore Freedom of Information requests

    <% form_tag({:action => "search_redirect"}, {:id => "search_form"}) do %>

           First, type in the name of the UK public authority you'd

like information from. By law, they have to send it to you.

           <%= text_field_tag 'query', params[:query], { :size => 30 } %>
           <%= hidden_field_tag 'bodies', 1 %>
           <%= submit_tag "Search" %>

           e.g. <%=link_to 'Liverpool', search_url('liverpool', 'bodies')%>, <%=link_to 'MRSA', search_url('mrsa', 'bodies')%>, <%=link_to 'Treasury', search_url('treasury', 'bodies')%>

           OR, search for information others have requested.

    <% end %>

    <% if @popular_bodies.size > 0 %>

            <% for popular_body in @popular_bodies %>

<%=public_body_link(popular_body)%>

            <% end%>

                <%= link_to "More authorities...", list_public_bodies_default %>

    <% end %>

    <% if @successful_requests.size > 0 %>

            <% for request in @successful_requests %>

<%=link_to h(excerpt(request.title, "", 35)), request_url(request)%>

            <% end %>

More successful requests...

    <% end %>


Change sentence for mailing list subscription

<% view_cache :ttl => 5.minutes.to_i, :tag => I18n.locale do %>

<%= _("Ejerce tu derecho a saber.") %>

1

2

3

<%= _("Para obtener información de instituciones públicas:") %>

<%= _("Piensa una pregunta para un organismo público.") %>

<%= _("Nosotros enviamos la pregunta por ti.") %>

<%= _("Te avisamos cuando haya una respuesta.") %>

            <%= link_to _("Preguntar »"), body_index_path %>

            <%= link_to _("¿Contestarán? »"), help_requesting_path(:anchor => 'making_requests') %>

Nuevo borrador de la Ley de Transparencia

Te mostramos <%= link_to _("qué ha cambiado en el texto"), help_borrador_transparencia_path %>, tras la incorporación de las aportaciones ciudadanas.

    			<form action="http://tuderechoasaber.us4.list-manage.com/subscribe/post?u=9416fe6b76f2c3f985c1f8e0f&id=36f187e6e2" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" target="_blank">

¿Quieres estar informado de todas las novedades? Suscríbete a nuestro boletín:

<input type="email" value="" name="EMAIL" class="email" id="mce-EMAIL" placeholder="dirección de correo" required="true" style="width:90%">

<input type="submit" value="Suscríbeme" name="subscribe" id="mc-embedded-subscribe" style="border-color:silver">

    			</form>

Twittear

<%= _("Haz una búsqueda entre las peticiones ya realizadas:") %>

              <% form_tag({:action => "search_redirect"}, {:id => "search_form"}) do %>

                <%= text_field_tag 'query', params[:query], { :size => 80 } %>
                <%= submit_tag _('Search') %>

              <% end %>

<%= _("Novedades") %>

                <% 0.upto(3).each do |position|
                    item = @blog_items[position];
                    break if item.nil? %>

                  <div class="frontpage-blog-post <%= position.even? ? 'left' : 'right' %>">
                    <img src="<%= item['thumbnail'] %>" width="278" height="128"/>

                      <a href='<%= "#{blog_url}\##{Time.parse(item['pubDate'][0]).to_i}" %>'><%= h item['title'] %>

<%= h excerpt(item['description'].to_s, "", 200) %>

<a href="<%= "#{blog_url}\##{Time.parse(item['pubDate'][0]).to_i}" %>"><%= _("Leer más »") %>

                  <% if position.odd? %>

                  <% end %>
                <% end %>

<a href="<%= blog_url %>"><%= _("Más novedades »") %>

<%= _("Peticiones destacadas") %>

                <% @featured_requests.each do |featured_request| %>
                <%= render :partial => 'track/tracking_request_links',
                      :locals => {
                        :track_thing => TrackThing.create_track_for_request(featured_request),
                        :own_request => featured_request.user == @user,
                        :location => "frontpage"
                      } %>
                <% end %>

<% end %>

<% view_cache :ttl => 5.minutes.to_i, :tag => I18n.locale do %>

<%= _("Ejerce tu derecho a saber.") %>

1

2

3

<%= _("Para obtener información de instituciones públicas:") %>

<%= _("Piensa una pregunta para un organismo público.") %>

<%= _("Nosotros enviamos la pregunta por ti.") %>

<%= _("Te avisamos cuando haya una respuesta.") %>

            <%= link_to _("Preguntar »"), body_index_path %>

            <%= link_to _("¿Contestarán? »"), help_requesting_path(:anchor => 'making_requests') %>

Nuevo borrador de la Ley de Transparencia

Te mostramos <%= link_to _("qué ha cambiado en el texto"), help_borrador_transparencia_path %>, tras la incorporación de las aportaciones ciudadanas.

    			<form action="http://tuderechoasaber.us4.list-manage.com/subscribe/post?u=9416fe6b76f2c3f985c1f8e0f&id=36f187e6e2" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" target="_blank">

Suscríbete y te mantendremos informado

<input type="email" value="" name="EMAIL" class="email" id="mce-EMAIL" placeholder="dirección de correo" required="true" style="width:90%">

<input type="submit" value="Suscríbeme" name="subscribe" id="mc-embedded-subscribe" style="border-color:silver">

    			</form>

Twittear

<%= _("Haz una búsqueda entre las peticiones ya realizadas:") %>

              <% form_tag({:action => "search_redirect"}, {:id => "search_form"}) do %>

                <%= text_field_tag 'query', params[:query], { :size => 80 } %>
                <%= submit_tag _('Search') %>

              <% end %>

<%= _("Novedades") %>

                <% 0.upto(3).each do |position|
                    item = @blog_items[position];
                    break if item.nil? %>

                  <div class="frontpage-blog-post <%= position.even? ? 'left' : 'right' %>">
                    <img src="<%= item['thumbnail'] %>" width="278" height="128"/>

                      <a href='<%= "#{blog_url}\##{Time.parse(item['pubDate'][0]).to_i}" %>'><%= h item['title'] %>

<%= h excerpt(item['description'].to_s, "", 200) %>

<a href="<%= "#{blog_url}\##{Time.parse(item['pubDate'][0]).to_i}" %>"><%= _("Leer más »") %>

                  <% if position.odd? %>

                  <% end %>
                <% end %>

<a href="<%= blog_url %>"><%= _("Más novedades »") %>

<%= _("Peticiones destacadas") %>

                <% @featured_requests.each do |featured_request| %>
                <%= render :partial => 'track/tracking_request_links',
                      :locals => {
                        :track_thing => TrackThing.create_track_for_request(featured_request),
                        :own_request => featured_request.user == @user,
                        :location => "frontpage"
                      } %>
                <% end %>

<% end %>


Formatting

Formatting

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

<% @page_title = 'Admin: Racers' %>

<%= render "shared/admin/tabs" %>

<%= start_form_tag({}, {:method => 'get'}) %>
	Name: <%= text_field_tag 'name', @name, :size => 30 %>

	<%# Nasty code required to show consisten meesages with and without AJAX. At least it could be in a helper. %>

		<%= image_tag('/images/icons/warn.gif', :height => 11, :width => 11, :id => 'warn_icon') %>
		<%= flash[:warn] %>
		<%= image_tag('/images/icons/confirmed.gif', :height => 11, :width => 11, :id => 'message_icon') %>
		<%= flash[:notice] %>

	<%= update_page_tag {|page| page.hide('message_icon')} unless flash[:notice] -%>
	<%= update_page_tag {|page| page.hide('warn_icon')} unless flash[:warn] -%>
<%= end_form_tag %>

				        Name
			            Team
			            Aliases
			            Road
			            MTB
			            DH
			            Cross
						Member

					<%= render :partial => "racer", :collection => @racers %>
					<% if @racers.empty? %>

						<%- if @name.blank? -%>
						Enter part of a racer's name
						<%- else -%>
						No racers found
						<%- end -%>

					<% end %>

			<%= form_tag({:action => 'preview_import'}, { :multipart => true }) %>

						<%=  link_image_to '/images/buttons/add.gif', :action => 'new' %>

							Import New Members:
							<%= file_field_tag "racers_file" %>
							<%= select_tag 'year', ['2007', '2006'] %>
							<%= submit_tag 'Import' %>

			<%= end_form_tag %>

<% @page_title = 'Admin: Racers' %>

<%= render "shared/admin/tabs" %>

<%= start_form_tag({}, {:method => 'get'}) %>
	Name: <%= text_field_tag 'name', @name, :size => 30 %>

	<%# Nasty code required to show consisten meesages with and without AJAX. At least it could be in a helper. %>

		<%= image_tag('/images/icons/warn.gif', :height => 11, :width => 11, :id => 'warn_icon') %>
		<%= flash[:warn] %>
		<%= image_tag('/images/icons/confirmed.gif', :height => 11, :width => 11, :id => 'message_icon') %>
		<%= flash[:notice] %>

	<%= update_page_tag {|page| page.hide('message_icon')} unless flash[:notice] -%>
	<%= update_page_tag {|page| page.hide('warn_icon')} unless flash[:warn] -%>
<%= end_form_tag %>

				        Name
			            Team
			            Aliases
			            Road
			            MTB
			            DH
			            Cross
						Member

					<%= render :partial => "racer", :collection => @racers %>
					<% if @racers.empty? %>

						<%- if @name.blank? -%>
						Enter part of a racer's name
						<%- else -%>
						No racers found
						<%- end -%>

					<% end %>

				<%= link_image_to '/images/buttons/add.gif', :action => 'new' %>

				<%= form_tag({:action => 'preview_import'}, { :multipart => true }) %>

Import New Members:

						<%= file_field_tag "racers_file" %>
						<%= select_tag 'year', ['2007', '2006'] %>
						<%= submit_tag 'Import' %>
				<%= end_form_tag %>


Need to call h to escape emails here

Need to call h to escape emails here

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

<%=h info_request_event.params_yaml.gsub(/-/,' ').strip %>

      <% 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_.*?_text$/ %>

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

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

      <% 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_.*?_text$/ %>

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


Update in development message.

Update in development message.

Hello! This site really isn't finished yet, but it
    works and so we wanted to start sharing it with you.
    Tell us what you think.

As always, if you want mySociety to do more stuff like this, please
    volunteer,
    donate,
    or commission us!

Hello! This site really isn't nearly finished yet, but it
    works and so we wanted to start sharing it with you.
    Things still to do:

 Finish designing the site - this appearance is just placeholder.

 Add things you tell us you want.

As always, if you want mySociety to do more stuff like this, please
    volunteer,
    donate,
    or commission us!


Capitalize all locale names

Capitalize all locale names

@import url(http://fonts.googleapis.com/css?family=Open+Sans:600,700);

/** LAYOUT **/
body {
    font-family: Verdana, Helvetica, Arial;
}
    body.front {
        background: none;
    }

#wrapper {
    padding-top: 10px;
    margin-bottom: 50px;
}

/** HEADER **/
#banner {
    background: #EAF5F6;
    border: none;
    height: 150px;
    position: relative;
}

#banner_inner {
    width: 950px;
    height: 150px;
}
    #banner_inner a:hover {
        text-decoration: underline;
    }

#logo {
    position: absolute;
    top: 20px;
}

#navigation_search {
    top: 50px;
    visibility: hidden;
}

div.lang {
    top: 23px;
    color: #00aaa6;
    font-size: 12px;
    text-transform: capitalize;
}
    div.lang a {
        color: #00aaa6;
        text-decoration: none;
    }

#logged_in_bar {
    top: 24px;
    font-weight: bold;
    font-size: 12px;
    padding: 3px 8px 1px 8px;
    height: 19px;
    background: #009a9d;
    border-radius: 5px;
}
    #logged_in_bar, #logged_in_bar a, #logged_in_bar a:visited {
        color: #FFF;
        text-decoration: none;
    }

/** NAVIGATION BAR **/
#topnav {
    font-family: Helvetica, Arial;
    font-size: 14px;
    font-weight: bold;
    margin-left: 190px;
}
    #topnav ul li {
        padding-left: 8px;
        padding-right: 8px;
        margin-right: 8px;

        border-top-left-radius: 5px;
        border-top-right-radius: 5px;
    }
    #topnav ul li a {
        color: #00aaa6 !important;
    }

/** MAIN SITE **/
h1, h1 a {
    font-family: 'Open Sans', Helvetica, Arial;
    color: #009a9d;
    font-size: 28px;
    font-weight: 600;
    margin-top: 30px;
    text-decoration: none;
}

h2, h2 a {
    font-family: 'Open Sans', Helvetica, Arial;
    color: #7bbb58;
    font-size: 18px;
    font-weight: 700;
}

h3, h3 a {
    font-family: Helvetica, Arial;
    color: #00aaa6;
    font-size: 14px;
    font-weight: bold;
}

/** HELP **/
#left_column_flip {
    margin-top: 20px;
    width: 550px;
    margin-right: 40px;
}

#right_column_flip {
    text-align: right;
    width: 240px;
}

.controller_help {
    font-size: 12px;
    line-height: 1.5;
    text-align: justify;
}
    .controller_help a {
        color: #009a9d;
        text-decoration: none;
    }
    .controller_help a:hover {
        text-decoration: underline;
    }

.XXX {  /* TODO stuff */
    color: red;
    font-weight: bold;
    background-color: yellow;
}

/** FRONTPAGE **/
.front #wrapper, .front #content {
    width: 100%;
    padding: 0px;
    margin: 0px;
}

#frontpage-intro {
    width: 950px;
    margin: auto;
    position: relative;
}

#frontpage-lead {
    font-family: 'Open Sans', Helvetica, Arial;
    font-size: 24px;
    font-weight: 700;
    text-align: center;
    color: #73c167;
}

#frontpage-left-balloon {
    float: left;
    width: 206px;
    height: 184px;
    background: url(/asktheeu-theme/images/yellow_balloon.gif);
    padding: 10px 20px 20px 50px;
    margin: 37px 8px 60px 0px;
}
    #frontpage-left-balloon h2 {
        font-family: 'Open Sans', Helvetica, Arial;
        font-size: 24px;
        font-weight: 700;
        color: #fff;
        padding-right: 20px;
        margin-bottom: 5px;
    }

#frontpage-middle-balloon {
    float: left;
    width: 314px;
    height: 283px;
    background: url(/asktheeu-theme/images/blue_balloon.gif);
    padding: 0px 30px 0px 30px;
}
    #frontpage-middle-balloon h1 {
        font-family: 'Open Sans', Helvetica, Arial;
        font-size: 42px;
        font-weight: 700;
        color: #fff;
        text-align: center;
        padding-right: 20px;
        margin-bottom: 5px;
    }
    #frontpage-middle-balloon p {
        margin-left: 15px;
    }
    #frontpage-middle-balloon .frontpage-button-link {
        margin-left: 95px;
    }

#frontpage-right-balloon {
    float: left;
    width: 218px;
    height: 174px;
    background: url(/asktheeu-theme/images/green_balloon.gif);
    padding: 5px 20px 20px 50px;
    margin: 42px 0px 60px 4px;
}
    #frontpage-right-balloon h2 {
        font-family: 'Open Sans', Helvetica, Arial;
        font-size: 24px;
        font-weight: 700;
        color: #fff;
        padding-right: 20px;
        margin-bottom: 5px;
    }

#frontpage-left-balloon p,
#frontpage-right-balloon p,
#frontpage-middle-balloon p {
    font-size: 14px;
    font-weight: bold;
    color: #fff;
    margin-top: 0px;
}

#frontpage-intro a {
    font-size: 16px;
    font-weight: bold;
    color: #fff;
    text-decoration: none;
}
    #frontpage-intro a:hover {
        text-decoration: underline;
    }

.frontpage-button-link {
    height: 24px;
    width: 100px;
    background: url(/asktheeu-theme/images/button_gradient.gif);
    border-radius: 5px;
    text-align: center;
    padding-top: 3px;
    padding-bottom: 3px;
}

#frontpage-content {
    background: #EAF5F6;
    border-top: 1px solid #b2dcde;
}

#frontpage-inner-content {
    width: 950px;
    margin: auto;
    position: relative;
    padding-bottom: 20px;
}

#left-column {
    float: left;
    background: #EAF5F6;
    width: 450px;
}

#right-column {
    float: right;
    width: 450px;
}

#frontpage-content p {
    color: #6f6f6e;
    font-size: 12px;
    line-height: 1.5;
}

#frontpage-content p a {
    color: #009a9d;
    font-size: 12px;
    text-decoration: none;
}
    #frontpage-content a:hover {
        text-decoration: underline;
    }

.picture-frame {
    width: 450px;
    height: 270px;
    background: #FFF;
    border-radius: 15px;
    margin-bottom: 30px;
}
    .picture-frame img,
    .picture-frame iframe {
        width: 420px;
        height: 240px;
        margin: 15px;
    }

#follow-us-frame {
    width: 390px;
    height: 60px;
    background: #FFF;
    border-radius: 15px;
    margin-bottom: 30px;
    margin-top: 50px;
    padding: 20px 30px 20px 30px;
}
    #follow-us-frame p {
        float: left;
        font-family: 'Open Sans', Helvetica, Arial;
        font-size: 18px;
        color: #009a9d;
    }
    #follow-us-frame span {
        float: left;
        margin-top: 12px;
        margin-left: 20px;
    }

.link-arrow {
    background: no-repeat url(/asktheeu-theme/images/arrow_icon.gif) ;
    padding-top: 6px;
    padding-left: 35px;
    height: 30px;
}
    .link-arrow a {
        font-family: Helvetica, Arial;
        color: #00aaa6;
        font-size: 14px;
        font-weight: bold;
        text-decoration: none;
    }

/** MODAL SIGN-IN **/

#signin-successful,
#signin-successful a {
    font-family: Helvetica, Arial;
    color: #00aaa6;
    font-size: 14px;
    font-weight: bold;
    padding-top: 50px;
}

/** FOOTER **/
#footer {
    height: 100px;
    margin: 0px;
    border-top-width: 1px;
}

#footer-inner {
    width: 950px;
    margin: auto;
    position: relative;
}

#access-info-logo {
    position: absolute;
    left: 0px;
    top: 10px;
}

#footer-links {
    margin-left: 150px;
    margin-top: 10px;
    float: left;

    font-family: 'Open Sans', Helvetica, Arial;
    font-size: 18px;
}
    #footer-links ul {
        list-style: none outside none;
    }
    #footer-links ul li {
        float: left;
        margin-right: 40px;
    }
    #footer-links ul a {
        text-decoration: none;
        color: #009a9d;
    }
    #footer-links ul a:hover {
        text-decoration: underline;
    }

#credits {
    float: right;
    margin-top: 30px;
    margin-right: 20px;

    font-family: Verdana, Helvetica, Arial;
    font-size: 12px;
}
    #credits a {
        text-decoration: none;
        color: #00aaa6;
    }

#creative-commons-logo {
    float: right;
    margin-top: 20px;
}

@import url(http://fonts.googleapis.com/css?family=Open+Sans:600,700);

/** LAYOUT **/
body {
    font-family: Verdana, Helvetica, Arial;
}
    body.front {
        background: none;
    }

#wrapper {
    padding-top: 10px;
    margin-bottom: 50px;
}

/** HEADER **/
#banner {
    background: #EAF5F6;
    border: none;
    height: 150px;
    position: relative;
}

#banner_inner {
    width: 950px;
    height: 150px;
}
    #banner_inner a:hover {
        text-decoration: underline;
    }

#logo {
    position: absolute;
    top: 20px;
}

#navigation_search {
    top: 50px;
    visibility: hidden;
}

div.lang {
    top: 23px;
    color: #00aaa6;
    font-size: 12px;
}
    div.lang a {
        color: #00aaa6;
        text-decoration: none;
    }

#logged_in_bar {
    top: 24px;
    font-weight: bold;
    font-size: 12px;
    padding: 3px 8px 1px 8px;
    height: 19px;
    background: #009a9d;
    border-radius: 5px;
}
    #logged_in_bar, #logged_in_bar a, #logged_in_bar a:visited {
        color: #FFF;
        text-decoration: none;
    }

/** NAVIGATION BAR **/
#topnav {
    font-family: Helvetica, Arial;
    font-size: 14px;
    font-weight: bold;
    margin-left: 190px;
}
    #topnav ul li {
        padding-left: 8px;
        padding-right: 8px;
        margin-right: 8px;

        border-top-left-radius: 5px;
        border-top-right-radius: 5px;
    }
    #topnav ul li a {
        color: #00aaa6 !important;
    }

/** MAIN SITE **/
h1, h1 a {
    font-family: 'Open Sans', Helvetica, Arial;
    color: #009a9d;
    font-size: 28px;
    font-weight: 600;
    margin-top: 30px;
    text-decoration: none;
}

h2, h2 a {
    font-family: 'Open Sans', Helvetica, Arial;
    color: #7bbb58;
    font-size: 18px;
    font-weight: 700;
}

h3, h3 a {
    font-family: Helvetica, Arial;
    color: #00aaa6;
    font-size: 14px;
    font-weight: bold;
}

/** HELP **/
#left_column_flip {
    margin-top: 20px;
    width: 550px;
    margin-right: 40px;
}

#right_column_flip {
    text-align: right;
    width: 240px;
}

.controller_help {
    font-size: 12px;
    line-height: 1.5;
    text-align: justify;
}
    .controller_help a {
        color: #009a9d;
        text-decoration: none;
    }
    .controller_help a:hover {
        text-decoration: underline;
    }

.XXX {  /* TODO stuff */
    color: red;
    font-weight: bold;
    background-color: yellow;
}

/** FRONTPAGE **/
.front #wrapper, .front #content {
    width: 100%;
    padding: 0px;
    margin: 0px;
}

#frontpage-intro {
    width: 950px;
    margin: auto;
    position: relative;
}

#frontpage-lead {
    font-family: 'Open Sans', Helvetica, Arial;
    font-size: 24px;
    font-weight: 700;
    text-align: center;
    color: #73c167;
}

#frontpage-left-balloon {
    float: left;
    width: 206px;
    height: 184px;
    background: url(/asktheeu-theme/images/yellow_balloon.gif);
    padding: 10px 20px 20px 50px;
    margin: 37px 8px 60px 0px;
}
    #frontpage-left-balloon h2 {
        font-family: 'Open Sans', Helvetica, Arial;
        font-size: 24px;
        font-weight: 700;
        color: #fff;
        padding-right: 20px;
        margin-bottom: 5px;
    }

#frontpage-middle-balloon {
    float: left;
    width: 314px;
    height: 283px;
    background: url(/asktheeu-theme/images/blue_balloon.gif);
    padding: 0px 30px 0px 30px;
}
    #frontpage-middle-balloon h1 {
        font-family: 'Open Sans', Helvetica, Arial;
        font-size: 42px;
        font-weight: 700;
        color: #fff;
        text-align: center;
        padding-right: 20px;
        margin-bottom: 5px;
    }
    #frontpage-middle-balloon p {
        margin-left: 15px;
    }
    #frontpage-middle-balloon .frontpage-button-link {
        margin-left: 95px;
    }

#frontpage-right-balloon {
    float: left;
    width: 218px;
    height: 174px;
    background: url(/asktheeu-theme/images/green_balloon.gif);
    padding: 5px 20px 20px 50px;
    margin: 42px 0px 60px 4px;
}
    #frontpage-right-balloon h2 {
        font-family: 'Open Sans', Helvetica, Arial;
        font-size: 24px;
        font-weight: 700;
        color: #fff;
        padding-right: 20px;
        margin-bottom: 5px;
    }

#frontpage-left-balloon p,
#frontpage-right-balloon p,
#frontpage-middle-balloon p {
    font-size: 14px;
    font-weight: bold;
    color: #fff;
    margin-top: 0px;
}

#frontpage-intro a {
    font-size: 16px;
    font-weight: bold;
    color: #fff;
    text-decoration: none;
}
    #frontpage-intro a:hover {
        text-decoration: underline;
    }

.frontpage-button-link {
    height: 24px;
    width: 100px;
    background: url(/asktheeu-theme/images/button_gradient.gif);
    border-radius: 5px;
    text-align: center;
    padding-top: 3px;
    padding-bottom: 3px;
}

#frontpage-content {
    background: #EAF5F6;
    border-top: 1px solid #b2dcde;
}

#frontpage-inner-content {
    width: 950px;
    margin: auto;
    position: relative;
    padding-bottom: 20px;
}

#left-column {
    float: left;
    background: #EAF5F6;
    width: 450px;
}

#right-column {
    float: right;
    width: 450px;
}

#frontpage-content p {
    color: #6f6f6e;
    font-size: 12px;
    line-height: 1.5;
}

#frontpage-content p a {
    color: #009a9d;
    font-size: 12px;
    text-decoration: none;
}
    #frontpage-content a:hover {
        text-decoration: underline;
    }

.picture-frame {
    width: 450px;
    height: 270px;
    background: #FFF;
    border-radius: 15px;
    margin-bottom: 30px;
}
    .picture-frame img,
    .picture-frame iframe {
        width: 420px;
        height: 240px;
        margin: 15px;
    }

#follow-us-frame {
    width: 390px;
    height: 60px;
    background: #FFF;
    border-radius: 15px;
    margin-bottom: 30px;
    margin-top: 50px;
    padding: 20px 30px 20px 30px;
}
    #follow-us-frame p {
        float: left;
        font-family: 'Open Sans', Helvetica, Arial;
        font-size: 18px;
        color: #009a9d;
    }
    #follow-us-frame span {
        float: left;
        margin-top: 12px;
        margin-left: 20px;
    }

.link-arrow {
    background: no-repeat url(/asktheeu-theme/images/arrow_icon.gif) ;
    padding-top: 6px;
    padding-left: 35px;
    height: 30px;
}
    .link-arrow a {
        font-family: Helvetica, Arial;
        color: #00aaa6;
        font-size: 14px;
        font-weight: bold;
        text-decoration: none;
    }

/** MODAL SIGN-IN **/

#signin-successful,
#signin-successful a {
    font-family: Helvetica, Arial;
    color: #00aaa6;
    font-size: 14px;
    font-weight: bold;
    padding-top: 50px;
}

/** FOOTER **/
#footer {
    height: 100px;
    margin: 0px;
    border-top-width: 1px;
}

#footer-inner {
    width: 950px;
    margin: auto;
    position: relative;
}

#access-info-logo {
    position: absolute;
    left: 0px;
    top: 10px;
}

#footer-links {
    margin-left: 150px;
    margin-top: 10px;
    float: left;

    font-family: 'Open Sans', Helvetica, Arial;
    font-size: 18px;
}
    #footer-links ul {
        list-style: none outside none;
    }
    #footer-links ul li {
        float: left;
        margin-right: 40px;
    }
    #footer-links ul a {
        text-decoration: none;
        color: #009a9d;
    }
    #footer-links ul a:hover {
        text-decoration: underline;
    }

#credits {
    float: right;
    margin-top: 30px;
    margin-right: 20px;

    font-family: Verdana, Helvetica, Arial;
    font-size: 12px;
}
    #credits a {
        text-decoration: none;
        color: #00aaa6;
    }

#creative-commons-logo {
    float: right;
    margin-top: 20px;
}


Slightly larger text field for API key

Slightly larger text field for API key

<%= _('AntiSpam settings')%>

<% form_for(:settings) do |f| %>

  <%= labelled_form_field _('Host'), f.text_field(:host) %>

  <%= labelled_form_field _('API key'), f.text_field(:api_key, :size => 40) %>

  <% button_bar do %>
    <%= submit_button(:save, _('Save'), :cancel => {:controller => 'plugins', :action => 'index'}) %>
  <% end %>

<% end %>

<%= _('AntiSpam settings')%>

<% form_for(:settings) do |f| %>

  <%= labelled_form_field _('Host'), f.text_field(:host) %>

  <%= labelled_form_field _('API key'), f.text_field (:api_key) %>

  <% button_bar do %>
    <%= submit_button(:save, _('Save'), :cancel => {:controller => 'plugins', :action => 'index'}) %>
  <% end %>

<% end %>


fixed html of spellcheck

fixed html of spellcheck

<% prefix=nil if prefix.blank? %>
<% unless @spelling_errors.blank? %>
  <%=pluralize(@spelling_errors.size, "Spelling error") %> detected. Click for spelling suggestions:
<% end %>

  <% unless @spelling_errors.blank? %>

Errors

            <%=render :partial=>"spell_check/spelling_error", :collection=>@spelling_errors, :locals=>{:prefix=>prefix}%>

<% else%>
  <%if @spelling_msg %>
    <%= @spelling_msg%>
  <% end %>
<% end %>

     <span id="<%=prefix%>suggestions">

<% prefix=nil if prefix.blank? %>
<% unless @spelling_errors.blank? %>
  <%=pluralize(@spelling_errors.size, "Spelling error") %> detected. Click for spelling suggestions:

Errors

     <%=render :partial=>"spell_check/spelling_error", :collection=>@spelling_errors, :locals=>{:prefix=>prefix}%>

  <% else%>
    <%if @spelling_msg %>
      <%= @spelling_msg%>
    <% end %>
  <% end %>

     <span id="<%=prefix%>suggestions">


Removing link (not available for environments)

<%= _('Enterprise registration completed') %>

<%= _("Your enterprise registration request was successfully registered. The validator organization you choose (%s) should get in touch with to start the validation process. As soon as the validators approve (or reject) your request, you will be notified by e-mail.") % @create_enterprise.target.name %>

<%= link_to _('You can continue to browse this environment.'), :controller => 'home' %>

<%= _('Enterprise registration completed') %>

<%= _("Your enterprise registration request was successfully registered. The validator organization you choose (%s) should get in touch with to start the validation process. As soon as the validators approve (or reject) your request, you will be notified by e-mail.") % link_to(@create_enterprise.target.name, @create_enterprise.target.url) %>

<%= link_to _('You can continue to browse this environment.'), :controller => 'home' %>


support profiles with project not set

support profiles with project not set

  <%= staff_profile.viewer ? staff_profile.viewer.name : 'no viewer' %>
  <%= staff_profile.viewer ? staff_profile.viewer.username : 'no viewer' %>
  <%= staff_profile.motivation_code %>
  <% if @projects %>
    <%= staff_profile.project.try(:title) %>
  <% end %>

      <%= costing_link staff_profile.id %>
      <%= travel_link staff_profile.id %>
      <%= profile_notes_link staff_profile.id, staff_profile.profile_notes.length %>
      <% if @viewer.is_eventgroup_coordinator?(@eg) %>
        <%= manual_donations_link staff_profile.motivation_code %>
        <%= withdraw_move_link staff_profile.id, 'move' %>
        <%= personal_crisis_info_link staff_profile.viewer.id %>
      <% end %>

  <%= staff_profile.viewer ? staff_profile.viewer.name : 'no viewer' %>
  <%= staff_profile.viewer ? staff_profile.viewer.username : 'no viewer' %>
  <%= staff_profile.motivation_code %>
  <% if @projects %>
    <%= staff_profile.project.title %>
  <% end %>

      <%= costing_link staff_profile.id %>
      <%= travel_link staff_profile.id %>
      <%= profile_notes_link staff_profile.id, staff_profile.profile_notes.length %>
      <% if @viewer.is_eventgroup_coordinator?(@eg) %>
        <%= manual_donations_link staff_profile.motivation_code %>
        <%= withdraw_move_link staff_profile.id, 'move' %>
        <%= personal_crisis_info_link staff_profile.viewer.id %>
      <% end %>


Fixed user linkage in overview

Fixed user linkage in overview

git-svn-id: 4158f9403e16ea83fe8a6e07a45f1f3b56a747ab@1448 567b1171-46fb-0310-a4c9-b4bef9110e78

<% content_for :action_nav do %>

<%= link_to "Create new article", :controller => 'articles', :action => "new" %>

<%= link_to "Create new section", :controller => 'sections' %>

  <% if @articles.any? -%>

<%= link_to "Moderate Comments",  :controller => 'comments' %>

  <% end -%>

<% end %>

  <%= link_to 'Subscribe', overview_url, :class => 'feed right' %>

Today <%= todays_short_date %>

  <%= render_events @todays_events %>

Yesterday <%= yesterdays_short_date %>

  <%= render_events @yesterdays_events %>

Before <%= yesterdays_short_date %>

  <%= render_events @events, true %>

<% content_for :sidebar do %>
  <% if @articles.any? -%>

Comments awaiting your approval

    <% @articles.each do |article| -%>

<%= link_to "(#{article.unapproved_comments.size}) #{h(article.title)}", :controller => 'articles', :action => 'comments', :id => article.id, :filter => :unapproved %>

    <% end -%>

  <% end -%>

Recent activity

      <% for user in @users %>

<%= avatar_for user %><%= link_to who(user.login), :controller => 'users', :action => 'show', :id => user %>
 showed up <%= distance_of_time_in_words_to_now(user.updated_at) %> ago

      <% end %>

<% end %>

<% content_for :action_nav do %>

<%= link_to "Create new article", :controller => 'articles', :action => "new" %>

<%= link_to "Create new section", :controller => 'sections' %>

  <% if @articles.any? -%>

<%= link_to "Moderate Comments",  :controller => 'comments' %>

  <% end -%>

<% end %>

  <%= link_to 'Subscribe', overview_url, :class => 'feed right' %>

Today <%= todays_short_date %>

  <%= render_events @todays_events %>

Yesterday <%= yesterdays_short_date %>

  <%= render_events @yesterdays_events %>

Before <%= yesterdays_short_date %>

  <%= render_events @events, true %>

<% content_for :sidebar do %>
  <% if @articles.any? -%>

Comments awaiting your approval

    <% @articles.each do |article| -%>

<%= link_to "(#{article.unapproved_comments.size}) #{h(article.title)}", :controller => 'articles', :action => 'comments', :id => article.id, :filter => :unapproved %>

    <% end -%>

  <% end -%>

Recent activity

      <% for user in @users %>

<%= avatar_for user %><%= link_to who(user.login), :controller => 'users', :action => 'show', :id => user.login %>
 showed up <%= distance_of_time_in_words_to_now(user.updated_at) %> ago

      <% end %>

<% end %>


changed other project members access type drop down to default to accessible

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

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

<%="
" if !@resource.errors.empty? and !@policy.valid? %>

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

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

          You may:

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

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

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

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

          <% end %>
          <% if !disable_advanced_view%>

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

          <% end %>

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

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

Or share it with..

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

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

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

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

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

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

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

Additional fine-grained sharing permissions

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

              Loading...

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

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

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

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

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

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

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

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

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

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

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

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

                  Step 3

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

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

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

                      Step 3: Choose access rights, review and
                      submit

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

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

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

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

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

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

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

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

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

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

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

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

  <% end %>

<%="
" if !@resource.errors.empty? and !@policy.valid? %>

<%
   object ||= nil
   set_parameters_for_sharing_form object
   disable_advanced_view ||= nil
   disable_can_publish_check ||= false
   show_advanced_permissions = !@resource.respond_to?(:has_advanced_permissions?) || @resource.has_advanced_permissions?
   default_projects_access_type = @resource.is_asset? ? Policy::ACCESSIBLE : Policy::EDITING
   default_consortium_access_type = Policy::VISIBLE
%>
<%# 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]", "" -%>

<%="
" if !@resource.errors.empty? and !@policy.valid? %>

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

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

          You may:

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

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

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

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

          <% end %>
          <% if !disable_advanced_view%>

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

          <% end %>

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

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

Or share it with..

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

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

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

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

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

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

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

Additional fine-grained sharing permissions

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

              Loading...

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

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

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

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

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

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

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

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

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

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

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

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

                  Step 3

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

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

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

                      Step 3: Choose access rights, review and
                      submit

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

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

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

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

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

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

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

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

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

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

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

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

  <% end %>

<%="
" if !@resource.errors.empty? and !@policy.valid? %>


modified "user" link in "recent changes" list to point directly to user's list of changes which is what you expect in this context, rather than going to that user's user page and having to click "edits" there.

  <% cl = cycle('table0', 'table1') %>

  <td class="<%= cl %>">
    #<%= changeset.id %>

  <td class="<%= cl %>">
    <% if changeset.closed_at > DateTime.now %> (still editing)
    <% else %><%= changeset.closed_at.strftime("%d %b %Y %H:%M") %><% end %>

  <%if showusername %>
    <td class="<%= cl %>">
    <% if changeset.user.data_public? %>
      <%= link_to h(changeset.user.display_name), :controller => "changeset", :action => "list_user", :display_name => changeset.user.display_name %>
    <% else %>
      Anonymous
    <% end %>

  <% end %>

  <td class="<%= cl %>">
    <% if changeset.tags['comment'] %>
      <%= h(changeset.tags['comment']) %>
    <% else %>
      (none)
    <% end %>

  <td class="<%= cl %>">
    <% if changeset.min_lat.nil? %>
      (no edits)
    <% else
      minlon = changeset.min_lon/GeoRecord::SCALE.to_f
      minlat = changeset.min_lat/GeoRecord::SCALE.to_f
      maxlon = changeset.max_lon/GeoRecord::SCALE.to_f
      maxlat = changeset.max_lat/GeoRecord::SCALE.to_f
    %>
      (<a href='/?minlon=<%= minlon %>&minlat=<%= minlat %>&maxlon=<%= maxlon %>&maxlat=<%= maxlat %>&box=yes' title='show area box'><%= format("%0.3f",minlon) -%>,<%= format("%0.3f",minlat) -%>,<%= format("%0.3f",maxlon) -%>,<%= format("%0.3f",maxlat) -%>)
  <% end %>

  <td class="<%= cl %>">
    <%= link_to 'more', {:controller => 'browse', :action => 'changeset', :id => changeset.id}, {:title => 'View changeset details'} %>

  <% cl = cycle('table0', 'table1') %>

  <td class="<%= cl %>">
    #<%= changeset.id %>

  <td class="<%= cl %>">
    <% if changeset.closed_at > DateTime.now %> (still editing)
    <% else %><%= changeset.closed_at.strftime("%d %b %Y %H:%M") %><% end %>

  <%if showusername %>
    <td class="<%= cl %>">
    <% if changeset.user.data_public? %>
      <%= link_to h(changeset.user.display_name), :controller => "user", :action => "view", :display_name => changeset.user.display_name %>
    <% else %>
      Anonymous
    <% end %>

  <% end %>

  <td class="<%= cl %>">
    <% if changeset.tags['comment'] %>
      <%= h(changeset.tags['comment']) %>
    <% else %>
      (none)
    <% end %>

  <td class="<%= cl %>">
    <% if changeset.min_lat.nil? %>
      (no edits)
    <% else
      minlon = changeset.min_lon/GeoRecord::SCALE.to_f
      minlat = changeset.min_lat/GeoRecord::SCALE.to_f
      maxlon = changeset.max_lon/GeoRecord::SCALE.to_f
      maxlat = changeset.max_lat/GeoRecord::SCALE.to_f
    %>
      (<a href='/?minlon=<%= minlon %>&minlat=<%= minlat %>&maxlon=<%= maxlon %>&maxlat=<%= maxlat %>&box=yes' title='show area box'><%= format("%0.3f",minlon) -%>,<%= format("%0.3f",minlat) -%>,<%= format("%0.3f",maxlon) -%>,<%= format("%0.3f",maxlat) -%>)
  <% end %>

  <td class="<%= cl %>">
    <%= link_to 'more', {:controller => 'browse', :action => 'changeset', :id => changeset.id}, {:title => 'View changeset details'} %>


Fix more deprecated truncate usage

Fix more deprecated truncate usage

News Article Search

<%= link_to "Help with more advanced searches", :controller => "pages", :action => :revisionista_search %>

  <% form_tag({ :controller => 'news_articles', :action => 'search', :page => nil}, :method => :get ) do  %>
<%= text_field_tag 'search', @search, :class => 'searchbox', :size => 40 %> <%= submit_tag ' Search ' %>
<% end %>

<% unless @search.nil? or @search.empty? or @versions.nil? -%>

<%= @versions.count %> hits for '<%=h @search %>'

Article Title
Date
Version
Source

<% @versions.each do |version| %>

<% if version.news_article.versions_count > 1 -%>
  <% if version.version == 0 -%>
    <%= link_to h(truncate(version.title, :length => 95)), { :action => :diff, :id => version.news_article.id,
      :version_a => version.version+1,
      :version_b => version.version }, :title => "#{h(version.title)}, first published #{version.news_article.created_at}" %>
  <% else -%>
    <%= link_to h(truncate(version.title, :length => 75)), { :action => :diff, :id => version.news_article.id,
      :version_a => version.version,
      :version_b => version.version-1 }, :title => "#{h(version.title)}, first published #{version.news_article.created_at}" %>
  <% end -%>
<% else -%>
<span title="<%= "#{h(version.title)}, first published #{version.news_article.created_at}" %>"><%= h(truncate(version.news_article.title, :length => 75)) %>
<% end -%>
<%= version.created_at.strftime('%d %b %Y') %>
<%= version.version %> of <%= version.news_article.versions_count %>
<%= version.news_article.source %>

<% end %>

<%= will_paginate @versions if @versions.respond_to?(:total_pages) %>
<%end -%>

News Article Search

<%= link_to "Help with more advanced searches", :controller => "pages", :action => :revisionista_search %>

  <% form_tag({ :controller => 'news_articles', :action => 'search', :page => nil}, :method => :get ) do  %>
<%= text_field_tag 'search', @search, :class => 'searchbox', :size => 40 %> <%= submit_tag ' Search ' %>
<% end %>

<% unless @search.nil? or @search.empty? or @versions.nil? -%>

<%= @versions.count %> hits for '<%=h @search %>'

Article Title
Date
Version
Source

<% @versions.each do |version| %>

<% if version.news_article.versions_count > 1 -%>
  <% if version.version == 0 -%>
    <%= link_to h(truncate(version.title, 75)), { :action => :diff, :id => version.news_article.id,
      :version_a => version.version+1,
      :version_b => version.version }, :title => "#{h(version.title)}, first published #{version.news_article.created_at}" %>
  <% else -%>
    <%= link_to h(truncate(version.title, 75)), { :action => :diff, :id => version.news_article.id,
      :version_a => version.version,
      :version_b => version.version-1 }, :title => "#{h(version.title)}, first published #{version.news_article.created_at}" %>
  <% end -%>
<% else -%>
<span title="<%= "#{h(version.title)}, first published #{version.news_article.created_at}" %>"><%= h(truncate(version.news_article.title, 75)) %>
<% end -%>
<%= version.created_at.strftime('%d %b %Y') %>
<%= version.version %> of <%= version.news_article.versions_count %>
<%= version.news_article.source %>

<% end %>

<%= will_paginate @versions if @versions.respond_to?(:total_pages) %>
<%end -%>


Reinstate IE test and pass result to flash.

<% if OSM_STATUS == :database_offline or OSM_STATUS == :api_offline %>

<%= t 'layouts.osm_offline' %>

<% elsif OSM_STATUS == :database_readonly or OSM_STATUS == :api_readonly %>

<%= t 'layouts.osm_read_only' %>

<% elsif !@user.data_public? %>

<%= t 'site.edit.not_public' %>

<%= t 'site.edit.not_public_description',
:user_page => (link_to t('site.edit.user_page_link'), {:controller => 'user', :action => 'account', :display_name => @user.display_name, :anchor => 'public'}) %>

<%= t 'site.edit.anon_edits', :link => link_to(t('site.edit.anon_edit_link_text'), t('site.edit.anon_edits_link')) %> ()

<% else %>
<% content_for :greeting do %>
<% if @user and !@user.home_lon.nil? and !@user.home_lat.nil? %>
<%= link_to_function 'home', "setPosition(#{@user.home_lat}, #{@user.home_lon}, 10)" %> |
<% end %>
<% end %>

<%= render :partial => 'sidebar', :locals => { :onopen => "resizeMap();", :onclose => "resizeMap();" } %>
<%= render :partial => 'search' %>

<%
session[:token] = @user.tokens.create.token unless session[:token]

# Decide on a lat lon to initialise potlatch with. Various ways of doing this
if params['lon'] and params['lat']
	lon =  h(params['lon'])
	lat =  h(params['lat'])
	zoom =  h(params['zoom'])

elsif params['mlon'] and params['mlat']
	lon =  h(params['mlon'])
	lat =  h(params['mlat'])
	zoom =  h(params['zoom'])

elsif params['gpx']
	#use gpx id to locate (dealt with below)

elsif cookies.key?("_osm_location")
	lon,lat,zoom,layers = cookies["_osm_location"].split("|")

elsif @user and !@user.home_lon.nil? and !@user.home_lat.nil?
	lon =  @user.home_lon
	lat =  @user.home_lat

else
	#catch all.  Do nothing.  lat=nil, lon=nil
	#Currently this results in potlatch starting up at 0,0 (Atlantic ocean).
end

zoom='14' if zoom.nil?
%>

	<%= t 'site.edit.flash_player_required' %>

<%= javascript_include_tag 'swfobject.js' %>

<% end %>


updating theme

updating theme

		<%= link_to _("Twitter settings"), :controller => 'cms', :action => 'edit', :id => @page.id %>
		<form>
			#hashtag a ser seguida
			<input></input><input class="btn-ok" type="submit" value="ok"></input>
		</form>

		<%= link_to _("Facebook settings"), :controller => 'cms', :action => 'edit', :id => @page.id %>

		<%= link_to _("General settings"), :controller => 'cms', :action => 'edit', :id => @page.id %>

		<%= link_to _("Twitter settings"), :controller => 'cms', :action => 'edit', :id => @page.id %>

		<%= link_to _("Facebook settings"), :controller => 'cms', :action => 'edit', :id => @page.id %>

		<%= link_to _("General settings"), :controller => 'cms', :action => 'edit', :id => @page.id %>


ActionItem890: adding a more detailed explanation for totally naive users.

 <%= _('Access denied') %>

  <% unless @message.nil? %>

<%= @message %>

  <% else %>

<%= _('You are not allowed to view this page.') %>

<%= _("If you are supposed to have access to this area, you'll probably want to talk to the people responsible and ask them to give you access.") %>
  <% end %>

<%= link_to _('Go to the site home page'), :controller => 'home' %>

<%= link_to _('Go back'), :back %>

 <%= _('Access denied') %>

  <% unless @message.nil? %>

<%= @message %>

  <% else %>

<%= _('You are not allowed to view this page.') %>

  <% end %>

<%= link_to _('Go to the site home page'), :controller => 'home' %>

<%= link_to _('Go back'), :back %>


nested scaffolds now honor association :conditions

git-svn-id: b2ff2946fad280430023ee7ead77858f96a610fa@632 561dde7e-7729-0410-be8e-ef83869d6c7d

<h4> </h4>
<%
  # TODO: shouldn't this logic happen in the controller action instead of the template?
  # Actually, maybe we should make render :active_scaffold work in the controller, and not even have a _nested.rhtml?

  # This assumes that the association is included as a column in the active_scaffold_config.columns collection
  associated_columns = []
  associated_columns = params[:associations].split(" ") unless params[:associations].nil?
  unless associated_columns.empty?
    parent_id = params[:id]
    associated_columns.each do | column_name |
      # find the column and the association
      column = active_scaffold_config.columns[column_name]
      association = column.association

      # determine what constraints we need
      if column.through_association?
        @constraints = {
          association.source_reflection.reverse => {
            association.through_reflection.reverse => parent_id
          }
        }
      else
        @constraints = { association.reverse => parent_id }
      end

      # generate the customized label
      @label = as_("%s for %s", active_scaffold_config_for(association.klass).label, format_column(@record.to_label))

      begin
        controller = active_scaffold_controller_for(association.klass)
      rescue ActiveScaffold::ControllerNotFound => error
        concat "#{error.class} - #{error.message}", binding
      else
        concat render(:active_scaffold => controller.controller_path,
          :constraints => @constraints,
          :conditions => association.options[:conditions],
          :label => @label,
          :params => {:nested => true, :parent_column => column_name, :parent_model => association.active_record}
        ), binding
      end
    end
  end
%>

<h4> </h4>
<%
  # This assumes that the association is included as a column in the active_scaffold_config.columns collection
  associated_columns = []
  associated_columns = params[:associations].split(" ") unless params[:associations].nil?
  unless associated_columns.empty?
    parent_id = params[:id]
    associated_columns.each do | column_name |
      column = active_scaffold_config.columns[column_name]
      association = column.association
      if column.through_association?
        constraints = {
          association.source_reflection.reverse => {
            association.through_reflection.reverse => parent_id
          }
        }
      else
        constraints = { association.reverse => parent_id }
      end
      begin
        controller = active_scaffold_controller_for(association.klass)
      rescue ActiveScaffold::ControllerNotFound => error
        concat "#{error.class} - #{error.message}", binding
      else
        concat render(:active_scaffold => controller.controller_path,
          :constraints => constraints,
          :label => as_("%s for %s", active_scaffold_config_for(association.klass).label, format_column(@record.to_label)),
          :params => {:nested => true, :parent_column => column_name, :parent_model => association.active_record}
        ), binding
      end
    end
  end
%>


minor formatting changes

minor formatting changes

 Weigh bats in cage <%= @cage.name %>

<%= start_form_tag :action => 'submit_weights', :id => @cage %>

Band
Weight
Weight Notes
Cage
Cage change reason

<% for @bat in @bats %>

<%= @bat.band %>
<%= text_field 'weight', @bat.id, :size => 4 %> g
<%= text_field 'note', @bat.id %>
<%# See http://www.rubyonrails.org/api/classes/ActionView/Helpers/FormOptionsHelper.html#M000404 %>
<%= select 'bat_cage', @bat.id.to_s , @cages.collect {|c| [c.name , c.id] }, :selected => @bat.cage.id  %>
<%= text_field 'cage_change_note', @bat.id %>

<% end %>

<%= submit_tag 'Submit Weights' %>

<%= end_form_tag %>

 Weigh Bats

<%= start_form_tag :action => 'submit_weights', :id => @cage %>

Weighing bats in cage: <%= @cage.name %>

Band
Weight(g)
Weight Notes
Cage
Cage change reason

<% for @bat in @bats %>

<%= @bat.band %>
<%= text_field 'weight', @bat.id, :size => 4 %> g
<%= text_field 'note', @bat.id %>
<%# See http://www.rubyonrails.org/api/classes/ActionView/Helpers/FormOptionsHelper.html#M000404 %>
<%= select 'bat_cage', @bat.id.to_s , @cages.collect {|c| [c.name , c.id] }, :selected => @bat.cage.id  %>
<%= text_field 'cage_change_note', @bat.id %>

<% end %>

<%= submit_tag 'Submit Weights' %>

<%= end_form_tag %>


Fix links to users' diaries.

Fix links to users' diaries.


Add text amendments suggested by the Information Commission.

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

Complain directly to the Information Commissioner.

If ...

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

Your request was refused, 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 Commissioner.

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 Commissioner. To do this read
Complaints about Freedom of Information
on the Information Commissioner'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 Commissioner, 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. Although the Information Commissioner has worked hard to reduce their backlog of casework,
it can still take several months to get resolution from them in most circumstances.
One area where they have sped up things considerably is that they are able to prompt non-responsive
authorities to reply within a few weeks of receiving a complaint.

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 pursuing 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 refused 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 refused, 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 Commissioner.

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 Commissioner. To do this read
Complaints about Freedom of Information
on the Information Commissioner'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 Commissioner, 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. Although the Information Commissioner has worked hard to reduce their backlog of casework,
it can still take several months to get resolution from them in most circumstances.
One area where they have sped up things considerably is that they are able to prompt non-responsive
authorities to reply within a few weeks of receiving a complaint.

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 pursuing 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 refused 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.


Make search+pagination work right

Make search+pagination work right

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

<% @page_heading = "Comments and Trackbacks for #{ this_blog.settings['blog_name'] }" %>

<% content_for('tasks') do %>
  <%= task_showmod 'Show only feedback needing moderation' %>
<% end %>

  <form>
    Feedback Search:<input type="text" id="search" name="search" value="<%=h params[:search] %>" size="15" />
  </form>

	Type
	Article
    Author
    IP
    Posted date
    Delete

  <% for feedback in @feedback -%>

	<%=h feedback.class %>
	<%= link_to_article_edit feedback.article %>

        <%=h (feedback.author || '(unknown)').slice(0,40) %>

	    <a href=<%=h feedback.url%>><%=h feedback.url.to_s.slice(0,40)%>

    	<%=h feedback.email.to_s.slice(0,40) %>

    <%=h feedback.ip %>
    <%=h distance_of_time_in_words_to_now(feedback.created_at) %>
	<%= link_to image_tag('delete'), {:action => 'delete', :id => feedback.id },  :confirm => "Are you sure?", :post => true %>

  <% end -%>

<%= link_to "Previous page", { :page => @pages.current.previous, :search => params[:search] } if @pages.current.previous %>
<%= pagination_links(@pages, :params => {:search => params[:search]}) %>
<%= link_to "Next page", { :page => @pages.current.next, :search => params[:search] } if @pages.current.next %>

<% @page_heading = "Comments and Trackbacks for #{ this_blog.settings['blog_name'] }" %>

<% content_for('tasks') do %>
  <%= task_showmod 'Show only feedback needing moderation' %>
<% end %>

  <form>
    Feedback Search:<input type="text" id="search" name="search" value="<%=h params[:search] %>" size="15" />
  </form>

	Type
	Article
    Author
    IP
    Posted date
    Delete

  <% for feedback in @feedback -%>

	<%=h feedback.class %>
	<%= link_to_article_edit feedback.article %>

        <%=h (feedback.author || '(unknown)').slice(0,40) %>

	    <a href=<%=h feedback.url%>><%=h feedback.url.to_s.slice(0,40)%>

    	<%=h feedback.email.to_s.slice(0,40) %>

    <%=h feedback.ip %>
    <%=h distance_of_time_in_words_to_now(feedback.created_at) %>
	<%= link_to image_tag('delete'), {:action => 'delete', :id => feedback.id },  :confirm => "Are you sure?", :post => true %>

  <% end -%>

<%= link_to "Previous page", { :page => @pages.current.previous } if @pages.current.previous %>
<%= pagination_links(@pages) %>
<%= link_to "Next page", { :page => @pages.current.next } if @pages.current.next %>