没有昵称的用户显示为:匿名用户

个人主页留言换行
This commit is contained in:
sw 2015-08-01 15:14:45 +08:00
parent c200634c27
commit 11afcaf17c
3 changed files with 5 additions and 5 deletions

View File

@ -418,7 +418,7 @@ class User < Principal
end
def nickname(formatter = nil)
login
login.nil? || (login && login.empty?) ? "AnonymousUser" : login
end
def name(formatter = nil)

View File

@ -3,9 +3,9 @@
<div class="mes_box02" id = '<%= reply.id %>'>
<%= link_to image_tag(url_to_avatar(reply.user),:width => '32',:height => '32'), user_path(reply.user),:class => "users_pic_sub fl mr5" %>
<div class=" mes_box02_info fl">
<%= link_to "#{reply.user.login}&nbsp;".html_safe, user_path(reply.user),:class => 'course_name fl c_blue02 ', :target => "_blank"%>
<%= link_to "#{reply.user.nickname}&nbsp;".html_safe, user_path(reply.user),:class => 'course_name fl c_blue02 ', :target => "_blank"%>
<span class="fl c_grey">&nbsp;回复&nbsp;</span>
<%= link_to "#{parent_jour.user.login}&nbsp;:&nbsp;".html_safe, user_path(parent_jour.user),:class => 'course_name fl c_blue02 mr5 ', :target => "_blank"%>
<%= link_to "#{parent_jour.user.nickname}&nbsp;:&nbsp;".html_safe, user_path(parent_jour.user),:class => 'course_name fl c_blue02 mr5 ', :target => "_blank"%>
<div class="cl">
<%= reply.notes.html_safe %>
</div>

View File

@ -1,8 +1,8 @@
<div class="message_list" id="<%= jour.id %>" nhname="rec" data-id="<%= jour.id %>">
<div class="message_list break_word" id="<%= jour.id %>" nhname="rec" data-id="<%= jour.id %>">
<%= link_to image_tag(url_to_avatar(jour.user),:width => '46',:height => '46'), user_path(jour.user),:class => "users_pic fl" %>
<div class="fl ml5 mes_box mb10" >
<div>
<%= link_to "#{jour.user.login}&nbsp;:&nbsp;".html_safe, user_path(jour.user),:class => 'fl c_blue02 f14 fb mb5', :target => "_blank"%>
<%= link_to "#{jour.user.nickname}&nbsp;:&nbsp;".html_safe, user_path(jour.user),:class => 'fl c_blue02 f14 fb mb5', :target => "_blank"%>
</div>
<div class="cl"></div>
<div>