Handle case where an external request doesn't have a user name.

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

<%=@title%>

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

        <a href="#metadata_<%=@info_request.id%>" data-toggle="collapse" data-parent="#info_request">Request metadata

    <div id="metadata_<%=@info_request.id%>" class="accordion-body collapse in">

          <%= link_to 'Edit metadata', '../edit/' + @info_request.id.to_s, :class => "btn" %>

        Public page:
        <%= link_to main_url(request_url(@info_request)), main_url(request_url(@info_request)) %>

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

                <%= name %>:

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

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

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

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

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

                <% end %>

          <% end %>

              Created by

          <% if @info_request.is_external? %>
                <%= link_to("".html_safe, @info_request.external_url, :title => "view URL of original request on external website") %>
                <%= @info_request.public_body.name %> on behalf of <%= (@info_request.user_name || _('an anonymous user'))%> (using API)
          <% else %>
                <%= link_to("".html_safe, user_url(@info_request.user), :title => "view user's page on public website") %>
                <%= user_admin_link_for_request(@info_request) %>
                <%= link_to _("move..."), "#", :class => "btn btn-mini btn-warning toggle-hidden" %>

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

          <% end %>

              Public authority:

              <%= link_to("".html_safe, main_url(public_body_url(@info_request.public_body)), :title => "view authority on public website") %>
              <%= link_to(@info_request.public_body.name, public_body_admin_url(@info_request.public_body)) %>
              <%= link_to "move...", "#", :class => "btn btn-mini btn-warning toggle-hidden" %>

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

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

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

              <%=_("Tags")%>

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

          <%= link_to 'Edit metadata', '../edit/' + @info_request.id.to_s, :class => "btn" %>

<% end %>
<formset class="form-horizontal">
  <legend>Actions</legend>

      FOI officer upload URL

      <%= link_to 'Generate URL', '../generate_upload_url/' + @info_request.id.to_s, :class => "btn" %>

(see also option to general URLs for individual incoming messages below)

  <% form_tag '../hide/' + @info_request.id.to_s, :class => "form form-inline", :info_request_id => @info_request.id.to_s, :id => "hide_request_form" do %>

        <% if  @info_request.is_external? %>
          Hide the request:
        <% else %>
          Hide the request and notify the user:
        <% end %>

        <% if ['hidden', 'requester_only'].include? @info_request.prominence %>

This request has already been hidden

        <% else %>

            <%= radio_button_tag "reason", "not_foi" %> <%= _("Not a valid FOI request") %>

            <%= radio_button_tag "reason", "vexatious" %> <%= _("A vexatious request") %>

        <% end %>

    <% if !['hidden', 'requester_only'].include? @info_request.prominence %>
        <% if ! @info_request.is_external? %>

            Subject of email:

              <%= text_field_tag "subject", "Your request on WhatDoTheyKnow.com hidden", {:id => "request_hidden_user_subject_field", :cols => 100} %>

            Reason for hiding the request (will be emailed to user):

              <%= text_area_tag "explanation", h(@request_hidden_user_explanation), {:id => "request_hidden_user_explanation_field"} %>

         <% end %>

        <%= submit_tag _("Hide request"), :class => "btn" %>

    <% end %>
  <% end %>
</formset>

Events

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

        <a href="#event_<%=info_request_event.id%>" data-toggle="collapse" data-parent="#events">
          <%= _("Event {{id}}", :id => info_request_event.id) %>:

            <%=h info_request_event.event_type.humanize %><% if !info_request_event.calculated_state.nil? %>; state: <%= info_request_event.calculated_state %><% end %>

            <%= info_request_event.created_at%>

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

                <% if info_request_event.described_state != 'waiting_clarification' and info_request_event.event_type == 'response' %>
                  <% form_tag '../mark_event_as_clarification', :class => "form form-inline admin-table-form admin-inline-form" do %>
                    <%= hidden_field_tag 'info_request_event_id', info_request_event.id %>
                    <%= submit_tag "Was clarification request", :class => "btn btn-mini btn-primary" %>
                  <% end %>
                <% end %>

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

                  <%=h name%>

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

            <% end %>

  <% end %>

Outgoing messages

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

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

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

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

                <% form_tag '../resend', :class => "admin-table-form" do %>
                  <%= hidden_field_tag 'outgoing_message_id', outgoing_message.id %>
                  <%= submit_tag "Resend", :class => "btn" %>
                <% end %>

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

                  <%=name%>

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

<%= simple_format( outgoing_message.body ) %>

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

            <% end %>

  <% end %>

Incoming messages

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

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

          <% if !incoming_message.cached_main_body_text_folded.nil? %>
            <%= truncate(incoming_message.cached_main_body_text_folded.gsub('FOLDED_QUOTED_SECTION', ''), :length => 400) %>
          <% end %>

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

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

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

                  <%=name%>

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

<%= simple_format(value) %>

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

            <% end %>

  <% end %>

Annotations

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

    <% for comment in @info_request.comments %>

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

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

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

                 By <%= link_to("".html_safe, user_url(comment.user), :title => "view user's page on public website") %>

                  <%= link_to(h(comment.user.name), user_admin_url(comment.user)) %>

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

                    <%=name%>

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

              <% end %>

    <% end %>

<% else %>

None yet.

<% end %>

Exim delivery logs

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

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

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

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

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

<% end %>

Censor rules

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

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

<%=@title%>

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

        <a href="#metadata_<%=@info_request.id%>" data-toggle="collapse" data-parent="#info_request">Request metadata

    <div id="metadata_<%=@info_request.id%>" class="accordion-body collapse in">

          <%= link_to 'Edit metadata', '../edit/' + @info_request.id.to_s, :class => "btn" %>

        Public page:
        <%= link_to main_url(request_url(@info_request)), main_url(request_url(@info_request)) %>

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

                <%= name %>:

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

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

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

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

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

                <% end %>

          <% end %>

              Created by

          <% if @info_request.is_external? %>
                <%= link_to("".html_safe, @info_request.external_url, :title => "view URL of original request on external website") %>
                <%= @info_request.public_body.name %> on behalf of <%= @info_request.user_name %> (using API)
          <% else %>
                <%= link_to("".html_safe, user_url(@info_request.user), :title => "view user's page on public website") %>
                <%= user_admin_link_for_request(@info_request) %>
                <%= link_to _("move..."), "#", :class => "btn btn-mini btn-warning toggle-hidden" %>

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

          <% end %>

              Public authority:

              <%= link_to("".html_safe, main_url(public_body_url(@info_request.public_body)), :title => "view authority on public website") %>
              <%= link_to(@info_request.public_body.name, public_body_admin_url(@info_request.public_body)) %>
              <%= link_to "move...", "#", :class => "btn btn-mini btn-warning toggle-hidden" %>

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

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

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

              <%=_("Tags")%>

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

          <%= link_to 'Edit metadata', '../edit/' + @info_request.id.to_s, :class => "btn" %>

<% end %>
<formset class="form-horizontal">
  <legend>Actions</legend>

      FOI officer upload URL

      <%= link_to 'Generate URL', '../generate_upload_url/' + @info_request.id.to_s, :class => "btn" %>

(see also option to general URLs for individual incoming messages below)

  <% form_tag '../hide/' + @info_request.id.to_s, :class => "form form-inline", :info_request_id => @info_request.id.to_s, :id => "hide_request_form" do %>

        <% if  @info_request.is_external? %>
          Hide the request:
        <% else %>
          Hide the request and notify the user:
        <% end %>

        <% if ['hidden', 'requester_only'].include? @info_request.prominence %>

This request has already been hidden

        <% else %>

            <%= radio_button_tag "reason", "not_foi" %> <%= _("Not a valid FOI request") %>

            <%= radio_button_tag "reason", "vexatious" %> <%= _("A vexatious request") %>

        <% end %>

    <% if !['hidden', 'requester_only'].include? @info_request.prominence %>
        <% if ! @info_request.is_external? %>

            Subject of email:

              <%= text_field_tag "subject", "Your request on WhatDoTheyKnow.com hidden", {:id => "request_hidden_user_subject_field", :cols => 100} %>

            Reason for hiding the request (will be emailed to user):

              <%= text_area_tag "explanation", h(@request_hidden_user_explanation), {:id => "request_hidden_user_explanation_field"} %>

         <% end %>

        <%= submit_tag _("Hide request"), :class => "btn" %>

    <% end %>
  <% end %>
</formset>

Events

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

        <a href="#event_<%=info_request_event.id%>" data-toggle="collapse" data-parent="#events">
          <%= _("Event {{id}}", :id => info_request_event.id) %>:

            <%=h info_request_event.event_type.humanize %><% if !info_request_event.calculated_state.nil? %>; state: <%= info_request_event.calculated_state %><% end %>

            <%= info_request_event.created_at%>

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

                <% if info_request_event.described_state != 'waiting_clarification' and info_request_event.event_type == 'response' %>
                  <% form_tag '../mark_event_as_clarification', :class => "form form-inline admin-table-form admin-inline-form" do %>
                    <%= hidden_field_tag 'info_request_event_id', info_request_event.id %>
                    <%= submit_tag "Was clarification request", :class => "btn btn-mini btn-primary" %>
                  <% end %>
                <% end %>

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

                  <%=h name%>

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

            <% end %>

  <% end %>

Outgoing messages

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

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

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

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

                <% form_tag '../resend', :class => "admin-table-form" do %>
                  <%= hidden_field_tag 'outgoing_message_id', outgoing_message.id %>
                  <%= submit_tag "Resend", :class => "btn" %>
                <% end %>

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

                  <%=name%>

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

<%= simple_format( outgoing_message.body ) %>

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

            <% end %>

  <% end %>

Incoming messages

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

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

          <% if !incoming_message.cached_main_body_text_folded.nil? %>
            <%= truncate(incoming_message.cached_main_body_text_folded.gsub('FOLDED_QUOTED_SECTION', ''), :length => 400) %>
          <% end %>

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

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

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

                  <%=name%>

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

