加入了开课时间,结课时间选项

增加了课时文本框
相应的增加了显示
This commit is contained in:
baiyu 2013-11-01 08:45:24 +08:00
parent 0a21b87714
commit b2080a4470
10 changed files with 93 additions and 18 deletions

View File

@ -510,11 +510,14 @@ class ProjectsController < ApplicationController
@course.extra='course' + DateTime.parse(Time.now.to_s).strftime('%Y-%m-%d_%H-%M-%S').to_s
@course.safe_attributes = params[:project][:course]
@course.tea_id = User.current.id
# added by bai
# added by bai
@course.term = params[:term]
@course.time = params[:time]
@course.setup_time = params[:setup_time]
@course.endup_time = params[:endup_time]
@course.class_period = params[:class_period]
end
# end
# end
# @course.save
# project = ProjectInfo.create(:user_id => User.current.id, :project_id => @project.id)
# project_status = ProjectStatus.create(:project_id => @project.id)
@ -806,10 +809,13 @@ class ProjectsController < ApplicationController
@course = Course.find_by_extra(@project.identifier)
unless @course.nil?
@course.password = params[:project][:course][:password]
# added by bai
# added by bai
@course.term = params[:term]
@course.time = params[:time]
# end
@course.setup_time = params[:setup_time]
@course.endup_time = params[:endup_time]
@course.class_period = params[:class_period]
# end
@course.save
end
@project.set_allowed_parent!(params[:project]['parent_id']) if params[:project].has_key?('parent_id')

View File

@ -111,14 +111,25 @@
<div class="inf_user_context">
<table style="font-family:微软雅黑" >
<!-- modified by bai 加超链接 -->
<!-- addedby bai 教师姓名加超链接、加入开课时间、结课时间与课时 -->
<tr>
<td valign="top" style="padding-left: 8px;"><%= l(:label_main_teacher) %> :</td><td class="font_lighter_sidebar"><%= link_to(@course.teacher.lastname+@course.teacher.firstname, user_path(@course.teacher)) %></td>
</tr>
<!-- end -->
<tr>
<td valign="top" style="padding-left: 8px;"><%= l(:label_setup_time) %> :</td><td class="font_lighter_sidebar"><%= @course.setup_time %></td>
</tr>
<tr>
<td valign="top" style="padding-left: 8px;"><%= l(:label_endup_time) %> :</td><td class="font_lighter_sidebar"><%= @course.endup_time %></td>
</tr>
<tr>
<td valign="top" style="padding-left: 8px;"><%= l(:label_class_period) %> :</td><td class="font_lighter_sidebar"><%= @course.class_period %>&nbsp;<%= l(:label_class_hour)%></td>
</tr>
<tr>
<td valign="top" style="padding-left: 8px;"><%= l(:label_main_term) %> :</td><td class="font_lighter_sidebar"><%= @course.time %> -- <%= @course.term %></td>
<td valign="top" style="padding-left: 8px;"><%= l(:label_main_term) %> :</td><td class="font_lighter_sidebar"><%= @course.time %> <%= @course.term %></td>
</tr>
<!-- end -->

View File

@ -67,7 +67,7 @@
</tr>
<tr>
<td><%= l(:label_limit_time) %> <%= @bid.deadline %></td>
<td><%= l(:label_limit_time) %>: <%= @bid.deadline %></td>
</tr>
<% unless @bid.parent_id.nil?%>
<tr>

View File

