diff --git a/app/controllers/homework_common_controller.rb b/app/controllers/homework_common_controller.rb index a4f092d31..70aec8ffc 100644 --- a/app/controllers/homework_common_controller.rb +++ b/app/controllers/homework_common_controller.rb @@ -190,7 +190,7 @@ class HomeworkCommonController < ApplicationController # homework_bank.save # homework.update_attributes(:homework_bank_id => homework_bank.id) # end - redirect_to setting_homework_common_path(homework, :is_new => 1) + redirect_to student_work_index_path(:homework => homework.id, :host=> Setting.host_course) end end end diff --git a/app/controllers/managements_controller.rb b/app/controllers/managements_controller.rb index 13026f591..8bed7cf57 100644 --- a/app/controllers/managements_controller.rb +++ b/app/controllers/managements_controller.rb @@ -157,17 +157,17 @@ class ManagementsController < ApplicationController discipline_category_option = params[:discipline_category_id] if params[:discipline_category_id] first_level_discipline_option = params[:first_level_discipline_id] if params[:first_level_discipline_id] if major_level_option && major_level_option != '0' - @major = @major.where(:major_level=>major_level_option) + @major = @major.where(:major_level => major_level_option) end if discipline_category_option && discipline_category_option != '0' - @major=@major.where(:discipline_category_id=>discipline_category_option) + @major=@major.where(:discipline_category_id => discipline_category_option) end if first_level_discipline_option && first_level_discipline_option != '0' - @major=@major.where(:first_level_discipline_id=>first_level_discipline_option) + @major=@major.where(:first_level_discipline_id => first_level_discipline_option) end if params[:support_shixuns] - @major = @major.where(:support_shixuns => params[:support_shixuns].to_i) + @major = @major.where(:support_shixuns => params[:support_shixuns].to_i, :major_level => 2) end @major = @major.order("created_at #{@sx_order}") diff --git a/app/helpers/student_work_helper.rb b/app/helpers/student_work_helper.rb index 215ed4ccc..b4ab956e3 100644 --- a/app/helpers/student_work_helper.rb +++ b/app/helpers/student_work_helper.rb @@ -124,7 +124,7 @@ module StudentWorkHelper elsif homework.end_time >= Time.now && work.user_id == User.current.id link_to "修改作品", edit_student_work_url_without_domain(work.id),:class => 'task-btn task-btn-blue fr' else - link_to "查看作品", student_work_path(work), :class => 'task-btn task-btn-blue fr', :title => "作业截止后不可修改作品" + link_to "查看作品", student_work_path(work), :class => 'task-btn task-btn-blue fr mt8 mr15', :title => "作业截止后不可修改作品" end end end diff --git a/app/models/major.rb b/app/models/major.rb index d24c67efd..4fe0abff5 100644 --- a/app/models/major.rb +++ b/app/models/major.rb @@ -1,4 +1,5 @@ # encoding: utf-8 +# major_level 1 研究生 2 本科生 3 专科生 class Major < ActiveRecord::Base belongs_to :first_level_discipline belongs_to :discipline_category diff --git a/app/views/student_work/index.html.erb b/app/views/student_work/index.html.erb index 36c01a508..487191987 100644 --- a/app/views/student_work/index.html.erb +++ b/app/views/student_work/index.html.erb @@ -37,29 +37,25 @@
-
-
-
<% if @is_teacher%> -
+
    <% if @homework.homework_type != 4 %> -
  • - <%= link_to l(:button_edit), edit_homework_common_path(@homework) %> -
  • +
  • + <%= link_to l(:button_edit), edit_homework_common_path(@homework) %> +
  • <% end %>
  • <%= link_to "设置", setting_homework_common_path(@homework) %> @@ -97,10 +93,15 @@ <% else %> <%= user_work_status @homework %> <% if @homework.homework_type == 4 && !@homework.student_works.where(:user_id => User.current.id, :work_status => 0).blank? %> - <%= link_to "开始实战", shixun_path(@homework.homework_commons_shixuns.shixun),:class => 'task-btn task-btn-blue fr mr10',:target => "_blank" %> + <%= link_to "开始实战", shixun_path(@homework.homework_commons_shixuns.shixun),:class => 'task-btn task-btn-blue fr mr10',:target => "_blank" %> <% end %> - <%= link_to "查看设置", setting_homework_common_path(@homework), :class => 'edu-btn fr mr10' %> + <%= link_to "查看设置", setting_homework_common_path(@homework), :class => 'edu-btn fr mr10 mt8' %> <% end %> +