<%= simple_format(value) %>

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

            <% end %>

  <% end %>

Annotations

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

    <% for comment in @info_request.comments %>

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

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

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

                 By <%= link_to("".html_safe, user_url(comment.user), :title => "view user's page on public website") %>

                  <%= link_to(h(comment.user.name), user_admin_url(comment.user)) %>

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

                    <%=name%>

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

              <% end %>

    <% end %>

<% else %>

None yet.

<% end %>

Exim delivery logs

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

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

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

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

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

<% end %>

Censor rules

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


_enter_weathers.rhtml now displays the temp/hum in a table

<%= flash[:note] %>

<% flash[:note] = nil %>

<form>

Room
Temperature
Humidity

<% for room in Room.find(:all, :order=> 'name') %>

<%= room.name %>

<% room_weather = room.weathers.today %>
<% if room_weather == nil %>
<%= text_field 'weather', 'temperature', :size=>2, :value=> '' %> &deg F
<%= text_field 'weather', 'humidity', :size=>2, :value=> '' %>%
<%= submit_to_remote 'Submit', 'Submit', :update => 'weathers',
        :url=>{:controller => 'weathers', :action => 'create', :room => room} %>

<% else %>
<%= room_weather.temperature %> &deg F
<%= room_weather.humidity %>%
<%= submit_to_remote('Delete','Delete',
        :url=>{:controller => 'weathers', :action => 'clear', :room => room},
        :update => 'weathers') %>
<% end %>

<% end %>

</form>

<%= flash[:note] %>

<% flash[:note] = nil %>

<% for room in Room.find(:all, :order=> 'name') %>
  <% room_weather = room.weathers.today %>
  <% if room_weather == nil %>
  <% form_remote_tag(:update => 'weathers',
        :url=>{:controller => 'weathers', :action => 'create', :room => room}) do %>

<%= room.name %>
    <%= text_field 'weather', 'temperature', :size=>2, :value=> '' %> &deg F
    <%= text_field 'weather', 'humidity', :size=>2, :value=> '' %>%
    <%= submit_tag 'Submit' %>

  <% end %>

  <% else %>

<form><%= room.name %>
    <%= room_weather.temperature %> &deg F
    <%= room_weather.humidity %>%
		<%= submit_to_remote('Delete','Delete',
        :url=>{:controller => 'weathers', :action => 'clear', :room => room},
        :update => 'weathers') %>
    </form>

  <% end %>
<% end %>


Added link to spam prevention section in #act-nav.

<% content_for :action_nav do %>

<%= link_to "General", '#general' %>

<%= link_to "Spam Prevention", '#spam' %>

<%= link_to "Comments", '#spam' %>

<%= link_to "Publishing", '#publish' %>

    <% if ActionController::Base.perform_caching -%>

<%= link_to 'Caches', :controller => '/admin/cached_pages' %>

    <% end -%>

<% end %>

<% form_for :site, :url => { :action => "update" } do |f| %>

General site settings

Website title

<%= f.text_field :title %>

Website subtitle

<%= f.text_field :subtitle %>

      Administrator email
      Shown in emails sent from your site

<%= f.text_field :email %>

Website Timezone

<%= select_tag 'site_timezone', options_for_select(['UTC'] + TZInfo::Timezone.all.map{|tz| [tz.to_s, tz.name]}.sort, @site.timezone.name), :name => 'site[timezone]' %>

      Current Theme Path
      This is the path to the current template in /themes/site-<%= site.id %>.  Be careful with this setting!

      <%= f.text_field :current_theme_path %>
    <% unless site.theme.name == site.current_theme_path -%>
      This setting is incorrect, set it to a valid theme path.
    <% end -%>

Spam prevention

At the moment Mephisto uses <%= link_to 'Akismet', 'http://akismet.com' %> to automatically handle spam.  If you leave out the Akismet settings, you can moderate new comments from the Overview.

Akismet API Key

<%= f.text_field :akismet_key %>

Blog url

<%= f.text_field :akismet_url %>

Comments

<%= f.select :comment_age, comment_expiration_options %>

      <%= f.check_box 'approve_comments' %> Approve and publish all comments automatically.

Publishing and Reading

      Comments filter

When comments are posted, they use this markup

      <select name="site[filter]">
        <%= options_for_select(filter_options, site.filter) %>
      </select>

      Articles per page

Default article limit for search/tag pages.

<%= f.text_field :articles_per_page, :class => 'tiny' %>

      Search area url

<%= f.text_field :search_path %>

      Tag area url

<%= f.text_field :tag_path %>

    <% if @layouts.any? -%>

      Tag area layout

      <select name="site[tag_layout]">
        <%= options_from_templates_for_select(@layouts, @site.tag_layout) %>
      </select>

    <% end -%>

      Article url style

Use the :year, :month, :day, :permalink, and :id in place of actual article values.

<%= f.text_field :permalink_style %>

<%= submit_tag 'Save and apply settings' %>

<% end %>

<% content_for :action_nav do %>

<%= link_to "General", '#general' %>

<%= link_to "Comments", '#spam' %>

<%= link_to "Publishing", '#publish' %>

    <% if ActionController::Base.perform_caching -%>

<%= link_to 'Caches', :controller => '/admin/cached_pages' %>

    <% end -%>

<% end %>

<% form_for :site, :url => { :action => "update" } do |f| %>

General site settings

Website title

<%= f.text_field :title %>

Website subtitle

<%= f.text_field :subtitle %>

      Administrator email
      Shown in emails sent from your site

<%= f.text_field :email %>

Website Timezone

<%= select_tag 'site_timezone', options_for_select(['UTC'] + TZInfo::Timezone.all.map{|tz| [tz.to_s, tz.name]}.sort, @site.timezone.name), :name => 'site[timezone]' %>

      Current Theme Path
      This is the path to the current template in /themes/site-<%= site.id %>.  Be careful with this setting!

      <%= f.text_field :current_theme_path %>
    <% unless site.theme.name == site.current_theme_path -%>
      This setting is incorrect, set it to a valid theme path.
    <% end -%>

Spam prevention

At the moment Mephisto uses <%= link_to 'Akismet', 'http://akismet.com' %> to automatically handle spam.  If you leave out the Akismet settings, you can moderate new comments from the Overview.

Akismet API Key

<%= f.text_field :akismet_key %>

Blog url

<%= f.text_field :akismet_url %>

Comments

<%= f.select :comment_age, comment_expiration_options %>

      <%= f.check_box 'approve_comments' %> Approve and publish all comments automatically.

Publishing and Reading

      Comments filter

When comments are posted, they use this markup

      <select name="site[filter]">
        <%= options_for_select(filter_options, site.filter) %>
      </select>

      Articles per page

Default article limit for search/tag pages.

<%= f.text_field :articles_per_page, :class => 'tiny' %>

      Search area url

<%= f.text_field :search_path %>

      Tag area url

<%= f.text_field :tag_path %>

    <% if @layouts.any? -%>

      Tag area layout

      <select name="site[tag_layout]">
        <%= options_from_templates_for_select(@layouts, @site.tag_layout) %>
      </select>

    <% end -%>

      Article url style

Use the :year, :month, :day, :permalink, and :id in place of actual article values.

<%= f.text_field :permalink_style %>

<%= submit_tag 'Save and apply settings' %>

<% end %>


do not error out if detect-browser is not run

<% # SPROUTCORE DEFAULT INDEX TEMPLATE
   # This template provide provides a basic wrapper for a SproutCore client.
   # Most of the time, it will be sufficient for your own needs.  However, if
   # you need to create your own template, you can do so by copying this file
   # into your client, naming it 'index.rhtml' and then adding the options
   # :index => 'index' to your client declaration in routes.rb.
   #
   # See the comments in this file for more information on what you can
   # change.
-%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<%  # @title will be defined if you passed :title in routes.rb -%>
    <title><%= (@title.to_s || bundle_name.to_s || '').capitalize %></title>
<% #
	 # This line should appear in your head area to include the stylesheets
	 # generated by your client.  If you need to include your own
	 # stylesheets, you don't need to change it here.  Instead, use the
	 # :requires option in routes.rb.
-%>
    <script src="<%= static_url('detect-browser') %>" type="text/javascript"></script>

    <%= stylesheets_for_client %>
<%= @content_for_page_styles %>
  </head>
  <body class="<%= @theme || 'sc-theme' %> focus">
    <script type="text/javascript">
    var SC; if (!SC) SC = {} ;
    if (SC.setupBodyClassNames) SC.setupBodyClassNames() ;
    </script>

<% #
   # This is where you root body element will appear.  To cause your
   # content to appear here, just declare content_for('body') in one of
   # your partials.
-%>
    <!-- Main Page Body -->
    <%= @content_for_body %>

<% #
   # This is where the resources you delcare will appear.  You must
   # include the following three lines verbatim for the resources you
   # declare to be properly used.
-%>
    <!-- Resources to be removed from DOM on page load -->
    <div id="resources" style="display:none; visibility: hidden;">
      <%= @content_for_resources -%>
    </div>

<% #
   # This line should appear at the bottom of your page to include your
   # generated JavaScript and any libraries you reference.  If you need
   # to include other javascripts, add them to the :requires option of
   # your client in routes.rb instead of changing it here.
-%>
    <!-- Include Site Javascript -->
    <%= javascripts_for_client %>
<%= @content_for_page_javascript %>

<% #
   # The following lines to the closing body tag must be included at the
   # very end of your file.  This will actually setup the JavaScript
   # views on your page and register SproutCore to start on page load.
-%>
<!-- Render Page Views -->
<%= render_page_views %>

    <!-- Start SproutCore on Page Load -->
    <script type="text/javascript">window.onload = SC.didLoad;</script>
<%= @content_for_final %>
	</body>
</html>

