修改:自己不能踩或顶自己
This commit is contained in:
parent
f16bec924c
commit
773b728828
|
@ -11,7 +11,10 @@ class PraiseTreadController < ApplicationController
|
||||||
@obj_type = params[:obj_type]
|
@obj_type = params[:obj_type]
|
||||||
@horizontal = params[:horizontal].downcase == "false" ? false:true
|
@horizontal = params[:horizontal].downcase == "false" ? false:true
|
||||||
@obj = find_object_by_type_and_id(@obj_type,@obj_id)
|
@obj = find_object_by_type_and_id(@obj_type,@obj_id)
|
||||||
praise_tread_plus(@obj_type,@obj_id,1)
|
unless @obj.author_id == User.current.id
|
||||||
|
praise_tread_plus(@obj_type,@obj_id,1)
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -47,7 +50,10 @@ class PraiseTreadController < ApplicationController
|
||||||
@obj_type = params[:obj_type]
|
@obj_type = params[:obj_type]
|
||||||
@horizontal = params[:horizontal].downcase == "false" ? false:true
|
@horizontal = params[:horizontal].downcase == "false" ? false:true
|
||||||
@obj = find_object_by_type_and_id(@obj_type,@obj_id)
|
@obj = find_object_by_type_and_id(@obj_type,@obj_id)
|
||||||
praise_tread_plus(@obj_type,@obj_id,0)
|
unless @obj.author_id == User.current.id
|
||||||
|
praise_tread_plus(@obj_type,@obj_id,0)
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -29,15 +29,26 @@
|
||||||
|
|
||||||
<% else %>
|
<% else %>
|
||||||
|
|
||||||
<table style="line-height: 1px">
|
<% if user_id == obj.author_id %>
|
||||||
<tr>
|
<table style="line-height: 1px">
|
||||||
<td > <%= link_to image_tag("/images/praise_tread/praise_true.png",weight:"22px", height:"22px",:title => l(:label_issue_praise)),
|
<tr>
|
||||||
:controller=>"praise_tread",:action=>"praise_plus",:remote=>true,:obj_id => obj.id,:obj_type => obj.class,:horizontal => horizontal %> </td>
|
<td ><%= image_tag "/images/praise_tread/praise_true.png" , weight:"22px", height:"22px",:title => l(:label_issue_not_praise_over) %></td>
|
||||||
<td align="center"><strong class="font_small_watch"><%= get_praise_num(obj)%></strong></td>
|
<td align="center"><strong class="font_small_watch"><%= get_praise_num(obj)%></strong></td>
|
||||||
<td> <%= link_to image_tag("/images/praise_tread/tread_true.png",weight:"22px", height:"22px",:title => l(:label_issue_tread)),:controller=>"praise_tread",
|
<td><%= image_tag "/images/praise_tread/tread_true.png",weight:"22px", height:"22px",:title => l(:label_issue_not_treed_over) %></td>
|
||||||
:action=>"tread_plus",:remote=>true,:obj_id => obj.id,:obj_type => obj.class,:horizontal => horizontal %></td>
|
</tr>
|
||||||
</tr>
|
</table>
|
||||||
</table>
|
<% else %>
|
||||||
|
<table style="line-height: 1px">
|
||||||
|
<tr>
|
||||||
|
<td > <%= link_to image_tag("/images/praise_tread/praise_true.png",weight:"22px", height:"22px",:title => l(:label_issue_praise)),
|
||||||
|
:controller=>"praise_tread",:action=>"praise_plus",:remote=>true,:obj_id => obj.id,:obj_type => obj.class,:horizontal => horizontal %> </td>
|
||||||
|
<td align="center"><strong class="font_small_watch"><%= get_praise_num(obj)%></strong></td>
|
||||||
|
<td> <%= link_to image_tag("/images/praise_tread/tread_true.png",weight:"22px", height:"22px",:title => l(:label_issue_tread)),:controller=>"praise_tread",
|
||||||
|
:action=>"tread_plus",:remote=>true,:obj_id => obj.id,:obj_type => obj.class,:horizontal => horizontal %></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
<!-- end -->
|
<!-- end -->
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
@ -80,20 +91,35 @@
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<% else %>
|
<% else %>
|
||||||
|
<% if user_id == obj.author_id %>
|
||||||
|
<table style="line-height: 1px">
|
||||||
|
<tr>
|
||||||
|
<td > <%= image_tag "/images/praise_tread/praise_true.png",weight:"22px", height:"22px", :title => l(:label_issue_not_praise_over) %></td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td align="center"><strong class="font_small_watch"><%= get_praise_num(obj)%></strong></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><%= image_tag "/images/praise_tread/tread_true.png",weight:"22px", height:"22px",:title => l(:label_issue_not_tread_over) %> </td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
<% else %>
|
||||||
|
<table style="line-height: 1px">
|
||||||
|
<tr>
|
||||||
|
<td > <%= link_to image_tag("/images/praise_tread/praise_true.png",weight:"22px", height:"22px",:title => l(:label_issue_praise)),
|
||||||
|
:controller=>"praise_tread",:action=>"praise_plus",:remote=>true,:obj_id => obj.id,:obj_type => obj.class ,:horizontal => horizontal %> </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td align="center"><strong class="font_small_watch"><%= get_praise_num(obj)%></strong></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td> <%= link_to image_tag("/images/praise_tread/tread_true.png",weight:"22px", height:"22px",:title => l(:label_issue_tread)),:controller=>"praise_tread",
|
||||||
|
:action=>"tread_plus",:remote=>true,:obj_id => obj.id,:obj_type => obj.class ,:horizontal => horizontal %></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
<table style="line-height: 1px">
|
|
||||||
<tr>
|
|
||||||
<td > <%= link_to image_tag("/images/praise_tread/praise_true.png",weight:"22px", height:"22px",:title => l(:label_issue_praise)),
|
|
||||||
:controller=>"praise_tread",:action=>"praise_plus",:remote=>true,:obj_id => obj.id,:obj_type => obj.class ,:horizontal => horizontal %> </td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td align="center"><strong class="font_small_watch"><%= get_praise_num(obj)%></strong></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td> <%= link_to image_tag("/images/praise_tread/tread_true.png",weight:"22px", height:"22px",:title => l(:label_issue_tread)),:controller=>"praise_tread",
|
|
||||||
:action=>"tread_plus",:remote=>true,:obj_id => obj.id,:obj_type => obj.class ,:horizontal => horizontal %></td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
<!-- end -->
|
<!-- end -->
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1537,6 +1537,8 @@ zh:
|
||||||
label_issue_tread: 烂问题,踩!
|
label_issue_tread: 烂问题,踩!
|
||||||
label_issue_praise_over: 我刚才顶过了~
|
label_issue_praise_over: 我刚才顶过了~
|
||||||
label_issue_tread_over: 我刚才踩过了~
|
label_issue_tread_over: 我刚才踩过了~
|
||||||
|
label_issue_not_praise_over: 不能顶自己~
|
||||||
|
label_issue_not_treed_over: 不能踩自己~
|
||||||
#end
|
#end
|
||||||
label_goto: 前往>>
|
label_goto: 前往>>
|
||||||
label_issue_appraise_over: 只能评价一次哦!
|
label_issue_appraise_over: 只能评价一次哦!
|
||||||
|
|
Loading…
Reference in New Issue