From 3a394315a40a70942fc8737b79d9af09a8ff9d98 Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 15 Sep 2017 21:25:16 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=E7=8F=AD=E7=BA=A7=E5=A4=B4=E9=83=A8?= =?UTF-8?q?=E7=9A=84=E5=AD=A6=E7=94=9F=E5=88=97=E8=A1=A8=E9=93=BE=E6=8E=A5?= =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Gemfile | 2 +- app/controllers/courses_controller.rb | 2 +- app/helpers/courses_helper.rb | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Gemfile b/Gemfile index 711032123..9ba9eafd7 100644 --- a/Gemfile +++ b/Gemfile @@ -14,7 +14,7 @@ unless RUBY_PLATFORM =~ /w32/ gem 'nokogiri' end -gem 'simple_xlsx_reader' +#gem 'simple_xlsx_reader' gem 'wechat',path: 'lib/wechat' gem 'grack', path:'lib/grack' gem 'gitlab', path: 'lib/gitlab-cli' diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index 8bfd88ffa..e223c0222 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -36,7 +36,7 @@ class CoursesController < ApplicationController before_filter :require_login, :only => [:join, :unjoin] #before_filter :allow_join, :only => [:join] require 'bundler/setup' - require 'simple_xlsx_reader' + #require 'simple_xlsx_reader' # params[:search] 搜索课程的名称 # params[:select] "join" "create" "all" 参与的 创建的 所有的课程 diff --git a/app/helpers/courses_helper.rb b/app/helpers/courses_helper.rb index 5336ffd56..127c65fcf 100644 --- a/app/helpers/courses_helper.rb +++ b/app/helpers/courses_helper.rb @@ -96,7 +96,7 @@ module CoursesHelper #生成课程老师成员链接 def course_teacher_link teacher_num if User.current.allowed_to?(:as_teacher, @course) - link_to teacher_num, settings_course_path(@course, :tab => 'member'), :class => 'ml5 edu-cir-grey-q color-orange05', :id => 'teacher_number' + link_to teacher_num, members_course_path(@course), :class => 'ml5 edu-cir-grey-q color-orange05', :id => 'teacher_number' elsif User.current.member_of_course?(@course) link_to teacher_num, course_member_path(@course, :role => 't'), :class => 'ml5 edu-cir-grey-q color-orange05', :id => 'teacher_number' else @@ -107,7 +107,7 @@ module CoursesHelper #生成课程学生列表连接 def course_student_link student_num if User.current.allowed_to?(:as_teacher, @course) - link_to "#{student_num}", settings_course_path(@course, :tab => 'member', :role => 'as'), :class => 'ml5 edu-cir-grey-q color-orange05', :id => 'student_number' + link_to "#{student_num}", members_course_path(@course, :role => 'as'), :class => 'ml5 edu-cir-grey-q color-orange05', :id => 'student_number' elsif (User.current.logged? && @course.open_student == 1) || (User.current.member_of_course?(@course)) link_to "#{student_num}", course_member_path(@course, :role => 'as'), :class => 'ml5 edu-cir-grey-q color-orange05', :id => "student_number" else @@ -118,7 +118,7 @@ module CoursesHelper # 生成分班列表连接 def course_group_link group_num if User.current.allowed_to?(:as_teacher, @course) - link_to "#{group_num}", settings_course_path(@course, :tab => 'member', :role => @course.course_groups.first.id), :class => 'ml5 edu-cir-grey-q color-orange03', :id => 'group_number' + link_to "#{group_num}", members_course_path(@course, :role => @course.course_groups.first.id), :class => 'ml5 edu-cir-grey-q color-orange03', :id => 'group_number' elsif (User.current.logged? && @course.open_student == 1) || (User.current.member_of_course?(@course)) link_to "#{group_num}", course_member_path(@course, :role => @course.course_groups.first.id), :class => 'ml5 edu-cir-grey-q color-orange03', :id => "group_number" else From 61f1d9bd10c7c08ba02b801094d66bc8f6e8ac2e Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 15 Sep 2017 22:35:36 +0800 Subject: [PATCH 2/7] =?UTF-8?q?=E8=AF=BE=E5=A0=82=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/courses_controller.rb | 26 ++++++-------- app/helpers/courses_helper.rb | 18 +++++----- app/views/boards/_course_show_detail.html.erb | 6 +--- app/views/courses/all_student_list.js.erb | 2 +- .../courses/has_group_student_list.js.erb | 2 +- .../courses/no_group_student_list.js.erb | 2 +- app/views/courses/settings/_members.html.erb | 19 +++++++---- .../_edit_late_setting.html.erb | 2 +- .../layouts/_group_children_list.html.erb | 20 +++++------ app/views/users/_course_boardlist.html.erb | 34 +++++++++++-------- app/views/users/_homework_base_info.html.erb | 2 +- public/javascripts/edu/application.js | 1 - public/javascripts/edu/base_edu.js | 34 ++++++++++++++++++- 13 files changed, 101 insertions(+), 67 deletions(-) diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index e223c0222..d33d211ae 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -978,23 +978,19 @@ class CoursesController < ApplicationController join_course_messages = CourseMessage.where("user_id =? and course_message_type =? and course_id =? and status = ? and viewed =?", User.current.id, 'JoinCourse', @course.id, 1, 0) join_course_messages.update_all(:viewed => true) - if User.current.allowed_to?(:as_teacher,@course) - @member ||= @course.members.new - @role = params[:role] if params[:role] + @member ||= @course.members.new + @role = params[:role] if params[:role] - @teachers = searchTeacherAndAssistant(@course) - @teacher_count = @teachers.count - @student_count = studentCount(@course) - @no_group_count = @course.members.where(:course_group_id => 0).select{|m| m.roles.to_s.include?("Student")}.count - @apply_users = CourseMessage.where(:course_id => @course.id,:course_message_type => 'JoinCourseRequest', :status => 0) + @teachers = searchTeacherAndAssistant(@course) + @teacher_count = @teachers.count + @student_count = studentCount(@course) + @no_group_count = @course.members.where(:course_group_id => 0).select{|m| m.roles.to_s.include?("Student")}.count + @apply_users = CourseMessage.where(:course_id => @course.id,:course_message_type => 'JoinCourseRequest', :status => 0) - @curr_page = '成员管理' - respond_to do |format| - format.html { render :layout => 'base_edu_course' } - format.api { render_validation_errors(@course) } - end - else - render_403 + @curr_page = '成员管理' + respond_to do |format| + format.html { render :layout => 'base_edu_course' } + format.api { render_validation_errors(@course) } end end diff --git a/app/helpers/courses_helper.rb b/app/helpers/courses_helper.rb index 127c65fcf..21acbdcb2 100644 --- a/app/helpers/courses_helper.rb +++ b/app/helpers/courses_helper.rb @@ -95,10 +95,10 @@ module CoursesHelper #生成课程老师成员链接 def course_teacher_link teacher_num - if User.current.allowed_to?(:as_teacher, @course) + if User.current.allowed_to?(:as_teacher, @course) || User.current.member_of_course?(@course) link_to teacher_num, members_course_path(@course), :class => 'ml5 edu-cir-grey-q color-orange05', :id => 'teacher_number' - elsif User.current.member_of_course?(@course) - link_to teacher_num, course_member_path(@course, :role => 't'), :class => 'ml5 edu-cir-grey-q color-orange05', :id => 'teacher_number' + # elsif User.current.member_of_course?(@course) + # link_to teacher_num, course_member_path(@course, :role => 't'), :class => 'ml5 edu-cir-grey-q color-orange05', :id => 'teacher_number' else content_tag 'span',teacher_num, :class => 'ml5 edu-cir-grey-q color-orange05' end @@ -106,10 +106,10 @@ module CoursesHelper #生成课程学生列表连接 def course_student_link student_num - if User.current.allowed_to?(:as_teacher, @course) + if User.current.allowed_to?(:as_teacher, @course) || User.current.member_of_course?(@course) link_to "#{student_num}", members_course_path(@course, :role => 'as'), :class => 'ml5 edu-cir-grey-q color-orange05', :id => 'student_number' - elsif (User.current.logged? && @course.open_student == 1) || (User.current.member_of_course?(@course)) - link_to "#{student_num}", course_member_path(@course, :role => 'as'), :class => 'ml5 edu-cir-grey-q color-orange05', :id => "student_number" + # elsif (User.current.logged? && @course.open_student == 1) || (User.current.member_of_course?(@course)) + # link_to "#{student_num}", course_member_path(@course, :role => 'as'), :class => 'ml5 edu-cir-grey-q color-orange05', :id => "student_number" else content_tag 'span',student_num, :class => 'ml5 edu-cir-grey-q color-orange05' end @@ -117,10 +117,10 @@ module CoursesHelper # 生成分班列表连接 def course_group_link group_num - if User.current.allowed_to?(:as_teacher, @course) + if User.current.allowed_to?(:as_teacher, @course) || User.current.member_of_course?(@course) link_to "#{group_num}", members_course_path(@course, :role => @course.course_groups.first.id), :class => 'ml5 edu-cir-grey-q color-orange03', :id => 'group_number' - elsif (User.current.logged? && @course.open_student == 1) || (User.current.member_of_course?(@course)) - link_to "#{group_num}", course_member_path(@course, :role => @course.course_groups.first.id), :class => 'ml5 edu-cir-grey-q color-orange03', :id => "group_number" + # elsif (User.current.logged? && @course.open_student == 1) || (User.current.member_of_course?(@course)) + # link_to "#{group_num}", course_member_path(@course, :role => @course.course_groups.first.id), :class => 'ml5 edu-cir-grey-q color-orange03', :id => "group_number" else content_tag 'span',group_num, :class => 'ml5 edu-cir-grey-q color-orange05' end diff --git a/app/views/boards/_course_show_detail.html.erb b/app/views/boards/_course_show_detail.html.erb index 5930d76df..8b766d033 100644 --- a/app/views/boards/_course_show_detail.html.erb +++ b/app/views/boards/_course_show_detail.html.erb @@ -3,8 +3,4 @@ <%= javascript_include_tag "create_kindeditor" %> <% end %> -<% if @topics.count > 0 %> - <%= render :partial => 'users/course_boardlist', :locals => {:topics => @topics, :is_course => 1, :is_board=>1} %> -<% else %> - <%= render :partial => "welcome/no_data" %> -<% end %> \ No newline at end of file +<%= render :partial => 'users/course_boardlist', :locals => {:topics => @topics, :is_course => 1, :is_board=>1} %> diff --git a/app/views/courses/all_student_list.js.erb b/app/views/courses/all_student_list.js.erb index b17d198a1..a439657cb 100644 --- a/app/views/courses/all_student_list.js.erb +++ b/app/views/courses/all_student_list.js.erb @@ -1,4 +1,4 @@ -<% if params[:page] %> +<% if params[:page] || params[:search] %> <% is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,@course)) %> $("#student_table_div").html("<%= j(render :partial => "courses/settings/student_table", :locals => {:is_teacher => is_teacher}) %>"); <% else %> diff --git a/app/views/courses/has_group_student_list.js.erb b/app/views/courses/has_group_student_list.js.erb index a9b65f5b3..4896db9dd 100644 --- a/app/views/courses/has_group_student_list.js.erb +++ b/app/views/courses/has_group_student_list.js.erb @@ -1,4 +1,4 @@ -<% if params[:page] %> +<% if params[:page] || params[:search] %> <% is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,@course)) %> $("#student_table_div").html("<%= j(render :partial => "courses/settings/student_table", :locals => {:is_teacher => is_teacher}) %>"); <% else %> diff --git a/app/views/courses/no_group_student_list.js.erb b/app/views/courses/no_group_student_list.js.erb index 63c3e0e6d..662e8380b 100644 --- a/app/views/courses/no_group_student_list.js.erb +++ b/app/views/courses/no_group_student_list.js.erb @@ -1,4 +1,4 @@ -<% if params[:page] %> +<% if params[:page] || params[:search] %> <% is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,@course)) %> $("#student_table_div").html("<%= j(render :partial => "courses/settings/student_table", :locals => {:is_teacher => is_teacher}) %>"); <% else %> diff --git a/app/views/courses/settings/_members.html.erb b/app/views/courses/settings/_members.html.erb index c3b9ef0e8..1c1806e00 100644 --- a/app/views/courses/settings/_members.html.erb +++ b/app/views/courses/settings/_members.html.erb @@ -1,3 +1,4 @@ +<% is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,@course)) %>
    @@ -7,9 +8,11 @@
    @@ -33,10 +36,12 @@ diff --git a/app/views/homework_common/_edit_late_setting.html.erb b/app/views/homework_common/_edit_late_setting.html.erb index 2986eb927..d41ac0bed 100644 --- a/app/views/homework_common/_edit_late_setting.html.erb +++ b/app/views/homework_common/_edit_late_setting.html.erb @@ -27,7 +27,7 @@
    • - + " name="homework_late_penalty" placeholder="5" />
    diff --git a/app/views/layouts/_group_children_list.html.erb b/app/views/layouts/_group_children_list.html.erb index 5a80ec320..10e456a37 100644 --- a/app/views/layouts/_group_children_list.html.erb +++ b/app/views/layouts/_group_children_list.html.erb @@ -1,15 +1,15 @@ +
  • + 分班 + <% group_count = @course.course_groups.count %> + <%= group_count %> +
  • +
  • + <% count = @course.members.where(:course_group_id => 0).select{|m| m.roles.to_s.include?("Student")}.count %> + 未分班 + <%= count %> +
  • <% unless @course.course_groups.empty? %>
      - <% group_count = @course.course_groups.count %> -
    • - 分班 - <%= group_count %> -
    • -
    • - <% count = @course.members.where(:course_group_id => 0).select{|m| m.roles.to_s.include?("Student")}.count %> - 未分班 - <%= count %> -
    • <% @course.course_groups.each do |group| %>
    • <% count = group.members.count %> diff --git a/app/views/users/_course_boardlist.html.erb b/app/views/users/_course_boardlist.html.erb index 74c6654ac..15f4bc394 100644 --- a/app/views/users/_course_boardlist.html.erb +++ b/app/views/users/_course_boardlist.html.erb @@ -1,4 +1,19 @@

      @@ -46,7 +48,8 @@

      - <% topics.each do |activity| %> + <% if @topics.count > 0 %> + <% topics.each do |activity| %>
      <%= link_to image_tag(url_to_avatar(activity.author), :width => "60", :height => "60", :class => "panel-list-img mr15"), user_path(activity.author), :alt => "用户",:style => "width:60px;height:60px;display: block;" %>
      @@ -77,6 +80,9 @@

      + <% end %> + <% else %> + <%= render :partial => "welcome/no_data" %> <% end %>
      diff --git a/app/views/users/_homework_base_info.html.erb b/app/views/users/_homework_base_info.html.erb index bb42721cf..20f848480 100644 --- a/app/views/users/_homework_base_info.html.erb +++ b/app/views/users/_homework_base_info.html.erb @@ -95,7 +95,7 @@
    • <% end %>
    • - <%= link_to "设置", setting_homework_common_path(activity), :class => "wpostOptionLink" %> + <%= link_to "设置", student_work_index_path(:homework => activity.id, :tab => 4), :class => "wpostOptionLink" %>
    • <%= link_to "导出成绩", student_work_index_path(:homework => activity, :format => 'xls'), :id => "export_student_work", :class => "wpostOptionLink" %> diff --git a/public/javascripts/edu/application.js b/public/javascripts/edu/application.js index 8dac759a2..b90880a8a 100644 --- a/public/javascripts/edu/application.js +++ b/public/javascripts/edu/application.js @@ -1011,7 +1011,6 @@ function submit_send_res_to_course(){ if($("input[name='course_ids[]']:checked").length >= 1){ $("#search_course_notice_h").html("").hide(); $("#course_list_form").submit(); - alert("发送成功!"); hideModal(); }else{ $("#search_course_notice_h").html("请先选择一个班级").show(); diff --git a/public/javascripts/edu/base_edu.js b/public/javascripts/edu/base_edu.js index 2aab075c6..88d9f4eaf 100644 --- a/public/javascripts/edu/base_edu.js +++ b/public/javascripts/edu/base_edu.js @@ -239,7 +239,19 @@ $(function(){ allowBlank:true, lang:'ch', format:'Y-m-d H:i', - validateOnBlur:false + validateOnBlur:false, + onSelectDate:function() { + if($.trim($("input[name='homework_appeal_time']").val()) == ""){ + var date = new Date(Date.parse($("input[name='homework_evaluation_end']").val().replace(/-/g, "/"))); + $("input[name='homework_appeal_time']").val(formate_time(new Date(date.setDate(date.getDate()+7)))); + } + }, + onSelectTime:function() { + if($.trim($("input[name='homework_appeal_time']").val()) == ""){ + var date = new Date(Date.parse($("input[name='homework_evaluation_end']").val().replace(/-/g, "/"))); + $("input[name='homework_appeal_time']").val(formate_time(new Date(date.setDate(date.getDate()+7)))); + } + } }); $("input[name='homework_appeal_time']").datetimepicker({ allowBlank:true, @@ -275,6 +287,22 @@ $(function(){ $(this).parent().parent('ul').find('input[type="text"]').removeAttr('disabled'); $(this).parent().parent('ul').find('input[type="text"]').removeClass('disabled-bg'); $("#anon_relate_setting_ul").show(); + $("input[name='homework_anonymous_appeal']").attr("checked", "checked"); + $("input[name='homework_appeal_time']").datetimepicker({ + allowBlank:true, + lang:'ch', + format:'Y-m-d H:i', + validateOnBlur:false + }); + $("input[name='homework_anonymous_appeal']").parent().parent('ul').find('input[type="text"]').removeAttr('disabled'); + $("input[name='homework_anonymous_appeal']").parent().parent('ul').find('input[type="text"]').removeClass('disabled-bg'); + if($("input[name='homework_evaluation_end']").val().trim() != ""){ + var my_date = new Date(); + var end_date = new Date(Date.parse($("input[name='homework_evaluation_end']").val().replace(/-/g, "/"))); + var max_date = my_date > end_date ? my_date : end_date; + $("input[name='homework_appeal_time']").val(formate_time(new Date(max_date.setDate(max_date.getDate()+7)))); + } + $("input[name='homework_appeal_penalty']").val("2"); if($("input[name='homework_end_time']").val().trim() != ""){ var my_date = new Date(); var end_date = new Date(Date.parse($("input[name='homework_end_time']").val().replace(/-/g, "/"))); @@ -294,6 +322,10 @@ $(function(){ $("input[name='homework_absence_penalty']").val("0"); $("#anon_relate_setting_ul").hide(); $("select[name='st_proportion']").attr('disabled', 'disabled').addClass('disabled-bg').val(0.0); + $("input[name='homework_anonymous_appeal']").parent().parent('ul').find('input[type="text"]').attr('disabled', 'disabled'); + $("input[name='homework_anonymous_appeal']").parent('ul').find('input[type="text"]').addClass('disabled-bg'); + $("input[name='homework_appeal_time']").val(""); + $("input[name='homework_appeal_penalty']").val("0"); } }); From 9b5218410642284410f338b2c378fa324643bcbb Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 15 Sep 2017 22:44:17 +0800 Subject: [PATCH 3/7] =?UTF-8?q?=E6=88=91=E7=9A=84=E9=A2=98=E5=BA=93?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E7=9A=84=E6=90=9C=E7=B4=A2=EF=BC=8C=E5=9B=9E?= =?UTF-8?q?=E8=BD=A6=E6=97=A0=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/homework_common_controller.rb | 2 +- .../_homework_bank_list.html.erb | 20 ++++++++++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/app/controllers/homework_common_controller.rb b/app/controllers/homework_common_controller.rb index 7f26da079..182d355f4 100644 --- a/app/controllers/homework_common_controller.rb +++ b/app/controllers/homework_common_controller.rb @@ -349,7 +349,7 @@ class HomeworkCommonController < ApplicationController end @homework.save @homework_detail_manual.save - redirect_to student_work_index_path(:homework => @homework.id, :tab => 4) + redirect_to student_work_index_path(:homework => @homework.id) end def edit diff --git a/app/views/homework_bank/_homework_bank_list.html.erb b/app/views/homework_bank/_homework_bank_list.html.erb index 60b44b7e2..5cdc44cd7 100644 --- a/app/views/homework_bank/_homework_bank_list.html.erb +++ b/app/views/homework_bank/_homework_bank_list.html.erb @@ -91,4 +91,22 @@
    - \ No newline at end of file + + + \ No newline at end of file From a4d0c65cad23f8161021ab2587b26c405f89fbaa Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Fri, 15 Sep 2017 22:44:36 +0800 Subject: [PATCH 4/7] =?UTF-8?q?=E8=AF=BE=E5=A0=82=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/application_helper.rb | 2 +- app/helpers/courses_helper.rb | 4 ++-- .../courses/_course_activity_content.html.erb | 2 +- app/views/courses/show.html.erb | 12 +++++------ .../_edit_publish_setting.html.erb | 6 +++--- app/views/layouts/_course_base_info.html.erb | 2 +- app/views/messages/_course_show.html.erb | 2 +- .../student_work/_common_reply_box.html.erb | 6 +++--- app/views/student_work/index.html.erb | 20 +++++++++---------- app/views/users/_course_message.html.erb | 2 +- public/stylesheets/css/edu-common.css | 3 ++- 11 files changed, 31 insertions(+), 30 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 1df371b9b..9788e36ba 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -532,7 +532,7 @@ module ApplicationHelper when '评阅中' style = 'edu-filter-btn-green' when '已结束' - style = 'edu-filter-btn' + style = 'edu-filter-btn-end' when '已开启补交' style = 'edu-filter-btn-late' when '未开启补交' diff --git a/app/helpers/courses_helper.rb b/app/helpers/courses_helper.rb index 5336ffd56..3c42e637b 100644 --- a/app/helpers/courses_helper.rb +++ b/app/helpers/courses_helper.rb @@ -118,9 +118,9 @@ module CoursesHelper # 生成分班列表连接 def course_group_link group_num if User.current.allowed_to?(:as_teacher, @course) - link_to "#{group_num}", settings_course_path(@course, :tab => 'member', :role => @course.course_groups.first.id), :class => 'ml5 edu-cir-grey-q color-orange03', :id => 'group_number' + link_to "#{group_num}", settings_course_path(@course, :tab => 'member', :role => @course.course_groups.first.id), :class => 'ml5 edu-cir-grey-q color-orange05', :id => 'group_number' elsif (User.current.logged? && @course.open_student == 1) || (User.current.member_of_course?(@course)) - link_to "#{group_num}", course_member_path(@course, :role => @course.course_groups.first.id), :class => 'ml5 edu-cir-grey-q color-orange03', :id => "group_number" + link_to "#{group_num}", course_member_path(@course, :role => @course.course_groups.first.id), :class => 'ml5 edu-cir-grey-q color-orange05', :id => "group_number" else content_tag 'span',group_num, :class => 'ml5 edu-cir-grey-q color-orange05' end diff --git a/app/views/courses/_course_activity_content.html.erb b/app/views/courses/_course_activity_content.html.erb index 91771c539..7e49d2868 100644 --- a/app/views/courses/_course_activity_content.html.erb +++ b/app/views/courses/_course_activity_content.html.erb @@ -1,4 +1,4 @@ -
    +
    <%= get_acts_list_type @type %>
    diff --git a/app/views/courses/show.html.erb b/app/views/courses/show.html.erb index 92b641741..425576ec6 100644 --- a/app/views/courses/show.html.erb +++ b/app/views/courses/show.html.erb @@ -9,13 +9,13 @@
    <% if User.current.admin? || User.current.allowed_to?(:as_teacher,@course) %> -
    - <%= link_to '成员管理', members_course_path(@course), :class => "fl white-btn orange-btn", :style => "flex: 1;text-align: center;" %> - <%= link_to '发布普通作业', new_homework_common_path(:course => @course.id, :homework_type => 1), :class => "fl white-btn orange-btn ml20", :style => "flex: 1;text-align: center;" %> - <%= link_to '发布实训作业', shixuns_homework_common_index_path(:course => @course.id), :remote => true, :class => "fl white-btn orange-btn ml20", :style => "flex: 1;text-align: center;" %> - 发布资源 +
    + <%= link_to '成员管理', members_course_path(@course), :class => "fl white-btn orange-btn", :style => "flex: 1;text-align: center;height:32px;line-height:32px" %> + <%= link_to '发布普通作业', new_homework_common_path(:course => @course.id, :homework_type => 1), :class => "fl white-btn orange-btn ml20", :style => "flex: 1;text-align: center;height:32px;line-height:32px" %> + <%= link_to '发布实训作业', shixuns_homework_common_index_path(:course => @course.id), :remote => true, :class => "fl white-btn orange-btn ml20", :style => "flex: 1;text-align: center;height:32px;line-height:32px" %> + 发布资源 <% course_board = @course.boards.where("parent_id is NULL").first %> - <%= link_to '发布帖子', new_board_message_path(:board_id => course_board.id), :class => "fl white-btn orange-btn ml20", :style => "flex: 1;text-align: center;" %> + <%= link_to '发布帖子', new_board_message_path(:board_id => course_board.id), :class => "fl white-btn orange-btn ml20", :style => "flex: 1;text-align: center;height:32px;line-height:32px" %>
    <% end %>
    diff --git a/app/views/homework_common/_edit_publish_setting.html.erb b/app/views/homework_common/_edit_publish_setting.html.erb index 1d5105c3b..6fd57b063 100644 --- a/app/views/homework_common/_edit_publish_setting.html.erb +++ b/app/views/homework_common/_edit_publish_setting.html.erb @@ -6,7 +6,7 @@
    • - 0 ? 'disabled' : '' %> class="fl task-form-15 task-height-40 panel-box-sizing <%= @homework.homework_detail_manual.try(:comment_status) > 0 ? 'disabled-bg' : '' %>" placeholder="<%= Time.parse((Time.now + 1.days).to_s).strftime("%Y-%m-%d") %> 00:00"/> + 0 ? 'disabled' : '' %> class="fl task-form-15 task-height-40 panel-box-sizing <%= @homework.homework_detail_manual.try(:comment_status) > 0 ? 'disabled-bg' : '' %>" placeholder="<%#= Time.parse((Time.now + 1.days).to_s).strftime("%Y-%m-%d") %>请选择发布时间"/>
    • - class="fl task-form-15 task-height-40 panel-box-sizing <%= !@homework.end_time.nil? && @homework.end_time <= Time.now ? 'disabled-bg' : '' %>" placeholder="<%= Time.parse((Time.now + 1.days).to_s).strftime("%Y-%m-%d") %> 10:00"/> + class="fl task-form-15 task-height-40 panel-box-sizing <%= !@homework.end_time.nil? && @homework.end_time <= Time.now ? 'disabled-bg' : '' %>" placeholder="<%#= Time.parse((Time.now + 1.days).to_s).strftime("%Y-%m-%d") %>请选择截止时间"/> @@ -33,7 +33,7 @@
    • - 10:00"/> + 请选择结束时间"/>
      -
      +
      -
      <%= comment.content_detail.html_safe %>
      +
      <%= comment.content_detail.html_safe %>
      <%= link_to comment.creator_user.show_real_name, user_url_in_org(comment.creator_user), :class => "content-username hide fl" %> @@ -77,9 +77,9 @@ <%=render :partial=> "praise_tread/edu_praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>

      -
      -
      +
      +
      diff --git a/app/views/student_work/index.html.erb b/app/views/student_work/index.html.erb index abf73dfa3..c7e950c77 100644 --- a/app/views/student_work/index.html.erb +++ b/app/views/student_work/index.html.erb @@ -98,7 +98,7 @@ <% 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 mt8',:target => "_blank" %> + <%= link_to "开始实战", shixun_path(@homework.homework_commons_shixuns.shixun),:class => 'white-btn orange-btn fr mr10 mt8',:target => "_blank" %> <% end %> <%#= link_to "查看设置", setting_homework_common_path(@homework), :class => 'edu-btn fr mr10 mt8' %> <% end %> @@ -207,13 +207,13 @@
    • <% if @is_teacher %>
      - <%= link_to "导出成绩", student_work_index_path(:homework => @homework.id,:order => @order, :sort => @b_sort, :name => @name, :group => @group, :comment => @comment, :status => @status, :format => 'xls'),:class=>'fl mr5 white-btn orange-btn', :id => "export_student_work"%> + <%= link_to "导出成绩", student_work_index_path(:homework => @homework.id,:order => @order, :sort => @b_sort, :name => @name, :group => @group, :comment => @comment, :status => @status, :format => 'xls'),:class=>'fl mt8 mr5 white-btn orange-btn', :id => "export_student_work"%> <% if @homework.homework_type == 1 || @homework.homework_type == 3 %> <% if @stundet_works.empty?%> - <%= link_to "导出作品附件", "javascript:void(0)", class: "fl mr5 white-btn orange-btn", :onclick => "notice_box('该检索条件下没有作品,无法下载附件')" %> + <%= link_to "导出作品附件", "javascript:void(0)", class: "fl mt8 mr5 white-btn orange-btn", :onclick => "notice_box('该检索条件下没有作品,无法下载附件')" %> <% else%> <%= link_to "导出作品附件", zipdown_assort_path(obj_class: @homework.class, obj_id: @homework, format: :json), - remote: true, class: "fl mr5 white-btn orange-btn download_homework_attachments" %> + remote: true, class: "fl mt8 mr5 white-btn orange-btn download_homework_attachments" %> <% end%> <% end %>
      @@ -228,8 +228,8 @@
    • - 你的评阅: - + 你的评阅: + 不限 <% has_comment = User.current.student_works_scores.where(:student_work_id => @homework.student_works.map(&:id), :reviewer_role => [1, 2]).group_by(&:student_work_id).count %> @@ -239,8 +239,8 @@
    • - 作品状态: - + 作品状态: + 不限 > @@ -251,8 +251,8 @@
    • - 分班情况: - + 分班情况: + 不限 <% @homework.course.course_groups.each do |group| %> diff --git a/app/views/users/_course_message.html.erb b/app/views/users/_course_message.html.erb index 651c6f208..fc95d3ece 100644 --- a/app/views/users/_course_message.html.erb +++ b/app/views/users/_course_message.html.erb @@ -50,7 +50,7 @@ <% if User.current.logged? %>
    <%= user.try(:login) %> <%= zh_course_role(h teacher.roles.where("name != 'Student'").first.name) %> - <% if User.current == @course.teacher && user.id == @course.tea_id %> - 更换管理员 - <% elsif user.id != @course.tea_id %> - 删除 + <% if is_teacher %> + <% if User.current == @course.teacher && user.id == @course.tea_id %> + 更换管理员 + <% elsif user.id != @course.tea_id %> + 删除 + <% end %> <% end %>