<% # SPROUTCORE DEFAULT INDEX TEMPLATE
   # This template provide provides a basic wrapper for a SproutCore client.
   # Most of the time, it will be sufficient for your own needs.  However, if
   # you need to create your own template, you can do so by copying this file
   # into your client, naming it 'index.rhtml' and then adding the options
   # :index => 'index' to your client declaration in routes.rb.
   #
   # See the comments in this file for more information on what you can
   # change.
-%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<%  # @title will be defined if you passed :title in routes.rb -%>
    <title><%= (@title.to_s || bundle_name.to_s || '').capitalize %></title>
<% #
	 # This line should appear in your head area to include the stylesheets
	 # generated by your client.  If you need to include your own
	 # stylesheets, you don't need to change it here.  Instead, use the
	 # :requires option in routes.rb.
-%>
    <script src="<%= static_url('detect-browser') %>" type="text/javascript"></script>

    <%= stylesheets_for_client %>
<%= @content_for_page_styles %>
  </head>
  <body class="<%= @theme || 'sc-theme' %> focus">
    <script type="text/javascript">
    if (SC.setupBodyClassNames) SC.setupBodyClassNames() ;
    </script>

<% #
   # This is where you root body element will appear.  To cause your
   # content to appear here, just declare content_for('body') in one of
   # your partials.
-%>
    <!-- Main Page Body -->
    <%= @content_for_body %>

<% #
   # This is where the resources you delcare will appear.  You must
   # include the following three lines verbatim for the resources you
   # declare to be properly used.
-%>
    <!-- Resources to be removed from DOM on page load -->
    <div id="resources" style="display:none; visibility: hidden;">
      <%= @content_for_resources -%>
    </div>

<% #
   # This line should appear at the bottom of your page to include your
   # generated JavaScript and any libraries you reference.  If you need
   # to include other javascripts, add them to the :requires option of
   # your client in routes.rb instead of changing it here.
-%>
    <!-- Include Site Javascript -->
    <%= javascripts_for_client %>
<%= @content_for_page_javascript %>

<% #
   # The following lines to the closing body tag must be included at the
   # very end of your file.  This will actually setup the JavaScript
   # views on your page and register SproutCore to start on page load.
-%>
<!-- Render Page Views -->
<%= render_page_views %>

    <!-- Start SproutCore on Page Load -->
    <script type="text/javascript">window.onload = SC.didLoad;</script>
<%= @content_for_final %>
	</body>
</html>


delete unused file

delete unused file

<%
#
# Nathan Reed, 29/04/2010

$LOAD_PATH << './lib' << '../shared'

begin
	load './lib/so-db.rb'
rescue LoadError
	load '../shared/so-db.rb'
end

load './lib/google-graph.rb'
require 'rubygems'
require 'json'
require 'cgi'

db = SoSql.real_connect();

site_list = ['so', 'sf', 'su']
cur_site = 'so'
max_tags = 50;
max_tags_default = 4;
all_tag = 'all';

query = CGI.new
so_tag = query.params['tag'][0];
so_tag = all_tag if so_tag.nil?
so_tag_display = so_tag # this appears after the '/' in the title

cur_site = query.params['site'][0] if !query.params['site'][0].nil?

# generate the list of tags that we can click on
popular_tags = db.get_tags(cur_site)
popular_tags.insert(0, {'tag_name'=> "ao-tag-#{all_tag}", 'site'=>cur_site})

if so_tag == all_tag
	# its the front page. Get the three main counters.
	q_count = db.get_rate_from_rate("#{cur_site}-question");
	a_count = db.get_rate_from_rate("#{cur_site}-answer");
	c_count = db.get_rate_from_count("#{cur_site}-comment-count");

	count_data = [q_count, a_count, c_count];
else
	# is this one of the main 3 tags? they get treated differently...
	if ['question', 'answer', 'comment'].include?(so_tag)
		question_count_tag = "#{cur_site}-#{so_tag}-count"
		tag_type = so_tag + 's'
		so_tag_display = so_tag + 's'
	else
		question_count_tag = "#{cur_site}-tag-#{so_tag}"
		tag_type = 'questions'
	end

	q_count = db.get_rate_from_count(question_count_tag);
	count_data = [q_count];

	graph_data = db.daily_graph_values(question_count_tag);
	graph_url = GoogleChart.new({:spacing => 20, :labels => graph_data['labels'], :color => '5FC5FF'}).generate(graph_data['data'])
	graph_url = './imgs/blank.png' if graph_url.nil?

end

# maybe the web server and the server that gathered the so data
# have slightly different clocks. We apply this offset to make them
# the same.
count_data.each do |ci|
	ci['age'] += $TIME_OFFSET;
end

db.close;

def to_hourly(rate_data)
	if rate_data.nil?
		return nil;
	end

	return (rate_data['rate']*3600).round().to_s + ' / hr';
end

def to_daily(rate_data)
	if rate_data.nil?
		return nil;
	end

	return (rate_data['rate']*86400).round().to_s + ' / day';
end

%>

<!doctype html public "-//w3c//dtd html 4.0 strict//en">

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title> analyticsoverflow - tracking the activity on stackoverflow.com </title>

<meta http-equiv="REFRESH" content="300">

<link rel="stylesheet" href="<%= $ROOT_PATH %>css/default.css" type="text/css" media="screen, projection">
<link rel="stylesheet" href="<%= $ROOT_PATH %>css/so-count.css?v=2" type="text/css" media="screen, projection">

			site:
	<%
		site_list.each_with_index do |site_item, i|
			if site_item == cur_site
				puts "#{site_item}"
			else
				puts "#{site_item}"
			end

			print ' | '  if i != site_list.length-1
		end
	%>

			analyticsoverflow<% print "/#{so_tag_display}" if so_tag != all_tag %>

		view by tag:

		<%
		tag_index = popular_tags.index(so_tag)
		tag_index = -1 if tag_index.nil?

		popular_tags.each_with_index do |cur_tag, i|
			tag_attr = []
			tag_attr << "class='so-more-tags'" if i > max_tags_default
			tag_attr << "style='display:none'" if i > max_tags_default and tag_index <= max_tags_default

			cur_tag_name = cur_tag['tag_name'].split('-', 3)[-1]
			cur_tag_site = cur_tag['site']

			if cur_tag_name == so_tag
				print " #{cur_tag_name} ";
			elsif cur_tag == all_tag
				print " #{cur_tag_name} ";
			else
				print " #{cur_tag_name} ";
			end
		end
		%>

		more...

	<% if so_tag == all_tag %>

<a id='<%= cur_site %>-comment-count' class='so-counter' href='./?site=<%= cur_site %>&tag=comment'> ...

 comments <%= to_hourly(c_count) %>

<a id='<%= cur_site %>-answer-count' class='so-counter' href='./?site=<%= cur_site %>&tag=answer'> ...

 answers <%= to_hourly(a_count) %>

<a id='<%= cur_site %>-question-count' class='so-counter' href='./?site=<%= cur_site %>&tag=question'> ...

 questions <%= to_hourly(q_count) %>

	<% else %>

		<div id='<%= question_count_tag %>' class='so-counter'> ...

 <%= tag_type %> <%= to_daily(q_count) %>

		<img src='<%= graph_url %>' title="'<%= so_tag%>' questions per day" />

	<% end %>

data updated from stackoverflow.com every 15 minutes

Nathan Reed (c) 2010 | popacular.com

source code is on github.com

<% if $IS_PROD %>

<% end %>


opera & safari fix'age

opera & safari fix'age

git-svn-id: d1603dcb7491ee151ff70de202d9b83ccaad14cb@38 e33b1f69-7d32-0410-b14e-e151786d21f0

<% ['/wymeditor/jquery/jquery', '/wymeditor/wymeditor/lang/en.js',
	'/wymeditor/wymeditor/jquery.wymeditor.js',
	'/wymeditor/wymeditor/jquery.wymeditor.explorer.js',
	'/wymeditor/wymeditor/jquery.wymeditor.mozilla.js',
	'/wymeditor/wymeditor/jquery.wymeditor.opera.js',
	'/wymeditor/wymeditor/jquery.wymeditor.safari.js',
	'/wymeditor/wymeditor/plugins/hovertools/jquery.wymeditor.hovertools.js',
	'/wymeditor/wymeditor/plugins/tidy/jquery.wymeditor.tidy.js',
	'/wymeditor/wymeditor/xhtml_parser.js', '/javascripts/radiant.wymeditor.js'].each {|script| @javascripts << script} %>
<% @stylesheets << '/wymeditor/wymeditor/skins/default/screen.css' %>

<% ['/wymeditor/jquery/jquery', '/wymeditor/wymeditor/lang/en.js',
	'/wymeditor/wymeditor/jquery.wymeditor.js',
	'/wymeditor/wymeditor/jquery.wymeditor.explorer.js',
	'/wymeditor/wymeditor/jquery.wymeditor.mozilla.js',
	'/wymeditor/wymeditor/jquery.opera.js',
	'/wymeditor/wymeditor/jquery.safari.js',
	'/wymeditor/wymeditor/plugins/hovertools/jquery.wymeditor.hovertools.js',
	'/wymeditor/wymeditor/plugins/tidy/jquery.wymeditor.tidy.js',
	'/wymeditor/wymeditor/xhtml_parser.js', '/javascripts/radiant.wymeditor.js'].each {|script| @javascripts << script} %>
<% @stylesheets << '/wymeditor/wymeditor/skins/default/screen.css' %>


HTML fix

HTML fix

<% @title = "Make an " + h(@info_request.law_used_short) + " request to '" + h(@info_request.public_body.name) + "'" %>

<% if @existing_request %>

    <%= user_or_you_capital_link(@existing_request.user) %> already
    created the same request on <%=simple_date(@existing_request.created_at)%>.
    You can either view the <a href="<%=request_url(@existing_request)%>">existing request,
    or edit the details below to make a new but similar request.

<% end %>

<%= foi_error_messages_for :info_request, :outgoing_message %>

