Browse Source

Route to logs for specific organisation

pull/557/head
Kat 3 years ago
parent
commit
e9b33b3f29
  1. 6
      app/controllers/organisations_controller.rb
  2. 2
      app/views/layouts/organisations.html.erb
  3. 2
      app/views/organisations/_organisation_list.html.erb
  4. 1
      app/views/organisations/logs.erb
  5. 1
      config/routes.rb

6
app/controllers/organisations_controller.rb

@ -42,6 +42,12 @@ class OrganisationsController < ApplicationController
end
end
def logs
unless current_user.support?
redirect_to "/logs"
end
end
private
def org_params

2
app/views/layouts/organisations.html.erb

@ -1,6 +1,6 @@
<% content_for :content do %>
<h1 class="govuk-heading-l">
Your organisation
<%= request.path == "/organisations" ? "Organisations" : "Your organisation" %>
</h1>
<% items = tab_items(current_user) %>

2
app/views/organisations/_organisation_list.html.erb

@ -16,7 +16,7 @@
<% organisations.map do |organisation| %>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">
<%= govuk_link_to organisation.name, organisation_path(organisation) %>
<%= govuk_link_to organisation.name, "organisations/#{organisation.id}/logs" %>
</th>
<td class="govuk-table__cell app-!-font-tabular">
<%= organisation.id %>

1
app/views/organisations/logs.erb

@ -0,0 +1 @@
wubwub

1
config/routes.rb

@ -67,6 +67,7 @@ Rails.application.routes.draw do
get "details", to: "organisations#details"
get "users", to: "organisations#users"
get "users/invite", to: "users/account#new"
get "logs", to: "organisations#logs"
end
end

Loading…
Cancel
Save