diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index a048c3c9c..ee1ca0230 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -410,6 +410,7 @@ class CoursesController < ApplicationController @course = Course.new @course.safe_attributes = params[:course] + month = Time.now.month render :layout => 'base' end diff --git a/app/helpers/courses_helper.rb b/app/helpers/courses_helper.rb index ba77d1edd..ac22ed412 100644 --- a/app/helpers/courses_helper.rb +++ b/app/helpers/courses_helper.rb @@ -475,6 +475,17 @@ module CoursesHelper type << option2 type end + + def cur_course_term + month = Time.now.month + if month >= 9 || month < 3 + term = "秋季学期" + else + term = "春季学期" + end + term + end + #获取课程动态 def get_course_activity courses, activities @course_ids=activities.keys() diff --git a/app/views/courses/_course_form.html.erb b/app/views/courses/_course_form.html.erb index 4324c5d47..c9ac7541d 100644 --- a/app/views/courses/_course_form.html.erb +++ b/app/views/courses/_course_form.html.erb @@ -43,7 +43,11 @@ <%= text_field_tag :class_period, @course.class_period, :placeholder => "#{l(:lable_input_class)}", :maxlength => 5 %> - <%= l(:label_class_hour) %> + + + <%= l(:label_class_hour) %> + + @@ -53,12 +57,16 @@
- <%= l(:label_class_period) %> - * + + <%= l(:label_class_period) %> + * + <%= text_field_tag :class_period, nil, :placeholder => "#{l(:lable_input_class)}", :maxlength => 5 %> - <%= l(:label_class_hour) %> + + <%= l(:label_class_hour) %> + |
- <%= l(:label_term) %> * + + <%= l(:label_term) %> + * + | <%= select_tag :time,options_for_select(course_time_option,@course.time), {} %> | - <%= select_tag :term,options_for_select(course_term_option,@course.term),{} %> + <%= select_tag :term,options_for_select(course_term_option,@course.term || cur_course_term),{} %> |
-
- <%= l(:text_command) %> + + <%= l(:text_command) %> + <% end %>
<%= custom_field_tag_with_label :course, value %>
++ <%= custom_field_tag_with_label :course, value %> +
<% end %> <%= call_hook(:view_courses_form, :course => @course, :form => f) %> diff --git a/app/views/courses/new.html.erb b/app/views/courses/new.html.erb index 8d153a447..77f041322 100644 --- a/app/views/courses/new.html.erb +++ b/app/views/courses/new.html.erb @@ -6,7 +6,9 @@ <%= labelled_form_for @course do |f| %>