Read this before writing your <%=h(@info_request.law_used_full)%> request

        <% form_tag("http://www.google.co.uk/search", {:id => "search_body_website_form", :method => "get"} ) do %>

               First, search the authority's web site ...

                       <%= text_field_tag 'q', params[:q], { :size => 20 } %>
               <%= hidden_field_tag 'as_sitesearch', @info_request.public_body.calculated_home_page %>
               <%= submit_tag "Search" %>

               ... to check that the info isn't already published.

        <% end %>

Write your request in simple, precise language.
    <% if @info_request.public_body.info_requests.size > 0 %>

Browse <%= link_to "other requests", public_body_url(@info_request.public_body)  %>
        to '<%= h(@info_request.public_body.name) %>'
        for examples of how to word your request.

    <% else %>

Browse <%= link_to "other requests", request_list_url %> for examples of how to word your request.

    <% end %>

Keep it focussed, if you ask for everything it might cost too much
    and you might get nothing.

Ask for particular documents, rather than general questions.

This site is public, everything you type (except your email address) and any response will be published.

    <% if @info_request.public_body.notes != "" %>

Special note for this authority!

<%=MySociety::Format.make_clickable(@info_request.public_body.notes) %>

    <% end %>

    <% if @info_request.public_body.eir_only? %>

Please ask for environmental information only

The Freedom of Information Act does not apply to <%=h(@info_request.public_body.name)%>.
        However, you have the right to request environmental
        information under a different law (explanation).
        This covers a very wide spectrum of information about the state of
        the natural and built environment, such as:

Air, water, soil, land, flora and fauna (including how these effect
        human beings)

Information on emissions and discharges (e.g. noise, energy,
        radiation, waste materials)

Human health and safety

Cultural sites and built structures (as they may be affected by the
        environmental factors listed above)

Plans and administrative measures that affect these matters

Please only request information that comes under those categories, do not waste your
        time or the time of the public authority by requesting unrelated information.

    <% end %>

<% form_for(:info_request, @info_request, :html => { :id => 'write_form' }  ) do |f| %>

			To:
			<%=h(@info_request.public_body.name)%>

			Summary:
			<%= f.text_field :title, :size => 50 %>

			(a one line summary of the information you are requesting,
			e.g.
            <% if @info_request.law_used == 'eir' %>
                'Pollution levels over time for the River Tyne'
            <% else %>
                'Crime statistics by ward level for Wales'
            <% end %>
            )

		<% fields_for :outgoing_message do |o| %>

			Your request:
			<%= o.text_area :body, :rows => 20, :cols => 60 %>

		<% end %>

			Privacy warning: All information that you enter, except
			for your email address, will be displayed publically on this website. Any
			response you get will also be published.

			Can I request information about myself?
			No! (Click here for details)

			<%= f.hidden_field(:public_body_id, { :value => @info_request.public_body_id } ) %>
			<%= hidden_field_tag(:submitted_new_request, 1 ) %>
			<%= hidden_field_tag(:preview, 1 ) %>
			<%= submit_tag "Preview your public request" %>

<% end %>


Show differences in titles

Show differences in titles

This article is from '<%= @article.source %>', was first published or seen
on <%= @article.created_at.utc.to_s(:long) %> (UTC) and has <%= @article.versions_count %> versions.</p

It has  <span id="reccounter<%=@va.id %>"><%= @va.votes %> recommendations -
  <span id="recommend-<%=@va.id %>">
    <%= link_to_remote 'Recommend this revision', { :url => { :controller => 'news_articles', :action => 'vote', :id => @va.id } },
    :title => "Vote for this revision"  %>.

<%= link_to '« Previous version', :action => 'diff',
  :version_a => @vb.version,
  :version_b => @prev.version if @prev %>

<%= link_to 'Next version »', :action => 'diff',
  :version_a => @next.version,
  :version_b => @va.version if @next %>

Version <%= @vb.version %>
Version <%= @va.version %>

<% if @va.title == @vb.title %>

<%= h @vb.title %>
<%= @vb.created_at %>

<%= h @va.title %>
<%= @va.created_at %>
<% else %>

<%= h @vb.title %>
<%= @vb.created_at %>

<%= h @va.title %>
<%= @va.created_at %>
<% end %>

<%= @diff %>

This article is from '<%= @article.source %>', was first published or seen
on <%= @article.created_at %> and has <%= @article.versions_count %> versions.</p

It has  <span id="reccounter<%=@va.id %>"><%= @va.votes %> recommendations -
  <span id="recommend-<%=@va.id %>">
    <%= link_to_remote 'Recommend this revision', { :url => { :controller => 'news_articles', :action => 'vote', :id => @va.id } },
    :title => "Vote for this revision"  %>.

<%= link_to '« Previous version', :action => 'diff',
  :version_a => @vb.version,
  :version_b => @prev.version if @prev %>

<%= link_to 'Next version »', :action => 'diff',
  :version_a => @next.version,
  :version_b => @va.version if @next %>

Version <%= @vb.version %>
Version <%= @va.version %>

<%= h @vb.title %>
<%= @vb.created_at %>

<%= h @va.title %>
<%= @va.created_at %>

<%= @diff %>


Clean up table structure, removing uneeded table in layout. Also fix indenting to make it easier to try and debug excessive tag soup.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

	<%= javascript_include_merged :base %>
	<%= yield :tinymce %>
	<%= javascript_include_merged :tt %>

	<%= javascript_include_tag "beast" if ['forums', 'posts', 'topics'].include? controller.controller_name %>
	<%= javascript_include_tag "swfobject" %>

	<%= stylesheet_link_merged :tt %>
	<%= stylesheet_link_tag "beast" if ['forums', 'posts', 'topics'].include? controller.controller_name %>
	<%= javascript_include_tag "builder" if ['activities'].include? controller.controller_name %>
	<% if ['activities'].include? controller.controller_name %>
	  <%= javascript_include_tag "portal" %>

	  <%= javascript_include_tag "flotr" %>
	<% end %>
	<%= yield :tinymce_init %>

	<%= stylesheet_link_tag "print", { :media => "print" } %>
	<%= auto_discovery_link_tag(:rss, {:controller => 'feeds', :action => 'rss', :id => current_user.uuid }) %>

	<title><%= controller.controller_name + " / " + controller.action_name %></title>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<% @internal = Customer.find(:first, :conditions => ["company_id = ? AND (name = 'Internal' or name = ?)", current_user.company_id, current_user.company.name ]) %>

<%= image_tag('spinner.gif', :border => 0) %>

<%= render(:partial => "layouts/menu") %>

<%= render :partial => "layouts/tabmenu" %>

			<% news = NewsItem.find(:first, :order => "id desc", :conditions => ["id > ?", current_user.seen_news_id ])
			unless news.nil? %>

[<%= tz.utc_to_local(news.created_at).strftime("#{current_user.time_format} #{current_user.date_format}") %>]	<%= news.body %>
				<%= link_to_remote "[#{_('Hide')}]", :url => { :controller => 'users', :action => 'update_seen_news', :id => news.id },
				:success => visual_effect(:fade, "news", :duration => 0.5) %>

			<% end %>

			<div id="flash" <%="style=\"display:none\"" unless flash['notice']%>>

<%= flash['notice'] %>
	[<%=_ 'Hide'%>]

						<%= @content_for_layout %>

						<td align="right" valign="top" style="width:15%;<%= "display:none;" if session[:collapse_menu].to_i > 0 %>" id="left_menu">

<td align="left" class="page_header tooltip" width="100%" title="<%= _'Custom saved filters showing a subset of your tasks'%>">
<%=_ 'Views' %>

<%= link_to _('New'),	 :controller => 'views', :action => 'new' %>

<%= link_to "#{_('Open Tasks')}", :controller => 'views', :action => 'all_tasks'%>

<%= link_to _('My Open Tasks'), :controller => 'views', :action => 'my_tasks'%>

<%= link_to _('My In Progress Tasks'), :controller => 'views', :action => 'my_in_progress_tasks'%>

<%= link_to _('Unassigned Tasks'), :controller => 'views', :action => 'unassigned_tasks'%>

			<% project_ids = current_project_ids
			client_ids = current_projects.collect(&:customer_id).uniq.join(',')
			client_ids = "0" if client_ids.nil? || client_ids.empty?

			views = View.find(:all, :conditions => ["company_id = ? AND (user_id = ? or shared = 1) AND (filter_customer_id = 0 OR filter_customer_id IS NULL OR filter_customer_id IN (#{client_ids})) AND (filter_project_id = 0 OR filter_project_id IS NULL OR filter_project_id IN (#{project_ids}))", current_user.company_id, current_user.id], :order => "shared, name")
			for view in views %>

<%= link_to view.name, :controller => 'views', :action => 'select', :id => view %>	<%= link_to _('Edit'), :controller => 'views', :action => 'edit', :id => view if(view.user_id == current_user.id || current_user.admin?)%><%= "[#{_('Shared')}]" if(view.user_id != current_user.id && !current_user.admin?)%>

			<% end %>

									<div <%= "style=\"display:none;\"" if @current_sheet.nil? || controller.action_name == "stop_work" %> id="work-log">

<div class="tooltip" title="<%= _'Text entered will be saved automatically to your current work notes.'%>"><%= _'Work Log' %>

												<form method="post" onsubmit="return false;" id="worklog_form"><textarea name="worklog[body]" id="worklog_body" style="padding:0;margin-top:0.5em;margin-bottom:0.3em;width:100%;" rows="4"><%= @current_sheet.body if @current_sheet%></textarea></form>

<td align=left class="page_header tooltip" width="100%" title="<%= _'Easy access to commonly needed information.'%>">
<%=_ 'Notes'%>

<%= link_to _('New'), :controller => 'pages', :action => 'new' %>

			<% for page in current_pages %>

