Skip to content

Commit

Permalink
AO3-6017 Change anon comment case to guard clause
Browse files Browse the repository at this point in the history
  • Loading branch information
Bilka2 committed Jan 4, 2024
1 parent a66c3ab commit 8605ec3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app/helpers/mailer_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +181,10 @@ def style_work_tag_metadata(tags)
end

def commenter_pseud_or_name_link(comment)
return style_bold(t("roles.anonymous_creator")) if comment.by_anonymous_creator?

if comment.comment_owner.nil?
t("roles.commenter_name_html", name: style_bold(comment.comment_owner_name), role: style_role(t("roles.guest_with_parens")))
elsif comment.by_anonymous_creator?
style_bold(t("roles.anonymous_creator"))
else
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))
Expand All @@ -193,10 +193,10 @@ def commenter_pseud_or_name_link(comment)
end

def commenter_pseud_or_name_text(comment)
return t("roles.anonymous_creator") if comment.by_anonymous_creator?

if comment.comment_owner.nil?
t("roles.commenter_name_text", name: comment.comment_owner_name, role: t("roles.guest_with_parens"))
elsif comment.by_anonymous_creator?
t("roles.anonymous_creator")
else
role = comment.user.official ? t("roles.official_with_parens") : t("roles.registered_with_parens")
t("roles.commenter_name_text", name: text_pseud(comment.pseud), role: role)
Expand Down

0 comments on commit 8605ec3

Please sign in to comment.