mirror of
https://github.com/discourse/discourse.git
synced 2024-11-27 08:53:38 +08: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
|
@ -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 New Issue
Block a user