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