-
Notifications
You must be signed in to change notification settings - Fork 524
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-6017 Add role of commenter to comment notification emails #4683
AO3-6017 Add role of commenter to comment notification emails #4683
Conversation
style_link(comment.comment_owner_name, polymorphic_url(comment.comment_owner, only_path: false)) | ||
role = comment.user.official ? t("roles.official_with_parens") : t("roles.registered_with_parens") | ||
pseud_link = style_link(comment.pseud.byline, user_pseud_url(comment.user, comment.pseud)) | ||
t("roles.commenter_name_html", name: style_bold(pseud_link), role: style_role(role)) | ||
end | ||
end |
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.
Not 100% sold myself, but might be more manageable with smaller scope if
like:
if comment.by_anonymous_creator?
return style_bold(t("roles.anonymous_creator"))
end
name =
if comment.comment_owner.nil?
comment.comment_owner_name
else
style_link(comment.pseud.byline, user_pseud_url(comment.user, comment.pseud))
end
role =
if comment.comment_owner.nil?
t("roles.guest_with_parens")
elsif comment.user.official
t("roles.official_with_parens")
else
t("roles.registered_with_parens")
end
t("roles.commenter_name_html", name: style_bold(name), role: style_role(role))
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 like the idea of turning the anon comment into a guard clause like
return style_bold(t("roles.anonymous_creator")) if comment.by_anonymous_creator?
but I don't know about the rest of the conditions.
Co-authored-by: Brian Austin <13002992+brianjaustin@users.noreply.github.com>
Would have been nice if GitHub allowed me to do that in my browser
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.
Thank you!
In text mails the indentation ends up in the emails, which is not desired
Issue
https://otwarchive.atlassian.net/browse/AO3-6017
Purpose
Adds the role of the commenter to comment notification emails. This marks logged-in users either as registered or official.
Add mailer previews for some comment notification emails, to cover all the different permutations of the pseud/user text (default pseud, different pseud, official, guest, anonymous creator).
Add tests for the commenter name display changes, including showing the username for comments left with pseuds and adding
(Guest)
for guest commenters from AO3-6548.Testing Instructions
See Jira.
Credit
Bilka (he/him)