Skip to content

Commit

Permalink
AO3-6376 instead override default title
Browse files Browse the repository at this point in the history
  • Loading branch information
phthallo committed Oct 2, 2024
1 parent d8fb621 commit f25624f
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
12 changes: 12 additions & 0 deletions app/controllers/users_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,18 @@ def edit
authorize @user.profile if logged_in_as_admin?
end

def change_email
@page_subtitle = t(".browser_title")
end

def change_password
@page_subtitle = t(".browser_title")
end

def change_username
@page_subtitle = t(".browser_title")
end

def changed_password
unless params[:password] && reauthenticate
render(:change_password) && return
Expand Down
5 changes: 2 additions & 3 deletions app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,8 @@
<% if defined?(@page_subtitle) %>
<%= @page_subtitle %>
<% else %>
<%= controller.action_name == "index" ? process_title(controller.controller_name) : process_title(controller.action_name) %>
<%= controller.action_name.split("_").first == "change" || controller.action_name == "index" ? "" : process_title(controller.controller_name.singularize) %>
<% end %>
<%= controller.action_name=="index" ? "" : process_title(controller.action_name) %>
<%= controller.action_name=="index" ? process_title(controller.controller_name) : process_title(controller.controller_name.singularize) %> <% end %>

Check failure on line 28 in app/views/layouts/application.html.erb

View workflow job for this annotation

GitHub Actions / ERB Lint runner

[] reported by reviewdog 🐶 Layout/SpaceAroundOperators: Surrounding space missing for operator `==`. Raw Output: app/views/layouts/application.html.erb:28:36: Layout/SpaceAroundOperators: Surrounding space missing for operator `==`.
|
<%= ArchiveConfig.APP_NAME %>
<% end %>
Expand Down
5 changes: 5 additions & 0 deletions config/locales/views/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -923,8 +923,13 @@ en:
description: Recalculate the filters for this work based on the current set of tags. Use this option if wrangling seems to have gone wrong. (e.g. If you synned one of this work's tags to a canonical but it's not showing up in the tag listings, or if the wrong tags are listed in the sidebar when you drill down to a search that includes only this work.)
title: Update Work Filters
users:
change_email:
browser_title: Change Email
change_password:
browser_title: Change Password
change_username:
account_faq: Account FAQ
browser_title: Change Username
caution: Please use this feature with caution.
change_window:
one: You can change your user name once per day.
Expand Down

0 comments on commit f25624f

Please sign in to comment.