<%= link_to "#{page.name} / #{page.project.name}", { :controller => 'pages', :action => 'show', :id => page} %> (<%=_('%s ago', time_ago_in_words( page.updated_at, false ) )%>)

			<% end %>

	<% if current_user.company.show_messaging %>

					<% current_user.chats.each do |@chat|
						@user = @chat.target %>
						<%= render :partial => 'shout/chat_user' if @chat.active >= 0%>
						<% if @chat.active == 1 %>

						<% end %>
					<% end %>

<%= _'Loading'%>...

<%= _('Online')%> (<%= online_users %>)

Clocking IT<% if current_user.locale != 'en_US' %> - <%= _'Help Translate'%><% end %>
<%=_ 'Feedback? Suggestions? Ideas? Bugs?'%><%= link_to "[Admin]", :controller => "admin", :action => "index" if current_user.admin == 10 %>

	<% else %>

Clocking IT<% if current_user.locale != 'en_US' %> - <%= _'Help Translate'%><% end %>
<%=_ 'Feedback? Suggestions? Ideas? Bugs?'%><%= link_to "[Admin]", :controller => "admin", :action => "index" if current_user.admin == 10 %>

	<% end %>

<%= periodically_call_remote(:url => { :controller => 'tasks', :action => 'update_sheet_info' }, :frequency => 90 ) -%>

<%= flash_plugin(session[:channels]) %>

<%#= query_review_output %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <%= javascript_include_merged :base %>
    <%= yield :tinymce %>
    <%= javascript_include_merged :tt %>

    <%= javascript_include_tag "beast" if ['forums', 'posts', 'topics'].include? controller.controller_name %>
    <%= javascript_include_tag "swfobject" %>

    <%= stylesheet_link_merged :tt %>
    <%= stylesheet_link_tag "beast" if ['forums', 'posts', 'topics'].include? controller.controller_name %>
    <%= javascript_include_tag "builder" if ['activities'].include? controller.controller_name %>
    <% if ['activities'].include? controller.controller_name %>
      <%= javascript_include_tag "portal" %>

      <%= javascript_include_tag "flotr" %>
    <% end %>
    <%= yield :tinymce_init %>

    <%= stylesheet_link_tag "print", { :media => "print" } %>
    <%= auto_discovery_link_tag(:rss, {:controller => 'feeds', :action => 'rss', :id => current_user.uuid }) %>

    <title><%= controller.controller_name + " / " + controller.action_name %></title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<% @internal = Customer.find(:first, :conditions => ["company_id = ? AND (name = 'Internal' or name = ?)", current_user.company_id, current_user.company.name ]) %>

<%= image_tag('spinner.gif', :border => 0) %>

              <%= render(:partial => "layouts/menu") %>

                  <%= render :partial => "layouts/tabmenu" %>

          <% news = NewsItem.find(:first, :order => "id desc", :conditions => ["id > ?", current_user.seen_news_id ]) %>
          <% unless news.nil? %>

[<%= tz.utc_to_local(news.created_at).strftime("#{current_user.time_format} #{current_user.date_format}") %>]	<%= news.body %>
                <%= link_to_remote "[#{_('Hide')}]", :url => { :controller => 'users', :action => 'update_seen_news', :id => news.id },
                :success => visual_effect(:fade, "news", :duration => 0.5) %>

          <% end %>

          <div id="flash" <%="style=\"display:none\"" unless flash['notice']%>>

<%= flash['notice'] %>
	[<%=_ 'Hide'%>]

<%= @content_for_layout %>

			<td align="right" valign="top" style="width:15%;<%= "display:none;" if session[:collapse_menu].to_i > 0 %>" id="left_menu">

                <td align="left" class="page_header tooltip" width="100%" title="<%= _'Custom saved filters showing a subset of your tasks'%>">
<%=_ 'Views' %>

<%= link_to _('New'),  :controller => 'views', :action => 'new' %>

<%= link_to "#{_('Open Tasks')}", :controller => 'views', :action => 'all_tasks'%>

<%= link_to _('My Open Tasks'), :controller => 'views', :action => 'my_tasks'%>

<%= link_to _('My In Progress Tasks'), :controller => 'views', :action => 'my_in_progress_tasks'%>

<%= link_to _('Unassigned Tasks'), :controller => 'views', :action => 'unassigned_tasks'%>

                <% project_ids = current_project_ids %>
                <% client_ids = current_projects.collect(&:customer_id).uniq.join(',')
                   client_ids = "0" if client_ids.nil? || client_ids.empty?

                   views = View.find(:all, :conditions => ["company_id = ? AND (user_id = ? or shared = 1) AND (filter_customer_id = 0 OR filter_customer_id IS NULL OR filter_customer_id IN (#{client_ids})) AND (filter_project_id = 0 OR filter_project_id IS NULL OR filter_project_id IN (#{project_ids}))", current_user.company_id, current_user.id], :order => "shared, name")
                   for view in views %>

<%= link_to view.name, :controller => 'views', :action => 'select', :id => view %>	<%= link_to _('Edit'), :controller => 'views', :action => 'edit', :id => view if(view.user_id == current_user.id || current_user.admin?)%><%= "[#{_('Shared')}]" if(view.user_id != current_user.id && !current_user.admin?)%>

                   <% end %>

								   <div <%= "style=\"display:none;\"" if @current_sheet.nil? || controller.action_name == "stop_work" %> id="work-log">

								           <div class="tooltip" title="<%= _'Text entered will be saved automatically to your current work notes.'%>"><%= _'Work Log' %>

										  <form method="post" onsubmit="return false;" id="worklog_form">
								           <textarea name="worklog[body]" id="worklog_body" style="padding:0;margin-top:0.5em;margin-bottom:0.3em;width:100%;" rows="4"><%= @current_sheet.body if @current_sheet%></textarea>
										  </form>

                  <td align=left class="page_header tooltip" width="100%" title="<%= _'Easy access to commonly needed information.'%>">

<%=_ 'Notes'%>

<%= link_to _('New'), :controller => 'pages', :action => 'new' %>

          <% for page in current_pages %>

                  <%= link_to "#{page.name} / #{page.project.name}", { :controller => 'pages', :action => 'show', :id => page} %> (<%=_('%s ago', time_ago_in_words( page.updated_at, false ) )%>)

          <% end %>

  <% if current_user.company.show_messaging %>

	    <% current_user.chats.each do |@chat|
	      @user = @chat.target
            %>
	      <%= render :partial => 'shout/chat_user' if @chat.active >= 0%>
	      <% if @chat.active == 1 %>

	      <% end %>
	    <% end %>

<%= _'Loading'%>...

<%= _('Online')%> (<%= online_users %>)

Clocking IT<% if current_user.locale != 'en_US' %> - <%= _'Help Translate'%><% end %>
<%=_ 'Feedback? Suggestions? Ideas? Bugs?'%><%= link_to "[Admin]", :controller => "admin", :action => "index" if current_user.admin == 10 %>

  <% else %>

Clocking IT<% if current_user.locale != 'en_US' %> - <%= _'Help Translate'%><% end %>
<%=_ 'Feedback? Suggestions? Ideas? Bugs?'%><%= link_to "[Admin]", :controller => "admin", :action => "index" if current_user.admin == 10 %>

  <% end %>

<%= periodically_call_remote(:url => { :controller => 'tasks', :action => 'update_sheet_info' }, :frequency => 90 ) -%>

<%= flash_plugin(session[:channels]) %>

<%#= query_review_output %>


ActionItem265: for now, finishing with the map

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

<%= content_tag('script', '', :src => GoogleMaps.api_url, :type => 'text/javascript') %>


Update requesting.rhtml

Update requesting.rhtml

The Scottish Information Commissioner has released some really good guidance.

<% @title = "Making requests" %>

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

<%= @title %> #

I’m not sure which authority to make my request to, how can I find out? #

It can be hard to untangle the complicated structure of government, and work out
who has the information you want. Here are a few tips:

Browse or <a href="<%= search_redirect_path %>">search WhatDoTheyKnow
looking for similar requests to yours.

When you’ve found an authority you think might have the information, use
the “home page” link on the right hand side of their page to check what they do
on their website.

Contact the authority by phone or email to ask if they hold the kind of
information you’re after.

Don’t worry too much about getting the right authority. If you get it
wrong, they ought to advise you who to make the request to instead.

If you’ve got a tricky case, please <a href="<%= help_contact_path %>">contact us for help.

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

Please <a href="<%= help_contact_path %>">contact us with the name of the public authority and,
if you can find it, their contact email address for Freedom of Information requests.

If you’d like to help add a whole category of public authority to the site, we’d love
to hear from you too.

Why do you include some authorities that aren’t formally subject to FOI?#

WhatDoTheyKnow lets you make requests for information to a range of
organisations:

 Those formally subject to the FOI Act

 Those formally subject to the Environmental Regulations (a less well
  defined group)

 Those which voluntarily comply with the FOI Act

 Those which aren’t subject to the Act
  but we think should be,
  on grounds
  such as them having significant public responsibilities.

In the last case, we’re using the site to lobby for expansion of the
scope of the FOI Act. Even if an organisation is not legally obliged to respond
to an FOI request, they can still do so voluntarily.

Why must I keep my request focused?#

Please put in your request only what is needed so that someone can
easily identify what information you are asking for. Please do
not include any of the following:

arguments about your cause

statements that could defame or insult others

questions or requests for comment rather than for specific information

If you include extraneous material,
we may have to remove your request to avoid problems with
libel law, which is a pain for both you and us.

The site is only for hosting FOI requests, not for general correspondence
with public authorities. Phrasing your request as a question or a request
for comment (e.g. “why are you doing X?” or “please
explain why you are doing X”) makes it more likely that your message
will not be seen as a valid FOI request, both by us and by the public
authority.  Asking for “copies of all policies and procedures
regarding X” would normally result in a valid FOI request.

Short, succinct messages
make it easier for authorities to be clear what information you are
requesting, which means you will get a reply more quickly.

