aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/controllers/admin_public_body_change_requests_controller.rb15
-rw-r--r--app/views/admin_public_body_change_requests/edit.html.erb8
2 files changed, 23 insertions, 0 deletions
diff --git a/app/controllers/admin_public_body_change_requests_controller.rb b/app/controllers/admin_public_body_change_requests_controller.rb
new file mode 100644
index 000000000..d76cdc0e5
--- /dev/null
+++ b/app/controllers/admin_public_body_change_requests_controller.rb
@@ -0,0 +1,15 @@
+class AdminPublicBodyChangeRequestsController < AdminController
+
+ def edit
+ @change_request = PublicBodyChangeRequest.find(params[:id])
+ end
+
+ def update
+ @change_request = PublicBodyChangeRequest.find(params[:id])
+ @change_request.close!
+ @change_request.send_response(params[:subject], params[:response])
+ flash[:notice] = 'The change request has been closed and the user has been notified'
+ redirect_to admin_general_index_path
+ end
+
+end
diff --git a/app/views/admin_public_body_change_requests/edit.html.erb b/app/views/admin_public_body_change_requests/edit.html.erb
new file mode 100644
index 000000000..cc9c5b5d9
--- /dev/null
+++ b/app/views/admin_public_body_change_requests/edit.html.erb
@@ -0,0 +1,8 @@
+<h1><%=@title%></h1>
+
+<%= form_tag admin_change_request_update_path(@change_request), :class => "form form-horizontal" do %>
+ <%= render :partial => 'admin_public_body_change_requests/response'%>
+ <div class="form-actions">
+ <%= submit_tag 'Close', :accesskey => 'c', :class => "btn btn-primary" %>
+ </div>
+<% end %>