From 7c422a0c3cfad993c522ed2ae8a038e6c40a2f79 Mon Sep 17 00:00:00 2001 From: JG Date: Mon, 6 Jun 2022 10:44:08 +0100 Subject: [PATCH] fixed titles --- app/views/case_logs/index.html.erb | 7 ++++--- app/views/organisations/index.html.erb | 4 +++- app/views/organisations/logs.html.erb | 6 ++++-- app/views/organisations/show.html.erb | 3 +++ app/views/organisations/users.html.erb | 6 ++++-- app/views/users/index.html.erb | 6 ++++-- 6 files changed, 22 insertions(+), 10 deletions(-) diff --git a/app/views/case_logs/index.html.erb b/app/views/case_logs/index.html.erb index b65a0338a..387bdd45a 100644 --- a/app/views/case_logs/index.html.erb +++ b/app/views/case_logs/index.html.erb @@ -1,11 +1,12 @@ <% item_label = @pagy.count > 1 ? "logs" : "log" %> - <% if @searched.present? %> - <% title = "Your organisation (#{@pagy.count} #{item_label} matching ‘#{@searched}’ of #{@total_count} total logs)" %> + <% title = "#{current_user.support? ? 'Logs' : current_user.organisation.name} (#{@pagy.count} #{item_label} matching ‘#{@searched}’)" %> <% else %> - <% title = "Your organisation (Logs)" %> + <% title = "#{current_user.support? ? 'Logs' : current_user.organisation.name}" %> <% end %> +<% content_for :title, title %> +

<% if !current_user.support? %> <%= current_user.organisation.name %> diff --git a/app/views/organisations/index.html.erb b/app/views/organisations/index.html.erb index ce2e4e9d6..8c6153f82 100644 --- a/app/views/organisations/index.html.erb +++ b/app/views/organisations/index.html.erb @@ -1,10 +1,12 @@ <% item_label = @pagy.count > 1 ? "organisations" : "organisation" %> <% if @searched.present? %> - <% title = "Organisations (#{@pagy.count} #{item_label} matching ‘#{@searched}’ of #{@total_count} total organisations)" %> + <% title = "Organisations (#{@pagy.count} #{item_label} matching ‘#{@searched}’" %> <% else %> <% title = "Organisations" %> <% end %> +<% content_for :title, title %> +

<% if current_user.support? && request.path == "/organisations" %> Organisations diff --git a/app/views/organisations/logs.html.erb b/app/views/organisations/logs.html.erb index 2f8102dd3..074fe3296 100644 --- a/app/views/organisations/logs.html.erb +++ b/app/views/organisations/logs.html.erb @@ -1,10 +1,12 @@ <% item_label = @pagy.count > 1 ? "logs" : "log" %> <% if @searched.present? %> - <% title = "Your organisation (#{@pagy.count} #{item_label} matching ‘#{@searched}’ of #{@total_count} total logs)" %> + <% title = "#{@organisation.name} (#{@pagy.count} #{item_label} matching ‘#{@searched}’)" %> <% else %> - <% title = "Your organisation (Logs)" %> + <% title = "#{@organisation.name} (Logs)" %> <% end %> +<% content_for :title, title %> +

<%= @organisation.name %>

diff --git a/app/views/organisations/show.html.erb b/app/views/organisations/show.html.erb index 87ed5046f..93f6ca76a 100644 --- a/app/views/organisations/show.html.erb +++ b/app/views/organisations/show.html.erb @@ -1,3 +1,6 @@ +<% title = "#{@organisation.name} (Organisation details)" %> +<% content_for :title, title %> +

<% if !current_user.support? %> <%= current_user.organisation.name %> diff --git a/app/views/organisations/users.html.erb b/app/views/organisations/users.html.erb index 0366a3b67..6d846c29c 100644 --- a/app/views/organisations/users.html.erb +++ b/app/views/organisations/users.html.erb @@ -1,10 +1,12 @@ <% item_label = @pagy.count > 1 ? "users" : "user" %> <% if @searched.present? %> - <% title = "Your organisation (#{@pagy.count} #{item_label} matching ‘#{@searched}’ of #{@total_count} total users)" %> + <% title = "#{@organisation.name} (#{@pagy.count} #{item_label} matching ‘#{@searched}’" %> <% else %> - <% title = "Your organisation (User)" %> + <% title = "#{@organisation.name} (Users)" %> <% end %> +<% content_for :title, title %> +

<% if current_user.support? %>

<%= @organisation.name %>

diff --git a/app/views/users/index.html.erb b/app/views/users/index.html.erb index f7b42d26e..0a3f642c2 100644 --- a/app/views/users/index.html.erb +++ b/app/views/users/index.html.erb @@ -1,10 +1,12 @@ <% item_label = @pagy.count > 1 ? "users" : "user" %> <% if @searched.present? %> - <% title = "Your organisation (#{@pagy.count} #{item_label} matching ‘#{@searched}’ of #{@total_count} total users)" %> + <% title = "#{current_user.support? ? 'Users' : current_user.organisation.name} (#{@pagy.count} #{item_label} matching ‘#{@searched}’" %> <% else %> - <% title = "Your organisation (Users)" %> + <% title = "#{current_user.support? ? 'Users' : current_user.organisation.name}" %> <% end %> +<% content_for :title, title %> +

<% unless current_user.support? %> <%= current_user.organisation.name %>