Show request metadata by default, and make the "edit" button more prominent

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

              <%= link_to("".html_safe, user_url(@info_request.user), :title => "view user's page on public website") %>
              <%= link_to(@info_request.user.name, user_admin_url(@info_request.user)) %>
              <%= link_to _("move..."), "#", :class => "btn btn-mini btn-warning toggle-hidden" %>

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

              Public authority:

              <%= link_to("".html_safe, 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 %>

      Hide the request and notify the user:

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

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

        <%= 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">Show metadata

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

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

                <%= name %>:

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

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

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

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

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

                <% end %>

          <% end %>

              Created by

              <%= link_to("".html_safe, user_url(@info_request.user), :title => "view user's page on public website") %>
              <%= link_to(@info_request.user.name, user_admin_url(@info_request.user)) %>
              <%= link_to _("move..."), "#", :class => "btn btn-mini btn-warning toggle-hidden" %>

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

              Public authority:

              <%= link_to("".html_safe, 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} %>

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

      Other views of this request

      <%= link_to 'Public page', main_url(request_url(@info_request)), :class => "btn" %>
      <%= link_to 'Edit page', '../edit/' + @info_request.id.to_s, :class => "btn" %>

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

      Hide the request and notify the user:

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

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

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


Following changes in main alaveteli for this same view

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

Mail server delivery logs

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

<% for mail_server_log_done_id, mail_server_logs in @info_request.mail_server_logs.group_by(&:mail_server_log_done_id) %>

<% for mail_server_log in mail_server_logs %><%=h mail_server_log.line%><% end %>

<% end %>
<% if @info_request.mail_server_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 || _('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 } %>


Fix one more linebreak.

Fix one more linebreak.

Žádost o zpřístupnění informace ve smyslu zákona č. 106/1999 Sb., o svobodném přístupu k
informacím.

Povinný subjekt:
<%= @outgoing_message.info_request.public_body.name %>

Žadatel:
<%-# !!!IF YOU CHANGE THE FORMAT OF THE BLOCK BELOW, ADD A NEW CENSOR RULE!!! -%>
===================================================================
# Jméno: <%= @outgoing_message.info_request.user.name %>
# Datum narození:  <%= @outgoing_message.info_request.user.dob %>
<%= @outgoing_message.info_request.user.address.gsub(/^/, "# Adresa: ") %>
===================================================================

Žádám o následující informaci:

<%= @outgoing_message.body.strip %>

Informaci poskytněte elektronicky na email: <%= @outgoing_message.info_request.incoming_email %>

Vámi poskytnutá informace bude zveřejněna na stránkách www.informaceprovsechny.cz. Účelem této služby je umožnit komukoliv svobodný přístup k informacím. DŮRAZNĚ VÁS ŽÁDÁME, ABYSTE VE SVÉ ODPOVĚDI ANI DO PŘÍLOH NEUVÁDĚLI ŽÁDNÉ OSOBNÍ ÚDAJE TAZATELE (ADRESU NEBO DATUM NAROZENÍ). Pokud osobní údaje do odpovědi zahrnete, porušíte Zákon 101/2000 Sb., o ochraně osobních údajů. Děkujeme.

Řádným a včasným zpřístupněním informace na základě této žádosti nebo jiným posouzením
žádosti podle zákona č. 106/1999 Sb., o svobodném přístupu k informacím, beru na vědomí,
že jste splnili svou povinnosti podle výše uvedeného zákona.
Datum podání:

<%= simple_date(Time.now) %>
-------------------------------------------------------------------

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

-------------------------------------------------------------------


formatting changes for release branch

formatting changes for release branch

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

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

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

<%= ASSOCIATION.short_name %>

      <%= render :partial => "category", :collection => @category.children.sort %>

Unknown

      <% for category in @unknowns %>
        <div class="category" id="category_<%= category.id %>"><%= category.name %>

        <%= draggable_element("category_#{category.id}", :revert => true, :ghosting => true) %>
      <% end %>

<%= drop_receiving_element("association_category", :url => {:action => 'add_child', :parent_id => @category.id}) %>
<%= drop_receiving_element("association_category_td", :url => {:action => 'add_child', :parent_id => @category.id}) %>
<%= drop_receiving_element("unknown_category", :url => {:action => 'add_child'}) %>
<%= drop_receiving_element("unknown_category_td", :url => {:action => 'add_child'}) %>


A couple more useful admin links.

A couple more useful admin links.

<% @title = "Public authority - " + h(@public_body.name) %>

<%=@title%>

<%
   columns = PublicBody.content_columns
   columns.delete_if {|c| ['last_edit_comment'].include?(c.name)}

   for column in columns %>
  <%= column.human_name %>:
  <% if column.name == 'home_page' and !column.name.empty? %>
    <%= link_to(h(@public_body.send(column.name)), @public_body.send(column.name))  %>
  <% elsif column.name == 'request_email' and !column.name.empty? %>
    <%= link_to(h(@public_body.send(column.name)), "mailto:" + @public_body.send(column.name))  %>
  <% else %>
      <%=h @public_body.send(column.name) %>
  <% end %>

<% end %>
Calculated home page:
<% if !@public_body.calculated_home_page.nil? %>
    <%= link_to(h(@public_body.calculated_home_page), @public_body.calculated_home_page) %>
<% else %>
    *unknown*
<% end %>

Tags: <%=h @public_body.tag_string %>

    <%= link_to 'Public page', main_url(public_body_url(@public_body)) %>
    | <%= link_to 'Edit', '../edit/' + @public_body.id.to_s %>

History

<%
    history_columns = PublicBody.content_columns
    history_columns.delete_if {|c| ['created_at', 'updated_at', 'first_letter'].include?(c.name)}
    for column in history_columns %>
  <%= column.human_name %>
<% end %>
Updated at

<% for historic_public_body in @public_body.versions.reverse %>
      <tr class="<%= cycle('odd', 'even') %>">
    <% for column in history_columns %>
      <%
        value = h(historic_public_body.send(column.name))
        if column.name == 'last_edit_comment'
            value = historic_public_body.last_edit_comment_for_html_display
        end
        # Highlight entries which have changed since previous version
        changed = (not ['version', 'last_edit_editor', 'last_edit_comment'].include?(column.name)) && ((historic_public_body.send(column.name) != @public_body.versions[historic_public_body.version - 2].send(column.name)) || (historic_public_body.version == 1)) %>
      <td <%= changed ? ' class="entry_changed" ': '' %> >
      <%=value%>

    <% end %>
      <%=h historic_public_body.updated_at %>

<% end %>

Requests

<%= render :partial => 'admin_request/some_requests', :locals => { :info_requests => @public_body.info_requests } %>

Track things

<%= render :partial => 'admin_track/some_tracks', :locals => { :track_things => @public_body.track_things } %>

<% @title = "Public authority - " + h(@public_body.name) %>

<%=@title%>

<%
   columns = PublicBody.content_columns
   columns.delete_if {|c| ['last_edit_comment'].include?(c.name)}

   for column in columns %>
  <%= column.human_name %>:
  <%=h @public_body.send(column.name) %>

<% end %>
Calculated home page:
<% if !@public_body.calculated_home_page.nil? %>
    <%= link_to(h(@public_body.calculated_home_page), @public_body.calculated_home_page) %>
<% else %>
    *unknown*
<% end %>

Tags: <%=h @public_body.tag_string %>

    <%= link_to 'Public page', main_url(public_body_url(@public_body)) %>
    | <%= link_to 'Edit', '../edit/' + @public_body.id.to_s %>

History

<%
    history_columns = PublicBody.content_columns
    history_columns.delete_if {|c| ['created_at', 'updated_at', 'first_letter'].include?(c.name)}
    for column in history_columns %>
  <%= column.human_name %>
<% end %>
Updated at

<% for historic_public_body in @public_body.versions.reverse %>
      <tr class="<%= cycle('odd', 'even') %>">
    <% for column in history_columns %>
      <%
        value = h(historic_public_body.send(column.name))
        if column.name == 'last_edit_comment'
            value = historic_public_body.last_edit_comment_for_html_display
        end
        # Highlight entries which have changed since previous version
        changed = (not ['version', 'last_edit_editor', 'last_edit_comment'].include?(column.name)) && ((historic_public_body.send(column.name) != @public_body.versions[historic_public_body.version - 2].send(column.name)) || (historic_public_body.version == 1)) %>
      <td <%= changed ? ' class="entry_changed" ': '' %> >
      <%=value%>

    <% end %>
      <%=h historic_public_body.updated_at %>

<% end %>

Requests

<%= render :partial => 'admin_request/some_requests', :locals => { :info_requests => @public_body.info_requests } %>

Track things

<%= render :partial => 'admin_track/some_tracks', :locals => { :track_things => @public_body.track_things } %>


Fixed a javascript bug

Fixed a javascript bug

<!DOCTYPE html>

    <meta charset="utf-8">
    <link rel="alternate" type="application/rss+xml" title="EMRL Work Timeline Feed" href="http://projects.emrl.com/feeds/rss/da222717fb7b4dfc61f3ed49e3f62f4d">
    <link href="https://fonts.googleapis.com/css?family=Roboto:400,400italic,700,700italic,300,300italic' rel='stylesheet" rel="stylesheet">
    <link href="//netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.css" rel="stylesheet">
    <link rel="alternate" type="application/rss+xml" title="RSS" href="http://projects.emrl.com/feeds/rss/da222717fb7b4dfc61f3ed49e3f62f4d" />

    <%= 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>
      <% @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 "#{_('')}", :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'] %>

                        <%= @content_for_layout %>

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

                                <%= h(current_user.name) %>

                                 •

                                  <%= "#{online_users} #{_('Online')}" %>

                                  <%= "" %>

                                <% if total_today > 0 %>

                                <%=_ 'You have worked'%> <%= distance_of_time_in_words(total_today.minutes) %>
                                <%=_ 'today.'%>
                                <% end %>

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

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

                                    <form method="post"
                                    onsubmit="return false;"
                                    id="worklog_form">
                                      <textarea name="worklog[body]"
                                      id="worklog_body"
                                      style="resize:vertical; font-size:11px; margin:0px; border:none; width:97%;" rows="7" placeholder="Text entered here will be saved automatically to your current task."><%= @current_sheet.body if @current_sheet%></textarea>
                                    </form>

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

                          <%=_ 'Task Views' %>

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

                        <%= link_to _('My Open Tasks'), :controller => 'views', :action => 'my_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 _(''), :controller => 'views', :action => 'edit', :id => view if(view.user_id == current_user.id || current_user.admin?)%>

<% end %>

                        <td align="left" class="page_header_side tooltip" width="100%" colspan="2" title="<%= _'Quickly access recently edited Wikis'%>">

                            <%=_ 'Recent Wikis'%>

           						<% wikis = WikiPage.find(:all, :limit => 6, :order => "updated_at DESC") %>
				          		<% wiki_i = 0 %>
			           			<% for wiki in wikis %>

                        <td class="views_item" style="white-space:nowrap;<%= "padding-top:0.2em;" if (wiki_i == 0) %>">

									         <%= wiki.to_url_truncate(28) %>

				        				<td<%= " style=\"color: padding-top:0.2em\"" if (wiki_i == 0) %>>
        									  <%= wiki.updated_at.strftime("%m/%d") %>

                      <% wiki_i += 1 %>
          						<% end %>

              <td align="left" class="page_header_side tooltip" width="100%" colspan="2" title="<%= _'Commonly Accessed Information'%>">

                  <%=_ 'Blog'%>

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

      <% end %>
      <%= periodically_call_remote(:url => { :controller => 'tasks', :action => 'update_sheet_info' }, :frequency => 90 ) -%>
      <%= flash_plugin(session[:channels]) %>

      <%#= query_review_output %>


Changed open defects to report age in days

Open defects

      Status
      Id
      Title
      Priority
      Severity
      Assigned to
      Due
      Raised by
      Days

    <% @open_defects.each do |d| %>

        <%= d.test_observation.status %>
        <%= d.test_observation_id %>
        <%= link_to_item d.test_observation %>
        <%= d.test_observation.priority_code %>
        <%= d.test_observation.detail.severity_code %>
        <%= link_to_item d.test_observation.person %>
        <td <%= overdue_class(d.test_observation) %>>
          <%= d.test_observation.due_on.strftime(date_format) unless d.test_observation.due_on.nil? %>

        <%= link_to_item d.test_observation.first_version_updated_by %>
        <%= (Date.today - d.test_observation.first_version_updated_at) %>

    <% end %>

Open defects

      Status
      Id
      Title
      Priority
      Severity
      Assigned to
      Due
      Raised by
      Age

    <% @open_defects.each do |d| %>

        <%= d.test_observation.status %>
        <%= d.test_observation_id %>
        <%= link_to_item d.test_observation %>
        <%= d.test_observation.priority_code %>
        <%= d.test_observation.detail.severity_code %>
        <%= link_to_item d.test_observation.person %>
        <td <%= overdue_class(d.test_observation) %>>
          <%= d.test_observation.due_on.strftime(date_format) unless d.test_observation.due_on.nil? %>

        <%= link_to_item d.test_observation.first_version_updated_by %>
        <%= d.test_observation.first_version_updated_at.strftime(date_format) %>

    <% end %>


Change the semantics of allow_comments slightly.  Previously, disabling comments kept Typo
from displaying any comments at all.  Now, disabling comments only stops new comments from
being added; old comments are still displayed.

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

<div class="post"<%= onhover_show_admin_tools(:article) %>>
  <%= link_to("edit", { :controller => "admin/content", :action => "edit", :id => @article },
        :class => "admintools", :style => "display: none", :id => "admin_article") %>

<%= @article.title %>

Posted by <%= author_link(@article) %>
  <%= js_distance_of_time_in_words_to_now @article.created_at.utc %>

  <%= @article.full_html %>

<% if @article.allow_comments? or @article.comments.size > 0 -%>

Comments

<% if @article.allow_comments? -%>

    Leave a response

<% end -%>
  <%= content_tag(:ol, render(:partial => "comment", :collection => @article.comments), :id => 'commentList', :class => 'comment-list') %>
<% end -%>

<% if @article.allow_pings? -%>

Trackbacks

    Use the following link to trackback from your own site:

    <%= server_url_for :controller=>"articles", :action=>"trackback", :id=>@article.id %>

  <%= content_tag(:ol, render(:partial => "trackback", :collection => @article.trackbacks), :id => 'trackbackList', :class => 'trackback-list') %>
<% end -%>

  <a href="<%= xml_url(:action=>'articlerss', :id=>@article) %>" title="RSS Feed">RSS feed for this post
  <a href="<%= server_url_for :controller=>"articles", :action=>"trackback", :id=>@article.id %>">trackback uri

<% if @article.allow_comments? -%>
  <%= render :partial => 'comment_box' %>
<% else -%>

Comments are disabled

<% end -%>

<div class="post"<%= onhover_show_admin_tools(:article) %>>
  <%= link_to("edit", { :controller => "admin/content", :action => "edit", :id => @article },
        :class => "admintools", :style => "display: none", :id => "admin_article") %>

<%= @article.title %>

Posted by <%= author_link(@article) %>
  <%= js_distance_of_time_in_words_to_now @article.created_at.utc %>

  <%= @article.full_html %>

<% if @article.allow_comments? -%>

Comments

    Leave a response

  <%= content_tag(:ol, render(:partial => "comment", :collection => @article.comments), :id => 'commentList', :class => 'comment-list') %>
<% end -%>

<% if @article.allow_pings? -%>

Trackbacks

    Use the following link to trackback from your own site:

    <%= server_url_for :controller=>"articles", :action=>"trackback", :id=>@article.id %>

  <%= content_tag(:ol, render(:partial => "trackback", :collection => @article.trackbacks), :id => 'trackbackList', :class => 'trackback-list') %>
<% end -%>

  <a href="<%= xml_url(:action=>'articlerss', :id=>@article) %>" title="RSS Feed">RSS feed for this post
  <a href="<%= server_url_for :controller=>"articles", :action=>"trackback", :id=>@article.id %>">trackback uri

<% if @article.allow_comments? -%>
  <%= render :partial => 'comment_box' %>
<% else -%>

Comments are disabled

<% end -%>