Skip to content

Commit

Permalink
AO3-6548 Use pseud helpers in comment emails and fix kudos image disp…
Browse files Browse the repository at this point in the history
…lay (otwcode#4691)

* AO3-6548 Re-add bold style

* AO3-6548-3 Fix kudos icon

* AO3-6548 Found a way to do this without changing the HTML

* AO3-6548 Move kudos icon up a bit

* AO3-6548 Update imageset and change to style_pseud_link

* AO3-6548 whoops forgot about this

* AO3-6548 Revert kudos CSS and add helpers to admin_mailers

* AO3-6548 Formatting

* AO3-6548 Remove extra whitespace

* AO3-6548 Fix visual bug on Firefox
  • Loading branch information
EchoEkhi authored Dec 22, 2023
1 parent 15cad10 commit cb58df0
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 20 deletions.
4 changes: 2 additions & 2 deletions app/helpers/mailer_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ def commenter_pseud_or_name_link(comment)
elsif comment.by_anonymous_creator?
style_bold(t("roles.anonymous_creator"))
else
style_link(comment.comment_owner_name, polymorphic_url(comment.comment_owner, only_path: false))
style_pseud_link(comment.pseud)
end
end

Expand All @@ -196,7 +196,7 @@ def commenter_pseud_or_name_text(comment)
elsif comment.by_anonymous_creator?
t("roles.anonymous_creator")
else
"#{comment.comment_owner_name} (#{polymorphic_url(comment.comment_owner, only_path: false)})"
text_pseud(comment.pseud)
end
end

Expand Down
8 changes: 1 addition & 7 deletions app/views/admin_mailer/comment_notification.html.erb
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
<% content_for :message do %>

<% if @comment.comment_owner %>
<b><%= style_link(@comment.comment_owner_name, polymorphic_url(@comment.comment_owner, :only_path => false)) %></b>
<% else %>
<%= style_bold(@comment.comment_owner_name) %>
<% end %>

left the following comment on
<%= commenter_pseud_or_name_link(@comment) %> left the following comment on

<% if @comment.ultimate_parent.is_a?(Tag) %>
the tag
Expand Down
2 changes: 1 addition & 1 deletion app/views/admin_mailer/comment_notification.text.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<% content_for :message do %>
<%= @comment.comment_owner_name %> <% if @comment.comment_owner then %>(<%= polymorphic_url(@comment.comment_owner, :only_path => false) %>) <% end %>left the following comment on
<%= commenter_pseud_or_name_text(@comment) %> left the following comment on
<% if @comment.ultimate_parent.is_a?(Tag) then %>the tag "<%= @comment.ultimate_parent.commentable_name %>" (<%= url_for(:controller => :tags, :action => :show, :id => @comment.ultimate_parent, :only_path => false) %>) <% else %>"<%= @comment.ultimate_parent.commentable_name.html_safe %>" (<%= polymorphic_url(@comment.ultimate_parent, :only_path => false) %>)<% end %>:
<%= text_divider %>

Expand Down
8 changes: 1 addition & 7 deletions app/views/admin_mailer/edited_comment_notification.html.erb
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
<% content_for :message do %>

<% if @comment.comment_owner %>
<b><%= style_link(@comment.comment_owner_name, polymorphic_url(@comment.comment_owner, :only_path => false)) %></b>
<% else %>
<%= style_bold(@comment.comment_owner_name) %>
<% end %>
<%= commenter_pseud_or_name_link(@comment) %> edited the following comment on

edited the following comment on

<% if @comment.ultimate_parent.is_a?(Tag) %>
the tag
<%= style_link(@comment.ultimate_parent.commentable_name, {:controller => :tags, :action => :show, :id => @comment.ultimate_parent.to_param, :only_path => false}) %>:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<% content_for :message do %>
<%= @comment.comment_owner_name %> <% if @comment.comment_owner then %>(<%= polymorphic_url(@comment.comment_owner, :only_path => false) %>) <% end %>edited the following comment on
<%= commenter_pseud_or_name_text(@comment) %> edited the following comment on
<% if @comment.ultimate_parent.is_a?(Tag) then %>the tag "<%= @comment.ultimate_parent.commentable_name %>" (<%= url_for(:controller => :tags, :action => :show, :id => @comment.ultimate_parent, :only_path => false) %>) <% else %>"<%= @comment.ultimate_parent.commentable_name.html_safe %>" (<%= polymorphic_url(@comment.ultimate_parent, :only_path => false) %>)<% end %>:
<%= text_divider %>

Expand Down
Binary file modified public/images/imageset.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion public/stylesheets/site/2.0/10-types-groups.css
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ p.kudos {
background: url("/images/imageset.png") no-repeat -111px -580px;
padding: 0.5em 0.5em 0.5em 60px;
margin: 2em 0;
min-height: 40px;
min-height: 50px;
}

.icon {
Expand Down
2 changes: 1 addition & 1 deletion public/stylesheets/site/2.0/15-group-comments.css
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ div.comment, li.comment {
}

.comment .icon .anonymous {
background: url("/images/imageset.png") no-repeat -100px -635px;
background: url("/images/imageset.png") no-repeat -0px -735px;
display: block;
}

Expand Down

0 comments on commit cb58df0

Please sign in to comment.