diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb
index 898ed5da2..981808017 100644
--- a/app/controllers/projects_controller.rb
+++ b/app/controllers/projects_controller.rb
@@ -341,6 +341,7 @@ class ProjectsController < ApplicationController
@course = Course.new
@course.extra=params[:project][:identifier]
@course.safe_attributes = params[:project][:course]
+ @course.tea_id = User.current.id
@course.save
# project = ProjectInfo.create(:user_id => User.current.id, :project_id => @project.id)
# project_status = ProjectStatus.create(:project_id => @project.id)
diff --git a/app/models/course.rb b/app/models/course.rb
index f5e00a09a..4d0fe8378 100644
--- a/app/models/course.rb
+++ b/app/models/course.rb
@@ -3,8 +3,9 @@ class Course < ActiveRecord::Base
attr_accessible :code, :extra, :name, :state, :tea_id, :time , :location, :state
belongs_to :project, :class_name => 'Project', :foreign_key => :extra
+ belongs_to :teacher, :class_name => 'User', :foreign_key => :tea_id # 定义一个方法teacher,该方法通过tea_id来调用User表
has_many :bid
- validates_presence_of :time
+ validates_presence_of :state
safe_attributes 'extra',
'time',
'name',
diff --git a/app/views/layouts/base_courses.html.erb b/app/views/layouts/base_courses.html.erb
index 83d4f4add..76ac17079 100644
--- a/app/views/layouts/base_courses.html.erb
+++ b/app/views/layouts/base_courses.html.erb
@@ -69,11 +69,14 @@
- 课程学时: |
+ 课程口令: |
+
+
- 课程学时: |
-
+ 主讲老师: |
+
+
@@ -85,12 +88,18 @@
+ <% if @project.description.size>0 %>
+ <% else %>
+
+ <% end %>
- <%= l(:label_create_time) %>:<%= @project.created_on %>
+ <%= l(:label_create_time) %>:<%= format_time(@project.created_on) %>
diff --git a/app/views/layouts/base_homework.html.erb b/app/views/layouts/base_homework.html.erb
index 896a8dd61..818e16b7c 100644
--- a/app/views/layouts/base_homework.html.erb
+++ b/app/views/layouts/base_homework.html.erb
@@ -110,8 +110,8 @@
- <%= link_to l(:label_question_student), { :controller => 'bids', :action => 'show' },:class => link_class(:respond)%>
- <%= link_to l(:label_homework_commit), { :controller => 'bids', :action => 'show_project' },:class => link_class(:project)%>
- - <%= link_to l(:label_homework_respond), { :controller => 'bids', :action => 'homework_respond' },:class => link_class(:homework_respond)%>
-
+
<%= yield %>
<%= call_hook :view_layouts_base_content %>
diff --git a/app/views/projects/_course_form.html.erb b/app/views/projects/_course_form.html.erb
index 7f3073488..91700c1ef 100644
--- a/app/views/projects/_course_form.html.erb
+++ b/app/views/projects/_course_form.html.erb
@@ -13,8 +13,9 @@
<% if @project.new_record? %>
<%= f.fields_for @course do |m| %>
- <%= 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;" %>
+
+ <%= m.text_field :state, :required => true, :size => 60, :style => "width:488px;margin-left: 10px;" %>
+ <%= l(:text_command) %>
<% end %>
<% end %>
diff --git a/app/views/tags/_tag_name.html.erb b/app/views/tags/_tag_name.html.erb
index d123b9053..49a81da2a 100644
--- a/app/views/tags/_tag_name.html.erb
+++ b/app/views/tags/_tag_name.html.erb
@@ -35,7 +35,7 @@
<% end %>
<% else %>
- <%= l(:label_tags_no) %>
+ <%= l(:label_tags_no) %>
<% end %>
<% end %>
\ No newline at end of file
diff --git a/config/locales/zh.yml b/config/locales/zh.yml
index b40dbe436..36f7e558b 100644
--- a/config/locales/zh.yml
+++ b/config/locales/zh.yml
@@ -221,7 +221,7 @@ zh:
field_location: 工作单位
field_couurse_time: 学时
field_course_code: 学分
- field_state: 设置口令
+ field_state: 加入课程口令
#end
field_description: 描述
field_summary: 摘要
@@ -951,6 +951,7 @@ zh:
text_caracters_maximum: "最多 %{count} 个字符。"
text_caracters_minimum: "至少需要 %{count} 个字符。"
text_length_between: "长度必须在 %{min} 到 %{max} 个字符之间。"
+ text_command: 口令仅数字可以使用,学生或其他成员申请加入课程时候需要使用该口令,该口令可以由老师在课堂上公布。
text_tracker_no_workflow: 此跟踪标签未定义工作流程
text_unallowed_characters: 非法字符
text_comma_separated: 可以使用多个值(用逗号,分开)。
@@ -1402,6 +1403,7 @@ zh:
label_issue_cancel_query: 取消查询
field_reward_type: 奖励类型
label_tags_no: 暂无标签!
+ label_course_description_no: 你还未对该课程添加描述!
label_bid_publish: 发布了
label_bid_project: 项目
label_project_no_follow: 该项目暂未被关注!