Browse Source

faet: update page titles

pull/2031/head
natdeanlewissoftwire 1 year ago
parent
commit
f224e5f503
  1. 14
      app/helpers/logs_helper.rb
  2. 2
      app/views/logs/index.html.erb
  3. 2
      app/views/organisations/logs.html.erb

14
app/helpers/logs_helper.rb

@ -8,6 +8,20 @@ module LogsHelper
end
end
def page_title
case controller.class.name
when "LettingsLogsController" then "Lettings logs"
when "SalesLogsController" then "Sales logs"
else
case action_name
when "lettings_logs" then "Lettings logs"
when "sales_logs" then "Sales logs"
else
raise "Log type not found for #{controller.class}, #{action_name}"
end
end
end
def bulk_upload_options(bulk_upload)
array = bulk_upload ? [bulk_upload.id] : []
array.index_with { |_bulk_upload_id| "With logs from bulk upload" }

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

@ -1,5 +1,5 @@
<% item_label = format_label(@pagy.count, "logs") %>
<% title = format_title(@searched, "Logs", current_user, item_label, @pagy.count, nil) %>
<% title = format_title(@searched, page_title, current_user, item_label, @pagy.count, nil) %>
<% content_for :title, title %>

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

@ -1,5 +1,5 @@
<% item_label = format_label(@pagy.count, "logs") %>
<% title = format_title(@searched, "Logs", current_user, item_label, @pagy.count, @organisation.name) %>
<% title = format_title(@searched, page_title, current_user, item_label, @pagy.count, @organisation.name) %>
<% content_for :title, title %>

Loading…
Cancel
Save