diff --git a/.gitignore b/.gitignore deleted file mode 100644 index af337a4e7..000000000 --- a/.gitignore +++ /dev/null @@ -1,23 +0,0 @@ -*.swp -/.project -/.idea -/.bundle -*.swp -/config/database.yml -/config/configuration.yml -/files/* -/log/* -/public/tmp/* -/tmp/* -/public/cache/* -.gitignore -/config/newrelic.yml -/public/images/avatars/* -/Gemfile -/Gemfile.lock -/db/schema.rb -/Gemfile.lock -/lib/plugins/acts_as_versioned/test/debug.log -.rbenv-gemsets -.DS_Store -public/api_doc/ diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb index 3ddf4ff6f..6a251a80c 100644 --- a/app/controllers/issues_controller.rb +++ b/app/controllers/issues_controller.rb @@ -156,7 +156,7 @@ class IssuesController < ApplicationController call_hook(:controller_issues_new_before_save, { :params => params, :issue => @issue }) @issue.save_attachments(params[:attachments] || (params[:issue] && params[:issue][:uploads])) # 给该issue在它所在的项目中所有的issues中所在的位置给一个序号 - @issue.project_issues_index = @issue.project.issues.last.project_issues_index + 1 + @issue.project_issues_index = @issue.project.issues.last.nil? ? 1 : @issue.project.issues.last.project_issues_index + 1 if @issue.save call_hook(:controller_issues_new_after_save, { :params => params, :issue => @issue}) respond_to do |format| diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index dbe292f76..30b2e7a21 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1841,7 +1841,7 @@ module ApplicationHelper # course_all_course_link = link_to l(:label_course_all), {:controller => 'courses', :action => 'index'} course_teacher_all_link = link_to l(:label_teacher_all), {:controller => 'users', :action => 'index', :role => 'teacher', :host => Setting.course_domain} # courses_link = link_to l(:label_course_practice), {:controller => 'courses', :action => 'index'} - users_link = link_to l(:label_software_user), {:controller => 'users', :action => 'index', :host => Setting.user_domain} + #users_link = link_to l(:label_software_user), {:controller => 'users', :action => 'index', :host => Setting.user_domain} # contest_link = link_to l(:label_contest_innovate), {:controller => 'contests', :action => 'index'} bids_link = link_to l(:label_requirement_enterprise), {:controller => 'bids', :action => 'index'} forum_link = link_to l(:label_forum_all), {:controller => "forums", :action => "index"} @@ -1860,7 +1860,7 @@ module ApplicationHelper nav_list.push(courses_link) if @nav_dispaly_course_label && @show_course == 1 # nav_list.push(projects_link) if @nav_dispaly_project_label - nav_list.push(users_link) if @nav_dispaly_user_label + #nav_list.push(users_link) if @nav_dispaly_user_label # nav_list.push(contest_link) if @nav_dispaly_contest_label && @show_contest == 1 nav_list.push(bids_link) if @nav_dispaly_bid_label nav_list.push(forum_link) if @nav_dispaly_forum_label diff --git a/app/models/message.rb b/app/models/message.rb index 413a4f91c..85a87132d 100644 --- a/app/models/message.rb +++ b/app/models/message.rb @@ -164,8 +164,11 @@ class Message < ActiveRecord::Base # Author lizanle # Description def act_as_forge_activity - self.forge_acts << ForgeActivity.new(:user_id => self.author_id, - :project_id => self.board.project.id) + # 如果project为空,那么就是课程相关的消息 + if !self.board.project.nil? + self.forge_acts << ForgeActivity.new(:user_id => self.author_id, + :project_id => self.board.project.id) + end end #更新用户分数 -by zjc diff --git a/app/models/news.rb b/app/models/news.rb index fa9f31712..d2547fc02 100644 --- a/app/models/news.rb +++ b/app/models/news.rb @@ -98,8 +98,11 @@ class News < ActiveRecord::Base # Author lizanle # Description 公用表中也要记录 def act_as_forge_activity - self.forge_acts << ForgeActivity.new(:user_id => self.author_id, - :project_id => self.project.id) + # 如果是project为空,那么是课程相关的,不需要保存 + if !self.project.nil? + self.forge_acts << ForgeActivity.new(:user_id => self.author_id, + :project_id => self.project.id) + end end end diff --git a/app/views/poll/_edit_head.html.erb b/app/views/poll/_edit_head.html.erb index dfa5b5cfc..c74453f6d 100644 --- a/app/views/poll/_edit_head.html.erb +++ b/app/views/poll/_edit_head.html.erb @@ -4,9 +4,14 @@