mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 09:36:19 -05:00
FIX: Don't display names on emails if display_name_on_posts
is false
Note that `enable_names` was always respected.
This commit is contained in:
parent
839416212e
commit
5c7d6e0a3c
2 changed files with 8 additions and 1 deletions
|
@ -54,6 +54,13 @@ module UserNotificationsHelper
|
|||
raw format_for_email(html)
|
||||
end
|
||||
|
||||
def show_name_on_post(post)
|
||||
SiteSetting.enable_names? &&
|
||||
SiteSetting.display_name_on_posts? &&
|
||||
post.user.name.present? &&
|
||||
post.user.name != post.user.username
|
||||
end
|
||||
|
||||
def format_for_email(html)
|
||||
PrettyText.format_for_email(html).html_safe
|
||||
end
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
</td>
|
||||
<td>
|
||||
<a class="username" href="<%=Discourse.base_url%>/users/<%= post.user.username_lower%>" target="_blank"><%= post.user.username %></a>
|
||||
<%- if SiteSetting.enable_names? && post.user.name.present? && post.user.name != post.user.username %>
|
||||
<%- if show_name_on_post(post) %>
|
||||
<a class="user-name" href="<%=Discourse.base_url%>/users/<%= post.user.username_lower%>" target="_blank"><%= post.user.name %></a>
|
||||
<% end %>
|
||||
<%- if post.user.title.present? %>
|
||||
|
|
Loading…
Reference in a new issue