From 20b8bf00b6c224a546f3ed5d4ebe79d2510d1d73 Mon Sep 17 00:00:00 2001 From: linhk <304431313@.com> Date: Fri, 5 Sep 2014 11:22:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=83=A8=E5=88=86=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E5=85=B3=E6=B3=A8=E4=B8=8D=E8=83=BD=E5=8F=8A=E6=97=B6?= =?UTF-8?q?=E6=9B=B4=E6=96=B0Bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/project_status.rb | 2 +- app/views/projects/_project.html.erb | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/models/project_status.rb b/app/models/project_status.rb index c3d306c58..7fd246234 100644 --- a/app/models/project_status.rb +++ b/app/models/project_status.rb @@ -12,7 +12,7 @@ class ProjectStatus < ActiveRecord::Base # 但是 如果超级用户删除其他用户的话会造成读取错误 这里是遗漏点 # 删除用户时 此表创建人员未作相应删除动作 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) end end diff --git a/app/views/projects/_project.html.erb b/app/views/projects/_project.html.erb index 004fb38ac..6f2354d66 100644 --- a/app/views/projects/_project.html.erb +++ b/app/views/projects/_project.html.erb @@ -82,7 +82,7 @@ <% end %> <%= content_tag('span', link_to(files_count, file_project_path(@project)), :class => "info") %><%= content_tag('span', l(:label_x_data,:count => files_count)) %>

- + <% end %> @@ -114,19 +114,19 @@ <% if(@project.project_type==1)%>    <%= l(:label_course_college) %>: <%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 %>
<%= content_tag('span', "#{l(:label_create_time)}: ") %><%= content_tag('span', format_time(@project.created_on)) %>
- +
- + <% if @project.project_type !=1 %> - <%= l(:label_project_grade)%>: + <%= l(:label_project_grade)%>: <%= link_to(format("%.2f" , red_project_scores(@project) ).to_i, {:controller => 'projects', @@ -138,7 +138,7 @@ - +