2016-04-24 12:48:03 +08:00
|
|
|
|
<% if PraiseTread.praised(activity) %>
|
2017-02-21 14:38:05 +08:00
|
|
|
|
<a href='<%= praise_tread_praise_plus_path({:obj_id => activity.id,
|
|
|
|
|
:obj_type => activity.class,
|
|
|
|
|
:user_activity_id => user_activity_id,
|
|
|
|
|
:type => type }) %>'
|
|
|
|
|
data-remote="true"
|
|
|
|
|
class="<%= type == 'reply'? 'fr' : 'ml15' %> likeButton"
|
|
|
|
|
title="点赞" >
|
2016-01-18 15:12:47 +08:00
|
|
|
|
<span class="likeText">赞</span>
|
2016-09-23 16:44:49 +08:00
|
|
|
|
<% num = activity.praise_tread_cache ? activity.praise_tread_cache.praise_num : 0 %>
|
2016-10-14 16:16:35 +08:00
|
|
|
|
<span class="likeNum"><%= (num.nil? ? 0 : num) > 0 ? "(#{(num.nil? ? 0 : num)})" : "" %></span>
|
2016-01-18 15:12:47 +08:00
|
|
|
|
</a>
|
2016-01-13 16:32:05 +08:00
|
|
|
|
<% else %>
|
2017-02-21 14:38:05 +08:00
|
|
|
|
<a href='<%= praise_tread_praise_minus_path({:obj_id => activity.id,
|
|
|
|
|
:obj_type => activity.class,
|
|
|
|
|
:user_activity_id => user_activity_id,
|
|
|
|
|
:type => type }) %>'
|
|
|
|
|
data-remote="true"
|
|
|
|
|
class="<%= type == 'reply'? 'fr' : 'ml15' %> likeButton"
|
|
|
|
|
title="取消点赞" >
|
2016-01-18 15:12:47 +08:00
|
|
|
|
<span class="likeText">已赞</span>
|
2016-09-23 16:44:49 +08:00
|
|
|
|
<% num = activity.praise_tread_cache ? activity.praise_tread_cache.praise_num : 0 %>
|
2016-10-14 16:16:35 +08:00
|
|
|
|
<span class="likeNum"><%= (num.nil? ? 0 : num) > 0 ? "(#{(num.nil? ? 0 : num)})" : "" %></span>
|
2016-01-18 15:12:47 +08:00
|
|
|
|
</a>
|
2016-01-13 16:32:05 +08:00
|
|
|
|
<% end %>
|