parent
1a57b3c6a7
commit
7a0db3b3f1
@ -1,17 +1,22 @@
|
||||
<span id="praise">
|
||||
<% if is_praise_or_tread(obj,user_id).size > 0 %>
|
||||
<%= image_tag("/images/praise.png") %>
|
||||
<%= link_to "#{l(:label_cancel_praise)}",:controller=>"praise_tread",:action=>"praise_minus",:remote=>true,:obj => obj %>
|
||||
(<strong class="font_small_watch"><%= get_praise_num(obj)%></strong>)
|
||||
<% else %>
|
||||
<%= image_tag("/images/tread.png") %>
|
||||
<%= link_to "#{l(:label_praise)}",:controller=>"praise_tread",:action=>"praise_plus",:remote=>true,:obj => obj %>
|
||||
(<strong class="font_small_watch"><%= get_praise_num(obj)%></strong>)
|
||||
<span id="praise_tread">
|
||||
<% @is_valuate = is_praise_or_tread(obj,user_id)%>
|
||||
|
||||
<% if @is_valuate.size > 0 %>
|
||||
|
||||
<% @flag = @is_valuate.first.praise_or_tread %>
|
||||
<% if @flag == 1 %> <!-- praise 1 -->
|
||||
<%= image_tag("/images/praise_tread/praise_true.png") %> <strong class="font_small_watch"><%= get_praise_num(obj)%></strong> <%= image_tag("/images/praise_tread/tread_false.png") %>
|
||||
|
||||
<% elsif @flag == 0 %> <!-- tread 0-->
|
||||
<%= image_tag("/images/praise_tread/praise_false.png") %> <strong class="font_small_watch"><%= get_praise_num(obj)%></strong> <%= image_tag("/images/praise_tread/tread_true.png") %>
|
||||
<% end %>
|
||||
|
||||
<% else %>
|
||||
|
||||
<%= 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 %> <strong class="font_small_watch"><%= get_praise_num(obj)%></strong> <%= 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 %>
|
||||
|
||||
<% end %>
|
||||
</span>
|
||||
<% if show_flag %>
|
||||
<span id="tread">
|
||||
<%= link_to image_tag("/images/tread.png"),:controller=>"praise_tread",
|
||||
:action=>"tread_minus",:remote=>true,:obj => obj %>踩
|
||||
</span>
|
||||
<% end %>
|
||||
|
||||
|
@ -1,3 +1,3 @@
|
||||
$('#praise_tread').html('<%= j(
|
||||
render :partial => "/praise_tread/praise_tread",:locals => {:obj => @obj,:show_flag => false,:user_id => User.current.id}
|
||||
render :partial => "/praise_tread/praise_tread",:locals => {:obj => @obj,:user_id => User.current.id}
|
||||
)%>');
|
||||
|
Loading…
Reference in new issue