aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/controllers/admin_general_controller.rb2
-rw-r--r--app/views/admin_general/_change_request_summary.html.erb60
-rw-r--r--app/views/admin_general/index.html.erb32
3 files changed, 93 insertions, 1 deletions
diff --git a/app/controllers/admin_general_controller.rb b/app/controllers/admin_general_controller.rb
index 1bdd0c772..753208c9a 100644
--- a/app/controllers/admin_general_controller.rb
+++ b/app/controllers/admin_general_controller.rb
@@ -35,6 +35,8 @@ class AdminGeneralController < AdminController
@old_unclassified = InfoRequest.find_old_unclassified(:limit => 20,
:conditions => ["prominence = 'normal'"])
@holding_pen_messages = InfoRequest.holding_pen_request.incoming_messages
+ @new_body_requests = PublicBodyChangeRequest.new_body_requests.open
+ @body_update_requests = PublicBodyChangeRequest.body_update_requests.open
end
def timeline
diff --git a/app/views/admin_general/_change_request_summary.html.erb b/app/views/admin_general/_change_request_summary.html.erb
new file mode 100644
index 000000000..bec49c12c
--- /dev/null
+++ b/app/views/admin_general/_change_request_summary.html.erb
@@ -0,0 +1,60 @@
+<table class="table table-striped table-condensed">
+ <tbody>
+ <tr>
+ <td>
+ <b>Authority</b>
+ </td>
+ <td>
+ <%= @change_request.get_public_body_name %>
+ </td>
+ </tr>
+
+ <% if @change_request.public_body %>
+ <tr>
+ <td>
+ <b>Current address</b>
+ </td>
+ <td>
+ <%= @change_request.public_body.request_email %>
+ </td>
+ </tr>
+ <% end %>
+
+ <tr>
+ <td>
+ <b>Suggested address</b>
+ </td>
+ <td>
+ <%= @change_request.public_body_email %>
+ </td>
+ </tr>
+
+ <tr>
+ <td>
+ <b>Source</b>
+ </td>
+ <td>
+ <%= @change_request.source_url %>
+ </td>
+ </tr>
+
+ <tr>
+ <td>
+ <b>Requested by</b>
+ </td>
+ <td>
+ <%= @change_request.get_user_name %> (<%= @change_request.get_user_email %>)
+ </td>
+ </tr>
+
+ <tr>
+ <td>
+ <b>Requested on</b>
+ </td>
+ <td>
+ <%= I18n.l(@change_request.created_at, :format => "%e %B %Y %H:%M:%S") %>
+ (<%= "#{time_ago_in_words(@change_request.created_at)} ago" %>)
+ </td>
+ </tr>
+ </tbody>
+</table>
diff --git a/app/views/admin_general/index.html.erb b/app/views/admin_general/index.html.erb
index 976860fa7..2202663be 100644
--- a/app/views/admin_general/index.html.erb
+++ b/app/views/admin_general/index.html.erb
@@ -174,9 +174,39 @@
</div>
</div>
<% end %>
+
+ <% if @new_body_requests.size > 0 %>
+ <div class="accordion-group">
+ <div class="accordion-heading">
+ <a class="accordion-toggle" href="#new-authorities" data-toggle="collapse" data-parent="things-to-do"><span class="label label-important"><%= @new_body_requests.size %></span><%= chevron_right %> Add new authorities</a>
+ </div>
+ <div id="new-authorities" class="accordion-body collapse">
+ <% for @change_request in @new_body_requests %>
+ <%= render :partial => 'change_request_summary'%>
+ <%= link_to("Close and respond", admin_change_request_edit_path(@change_request), :class => 'btn') %>
+ <%= link_to("Add authority", admin_body_new_path(:change_request_id => @change_request.id), :class => 'btn btn-primary') %>
+ <% end %>
+ </div>
+ </div>
+ <% end %>
+
+ <% if @body_update_requests.size > 0 %>
+ <div class="accordion-group">
+ <div class="accordion-heading">
+ <a class="accordion-toggle" href="#update-authorities" data-toggle="collapse" data-parent="things-to-do"><span class="label label-important"><%= @body_update_requests.size %></span><%= chevron_right %> Update authorities</a>
+ </div>
+ <div id="update-authorities" class="accordion-body collapse">
+ <% for @change_request in @body_update_requests %>
+ <%= render :partial => 'change_request_summary' %>
+ <%= link_to("Close and respond", admin_change_request_edit_path(@change_request), :class => 'btn') %>
+ <%= link_to("Make update", admin_body_edit_path(@change_request.public_body, :change_request_id => @change_request.id), :class => 'btn btn-primary') %>
+ <% end %>
+ </div>
+ </div>
+ <% end %>
</div>
-<% if @holding_pen_messages.size == 0 && @old_unclassified.size == 0 && @requires_admin_requests.size == 0 && @blank_contacts.size == 0 && @attention_requests.size == 0 %>
+<% if @holding_pen_messages.size == 0 && @old_unclassified.size == 0 && @requires_admin_requests.size == 0 && @blank_contacts.size == 0 && @attention_requests.size == 0 && @new_body_requests.size == 0 && @body_update_requests.size == 0 %>
<div class="row">
<div class="span12 alert alert-success">
No pending administration required.