2013-08-12 14:50:54 +08:00
|
|
|
<!-- get_praise_num(obj,1)函数中 1代表返回顶得次数 0返回踩的次数 -->
|
|
|
|
<div id="praise_tread_<%= obj.id %>" style="float:right;">
|
2013-08-11 23:44:12 +08:00
|
|
|
|
2013-08-12 14:50:54 +08:00
|
|
|
<% @is_valuate = is_praise_or_tread(obj,user_id)%>
|
|
|
|
<% if @is_valuate.size > 0 %> <!-- 评价过 1代表赞 0代表踩 -->
|
|
|
|
<% @flag = @is_valuate.first.praise_or_tread %>
|
|
|
|
<% if @flag == 1 %> <!-- 顶过 -->
|
|
|
|
<table style="line-height: 1px">
|
|
|
|
<tr>
|
|
|
|
<td ><%= image_tag("/images/praise_tread/praise_true.png") %></td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td align="center"><strong class="font_small_watch">+<%= get_praise_num(obj,1)%></strong></td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td><%= image_tag("/images/praise_tread/tread_false.png") %></td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
<% elsif @flag == 0 %> <!-- 踩过 0-->
|
|
|
|
<table style="line-height: 1px">
|
|
|
|
<tr>
|
|
|
|
<td > <%= image_tag("/images/praise_tread/praise_false.png") %></td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td align="center"><strong class="font_small_watch">-<%= get_praise_num(obj,0)%></strong></td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td><%= image_tag("/images/praise_tread/tread_true.png") %> </td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
<% end %>
|
2013-08-11 23:44:12 +08:00
|
|
|
|
2013-08-12 14:50:54 +08:00
|
|
|
<% else %>
|
|
|
|
|
|
|
|
<table style="line-height: 1px">
|
|
|
|
<tr>
|
|
|
|
<td > <%= link_to image_tag("/images/praise_tread/praise_false.png"),
|
|
|
|
:controller=>"praise_tread",:action=>"praise_plus",:remote=>true,:obj_id => obj.id,:obj_type => obj.class%> </td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td align="center">+<strong class="font_small_watch"><%= get_praise_num(obj,1)%></strong></td>
|
|
|
|
</tr>
|
|
|
|
<tr><td align="center">---</td></tr>
|
|
|
|
<tr>
|
|
|
|
<td align="center">-<strong class="font_small_watch"><%= get_praise_num(obj,0)%></strong></td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td> <%= link_to image_tag("/images/praise_tread/tread_false.png"),:controller=>"praise_tread",
|
|
|
|
:action=>"tread_plus",:remote=>true,:obj_id => obj.id,:obj_type => obj.class %></td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
2013-08-11 23:44:12 +08:00
|
|
|
|
2013-08-12 14:50:54 +08:00
|
|
|
<% end %>
|
|
|
|
</div>
|
2013-08-11 23:44:12 +08:00
|
|
|
|