commit
4b998de820
@ -1,17 +1,57 @@
|
|||||||
<span id="praise">
|
<!-- get_praise_num(obj,1)函数中 1代表返回顶得次数 0返回踩的次数 -->
|
||||||
<% if is_praise_or_tread(obj,user_id).size > 0 %>
|
<div id="praise_tread_<%= obj.id %>" style="float:right;">
|
||||||
<%= image_tag("/images/praise.png") %>
|
|
||||||
<%= link_to "#{l(:label_cancel_praise)}",:controller=>"praise_tread",:action=>"praise_minus",:remote=>true,:obj => obj %>
|
<% @is_valuate = is_praise_or_tread(obj,user_id)%>
|
||||||
(<strong class="font_small_watch"><%= get_praise_num(obj)%></strong>)
|
<% if @is_valuate.size > 0 %> <!-- 评价过 1代表赞 0代表踩 -->
|
||||||
<% else %>
|
<% @flag = @is_valuate.first.praise_or_tread %>
|
||||||
<%= image_tag("/images/tread.png") %>
|
<% if @flag == 1 %> <!-- 顶过 -->
|
||||||
<%= link_to "#{l(:label_praise)}",:controller=>"praise_tread",:action=>"praise_plus",:remote=>true,:obj => obj %>
|
<table style="line-height: 1px">
|
||||||
(<strong class="font_small_watch"><%= get_praise_num(obj)%></strong>)
|
<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 %>
|
<% end %>
|
||||||
</span>
|
|
||||||
<% if show_flag %>
|
<% else %>
|
||||||
<span id="tread">
|
|
||||||
<%= link_to image_tag("/images/tread.png"),:controller=>"praise_tread",
|
<table style="line-height: 1px">
|
||||||
:action=>"tread_minus",:remote=>true,:obj => obj %>踩
|
<tr>
|
||||||
</span>
|
<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>
|
||||||
|
|
||||||
<% end %>
|
<% end %>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
$('#praise_tread').html('<%= j(
|
|
||||||
render :partial => "/praise_tread/praise_tread",:locals => {:obj => @obj,:show_flag => false,:user_id => User.current.id}
|
$('#praise_tread_<%= @obj.id %>').html('<%= j(
|
||||||
|
render :partial => "/praise_tread/praise_tread",:locals => {:obj => @obj,:user_id => User.current.id}
|
||||||
)%>');
|
)%>');
|
||||||
|
After Width: | Height: | Size: 3.6 KiB |
After Width: | Height: | Size: 3.7 KiB |
After Width: | Height: | Size: 3.7 KiB |
After Width: | Height: | Size: 3.7 KiB |
Loading…
Reference in new issue