diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 5c9fa7fce..abe9e3291 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -348,7 +348,7 @@ class ProjectsController < ApplicationController end def new - @project_type = params[:project_type] + @project_type = params[:project_type] ||= params[:course] @issue_custom_fields = IssueCustomField.sorted.all @trackers = Tracker.sorted.all @@ -362,9 +362,9 @@ class ProjectsController < ApplicationController @course_tag = params[:course] @course = Course.new @course.safe_attributes = params[:course] - else - render_404 - return -1 + else # default Project + @project = Project.new + @project.safe_attributes = params[:project] end render :layout => 'base' end @@ -851,8 +851,7 @@ class ProjectsController < ApplicationController def select_project_layout project = Project.find_by_id(params[:id]) - project ||= @project - project ||= @course + project ||= @project ||= @course ||= params[:course] ||= params[:project_type] (project.try(:project_type) == Project::ProjectType_project) ? 'base_projects' : 'base_courses' end diff --git a/app/views/projects/_course.html.erb b/app/views/projects/_course.html.erb index 2ea16a3ce..f55a80db3 100644 --- a/app/views/projects/_course.html.erb +++ b/app/views/projects/_course.html.erb @@ -47,6 +47,7 @@

+ <% if @project.project_type==Project::ProjectType_course %> <% if(course_endTime_timeout? @project) %> 课程学期已结束 @@ -54,6 +55,7 @@ <% else %> <%= join_in_course_for_list(@project, User.current,['regular'])%> <% end -%> + <% end %>