Browse Source

headings partial (#645)

* mopped headings

* show page dry logic

* dry headings logic
pull/646/head
J G 3 years ago committed by GitHub
parent
commit
37298e1875
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      app/views/case_logs/index.html.erb
  2. 4
      app/views/organisations/_headings.html.erb
  3. 12
      app/views/organisations/index.html.erb
  4. 4
      app/views/organisations/logs.html.erb
  5. 9
      app/views/organisations/show.html.erb
  6. 4
      app/views/organisations/users.html.erb
  7. 7
      app/views/users/index.html.erb

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

@ -3,12 +3,7 @@
<% content_for :title, title %> <% content_for :title, title %>
<h1 class="govuk-heading-l"> <%= render partial: "organisations/headings", locals: current_user.support? ? { main: "Logs", sub: nil } : { main: "Logs", sub: current_user.organisation.name } %>
<% unless current_user.support? %>
<span class="govuk-caption-l"><%= current_user.organisation.name %></span>
<% end %>
Logs
</h1>
<div class="app-filter-layout" data-controller="filter-layout"> <div class="app-filter-layout" data-controller="filter-layout">
<div class="govuk-button-group app-filter-toggle"> <div class="govuk-button-group app-filter-toggle">

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

@ -0,0 +1,4 @@
<h1 class="govuk-heading-l">
<span class="govuk-caption-l"><%= sub %></span>
<%= main %>
</h1>

12
app/views/organisations/index.html.erb

@ -3,17 +3,7 @@
<% content_for :title, title %> <% content_for :title, title %>
<h1 class="govuk-heading-l"> <%= render partial: "organisations/headings", locals: request.path == "/organisations" ? { main: "Organisations", sub: nil } : { main: @organisation.name, sub: "Organisations" } %>
<% if current_user.support? && request.path == "/organisations" %>
Organisations
<% end %>
<% if current_user.support? && request.path != "/organisations" %>
<span class="govuk-caption-l"><%= @organisation.name %></span>
<h1 class="govuk-heading-l">Organisations</h1>
<% end %>
</h1>
<% items = tab_items(current_user) %>
<h2 class="govuk-visually-hidden">Organisations</h2> <h2 class="govuk-visually-hidden">Organisations</h2>

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

@ -3,9 +3,7 @@
<% content_for :title, title %> <% content_for :title, title %>
<h1 class="govuk-heading-l"> <%= render partial: "organisations/headings", locals: { main: @organisation.name, sub: nil } %>
<%= @organisation.name %>
</h1>
<%= render SubNavigationComponent.new( <%= render SubNavigationComponent.new(
items: secondary_items(request.path, @organisation.id), items: secondary_items(request.path, @organisation.id),

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

@ -2,14 +2,7 @@
<% title = format_title(nil, current_user.support? ? "About this organisation" : "About your organisation", current_user, nil, nil, @organisation.name) %> <% title = format_title(nil, current_user.support? ? "About this organisation" : "About your organisation", current_user, nil, nil, @organisation.name) %>
<% content_for :title, title %> <% content_for :title, title %>
<h1 class="govuk-heading-l"> <%= render partial: "organisations/headings", locals: current_user.support? ? { main: @organisation.name, sub: nil } : { main: "About your organisation", sub: current_user.organisation.name } %>
<% if !current_user.support? %>
<span class="govuk-caption-l"><%= current_user.organisation.name %></span>
About your organisation
<% else %>
<%= @organisation.name %>
<% end %>
</h1>
<% if current_user.support? %> <% if current_user.support? %>
<%= render SubNavigationComponent.new( <%= render SubNavigationComponent.new(

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

@ -3,9 +3,7 @@
<% content_for :title, title %> <% content_for :title, title %>
<h1 class="govuk-heading-l"> <%= render partial: "organisations/headings", locals: { main: @organisation.name, sub: nil } %>
<%= @organisation.name %>
</h1>
<%= render SubNavigationComponent.new( <%= render SubNavigationComponent.new(
items: secondary_items(request.path, @organisation.id), items: secondary_items(request.path, @organisation.id),

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

@ -3,12 +3,7 @@
<% content_for :title, title %> <% content_for :title, title %>
<h1 class="govuk-heading-l"> <%= render partial: "organisations/headings", locals: current_user.support? ? { main: "Users", sub: nil } : { main: "User", sub: current_user.organisation.name } %>
<% unless current_user.support? %>
<span class="govuk-caption-l"><%= current_user.organisation.name %></span>
<% end %>
Users
</h1>
<h2 class="govuk-visually-hidden">Users</h2> <h2 class="govuk-visually-hidden">Users</h2>

Loading…
Cancel
Save