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 @@
- - - - - - - + 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 %>

-

<%= f.text_field :homepage, :size => 60, :style => "width:488px;margin-left: 10px;" %>

+ <%= f.fields_for @course do |m| %> -

<%= m.text_field :name,:required => true, :size => 60, :style => "width:488px;margin-left: 10px;" %>

-

<%= m.text_field :time, :size => 60, :style => "width:488px;margin-left: 10px;" %>

-

<%= m.text_field :code, :size => 60, :style => "width:488px;margin-left: 10px;" %>

-

<%= m.text_field :location, :size => 60, :style => "width:488px;margin-left: 10px;" %>

+ +

<%= m.text_field :time, :required => true, :size => 60, :style => "width:488px;margin-left: 10px;" %>

+

<%= m.text_field :state, :size => 60, :style => "width:488px;margin-left: 10px;" %>

+ <% end %> -

<%= f.check_box :is_public, :style => "margin-left:10px;" %>

+

<%= f.text_field :project_type, :value => 1 %>

diff --git a/config/locales/zh.yml b/config/locales/zh.yml index 7cd90ad3..6ee17ac0 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -221,6 +221,7 @@ zh: field_location: 工作单位 field_couurse_time: 学时 field_course_code: 学分 + field_state: 设置口令 #end field_description: 描述 field_summary: 摘要
教师名称:<%= @course.name%>
所在单位:<%= @course.location%>
课程学分:<%= @course.code%>课程学时:<%= @course.state%>
课程学时:<%= @course.time%>