How can I make responsible and effective FOI requests?#

We would encourage all our users to read
FOI Man’s Ten Top Tips
on making responsible and effective FOI requests and the
Scottish Information Commissioner's
Tips for requesting information.

Can I use your site for campaigning?#

If you want information to support an argument or campaign, Freedom of
Information is a powerful tool. Although you may not use this site to
run your campaign, we encourage you to use it to get the information you
need. We also encourage to run your campaign elsewhere – one effective
and very easy way is to <%= link_to 'start your own blog',
"http://wordpress.com/"%>. You are welcome to link to your campaign
from this site in an annotation to your request (you can make
annotations after submitting the request).

Does it cost me anything to make a request?#

Making an FOI request is nearly always free.

Authorities often include unnecessary, scary, boilerplate in
acknowledgement messages saying they “may” charge a fee. Ignore such notices.
They hardly ever will actually charge a fee. If they do, they can only charge you if
you have specifically agreed in advance to pay. More
    details from the Information Commissioner.

Sometimes an authority will refuse your request, saying that the cost
of handling it exceeds £600 (for central government) or £450 (for all other
public authorities). At this point you can refine your
request, e.g. it would be much cheaper for an authority to tell you the amount
spent on marshmallows in the past year than in the past ten years.

Will I get the information in the format I want? #

The law requires that if you ask for the information to be provided in a
particular format the public authority is required to provide any
information released in the requested format so long as it is as reasonably
practicable to do so. Unfortunately, the Information Commissioner and Tribunal
are currently interpreting this requirement to refer only to the choice between
receiving documents in paper format or receiving them electronically and not to
a choice of electronic file format.

We think the person making the request should be able to specify an electronic
format and we note that the Freedom of Information Act 2000 uses the words
‘...
or in another form acceptable to the applicant’.

How quickly will I get a response? #

By law, public authorities must respond promptly to
requests.

Even if they are not prompt, in nearly all cases they must respond within
20 working days. If you had to clarify your request, or they are a school,
or one or two other cases, then they may have more time
(<a href="<%= help_officers_path(:anchor => 'days') %>">full details).

WhatDoTheyKnow will email you if you don’t get a timely response.  You can
then send the public authority a message to remind them, and tell them if they
are breaking the law.

What if I never get a response?#

There are several things you can do if you never get a response.

Sometimes there has been a genuine problem and the authority never
    received the request. It is worth telephoning the authority and politely
    checking that they received the request. It was sent to them by email.

If they have not received it, the problem is most likely due to
    "spam filters". Refer the authority to the measures in the answer
    ‘<a href="<%= help_officers_path(:anchor => 'spam_problems') %>">I can see a request on WhatDoTheyKnow, but we never got it by email!’
    in the FOI officers section of this help.

If you’re still having no luck, then you can ask for an internal review,
    and then complain to the Information Commissioner about the authority.
    Read our page ‘<a href="<%= help_general_path(:action => 'unhappy') %>">Unhappy about the response you got?’.

What if I’m not satisfied with the response? #

If you didn’t get the information you asked for, or you didn’t get it in time,
then read our page ‘<a href="<%= help_general_path(:action => 'unhappy') %>">Unhappy about the response you got?’.

It says I can’t re-use the information I got!#

Authorities often add legal boilerplate about the
"Re-Use of Public Sector
Information Regulations 2005", which at first glance implies you may not
be able do anything with the information.

You can, of course, write articles about the information or summarise it, or
quote parts of it. We also think you should feel free to republish the
information in full, just as we do, even though in theory you might not be
allowed to do so.  See <a href="<%= help_officers_path(:anchor => 'copyright') %>">our policy on copyright.

If the information you have received is Crown Copyright then you are able to
reproduce it under the
Open
Government Licence but there are some conditions.

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

Have a look at the
access to official information
pages on the Information Commissioner’s website.

If you’re requesting information from a Scottish public authority,
the process is very similar. There are differences around time
limits for compliance.
See the Scottish
Information Commissioner’s guidance for details.

Can I request information about myself? #

No. Requests made using WhatDoTheyKnow are public, made under the Freedom of
Information Act, and cannot help you find information about a private
individual.

If you would like to know what information a public
authority holds about yourself, you should make a “Subject Access Request” in private using Data Protection law.
 The
Information Commissioner’s website provides advice on accessing your
own personal information

If you see that somebody has included personal information, perhaps
unwittingly, in a request, please <a href="<%= help_contact_path %>">contact us
immediately so we can remove it.

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

WhatDoTheyKnow is currently only designed for public requests. All
responses that we receive are automatically published on the website for anyone
to read.

You should contact the public authority directly if you would like to
make a request in private.  If you’re interested in buying a system which helps
you manage FOI requests in secret, then <a href="<%= help_contact_path %>">contact us.

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

Some public authorities, such as Milford Haven Port Authority,
don’t come under the Freedom of Information Act, but do come under another law called
the Environmental Information Regulations (EIR).

It’s a very similar law, so you make a request
to them using WhatDoTheyKnow in just the same way as an FOI request. The only
difference is that on the page where your write you request, it reminds you
that you can only request “environmental information” and tells you what that
means. It is quite broad.

You can, of course, request environmental information from other
authorities. Just make a Freedom of Information (FOI) request as normal. The
authority has a duty to work out if the Environmental Information Regulations
(EIR) is the more appropriate legislation to reply under.

Can I make the same to request to lots of authorities, e.g. all councils? #

We ask you to first send a test version of your request to a few
authorities. Their responses will help you improve the wording of your request,
so that you get the best information when you send the request to all of
the authorities. There is currently no automated system for sending the request
to the other authorities, you must copy and paste it by hand.

I made a request off the site, how do I upload it to the archive?#

WhatDoTheyKnow is an archive of requests made through the site,
and does not try to be an archive of all FOI requests. We’ll never support uploading
other requests. For one thing, we wouldn’t be able to verify that other
responses actually came from the authority. If this really matters to you,
you can always make the same request again via WhatDoTheyKnow.

How do you moderate request annotations? #

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

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

Next, read about <a href="<%= help_privacy_path %>">your privacy -->

<% @title = "Making requests" %>

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

<%= @title %> #

I’m not sure which authority to make my request to, how can I find out? #

It can be hard to untangle the complicated structure of government, and work out
who has the information you want. Here are a few tips:

Browse or <a href="<%= search_redirect_path %>">search WhatDoTheyKnow
looking for similar requests to yours.

When you’ve found an authority you think might have the information, use
the “home page” link on the right hand side of their page to check what they do
on their website.

Contact the authority by phone or email to ask if they hold the kind of
information you’re after.

Don’t worry too much about getting the right authority. If you get it
wrong, they ought to advise you who to make the request to instead.

If you’ve got a tricky case, please <a href="<%= help_contact_path %>">contact us for help.

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

Please <a href="<%= help_contact_path %>">contact us with the name of the public authority and,
if you can find it, their contact email address for Freedom of Information requests.

If you’d like to help add a whole category of public authority to the site, we’d love
to hear from you too.

Why do you include some authorities that aren’t formally subject to FOI?#

WhatDoTheyKnow lets you make requests for information to a range of
organisations:

 Those formally subject to the FOI Act

 Those formally subject to the Environmental Regulations (a less well
  defined group)

 Those which voluntarily comply with the FOI Act

 Those which aren’t subject to the Act
  but we think should be,
  on grounds
  such as them having significant public responsibilities.

In the last case, we’re using the site to lobby for expansion of the
scope of the FOI Act. Even if an organisation is not legally obliged to respond
to an FOI request, they can still do so voluntarily.

Why must I keep my request focused?#

Please put in your request only what is needed so that someone can
easily identify what information you are asking for. Please do
not include any of the following:

arguments about your cause

statements that could defame or insult others

questions or requests for comment rather than for specific information

If you include extraneous material,
we may have to remove your request to avoid problems with
libel law, which is a pain for both you and us.

The site is only for hosting FOI requests, not for general correspondence
with public authorities. Phrasing your request as a question or a request
for comment (e.g. “why are you doing X?” or “please
explain why you are doing X”) makes it more likely that your message
will not be seen as a valid FOI request, both by us and by the public
authority.  Asking for “copies of all policies and procedures
regarding X” would normally result in a valid FOI request.

Short, succinct messages
make it easier for authorities to be clear what information you are
requesting, which means you will get a reply more quickly.

How can I make responsible and effective FOI requests?#

We would encourage all our users to read
FOI Man’s Ten Top Tips
on making responsible and effective FOI requests.

Can I use your site for campaigning?#

If you want information to support an argument or campaign, Freedom of
Information is a powerful tool. Although you may not use this site to
run your campaign, we encourage you to use it to get the information you
need. We also encourage to run your campaign elsewhere – one effective
and very easy way is to <%= link_to 'start your own blog',
"http://wordpress.com/"%>. You are welcome to link to your campaign
from this site in an annotation to your request (you can make
annotations after submitting the request).

Does it cost me anything to make a request?#

Making an FOI request is nearly always free.

Authorities often include unnecessary, scary, boilerplate in
acknowledgement messages saying they “may” charge a fee. Ignore such notices.
They hardly ever will actually charge a fee. If they do, they can only charge you if
you have specifically agreed in advance to pay. More
    details from the Information Commissioner.

Sometimes an authority will refuse your request, saying that the cost
of handling it exceeds £600 (for central government) or £450 (for all other
public authorities). At this point you can refine your
request, e.g. it would be much cheaper for an authority to tell you the amount
spent on marshmallows in the past year than in the past ten years.

Will I get the information in the format I want? #

The law requires that if you ask for the information to be provided in a
particular format the public authority is required to provide any
information released in the requested format so long as it is as reasonably
practicable to do so. Unfortunately, the Information Commissioner and Tribunal
are currently interpreting this requirement to refer only to the choice between
receiving documents in paper format or receiving them electronically and not to
a choice of electronic file format.

