积分少于2分时不能踩人
This commit is contained in:
parent
e1672fd0e0
commit
42285ce44d
|
@ -1,4 +1,14 @@
|
|||
class OptionNumber < ActiveRecord::Base
|
||||
attr_accessible :attachment, :changeset, :document, :follow, :issue_done_ratio, :issues_status, :memo, :messages_for_issues, :post_issue, :praise_by_one, :praise_by_three, :praise_by_two, :replay_for_memo, :replay_for_message, :score_type, :total_score, :tread, :tread_by_one, :tread_by_three, :tread_by_two, :user_id
|
||||
|
||||
def self.get_user_option_number user_id
|
||||
result = nil
|
||||
unless user_id.nil?
|
||||
ons = OptionNumber.find_all_by_user_id(user_id);
|
||||
unless (ons .nil? && ons.count > 0)
|
||||
result = ons.first
|
||||
end
|
||||
end
|
||||
result
|
||||
end
|
||||
end
|
||||
|
|
|
@ -38,15 +38,28 @@
|
|||
</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>
|
||||
<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>
|
||||
<!-- 积分少于2分不能踩帖 -->
|
||||
<% if OptionNumber.get_user_option_number(user_id).nil? || OptionNumber.get_user_option_number(user_id).total_score < 2 %>
|
||||
<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><%= image_tag "/images/praise_tread/tread_true.png",weight:"22px", height:"22px",:title => l(:label_issues_score_not_enough) %></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>
|
||||
<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 -->
|
||||
|
@ -105,19 +118,36 @@
|
|||
</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>
|
||||
<% if OptionNumber.get_user_option_number(user_id).nil? || OptionNumber.get_user_option_number(user_id).total_score < 2 %>
|
||||
<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><%= image_tag "/images/praise_tread/tread_true.png",weight:"22px", height:"22px",:title => l(:label_issues_score_not_enough) %> </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 %>
|
||||
|
||||
<% end %>
|
||||
|
||||
<!-- end -->
|
||||
|
|
|
@ -1589,6 +1589,7 @@ zh:
|
|||
label_issue_tread_over: 我刚才踩过了~
|
||||
label_issue_not_praise_over: 不能顶自己~
|
||||
label_issue_not_treed_over: 不能踩自己~
|
||||
label_issues_score_not_enough: 积分不够,不能踩别人~
|
||||
#end
|
||||
label_goto: 前往>>
|
||||
label_issue_appraise_over: 只能评价一次哦!
|
||||
|
|
Loading…
Reference in New Issue