Skip to content

AO3-7409 Adjust header and page subtitle for managing invitations#5780

Open
jmalark wants to merge 1 commit intootwcode:masterfrom
jmalark:AO3-7409-manage-invitations-title
Open

AO3-7409 Adjust header and page subtitle for managing invitations#5780
jmalark wants to merge 1 commit intootwcode:masterfrom
jmalark:AO3-7409-manage-invitations-title

Conversation

@jmalark
Copy link
Copy Markdown
Contributor

@jmalark jmalark commented May 3, 2026

Pull Request Checklist

Issue

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

Purpose

On the manage invitations page, adjusts the browser subtitle and the header

Credit

Jesse Malark he/him

@jmalark jmalark force-pushed the AO3-7409-manage-invitations-title branch 2 times, most recently from 7c2db7e to 646a997 Compare May 3, 2026 23:13
Comment thread app/controllers/invitations_controller.rb Outdated
Comment thread app/views/invitations/manage.html.erb Outdated
Comment thread spec/controllers/invitations_controller_spec.rb
Comment thread app/views/invitations/manage.html.erb Outdated
@@ -1,5 +1,5 @@
<!--Descriptive page name, messages and instructions-->
<h2 class="heading"><%= logged_in_as_admin? ? (@user.login + "'s") : "Your" %> Invitations</h2>
<h2 class="heading"><%= t(logged_in_as_admin? ? ".page_heading_admin" : ".page_heading_user", username: @user.login) %></h2>
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Can you make these page_heading.admin and page_heading.user, please? It should look like this in the locale file:

manage:
  page_heading:
    admin: text
    user: text

And apologies for not catching this before, but the current code will define the username variable even when we don't need it. It's not terrible, but it would be better to do something like

<h2 class="heading">
  <% if logged_in_as_admin? %>
    <%= t(".page_heading.admin", username: @user.login) %>
  <% else %>
    [etc]

That would also mean i18n-tasks unused -l en should pass without needing to add anything to ignore_unused.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

If we are adding an if / else condition, should I also be making the text more like displaying base text for user and base text + admin text for admin or would trying to name those things make the code less clear?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Whoops, sorry, didn't see this question before I approved the pull request! But in general, it's a good idea to avoid doing that. Just because "Manage Invitations" and "for username" combine nicely into "Manage Invitations for username" English doesn't mean it will work across all languages. It's easier for the translation team to have the versions entirely separate like we've done here.

@jmalark jmalark force-pushed the AO3-7409-manage-invitations-title branch from 6daa8e4 to 035bd12 Compare May 8, 2026 21:06
Copy link
Copy Markdown
Collaborator

@sarken sarken 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