We think the person making the request should be able to specify an electronic
format and we note that the Freedom of Information Act 2000 uses the words
‘...
or in another form acceptable to the applicant’.

How quickly will I get a response? #

By law, public authorities must respond promptly to
requests.

Even if they are not prompt, in nearly all cases they must respond within
20 working days. If you had to clarify your request, or they are a school,
or one or two other cases, then they may have more time
(<a href="<%= help_officers_path(:anchor => 'days') %>">full details).

WhatDoTheyKnow will email you if you don’t get a timely response.  You can
then send the public authority a message to remind them, and tell them if they
are breaking the law.

What if I never get a response?#

There are several things you can do if you never get a response.

Sometimes there has been a genuine problem and the authority never
    received the request. It is worth telephoning the authority and politely
    checking that they received the request. It was sent to them by email.

If they have not received it, the problem is most likely due to
    "spam filters". Refer the authority to the measures in the answer
    ‘<a href="<%= help_officers_path(:anchor => 'spam_problems') %>">I can see a request on WhatDoTheyKnow, but we never got it by email!’
    in the FOI officers section of this help.

If you’re still having no luck, then you can ask for an internal review,
    and then complain to the Information Commissioner about the authority.
    Read our page ‘<a href="<%= help_general_path(:action => 'unhappy') %>">Unhappy about the response you got?’.

What if I’m not satisfied with the response? #

If you didn’t get the information you asked for, or you didn’t get it in time,
then read our page ‘<a href="<%= help_general_path(:action => 'unhappy') %>">Unhappy about the response you got?’.

It says I can’t re-use the information I got!#

Authorities often add legal boilerplate about the
"Re-Use of Public Sector
Information Regulations 2005", which at first glance implies you may not
be able do anything with the information.

You can, of course, write articles about the information or summarise it, or
quote parts of it. We also think you should feel free to republish the
information in full, just as we do, even though in theory you might not be
allowed to do so.  See <a href="<%= help_officers_path(:anchor => 'copyright') %>">our policy on copyright.

If the information you have received is Crown Copyright then you are able to
reproduce it under the
Open
Government Licence but there are some conditions.

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

Have a look at the
access to official information
pages on the Information Commissioner’s website.

If you’re requesting information from a Scottish public authority,
the process is very similar. There are differences around time
limits for compliance.
See the Scottish
Information Commissioner’s guidance for details.

Can I request information about myself? #

No. Requests made using WhatDoTheyKnow are public, made under the Freedom of
Information Act, and cannot help you find information about a private
individual.

If you would like to know what information a public
authority holds about yourself, you should make a “Subject Access Request” in private using Data Protection law.
 The
Information Commissioner’s website provides advice on accessing your
own personal information

If you see that somebody has included personal information, perhaps
unwittingly, in a request, please <a href="<%= help_contact_path %>">contact us
immediately so we can remove it.

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

WhatDoTheyKnow is currently only designed for public requests. All
responses that we receive are automatically published on the website for anyone
to read.

You should contact the public authority directly if you would like to
make a request in private.  If you’re interested in buying a system which helps
you manage FOI requests in secret, then <a href="<%= help_contact_path %>">contact us.

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

Some public authorities, such as Milford Haven Port Authority,
don’t come under the Freedom of Information Act, but do come under another law called
the Environmental Information Regulations (EIR).

It’s a very similar law, so you make a request
to them using WhatDoTheyKnow in just the same way as an FOI request. The only
difference is that on the page where your write you request, it reminds you
that you can only request “environmental information” and tells you what that
means. It is quite broad.

You can, of course, request environmental information from other
authorities. Just make a Freedom of Information (FOI) request as normal. The
authority has a duty to work out if the Environmental Information Regulations
(EIR) is the more appropriate legislation to reply under.

Can I make the same to request to lots of authorities, e.g. all councils? #

We ask you to first send a test version of your request to a few
authorities. Their responses will help you improve the wording of your request,
so that you get the best information when you send the request to all of
the authorities. There is currently no automated system for sending the request
to the other authorities, you must copy and paste it by hand.

I made a request off the site, how do I upload it to the archive?#

WhatDoTheyKnow is an archive of requests made through the site,
and does not try to be an archive of all FOI requests. We’ll never support uploading
other requests. For one thing, we wouldn’t be able to verify that other
responses actually came from the authority. If this really matters to you,
you can always make the same request again via WhatDoTheyKnow.

How do you moderate request annotations? #

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

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

Next, read about <a href="<%= help_privacy_path %>">your privacy -->


indentation

indentation

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

        <%= _("Make a new

        Freedom of

        Information

        request") %>

      <%= _("Start now »") %>

          <%= _("Search over

          {{number_of_requests}} requests and

          {{number_of_authorities}} authorities",
          :number_of_requests => InfoRequest.count, :number_of_authorities => PublicBody.count) %>

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

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

        <% end %>

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

    <% if @popular_bodies.size > 0 %>

<%= _("Who can I request information from?") %>

        <%= _("{{site_name}} covers requests to {{number_of_authorities}} authorities, including:",
            :site_name => site_name, :number_of_authorities => PublicBody.count) %>

            <% for popular_body in @popular_bodies %>

<%=public_body_link(popular_body)%>
                 <%= n_('%d request', '%d requests', popular_body.info_requests.count) % popular_body.info_requests.count %>

            <% end%>

            <%= link_to _('Browse all authorities...'), list_public_bodies_default %>

    <% end %>

<%= _("What information has been released?") %>

       <%= _("{{site_name}} users have made {{number_of_requests}} requests, including:",
        :site_name => site_name, :number_of_requests => InfoRequest.count) %>

          <% for event in @request_events %>

               <%= public_body_link(event.info_request.public_body) %> <%= _('answered a request about') %>
               <%=link_to h(event.info_request.title), request_url(event.info_request)%>
               <%= _('{{length_of_time}} ago', :length_of_time => time_ago_in_words(event.described_at)) %>
               <p class="excerpt" onclick="document.location.href='<%=request_url(event.info_request)%>'"><%= excerpt(event.search_text_main(true), "", 200) %>

          <% end %>

<%=link_to _('More successful requests...'), request_list_successful_url %>

<% end %>


ActionItem929: translate the labels for pikachoose

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
  <head>
    <link rel="shortcut icon" href="<%= '/designs/themes/' + current_theme + '/images/favicon.ico' %>" type="image/x-icon" />
    <title><%=
       (@page ? @page.name + ' - ' : '') +
       (@profile ? @profile.name + ' - ' : '') +
       @environment.name +
       (@category ? "→ #{@category.full_name}" : '')
    %></title>

    <%= stylesheet_import "slideshow" %>
    <%= javascript_include_tag 'jquery-latest', 'sliderjs', 'pikachoose' %>
    <script language="javascript">
      <!--
      $(document).ready(function (){
        $("#slideshow").PikaChoose({
          buttons: { play: <%= _("Play").to_json %>, stop: <%= _("Stop").to_json %>, previous: <%= _("Previous").to_json %>, next: <%= _("Next").to_json %> }
        });
        $("#slideshow").SliderJS({
          window_width: 320,
          window_height: 55,
          list_width: 832,
          pikachoose: true,
          auto_play: false,
        });
      });
      -->
    </script>
  </head>
  <body>
    <%= yield %>
  </body>
</html>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
  <head>
    <title><%=
       (@page ? @page.name + ' - ' : '') +
       (@profile ? @profile.name + ' - ' : '') +
       @environment.name +
       (@category ? "→ #{@category.full_name}" : '')
    %></title>

    <%= stylesheet_import "slideshow" %>
    <%= javascript_include_tag 'jquery-latest', 'sliderjs', 'pikachoose' %>
    <script language="javascript">
      <!--
      $(document).ready(function (){
        $("#slideshow").PikaChoose();
        $("#slideshow").SliderJS({
          window_width: 320,
          window_height: 55,
          list_width: 832,
          pikachoose: true,
          auto_play: false
        });
      });
      -->
    </script>
  </head>
  <body>
    <%= yield %>
  </body>
</html>


Ommit horizontal rules for empty bodies

Ommit horizontal rules for empty bodies

<% unless folder.body.blank? %>

    <%= folder.body %>

<% end %>

<% if folder.children.empty? %>
  <%= _('(empty folder)') %>
<% else %>
  <%= list_articles(available_articles(folder.children, user)) %>
<% end %>

  <%= folder.body %>

<% if folder.children.empty? %>
  <%= _('(empty folder)') %>
<% else %>
  <%= list_articles(available_articles(folder.children, user)) %>
<% end %>


add string *has published*

add string *has published*

  <%= link_to(profile_image(activity.user, :minor), activity.user.url) %>

<div class='profile-activity-description profile-activity-article-<%= activity.target.class.icon_name %>'>

    <%= link_to activity.user.short_name(20), activity.user.url %>
    <%= _("has published on community %s") % link_to(activity.target.profile.short_name(20), activity.target.profile.url) if activity.target.profile.is_a?(Community) %>

<%= link_to(activity.params['name'], activity.params['url']) %>

    <span title='<%= activity.target.class.short_description %>' class='profile-activity-icon icon-new icon-new<%= activity.target.class.icon_name %>'>
    <%= image_tag(activity.params['first_image']) unless activity.params['first_image'].blank? %><%= strip_tags(truncate(activity.params['lead'], :length => 1000, :ommision => '...')).gsub(/(\xC2\xA0|\s)+/, ' ').gsub(/^\s+/, '') %> <%= link_to(_('See more'), activity.params['url']) unless activity.get_lead.blank? %>

  <%= content_tag(:p, link_to(_('See complete forum'), activity.get_url), :class => 'see-forum') if activity.target.is_a?(Forum) %>

<%= time_ago_as_sentence(activity.created_at) %>

    <%= link_to s_('profile|Comment'), '#', { :class => 'focus-on-comment'} %>
    <%= link_to_function(_('Remove'), 'remove_item_wall(this, %s, %s, %s); return false ;' % ["'.profile-activity-item'", url_for(:profile => params[:profile], :action => :remove_activity, :activity_id => activity.id, :only_hide => true, :view => params[:view]).to_json, _('Are you sure you want to remove this activity and all its replies?').to_json]) if logged_in? && current_person == @profile %>

<%= render :partial => 'profile_comments', :locals => { :activity => activity, :tab_action => tab_action } %>

  <%= link_to(profile_image(activity.user, :minor), activity.user.url) %>

<div class='profile-activity-description profile-activity-article-<%= activity.target.class.icon_name %>'>

    <%= link_to activity.user.short_name(20), activity.user.url %>
    <%= _("on community %s") % link_to(activity.target.profile.short_name(20), activity.target.profile.url) if activity.target.profile.is_a?(Community) %>

<%= link_to(activity.params['name'], activity.params['url']) %>

    <span title='<%= activity.target.class.short_description %>' class='profile-activity-icon icon-new icon-new<%= activity.target.class.icon_name %>'>
    <%= image_tag(activity.params['first_image']) unless activity.params['first_image'].blank? %><%= strip_tags(truncate(activity.params['lead'], :length => 1000, :ommision => '...')).gsub(/(\xC2\xA0|\s)+/, ' ').gsub(/^\s+/, '') %> <%= link_to(_('See more'), activity.params['url']) unless activity.get_lead.blank? %>

  <%= content_tag(:p, link_to(_('See complete forum'), activity.get_url), :class => 'see-forum') if activity.target.is_a?(Forum) %>

<%= time_ago_as_sentence(activity.created_at) %>

    <%= link_to s_('profile|Comment'), '#', { :class => 'focus-on-comment'} %>
    <%= link_to_function(_('Remove'), 'remove_item_wall(this, %s, %s, %s); return false ;' % ["'.profile-activity-item'", url_for(:profile => params[:profile], :action => :remove_activity, :activity_id => activity.id, :only_hide => true, :view => params[:view]).to_json, _('Are you sure you want to remove this activity and all its replies?').to_json]) if logged_in? && current_person == @profile %>

<%= render :partial => 'profile_comments', :locals => { :activity => activity, :tab_action => tab_action } %>


Updated doc for Checkout Options / Receipt Templates

<% paragraph_options_form_for "Checkout Options",:checkout ,@options do |f| -%>

<% tabled_ajax_tabs ['Options','Actions'], 'Options' do |t| %>
  <% t.tabled_tab do -%>
      <%= f.page_selector :cart_page_id, :label => 'Edit Cart Page'.t %>
      <%= f.page_selector :success_page_id, :label => 'Success Page'.t %>
      <%= f.select :receipt_template_id, [["--Don't send a receipt--".t,nil]] +  MailTemplate.site_template_options,
                :description => "Available Variables: %%ORDER_ID%%, %%ORDER_HTML%%,\n %%ORDER_TEXT%%, %%ORDER_BILLING_COUNTRY%%, %%ORDER_BILLING_NAME%%,\n %%ORDER_BILLING_ZIP%%, %%ORDER_BILLING_ADDRESS%%, %%ORDER_BILLING_CITY%%,\n %%ORDER_BILLING_STATE%%, %%ORDER_BILLING_ADDRESS2%% (User Variables as well)" %>
      <%= f.radio_buttons :show_gift, [['Yes'.t,true],['No'.t,false]] %>
      <%= f.text_field :add_tags, :description => 'Tags to add after an order' %>
      <%= f.radio_buttons :address_type, [['American'.t,'american'],['European'.t,'european']] %>
      <%= f.radio_buttons :show_company, [['Yes'.t,true],['No'.t,false]] %>
      <%= f.radio_buttons :show_fax, [['Yes'.t,true],['No'.t,false]] %>
      <%= f.select :cart_site_feature_id, SiteFeature.options('shop_full_cart') %>
 <% end -%>
 <% t.tabled_tab do %>

      <%= render :partial => '/editor/includes/actions' %>

  <% end -%>

<% end -%>
<% end -%>

<% paragraph_options_form_for "Checkout Options",:checkout ,@options do |f| -%>

<% tabled_ajax_tabs ['Options','Actions'], 'Options' do |t| %>
  <% t.tabled_tab do -%>
      <%= f.page_selector :cart_page_id, :label => 'Edit Cart Page'.t %>
      <%= f.page_selector :success_page_id, :label => 'Success Page'.t %>
      <%= f.select :receipt_template_id, [["--Don't send a receipt--".t,nil]] +  MailTemplate.site_template_options,
                :description => "Available Variables: %%ORDER_ID%%, %%ORDER_HTML%%,\n %%ORDER_TEXT%% (User Variables as well)" %>
      <%= f.radio_buttons :show_gift, [['Yes'.t,true],['No'.t,false]] %>
      <%= f.text_field :add_tags, :description => 'Tags to add after an order' %>
      <%= f.radio_buttons :address_type, [['American'.t,'american'],['European'.t,'european']] %>
      <%= f.radio_buttons :show_company, [['Yes'.t,true],['No'.t,false]] %>
      <%= f.radio_buttons :show_fax, [['Yes'.t,true],['No'.t,false]] %>
      <%= f.select :cart_site_feature_id, SiteFeature.options('shop_full_cart') %>
 <% end -%>
 <% t.tabled_tab do %>

      <%= render :partial => '/editor/includes/actions' %>

  <% end -%>

<% end -%>
<% end -%>


Fix to remove variables named test

Fix to remove variables named test

<%
  if opt[0].to_sym == :test
    ''
  else
    case opt[2]
    when 'string': -%>
    <%= raise opt.inspect %>
    <%= f.text_field opt[0].to_sym, :label => opt[1], :description => opt[3] %>
    <% when "image": -%>
      <%= f.filemanager_image opt[0].to_sym, :label => opt[1], :description => opt[3] %>
    <% when "src": -%>
      <%= f.filemanager_file opt[0].to_sym, :label => opt[1], :description => opt[3] %>
    <% when "url": -%>
      <%= f.select opt[0].to_sym, [['--Select Page--'.t,'']] +  SiteNode.page_url_options, :label => opt[1], :description => opt[3] %>
    <% when "color": -%>
      <%= f.color_field opt[0].to_sym, :label => opt[1], :description => opt[3] %>
    <% else -%>
      <% f.custom_field opt[0], :description => opt[3] do -%>
        <%= opt[0] %> - <%= opt[2] %>
      <% end -%>
    <% end -%>
  <% end -%>

<% case opt[2]
    when 'string': -%>
    <%= f.text_field opt[0].to_sym, :label => opt[1], :description => opt[3] %>
    <% when "image": -%>
      <%= f.filemanager_image opt[0].to_sym, :label => opt[1], :description => opt[3] %>
    <% when "src": -%>
      <%= f.filemanager_file opt[0].to_sym, :label => opt[1], :description => opt[3] %>
    <% when "url": -%>
      <%= f.select opt[0].to_sym, [['--Select Page--'.t,'']] +  SiteNode.page_url_options, :label => opt[1], :description => opt[3] %>
    <% when "color": -%>
      <%= f.color_field opt[0].to_sym, :label => opt[1], :description => opt[3] %>
    <% else -%>
      <% f.custom_field opt[0], :description => opt[3] do -%>
        <%= opt[0] %> - <%= opt[2] %>
      <% end -%>
    <% end -%>


add theme edit link

add theme edit link

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

        <%= "* " if theme.current? %>
        <span title="stored in /<%= theme.current? ? 'current' : "other/#{theme.name}" %>"><%=h theme.title %>

          <% unless theme.version.blank? -%>v<%=h theme.version %> |<% end -%>
          by <%= theme.linked_author.blank? ? 'unknown' : theme.linked_author %>

      <img src="<%= url_for(:controller => '/admin/themes', :action => 'preview_for', :id => theme) %>" alt="Theme preview" title="<%=h theme.title %> (v<%=h theme.version %>)" />

        <% unless theme.current? -%>

<%= link_to 'Use this theme', :action => 'change_to', :id => theme %>

<%= link_to 'Edit', :controller => 'design', :action => 'index', :theme => theme %>

        <% end -%>

<%= link_to 'Export', :action => 'export', :id => theme %>

        <%= "* " if theme.current? %>
        <span title="stored in /<%= theme.current? ? 'current' : "other/#{theme.name}" %>"><%=h theme.title %>

          <% unless theme.version.blank? -%>v<%=h theme.version %> |<% end -%>
          by <%= theme.linked_author.blank? ? 'unknown' : theme.linked_author %>

      <img src="<%= url_for(:controller => '/admin/themes', :action => 'preview_for', :id => theme) %>" alt="Theme preview" title="<%=h theme.title %> (v<%=h theme.version %>)" />

        <% unless theme.current? -%>

<%= link_to 'Use this theme', :action => 'change_to', :id => theme %>

        <% end -%>

<%= link_to 'Export', :action => 'export', :id => theme %>


Capistrano doesn't use ActionView when parsing this so translations etc won't work.

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">

    <title>iNaturalist is Catching Some Zs</title>

        iNaturalist is Catching Some Zs

        We're currently down for <%= reason ? reason : "maintenance" %> as of
        <%= Time.now.strftime("%H:%M %Z") %>.

        iNat will be back on its feet/wings/fins/tentacles/pseudopodia
        <%= deadline ? "by #{deadline}" : "shortly" %>.

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">

    <title><%=t :inaturalist_is_catching_some_zs, :site_name => SITE_NAME %></title>

        <%=t :inaturalist_is_catching_some_zs, :site_name => SITE_NAME %>

       <%=t :were_currently_down_for %> <%= reason ? reason : "maintenance" %> as of
        <%=l Time.now %>.

        <%=t :inat_will_be_back_on, :site_name => SITE_NAME_SHORT %>
        <%= deadline ? "by #{deadline}" : "shortly" %>.