修改部分项目关注不能及时更新Bug

This commit is contained in:
linhk 2014-09-05 11:22:10 +08:00
parent e99f9250c3
commit 20b8bf00b6
2 changed files with 7 additions and 7 deletions

View File

@ -12,7 +12,7 @@ class ProjectStatus < ActiveRecord::Base
# 但是 如果超级用户删除其他用户的话会造成读取错误 这里是遗漏点 # 但是 如果超级用户删除其他用户的话会造成读取错误 这里是遗漏点
# 删除用户时 此表创建人员未作相应删除动作 # 删除用户时 此表创建人员未作相应删除动作
def update_watchers_count(num) def update_watchers_count(num)
if self.watchers_count >= 0 if self.watchers_count||0 >= 0
self.update_attribute(:watchers_count, self.watchers_count.to_i + num) self.update_attribute(:watchers_count, self.watchers_count.to_i + num)
end end
end end

View File

@ -82,7 +82,7 @@
<% end %> <% end %>
<%= content_tag('span', link_to(files_count, file_project_path(@project)), :class => "info") %><%= content_tag('span', l(:label_x_data,:count => files_count)) %> <%= content_tag('span', link_to(files_count, file_project_path(@project)), :class => "info") %><%= content_tag('span', l(:label_x_data,:count => files_count)) %>
</p> </p>
</div> </div>
<% end %> <% end %>
@ -114,19 +114,19 @@
<% if(@project.project_type==1)%> <% if(@project.project_type==1)%>
&nbsp;&nbsp;&nbsp;<%= l(:label_course_college) %> &nbsp;&nbsp;&nbsp;<%= l(:label_course_college) %>
<%if @admin&&@admin.first&&@admin.first.user&&@admin.first.user.user_extensions%> <%if @admin&&@admin.first&&@admin.first.user&&@admin.first.user.user_extensions%>
<%= @admin.first.user.user_extensions.occupation %> <%= @admin.first.user.user_extensions.occupation %>
<% end %> <% end %>
<% end %> <% end %>
</div> </div>
<div class="licences"> <div class="licences">
<%= content_tag('span', "#{l(:label_create_time)}: ") %><%= content_tag('span', format_time(@project.created_on)) %> <%= content_tag('span', "#{l(:label_create_time)}: ") %><%= content_tag('span', format_time(@project.created_on)) %>
</div> </div>
<!-- added by bai --> <!-- added by bai -->
<div class="grade"> <div class="grade">
<% if @project.project_type !=1 %> <% if @project.project_type !=1 %>
<%= l(:label_project_grade)%>: <%= l(:label_project_grade)%>:
<span > <span >
<%= link_to(format("%.2f" , red_project_scores(@project) ).to_i, <%= link_to(format("%.2f" , red_project_scores(@project) ).to_i,
{:controller => 'projects', {:controller => 'projects',
@ -138,7 +138,7 @@
<!-- end --> <!-- end -->
<!-- added by liuping --> <!-- added by liuping -->
</span> </span>
</div> </div>