+
+
+
+
<%= @homework.description.html_safe %> @@ -191,7 +192,7 @@ <%= render :partial => 'student_work_replies' %>
-
+
<% if @is_teacher %> @@ -261,9 +262,9 @@ <% else %> 你未提交 <% end %> - <% if @homework.homework_detail_manual.comment_status < 3 %> - <%= user_work_status @homework %> - <% end %> + <%# if @homework.homework_detail_manual.comment_status < 3 %> + <%#= user_work_status @homework %> + <%# end %> <% if @homework.homework_type == 4 && !@homework.student_works.where(:user_id => User.current.id, :work_status => 0).blank? %> <%= link_to "开始实战", shixun_path(@homework.homework_commons_shixuns.shixun),:class => 'task-btn task-btn-blue fr mr10',:target => "_blank" %> <% end %> diff --git a/app/views/subjects/_subject_list.html.erb b/app/views/subjects/_subject_list.html.erb index 7d6660142..f5d199aa6 100644 --- a/app/views/subjects/_subject_list.html.erb +++ b/app/views/subjects/_subject_list.html.erb @@ -34,10 +34,10 @@ <%= subject.description.blank? ? "轻松学习#{subject.name}~" : subject.description %>

- <%= subject.stages.count %> - <%= subject.stage_shixuns.count %> - <%= subject.subject_score %> - <%= subject.subject_challenges %> + <%= subject.stages.count %> + <%= subject.stage_shixuns.count %> + <%= subject.subject_score %> + <%= subject.subject_challenges %>

<%= image_tag(url_to_avatar(subject.user), :width =>"40", :height => "40", :class => "bor-radius-all mr10 fl mt8", :alt=>"头像") %> diff --git a/db/migrate/20170825113413_modify_support_shixuns_for_major.rb b/db/migrate/20170825113413_modify_support_shixuns_for_major.rb index f29f16808..da9ffd985 100644 --- a/db/migrate/20170825113413_modify_support_shixuns_for_major.rb +++ b/db/migrate/20170825113413_modify_support_shixuns_for_major.rb @@ -1,6 +1,7 @@ class ModifySupportShixunsForMajor < ActiveRecord::Migration def up sql = "SELECT distinct(major_id) FROM `major_courses`" + Major.where("0=0").update_all(:support_shixuns, 0) MajorCourse.find_by_sql(sql).each do |mc| Major.where(:id => mc.try(:major_id)).first.update_column(:support_shixuns, 1) end diff --git a/db/migrate/20170827023117_managements_zhuanye.rb b/db/migrate/20170827023117_managements_zhuanye.rb new file mode 100644 index 000000000..2f3871da7 --- /dev/null +++ b/db/migrate/20170827023117_managements_zhuanye.rb @@ -0,0 +1,12 @@ +class ManagementsZhuanye < ActiveRecord::Migration + def up + sql = "SELECT distinct(major_id) FROM `major_courses`" + Major.where("0=0").update_all(:support_shixuns => 0) + MajorCourse.find_by_sql(sql).each do |mc| + Major.where(:id => mc.try(:major_id)).first.update_column(:support_shixuns, 1) + end + end + + def down + end +end diff --git a/public/stylesheets/css/edu-class.css b/public/stylesheets/css/edu-class.css index a21d1b3bf..8c91ddd45 100644 --- a/public/stylesheets/css/edu-class.css +++ b/public/stylesheets/css/edu-class.css @@ -305,7 +305,7 @@ img.ui-datepicker-trigger {display:block;background:url(../images/public_icon.pn /* 班级 */ .edu-position-hide{ position: absolute; top:15px; left:-20px; box-shadow: 0px 2px 8px rgba(146, 153, 169, 0.5); background:#fff;z-index:1001; padding:5px 0;} -.edu-position-hide li a{ display:inline-block; height: 30px; width: 100px; line-height: 30px; text-align: center; font-size:12px; } +.edu-position-hide li a{ display:inline-block; height: 30px; width: 100px; line-height: 30px; text-align: center; font-size:12px!important; } .edu-position-hide li a:hover{ background:#eee; color:#666;} .edu-position-hidebox{ } .edu-position-hidebox i{ color:#bcbcbc;}