Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AO3-6376 Remove "User" from username, password and email change page titles #4933

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

phthallo
Copy link

@phthallo phthallo commented Sep 28, 2024

Pull Request Checklist

Issue

https://otwarchive.atlassian.net/browse/AO3-6376

Purpose

This PR adds conditional rendering of the singularised controller_name (User) based on whether the controller.action_name has 'change' in it (as in change_password, change_email etc.).

Testing Instructions

Follow the instructions in the description of the Jira ticket.

References

N/A

Credit

phthallo [Annabel Quach] (they/them)

@brianjaustin
Copy link
Member

Hi Annabel,

Thank you for the contribution! Someone will be along to review it soon.

In the meantime, I've assigned the Jira issue to you and set its status to In Review, so no one will mistakenly create a duplicate pull request. I've also given your account permission to comment on, assign, and transition issues in the future.

Thanks again for the PR! If you have any questions, please feel free to contact our dev team at [email protected].

Copy link
Member

@brianjaustin brianjaustin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks again for the PR! Because application.html.erb changes can have global impact, I'd like to avoid changing where we can to avoid unexpected impacts. However, we can use @page_title to override an action's default title (for example #4675).

It looks like there's an implicit change_password action (similar for the other 2), so you would need to add an explicit method to https://github.com/otwcode/otwarchive/blob/c09729dbe28774f8c99856ad81665481c17db044/app/controllers/users_controller.rb

def change_password
  @page_title = t(".browser_title")

and since we try to extract translatable text where possible, the above also needs this to be added to https://github.com/otwcode/otwarchive/blob/f9da02285e2e18d9fe722c860104a930a5488ed5/config/locales/views/en.yml

# other keys
users:
  change_password:
    browser_title: Change Password

Please feel free to let me know if that raises any questions!

@phthallo
Copy link
Author

phthallo commented Oct 2, 2024

Made some changes - I did use page_subtitle instead of page_title to keep the | {app_name} at the end of the tab name consistent with the other edit pages.

Copy link
Member

@brianjaustin brianjaustin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants