diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 2769b473..6ec741b3 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -486,6 +486,8 @@ class ProjectsController < ApplicationController # if @course_tag == '1' if @project.project_type == 1 render :layout => 'base_courses' + else + render :layout => 'base_projects' end #Ended by young end diff --git a/app/models/course.rb b/app/models/course.rb index be335ec4..f5e00a09 100644 --- a/app/models/course.rb +++ b/app/models/course.rb @@ -1,16 +1,18 @@ class Course < ActiveRecord::Base include Redmine::SafeAttributes - attr_accessible :code, :extra, :name, :state, :tea_id, :time , :location + attr_accessible :code, :extra, :name, :state, :tea_id, :time , :location, :state belongs_to :project, :class_name => 'Project', :foreign_key => :extra has_many :bid - validates_presence_of :code, :time, :location, :name + validates_presence_of :time safe_attributes 'extra', 'time', 'name', 'extra', 'code', - 'location' + 'location', + 'tea_id', + 'state' end diff --git a/app/views/layouts/base_courses.html.erb b/app/views/layouts/base_courses.html.erb index e9976f4a..cbe8c7b5 100644 --- a/app/views/layouts/base_courses.html.erb +++ b/app/views/layouts/base_courses.html.erb @@ -69,13 +69,7 @@
教师名称: | <%= @course.name%> | -||
所在单位: | <%= @course.location%> | -||
课程学分: | <%= @course.code%> | +课程学时: | <%= @course.state%> |
课程学时: | <%= @course.time%> | diff --git a/app/views/projects/_course_form.html.erb b/app/views/projects/_course_form.html.erb index 34de1fde..cf7d417c 100644 --- a/app/views/projects/_course_form.html.erb +++ b/app/views/projects/_course_form.html.erb @@ -10,14 +10,14 @@ <% unless @project.identifier_frozen? %> <%= l(:text_length_between, :min => 1, :max => Project::IDENTIFIER_MAX_LENGTH) %> <%= l(:text_project_identifier_info).html_safe %> <% end %> -