修改帖子显示用户名与链接问题
This commit is contained in:
parent
aed4b250a0
commit
973a59042c
|
@ -456,6 +456,14 @@ module ApplicationHelper
|
|||
def added_time(created)
|
||||
l(:label_added_time, :age => time_tag(created)).html_safe
|
||||
end
|
||||
|
||||
def user_url_and_time(user_name, user_url, created)
|
||||
unless user_name.nil?
|
||||
l(:label_added_time_by, :author => link_to(user_name, user_url), :age => time_tag(created)).html_safe
|
||||
else
|
||||
l(:label_added_time, :age => time_tag(created)).html_safe
|
||||
end
|
||||
end
|
||||
|
||||
#huang
|
||||
def betweentime(enddate)
|
||||
|
|
|
@ -62,7 +62,7 @@
|
|||
<% if @memo.author %>
|
||||
<%= authoring @memo.created_at, @memo.author.name %>
|
||||
<% else %>
|
||||
<%= added_time @memo.created_at %>
|
||||
<%= user_url_and_time @memo.username, @memo.userhomeurl, @memo.created_at %>
|
||||
<% end %></div>
|
||||
<div class="tags">
|
||||
<div id="tags">
|
||||
|
@ -142,7 +142,7 @@
|
|||
<% if reply.author %>
|
||||
<%= authoring reply.created_at, reply.author.name %>
|
||||
<% else %>
|
||||
<%= added_time reply.created_at %>
|
||||
<%= user_url_and_time reply.username, reply.userhomeurl, reply.created_at %>
|
||||
<% end %></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
|
Loading…
Reference in New Issue