diff options
-rw-r--r-- | app/views/admin_public_body/_one_list.rhtml | 44 | ||||
-rw-r--r-- | app/views/admin_request/show.rhtml | 227 |
2 files changed, 134 insertions, 137 deletions
diff --git a/app/views/admin_public_body/_one_list.rhtml b/app/views/admin_public_body/_one_list.rhtml index cf1866212..c867433a0 100644 --- a/app/views/admin_public_body/_one_list.rhtml +++ b/app/views/admin_public_body/_one_list.rhtml @@ -2,31 +2,30 @@ <% for public_body in bodies %> <div class="accordion-group"> <div class="accordion-heading accordion-toggle row"> - <span class="item-title span6"> - <a href="#body_<%=public_body.id%>" data-toggle="collapse" data-parent="requests"><i class="icon-chevron-right"></i></a> - <%= link_to(public_body.name, admin_body_show_path(public_body), :title => "view full details")%> - </span> - <span class="item-metadata span6"> - <%= render :partial => 'tags', :locals => { :body => public_body} %> - </span> + <span class="item-title span6"> + <a href="#body_<%=public_body.id%>" data-toggle="collapse" data-parent="requests"><i class="icon-chevron-right"></i></a> + <%= link_to(public_body.name, admin_body_show_path(public_body), :title => "view full details")%> + </span> + <span class="item-metadata span6"> + <%= render :partial => 'tags', :locals => { :body => public_body} %> + </span> </div> <div id="body_<%=public_body.id%>" class="item-detail accordion-body collapse row"> - - <% public_body.for_admin_column do |name, value, type| %> - <div> - <span class="span6"> - <b><%=name%></b> - </span> - <span class="span6"> - <% 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 %> - </span> + <% public_body.for_admin_column do |name, value, type| %> + <div> + <span class="span6"> + <b><%=name%></b> + </span> + <span class="span6"> + <% 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 %> + </span> </div> - <% end %> + <% end %> </div> </div> <% end %> @@ -41,6 +40,5 @@ <%= submit_tag "Add tag to all", :class => "btn btn-primary" %> (in table just above) </p> - <% end %> diff --git a/app/views/admin_request/show.rhtml b/app/views/admin_request/show.rhtml index fac1e3e4c..fd5daee55 100644 --- a/app/views/admin_request/show.rhtml +++ b/app/views/admin_request/show.rhtml @@ -4,114 +4,113 @@ <% form_tag '../move_request', { :class => "form form-horizontal" } do %> <%= hidden_field_tag 'info_request_id', @info_request.id %> -<div class="accordion" id="info_request"> - <div class="accordion-group"> - <div class="accordion-heading"> - <span class="item-title"> - <a href="#metadata_<%=@info_request.id%>" data-toggle="collapse" data-parent="#info_request"><i class="icon-chevron-down"></i></a>Request metadata - </span> - </div> - <div id="metadata_<%=@info_request.id%>" class="accordion-body collapse in"> - <table class="table table-striped table-condensed"> - <thead> - <tr> - <td colspan="2"> - <%= link_to 'Edit metadata', '../edit/' + @info_request.id.to_s, :class => "btn" %> - </td> - </tr> - </thead> - <tbody> - <tr> - <th>Public page:</th> - <td><%= link_to request_url(@info_request), request_path(@info_request) %></td> - </tr> - <% @info_request.for_admin_column do |name, value, type, column_name|%> + <div class="accordion" id="info_request"> + <div class="accordion-group"> + <div class="accordion-heading"> + <span class="item-title"> + <a href="#metadata_<%=@info_request.id%>" data-toggle="collapse" data-parent="#info_request"><i class="icon-chevron-down"></i></a>Request metadata + </span> + </div> + <div id="metadata_<%=@info_request.id%>" class="accordion-body collapse in"> + <table class="table table-striped table-condensed"> + <thead> + <tr> + <td colspan="2"> + <%= link_to 'Edit metadata', '../edit/' + @info_request.id.to_s, :class => "btn" %> + </td> + </tr> + </thead> + <tbody> + <tr> + <th>Public page:</th> + <td><%= link_to request_url(@info_request), request_path(@info_request) %></td> + </tr> + <% @info_request.for_admin_column do |name, value, type, column_name|%> + <tr> + <td> + <b><%= name %>:</b> + </td> + <td> + <% 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' %> + <ul> + <li><strong>Initial request last sent at:</strong> <%= @info_request.calculate_status %> + <li><strong>Initial request last sent at:</strong> <%=@info_request.date_initial_request_last_sent_at.to_date %> + <li><strong>Date response required by:</strong> <%= @info_request.date_response_required_by %> + <li><strong>Very overdue after:</strong> <%= @info_request.date_very_overdue_after %> + </ul> + <% end %> + </td> + </tr> + <% end %> <tr> <td> - <b><%= name %>:</b> + <b>Created by</b> </td> <td> - <% 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)) %>) + <% if @info_request.is_external? %> + <%= link_to("<i class='icon-eye-open'></i>".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 %> - <%= h value %> - <% end %> - <% if column_name == 'described_state' %> - <ul> - <li><strong>Initial request last sent at:</strong> <%= @info_request.calculate_status %> - <li><strong>Initial request last sent at:</strong> <%=@info_request.date_initial_request_last_sent_at.to_date %> - <li><strong>Date response required by:</strong> <%= @info_request.date_response_required_by %> - <li><strong>Very overdue after:</strong> <%= @info_request.date_very_overdue_after %> - </ul> + <%= link_to("<i class='icon-eye-open'></i>".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" %> + <div style="display:none;"> + <strong>url_name of new user:</strong> + <%= text_field_tag 'user_url_name', "", { :size => 20 } %> + <%= submit_tag "Move request to user", :class => "btn btn-info" %> + </div> <% end %> </td> </tr> - <% end %> - <tr> - <td> - <b>Created by</b> - </td> - <td> - <% if @info_request.is_external? %> - <%= link_to("<i class='icon-eye-open'></i>".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("<i class='icon-eye-open'></i>".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" %> + <tr> + <td> + <b>Public authority:</b> + </td> + <td> + <%= link_to("<i class='icon-eye-open'></i>".html_safe, public_body_path(@info_request.public_body), :title => "view authority on public website") %> + <%= link_to(@info_request.public_body.name, admin_body_show_path(@info_request.public_body)) %> + <%= link_to "move...", "#", :class => "btn btn-mini btn-warning toggle-hidden" %> <div style="display:none;"> - <strong>url_name of new user:</strong> - <%= text_field_tag 'user_url_name', "", { :size => 20 } %> - <%= submit_tag "Move request to user", :class => "btn btn-info" %> + <strong>url_name of new authority:</strong> + <%= text_field_tag 'public_body_url_name', "", { :size => 20 } %> + <%= submit_tag "Move request to authority", :class => "btn btn-info" %> </div> - <% end %> - - </td> - </tr> - <tr> - <td> - <b>Public authority:</b> - </td> - <td> - <%= link_to("<i class='icon-eye-open'></i>".html_safe, public_body_path(@info_request.public_body), :title => "view authority on public website") %> - <%= link_to(@info_request.public_body.name, admin_body_show_path(@info_request.public_body)) %> - <%= link_to "move...", "#", :class => "btn btn-mini btn-warning toggle-hidden" %> - <div style="display:none;"> - <strong>url_name of new authority:</strong> - <%= text_field_tag 'public_body_url_name', "", { :size => 20 } %> - <%= submit_tag "Move request to authority", :class => "btn btn-info" %> - </div> - </td> - </tr> - <tr> - <td> - <b><%=_("Incoming email address")%></b> - </td> - <td> - <%= link_to h(@info_request.incoming_email), "mailto:#{@info_request.incoming_email}" %> - </td> - </tr> - <tr> - <td> - <b><%=_("Tags")%></b> - </td> - <td> - <%= render :partial => 'tags', :locals => { :info_request => @info_request} %> - </td> - </tr> - </tbody> - <tfoot> - <tr> - <td colspan="2"> - <%= link_to 'Edit metadata', '../edit/' + @info_request.id.to_s, :class => "btn" %> - </td> - </tr> - </tfoot> - </table> + </td> + </tr> + <tr> + <td> + <b><%=_("Incoming email address")%></b> + </td> + <td> + <%= link_to h(@info_request.incoming_email), "mailto:#{@info_request.incoming_email}" %> + </td> + </tr> + <tr> + <td> + <b><%=_("Tags")%></b> + </td> + <td> + <%= render :partial => 'tags', :locals => { :info_request => @info_request} %> + </td> + </tr> + </tbody> + <tfoot> + <tr> + <td colspan="2"> + <%= link_to 'Edit metadata', '../edit/' + @info_request.id.to_s, :class => "btn" %> + </td> + </tr> + </tfoot> + </table> + </div> </div> </div> -</div> <% end %> <formset class="form-horizontal"> <legend>Actions</legend> @@ -126,13 +125,13 @@ </div> <% 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 %> <div class="control-group"> - <% if @info_request.is_external? %> - <label class="control-label">Hide the request:</label> - <% else %> - <label class="control-label">Hide the request and notify the user:</label> - <% end %> + <% if @info_request.is_external? %> + <label class="control-label">Hide the request:</label> + <% else %> + <label class="control-label">Hide the request and notify the user:</label> + <% end %> - <div class="controls" id="request_hidden_user_explanation_reasons"> + <div class="controls" id="request_hidden_user_explanation_reasons"> <% if ['hidden', 'requester_only'].include? @info_request.prominence %> <p class="help-block">This request has already been hidden</p> <% else %> @@ -147,23 +146,23 @@ </div> <% if !['hidden', 'requester_only'].include? @info_request.prominence %> - <% if ! @info_request.is_external? %> + <% if ! @info_request.is_external? %> - <div class="control-group" id="request_hidden_user_subject"> - <label for="request_hidden_user_subject_field" class="control-label">Subject of email:</label> - <div class="controls"> - <%= text_field_tag "subject", "Your request on WhatDoTheyKnow.com hidden", {:id => "request_hidden_user_subject_field", :cols => 100} %> - </div> + <div class="control-group" id="request_hidden_user_subject"> + <label for="request_hidden_user_subject_field" class="control-label">Subject of email:</label> + <div class="controls"> + <%= text_field_tag "subject", "Your request on WhatDoTheyKnow.com hidden", {:id => "request_hidden_user_subject_field", :cols => 100} %> </div> + </div> - <div class="control-group" id="request_hidden_user_explanation"> - <label for="request_hidden_user_explanation_field" class="control-label">Reason for hiding the request (will be emailed to user):</label> - <div class="controls"> - <%= text_area_tag "explanation", h(@request_hidden_user_explanation), {:id => "request_hidden_user_explanation_field"} %> - </div> + <div class="control-group" id="request_hidden_user_explanation"> + <label for="request_hidden_user_explanation_field" class="control-label">Reason for hiding the request (will be emailed to user):</label> + <div class="controls"> + <%= text_area_tag "explanation", h(@request_hidden_user_explanation), {:id => "request_hidden_user_explanation_field"} %> </div> + </div> - <% end %> + <% end %> <div class="form-actions" id="request_hide_button"> <%= submit_tag _("Hide request"), :class => "btn" %> </div> |