@ -17,11 +17,52 @@
<%= f.fields_for @course do |m| %>
<!-- added by bai 增加了“年度”和“学期” -->
<p><table><tr><td>
<!-- added by bai 新增开课时间、结课时间、课时 -->
<% unless @course.nil?%>
<p><table><tr><td><span class="info" align="right" style="width: 90px; font-weight: bold ;margin-left:20px"><%= l(:label_setup_time) %><span class="required"> *&nbsp;&nbsp;</span></span>
<span class="info" style="width: 10px"><%= text_field_tag :setup_time, @course.setup_time, :placeholder => "在此选择开课日期" %></span>
<span><%= calendar_for('setup_time')%></span>
</td></tr></table></p>
<% else %>
<p><table><tr><td><span class="info" align="right" style="width: 90px; font-weight: bold ;margin-left:20px"><%= l(:label_setup_time) %><span class="required"> *&nbsp;&nbsp;</span></span>
<span class="info" style="width: 10px"><%= text_field_tag :setup_time, nil, :placeholder => "在此选择开课日期" %></span>
<span><%= calendar_for('setup_time')%></span>
</td></tr></table></p>
<% end %>
<% unless @course.nil?%>
<p><table><tr><td><span class="info" align="right" style="width: 90px; font-weight: bold ;margin-left:20px"><%= l(:label_endup_time) %><span class="required"> *&nbsp;&nbsp;</span></span>
<span class="info" style="width: 10px"><%= text_field_tag :endup_time, @course.endup_time, :placeholder => "在此选择结课日期" %></span>
<span><%= calendar_for('endup_time')%></span>
</td></tr></table></p>
<% else %>
<p><table><tr><td><span class="info" align="right" style="width: 90px; font-weight: bold ;margin-left:20px"><%= l(:label_endup_time) %><span class="required"> *&nbsp;&nbsp;</span></span>
<span class="info" style="width: 10px"><%= text_field_tag :endup_time, nil, :placeholder => "在此选择结课日期" %></span>
<span><%= calendar_for('endup_time')%></span>
</td></tr></table></p>
<% end %>
<% unless @course.nil?%>
<p><table><tr><td><span class="info" align="right" style="width: 90px; font-weight: bold ;margin-left:20px"><%= l(:label_class_period) %><span class="required"> *&nbsp;&nbsp;</span></span>
<span class="info" style="width: 10px"><%= text_field_tag :class_period, @course.class_period, :placeholder => "在此输入课时" %></span> <span>&nbsp;<strong><%= l(:label_class_hour)%></strong></span>
</td></tr></table></p>
<% else %>
<p><table><tr><td><span class="info" align="right" style="width: 90px; font-weight: bold ;margin-left:20px"><%= l(:label_class_period) %><span class="required"> *&nbsp;&nbsp;</span></span>
<span class="info" style="width: 10px"><%= text_field_tag :class_period, nil, :placeholder => "在此输入课时" %></span><strong><%= l(:label_class_hour)%></strong>
</td></tr></table></p>
<% end %>
<!-- end -->
<!-- added by bai 增加了“年度”和“学期” -->
<p><table><tr><td>
<% unless @course.nil? %>
<% if @course.time == 2008 %>
<p><table><tr><td class="info" align="right" style="width: 90px"><strong><%= l(:label_term) %><span class="required"> *&nbsp;&nbsp;</span></strong></td>
<p><table><tr><td class="info" align="right" style="width: 90px; margin-left:20px"><strong><%= l(:label_term) %><span class="required"> *&nbsp;&nbsp;</span></strong></td>
<td class="info" style="width: 10px">
<%= select_tag 'time', "<option value = '2008' selected='selected'>2008</option>
<option value = '2009'>2009</option>
@ -227,7 +268,7 @@
<em class="info" style="margin-left:95px;"><%= l(:text_command) %></em>
<% end %>
<p style="margin-left:-10px;padding-right: 20px;"><%= f.text_area :description, :rows => 8, :class => 'wiki-edit', :style => "font-size:small;width:490px;margin-left:10px;" %></p><!--by young-->
<p style="margin-left:-10px;"><em style ="color: #888888;display: block;font-size: 90%;font-style: normal;"><%= f.check_box :is_public, :style => "margin-left:10px;" %></em></p>
<p style="margin-left:-10px;"><em style ="color: #888888;display: block;font-size: 90%;font-style: normal;"><%= f.check_box :is_public, :style => "margin-left:10px;" %><%= l(:label_public_info) %></em></p> <!-- modified by bai -->
<p style="display:none;"><%= f.text_field :project_type, :value => 1 %></p>

View File

@ -1546,14 +1546,19 @@ zh:
label_requirement_from: 需求来源
label_course_view: 作业界面
label_course_return: "返 回 课 程"
label_setup_time: 开课时间
label_endup_time: 结课时间
label_class_period: 整体课时
label_class_hour: 学时
#end
label_course: 课程
label_course_new: 新建课程
label_course_join_student: 加入课程
label_public_info: (打钩为公开,不打钩则不公开,若不公开,仅项目成员可见该项目。)
label_course_view_student: 查看其他课程
label_public_info: 若不公开,仅项目成员可见该项目
label_course_student: 学生
label_homework: 课程作业
label_course_file: 资料共享

View File

@ -1,5 +0,0 @@
class AddDescriptionToShare < ActiveRecord::Migration
def change
add_column :shares, :description, :string
end
end

View File

@ -0,0 +1,5 @@
class AddSetupTimeToCourses < ActiveRecord::Migration
def change
add_column :courses, :setup_time, :string
end
end

View File

@ -0,0 +1,5 @@
class AddEndupTimeToCourses < ActiveRecord::Migration
def change
add_column :courses, :endup_time, :string
end
end

View File

@ -0,0 +1,5 @@
class AddClassPeriodToCourses < ActiveRecord::Migration
def change
add_column :courses, :class_period, :string
end
end

View File

@ -510,9 +510,11 @@ ActiveRecord::Schema.define(:version => 20131031093317) do
t.integer "project_id"
t.integer "project_type"
t.integer "gitlab_group_id", :limit => 8
t.float "grade"
end
add_index "project_statuses", ["changesets_count"], :name => "index_project_statuses_on_changesets_count"
add_index "project_statuses", ["grade"], :name => "index_project_statuses_on_grade"
add_index "project_statuses", ["watchers_count"], :name => "index_project_statuses_on_watchers_count"
create_table "project_tags", :force => true do |t|