-
Notifications
You must be signed in to change notification settings - Fork 493
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-5610 notify users when a bookmark or series they have created is hidden #4760
base: master
Are you sure you want to change the base?
Conversation
@@ -377,6 +377,18 @@ def admin_deleted_work_notification(user, work) | |||
end | |||
end | |||
|
|||
def admin_hidden_series_notification(creation_id, user_id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we want to reutilize the admin_hidden_work_notification
action (maybe call it admin_hidden_creation_notification
), and update the email contents by passing in parameters?
or can we have separate mailer actions for when an admin hides works/series/bookmarks?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Personally, I like separate actions for each. I think the contents of the emails could potentially have enough differences that it could get kind of messy trying to account for all of the variations.
I haven't used Rails + i18n before. Is there a way to generate the translations from the yaml i added to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left some comments regarding the localisation of the email. There are so many notes because the admin_hidden_work_notification that you based this of was using some outdated I18n standards.
<% content_for :message do %> | ||
<p><%= t("mailer.general.greeting.formal", name: style_bold(@user.login)).html_safe %></p> | ||
|
||
<p><%= t(".html.hidden", title: style_creation_link(@series.title, @series)).html_safe %></p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The html
in the locale keys should be at the end. Then, the interpolated links are automatically treated as html safe and we do not need the potentially unsafe html_safe call:
<p><%= t(".hidden.html", title: style_creation_link(@series.title, @series)) %></p>
This applies to all keys you added in this file here, as well as the text version, where the key should be ".hidden.text"
and so on.
Furthermore, the variable name for links should end in _link
. In this key it would also be nice to use a more specific variable name:
<p><%= t(".html.hidden", title: style_creation_link(@series.title, @series)).html_safe %></p> | |
<p><%= t(".hidden.html", series_link: style_creation_link(@series.title, @series)) %></p> |
|
||
<p><%= t(".check_email") %></p> | ||
|
||
<p><%= t(".html.tos_violation", tos_link: tos_link(t ".tos")).html_safe %></p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ideal configuration of parentheses would be this:
<p><%= t(".html.tos_violation", tos_link: tos_link(t ".tos")).html_safe %></p> | |
<p><%= t(".tos_violation.html", tos_link: tos_link(t(".tos"))) %></p> |
Similar for the abuse link below.
@@ -6,20 +6,20 @@ en: | |||
expiration: | |||
one: If you do not use this link to reset your password within %{count} day, it will expire, and you will have to request a new one. | |||
other: If you do not use this link to reset your password within %{count} days, it will expire, and you will have to request a new one. | |||
intro: 'Someone has requested a password reset for your account. You can change your account password by following the link below and entering your new password:' | |||
intro: "Someone has requested a password reset for your account. You can change your account password by following the link below and entering your new password:" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The style guideline regarding "
quotation marks being preferred does not apply to the locale yml files for strings that contain colons :
. The normalized files are expected to use '
for these strings.
You can see this because the i18n test for this file fails. To have it show up as a failed test here on github, merge master
into your branch so that you get this bug fix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(You can normalize the file again with bundle exec i18n-tasks normalize -l en
, from https://github.com/otwcode/otwarchive/wiki/Internationalization-%28i18n%29-Standards#i18n-tasks.)
I18n.with_locale(@user.preference.locale.iso) do | ||
mail( | ||
to: @user.email, | ||
subject: default_i18n_subject(app_name: ArchiveConfig.APP_SHORT_NAME) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs a comment to help out i18n-tasks:
subject: default_i18n_subject(app_name: ArchiveConfig.APP_SHORT_NAME) | |
# i18n-tasks-use t('user_mailer.admin_hidden_series_notification.subject') | |
subject: default_i18n_subject(app_name: ArchiveConfig.APP_SHORT_NAME) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update: The comment is no longer needed! Just merge the current master branch into this PR branch and i18n-tasks will recognize default_i18n_subject
automatically.
Noting that besides the i18n review comments, the notification for bookmarks still needs to be added. |
Pull Request Checklist
as the first thing in your pull request title (e.g.
AO3-1234 Fix thing
)until they are reviewed and merged before creating new pull requests.
Issue
https://otwarchive.atlassian.net/browse/AO3-5610 (Please fill in issue number and remove this comment.)
Purpose
What does this PR do?
Testing Instructions
How can the Archive's QA team verify that this is working as you intended?
If you have a Jira account with access, please update or comment on the issue
with any new or missing testing instructions instead.
References
Are there other relevant issues/pull requests/mailing list discussions?
Credit
What name and pronouns should we use to credit you in the Archive of Our Own's Release Notes?
If you have a Jira account, please include the same name in the "Full name"
field on your Jira profile, so we can assign you the issues you're working on.
Please note that if you do not fill in this section, we will use your GitHub account name and
they/them pronouns.