Browse Source

Fix sub nav (#642)

* fixed sub nav

* fixed titles for non sup

* fixed title for coord

* fixed title for coordin

* lint
pull/644/head
J G 3 years ago committed by GitHub
parent
commit
37ff77f424
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      app/views/case_logs/index.html.erb
  2. 4
      app/views/organisations/logs.html.erb
  3. 6
      app/views/organisations/show.html.erb
  4. 4
      app/views/organisations/users.html.erb
  5. 2
      app/views/users/index.html.erb
  6. 6
      spec/requests/case_logs_controller_spec.rb

2
app/views/case_logs/index.html.erb

@ -2,7 +2,7 @@
<% if @searched.present? %> <% if @searched.present? %>
<% title = "#{current_user.support? ? 'Logs' : current_user.organisation.name} (#{@pagy.count} #{item_label} matching ‘#{@searched}’)" %> <% title = "#{current_user.support? ? 'Logs' : current_user.organisation.name} (#{@pagy.count} #{item_label} matching ‘#{@searched}’)" %>
<% else %> <% else %>
<% title = current_user.support? ? "Logs" : "#{current_user.organisation.name} (Logs)" %> <% title = "Logs" %>
<% end %> <% end %>
<% content_for :title, title %> <% content_for :title, title %>

4
app/views/organisations/logs.html.erb

@ -11,12 +11,12 @@
<h1 class="govuk-heading-l"><%= @organisation.name %></h1> <h1 class="govuk-heading-l"><%= @organisation.name %></h1>
</h1> </h1>
<h2 class="govuk-visually-hidden">Logs</h2>
<%= render SubNavigationComponent.new( <%= render SubNavigationComponent.new(
items: secondary_items(request.path, @organisation.id), items: secondary_items(request.path, @organisation.id),
) %> ) %>
<h2 class="govuk-visually-hidden">Logs</h2>
<div class="app-filter-layout" data-controller="filter-layout"> <div class="app-filter-layout" data-controller="filter-layout">
<%= render partial: "case_logs/log_filters" %> <%= render partial: "case_logs/log_filters" %>
<div class="app-filter-layout__content"> <div class="app-filter-layout__content">

6
app/views/organisations/show.html.erb

@ -1,4 +1,4 @@
<% title = "#{@organisation.name} (Organisation details)" %> <% title = current_user.support? ? "#{@organisation.name} (Organisation details)" : "Organisation details" %>
<% content_for :title, title %> <% content_for :title, title %>
<h1 class="govuk-heading-l"> <h1 class="govuk-heading-l">
@ -10,14 +10,14 @@
<% end %> <% end %>
</h1> </h1>
<h2 class="govuk-visually-hidden">About this organisation</h2>
<% if current_user.support? %> <% if current_user.support? %>
<%= render SubNavigationComponent.new( <%= render SubNavigationComponent.new(
items: secondary_items(request.path, @organisation.id), items: secondary_items(request.path, @organisation.id),
) %> ) %>
<% end %> <% end %>
<h2 class="govuk-visually-hidden">About this organisation</h2>
<div class="govuk-grid-row"> <div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds-from-desktop"> <div class="govuk-grid-column-two-thirds-from-desktop">
<%= govuk_summary_list do |summary_list| %> <%= govuk_summary_list do |summary_list| %>

4
app/views/organisations/users.html.erb

@ -13,12 +13,12 @@
<% end %> <% end %>
</h1> </h1>
<h2 class="govuk-visually-hidden">Users</h2>
<%= render SubNavigationComponent.new( <%= render SubNavigationComponent.new(
items: secondary_items(request.path, @organisation.id), items: secondary_items(request.path, @organisation.id),
) %> ) %>
<h2 class="govuk-visually-hidden">Users</h2>
<% if current_user.data_coordinator? || current_user.support? %> <% if current_user.data_coordinator? || current_user.support? %>
<%= govuk_button_link_to "Invite user", new_user_path(organisation_id: @organisation.id), html: { method: :get } %> <%= govuk_button_link_to "Invite user", new_user_path(organisation_id: @organisation.id), html: { method: :get } %>
<% end %> <% end %>

2
app/views/users/index.html.erb

@ -2,7 +2,7 @@
<% if @searched.present? %> <% if @searched.present? %>
<% title = "#{current_user.support? ? 'Users' : current_user.organisation.name} (#{@pagy.count} #{item_label} matching ‘#{@searched}’" %> <% title = "#{current_user.support? ? 'Users' : current_user.organisation.name} (#{@pagy.count} #{item_label} matching ‘#{@searched}’" %>
<% else %> <% else %>
<% title = current_user.support? ? "Users" : "#{current_user.organisation.name} (Users)" %> <% title = "Users" %>
<% end %> <% end %>
<% content_for :title, title %> <% content_for :title, title %>

6
spec/requests/case_logs_controller_spec.rb

@ -466,7 +466,7 @@ RSpec.describe CaseLogsController, type: :request do
end end
it "does not have pagination in the title" do it "does not have pagination in the title" do
expect(page).to have_title("#{user.organisation.name} (Logs) - Submit social housing lettings and sales data (CORE) - GOV.UK") expect(page).to have_title("Logs - Submit social housing lettings and sales data (CORE) - GOV.UK")
end end
it "shows the download csv link" do it "shows the download csv link" do
@ -542,7 +542,7 @@ RSpec.describe CaseLogsController, type: :request do
end end
it "has pagination in the title" do it "has pagination in the title" do
expect(page).to have_title("#{user.organisation.name} (Logs) (page 1 of 2) - Submit social housing lettings and sales data (CORE) - GOV.UK") expect(page).to have_title("Logs (page 1 of 2) - Submit social housing lettings and sales data (CORE) - GOV.UK")
end end
end end
@ -567,7 +567,7 @@ RSpec.describe CaseLogsController, type: :request do
end end
it "has pagination in the title" do it "has pagination in the title" do
expect(page).to have_title("#{user.organisation.name} (Logs) (page 2 of 2) - Submit social housing lettings and sales data (CORE) - GOV.UK") expect(page).to have_title("Logs (page 2 of 2) - Submit social housing lettings and sales data (CORE) - GOV.UK")
end end
end end
end end

Loading…
Cancel
Save