This commit is contained in:
huangjingquan 2013-09-12 17:25:40 +08:00
parent 602e3dc3fa
commit 7aa5eef2e4
5 changed files with 15 additions and 16 deletions

View File

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

View File

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

View File

@ -69,13 +69,7 @@
<div class="inf_user_context">
<table style="font-family:微软雅黑" width="220">
<tr>
<td style="padding-left: 8px" width="80px">教师名称:</td><td class="font_lighter_sidebar" width="140px"><%= @course.name%></td>
</tr>
<tr>
<td style="padding-left: 8px">所在单位:</td><td class="font_lighter_sidebar"><%= @course.location%></td>
</tr>
<tr>
<td style="padding-left: 8px">课程学分:</td><td class="font_lighter_sidebar"><%= @course.code%></td>
<td valign="top" style="padding-left: 8px;">课程学时:</td><td class="font_lighter_sidebar"><%= @course.state%></td>
</tr>
<tr>
<td valign="top" style="padding-left: 8px;">课程学时:</td><td class="font_lighter_sidebar"><%= @course.time%></td>

View File

@ -10,14 +10,14 @@
<% unless @project.identifier_frozen? %>
<em class="info"><%= l(:text_length_between, :min => 1, :max => Project::IDENTIFIER_MAX_LENGTH) %> <%= l(:text_project_identifier_info).html_safe %></em>
<% end %></p>
<p style="margin-left:-10px;"><%= f.text_field :homepage, :size => 60, :style => "width:488px;margin-left: 10px;" %></p>
<%= f.fields_for @course do |m| %>
<p style="margin-left:-10px;"><%= m.text_field :name,:required => true, :size => 60, :style => "width:488px;margin-left: 10px;" %></p>
<p style="margin-left:-10px;"><%= m.text_field :time, :size => 60, :style => "width:488px;margin-left: 10px;" %></p>
<p style="margin-left:-10px;"><%= m.text_field :code, :size => 60, :style => "width:488px;margin-left: 10px;" %></p>
<p style="margin-left:-10px;"><%= m.text_field :location, :size => 60, :style => "width:488px;margin-left: 10px;" %></p>
<p style="margin-left:-10px;"><%= m.text_field :time, :required => true, :size => 60, :style => "width:488px;margin-left: 10px;" %></p>
<p style="margin-left:-10px;"><%= m.text_field :state, :size => 60, :style => "width:488px;margin-left: 10px;" %></p>
<% end %>
<p style="margin-left:-10px;"><%= f.check_box :is_public, :style => "margin-left:10px;" %></p>
<!-- <p style="margin-left:-10px;"><%= f.check_box :is_public, :style => "margin-left:10px;" %></p> -->
<p style="display:none;"><%= f.text_field :project_type, :value => 1 %></p>

View File

@ -221,6 +221,7 @@ zh:
field_location: 工作单位
field_couurse_time: 学时
field_course_code: 学分
field_state: 设置口令
#end
field_description: 描述
field_summary: 摘要