refactory projectController#new
This commit is contained in:
parent
a101be344c
commit
5fb29c150b
|
@ -485,18 +485,24 @@ class ProjectsController < ApplicationController
|
|||
end
|
||||
|
||||
def new
|
||||
@project_type = params[:project_type]
|
||||
@course_tag = params[:course]
|
||||
@project_type = params[:project_type]
|
||||
@issue_custom_fields = IssueCustomField.sorted.all
|
||||
@trackers = Tracker.sorted.all
|
||||
@project = Project.new
|
||||
@project.safe_attributes = params[:project]
|
||||
@trackers = Tracker.sorted.all
|
||||
|
||||
##TODO: , viewed by nyan
|
||||
##add by huang
|
||||
@course=Course.new
|
||||
@course.safe_attributes = params[:course]
|
||||
##end
|
||||
case @project_type
|
||||
when '0' # Project
|
||||
@project = Project.new
|
||||
@project.safe_attributes = params[:project]
|
||||
when '1' # Course
|
||||
@project = Project.new
|
||||
@project.safe_attributes = params[:project]
|
||||
@course_tag = params[:course]
|
||||
@course = Course.new
|
||||
@course.safe_attributes = params[:course]
|
||||
else
|
||||
render_404
|
||||
return -1
|
||||
end
|
||||
render :layout => 'base'
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue