From cb6ce3b52acc565b45d64b19a742962b0ab73873 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Tue, 10 Dec 2019 11:50:52 +0800 Subject: [PATCH 1/8] =?UTF-8?q?=E8=B5=84=E6=BA=90=E7=9A=84=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/files_controller.rb | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/app/controllers/files_controller.rb b/app/controllers/files_controller.rb index bba78ceb7..9a3eec9ca 100644 --- a/app/controllers/files_controller.rb +++ b/app/controllers/files_controller.rb @@ -361,15 +361,16 @@ class FilesController < ApplicationController def publish_params tip_exception("缺少发布参数") if params[:delay_publish].blank? @unified_setting = 1 - if params[:delay_publish].to_i == 1 && @course.course_group_module? && @course.course_groups_count != 0 - tip_exception("分班发布设置不能为空") if params[:group_settings].blank? - min_publish_time = params[:group_settings].pluck(:publish_time).reject(&:blank?).min - max_publish_time = params[:group_settings].pluck(:publish_time).reject(&:blank?).max - tip_exception("分班发布设置不能为空") if min_publish_time.blank? - - # 分班设置中的时间一样且包含所有分班 则按统一设置处理,否则是非统一设置 - @unified_setting = 0 unless min_publish_time == max_publish_time && params[:group_settings].pluck(:group_id).flatten.sort == @course.course_groups.pluck(:id).sort - elsif params[:delay_publish].to_i == 1 + # if params[:delay_publish].to_i == 1 && @course.course_group_module? && @course.course_groups_count != 0 + # tip_exception("分班发布设置不能为空") if params[:group_settings].blank? + # min_publish_time = params[:group_settings].pluck(:publish_time).reject(&:blank?).min + # max_publish_time = params[:group_settings].pluck(:publish_time).reject(&:blank?).max + # tip_exception("分班发布设置不能为空") if min_publish_time.blank? + # + # # 分班设置中的时间一样且包含所有分班 则按统一设置处理,否则是非统一设置 + # @unified_setting = 0 unless min_publish_time == max_publish_time && params[:group_settings].pluck(:group_id).flatten.sort == @course.course_groups.pluck(:id).sort + # els + if params[:delay_publish].to_i == 1 tip_exception("缺少延期发布的时间参数") if params[:publish_time].blank? min_publish_time = params[:publish_time] end From feabdaf954528b73dedf01ccfbd59719213b774f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Tue, 10 Dec 2019 12:00:22 +0800 Subject: [PATCH 2/8] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../courses/coursesPublic/sendResource.js | 35 +++++++++---------- 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/public/react/src/modules/courses/coursesPublic/sendResource.js b/public/react/src/modules/courses/coursesPublic/sendResource.js index 7915e6674..73a0f6630 100644 --- a/public/react/src/modules/courses/coursesPublic/sendResource.js +++ b/public/react/src/modules/courses/coursesPublic/sendResource.js @@ -402,28 +402,25 @@ class Sendresource extends Component{ 延期发布 - {this.props.course_groups.length===0? - this.onChangeTimepublish(e,index,undefined,1)} - disabledTime={disabledDateTime} - disabledDate={disabledDate} - disabled={this.state.Radiovalue===1?false:true} - />:""} + this.onChangeTimepublish(e,index,undefined,1)} + disabledTime={disabledDateTime} + disabledDate={disabledDate} + disabled={this.state.Radiovalue===1?false:true} + /> (按照设置的时间定时发布) - - - From d9c7b5c8f90121bd9bc380726d1b1b726b4abc68 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Tue, 10 Dec 2019 12:42:53 +0800 Subject: [PATCH 3/8] =?UTF-8?q?=E8=B6=85=E7=AE=A1=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/admins/myshixuns_controller.rb | 1 + app/views/admins/myshixuns/shared/_list.html.erb | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/controllers/admins/myshixuns_controller.rb b/app/controllers/admins/myshixuns_controller.rb index f70a64554..adc34e95e 100644 --- a/app/controllers/admins/myshixuns_controller.rb +++ b/app/controllers/admins/myshixuns_controller.rb @@ -6,6 +6,7 @@ class Admins::MyshixunsController < Admins::BaseController myshixuns = Admins::MyshixunQuery.call(params) @myshixuns = paginate myshixuns.includes(:last_executable_task, :last_task, shixun: :user, user: { user_extension: :school }) + @params_page = params[:page] || 1 myshixun_ids = @myshixuns.map(&:id) @finish_game_count = Game.where(myshixun_id: myshixun_ids, status: 2).group(:myshixun_id).count diff --git a/app/views/admins/myshixuns/shared/_list.html.erb b/app/views/admins/myshixuns/shared/_list.html.erb index 440437320..a80a4ef23 100644 --- a/app/views/admins/myshixuns/shared/_list.html.erb +++ b/app/views/admins/myshixuns/shared/_list.html.erb @@ -1,9 +1,10 @@ + - + @@ -14,8 +15,9 @@ <% if myshixuns.present? %> - <% myshixuns.each do |myshixun| %> + <% myshixuns.each_with_index do |myshixun, index| %> +
序号 ID 标识实训名称实训名称 实训老师 完成 经验值
<%= list_index_no(@params_page.to_i, index) %> <%= myshixun.id %> <%= myshixun.identifier %> From 1d67530fa6956693c09b4c36c4cf6c0a22d9b297 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Tue, 10 Dec 2019 12:45:31 +0800 Subject: [PATCH 4/8] =?UTF-8?q?=E8=B5=84=E6=BA=90=E7=9A=84=E7=AB=8B?= =?UTF-8?q?=E5=8D=B3=E5=8F=91=E5=B8=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/files_controller.rb | 30 ++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/app/controllers/files_controller.rb b/app/controllers/files_controller.rb index 9a3eec9ca..25e0de44a 100644 --- a/app/controllers/files_controller.rb +++ b/app/controllers/files_controller.rb @@ -47,26 +47,26 @@ class FilesController < ApplicationController def bulk_publish return normal_status(403, "您没有权限进行操作") if current_user.course_identity(@course) >= 5 - tip_exception("请至少选择一个分班") if params[:group_ids].blank? && @course.course_groups.size != 0 + # tip_exception("请至少选择一个分班") if params[:group_ids].blank? && @course.course_groups.size != 0 attachments = @course.attachments.by_ids(@attachment_ids) ActiveRecord::Base.transaction do # 有分班设置时 - if @course.course_group_module? && @course.course_groups_count != 0 && params[:group_ids] - group_ids = params[:group_ids]&.reject(&:blank?) - charge_group_ids = @course.charge_group_ids(current_user) - publish_groups = charge_group_ids & group_ids if group_ids - - attachments.each do |atta| - if atta.published? && !atta.unified_setting || !atta.published? - create_atta_group_settings atta - atta.update_all(unified_setting: 0) if atta.unified_setting - none_publish_settings = atta.attachment_group_settings.where(course_group_id: publish_groups).none_published - none_publish_settings.update_all(publish_time: Time.now) - end - end - end + # if @course.course_group_module? && @course.course_groups_count != 0 && params[:group_ids] + # group_ids = params[:group_ids]&.reject(&:blank?) + # charge_group_ids = @course.charge_group_ids(current_user) + # publish_groups = charge_group_ids & group_ids if group_ids + # + # attachments.each do |atta| + # if atta.published? && !atta.unified_setting || !atta.published? + # create_atta_group_settings atta + # atta.update_attributes!(unified_setting: 0) if atta.unified_setting + # none_publish_settings = atta.attachment_group_settings.where(course_group_id: publish_groups).none_published + # none_publish_settings.update_all(publish_time: Time.now) + # end + # end + # end # 未发布的资源更新状态 attachments.where(is_publish: 0).update_all(is_publish: 1, publish_time: Time.now) From f6bb0890f800a6b0ce046277785f24911996ee9a Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Tue, 10 Dec 2019 15:43:12 +0800 Subject: [PATCH 5/8] =?UTF-8?q?=E8=B6=85=E7=BA=A7=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E5=91=98=E9=A1=B5=E9=9D=A2=E5=A2=9E=E5=8A=A0=E5=BA=8F=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/admins/courses/shared/_list.html.erb | 13 +++++++------ app/views/admins/courses/shared/_td.html.erb | 1 + app/views/admins/courses/update.js.erb | 4 +++- app/views/admins/customers/shared/_list.html.erb | 6 ++++-- .../admins/department_applies/shared/_list.html.erb | 6 ++++-- app/views/admins/department_members/create.js.erb | 4 +++- .../departments/shared/_department_item.html.erb | 1 + app/views/admins/departments/shared/_list.html.erb | 7 ++++--- app/views/admins/departments/update.js.erb | 4 +++- .../identity_authentications/shared/_list.html.erb | 6 ++++-- .../laboratories/shared/_laboratory_item.html.erb | 1 + app/views/admins/laboratories/shared/_list.html.erb | 7 ++++--- app/views/admins/laboratories/update.js.erb | 4 +++- .../admins/laboratories/update_sync_course.js.erb | 4 +++- .../admins/laboratory_shixuns/shared/_list.html.erb | 9 +++++---- .../admins/laboratory_shixuns/shared/_td.html.erb | 1 + .../laboratory_subjects/shared/_list.html.erb | 6 ++++-- app/views/admins/laboratory_users/create.js.erb | 4 +++- .../admins/library_applies/shared/_list.html.erb | 6 ++++-- app/views/admins/partners/shared/_list.html.erb | 6 ++++-- .../shared/_list.html.erb | 6 ++++-- .../project_package_applies/shared/_list.html.erb | 6 ++++-- app/views/admins/projects/shared/_list.html.erb | 6 ++++-- app/views/admins/schools/index.html.erb | 2 +- app/views/admins/schools/shared/_list.html.erb | 6 ++++-- .../shixun_authorizations/shared/_list.html.erb | 6 ++++-- .../admins/shixun_recycles/shared/_list.html.erb | 6 ++++-- .../subject_authorizations/shared/_list.html.erb | 6 ++++-- app/views/admins/subjects/shared/_list.html.erb | 12 +++++++----- .../admins/unit_applies/shared/_apply_item.html.erb | 1 + app/views/admins/unit_applies/shared/_list.html.erb | 7 ++++--- .../admins/user_statistics/shared/_list.html.erb | 12 +++++++----- app/views/admins/users/shared/_user_list.html.erb | 8 +++++--- .../admins/video_applies/shared/_list.html.erb | 6 ++++-- 34 files changed, 123 insertions(+), 67 deletions(-) diff --git a/app/views/admins/courses/shared/_list.html.erb b/app/views/admins/courses/shared/_list.html.erb index 633616462..4105c8153 100644 --- a/app/views/admins/courses/shared/_list.html.erb +++ b/app/views/admins/courses/shared/_list.html.erb @@ -1,30 +1,31 @@ + - + - + - - + + <% if courses.present? %> - <% courses.each do |course| %> + <% courses.each_with_index do |course, index| %> - <%= render 'admins/courses/shared/td', course: course %> + <%= render partial: 'admins/courses/shared/td', locals: {course: course, no: index} %> <% end %> <% else %> diff --git a/app/views/admins/courses/shared/_td.html.erb b/app/views/admins/courses/shared/_td.html.erb index 1d2da2a33..51cc4b199 100644 --- a/app/views/admins/courses/shared/_td.html.erb +++ b/app/views/admins/courses/shared/_td.html.erb @@ -1,3 +1,4 @@ +
序号 ID 课堂名称成员成员 资源 普通作业 分组作业 实训作业 试卷评测次数评测次数 私有 状态 单位 创建者 <%= sort_tag('创建时间', name: 'created_at', path: admins_courses_path) %> 首页邮件通知操作邮件通知操作
<%= list_index_no((params[:page] || 1).to_i, no) %> <%= course.id %> <%= link_to(course.name, "/courses/#{course.id}", target: '_blank') %> diff --git a/app/views/admins/courses/update.js.erb b/app/views/admins/courses/update.js.erb index 1278a2e1f..983ac22f0 100644 --- a/app/views/admins/courses/update.js.erb +++ b/app/views/admins/courses/update.js.erb @@ -1 +1,3 @@ -$("#course-item-<%= @course.id %>").html("<%= j render partial: "admins/courses/shared/td",locals: {course: @course} %>") \ No newline at end of file +var index = $("#course-item-<%= @course.id %>").children(":first").html(); +$("#course-item-<%= @course.id %>").html("<%= j render partial: "admins/courses/shared/td",locals: {course: @course, no: 1} %>"); +$("#course-item-<%= @course.id %>").children(":first").html(index); \ No newline at end of file diff --git a/app/views/admins/customers/shared/_list.html.erb b/app/views/admins/customers/shared/_list.html.erb index 0ba5638cb..6f84db4e5 100644 --- a/app/views/admins/customers/shared/_list.html.erb +++ b/app/views/admins/customers/shared/_list.html.erb @@ -1,15 +1,17 @@ - + + <% if customers.present? %> - <% customers.each do |customer| %> + <% customers.each_with_index do |customer, index| %> +
客户名称序号客户名称 <%= sort_tag('添加时间', name: 'created_at', path: admins_partner_customers_path(current_partner)) %> 操作
<%= list_index_no((params[:page] || 1).to_i, index) %> <%= customer.school&.name %> <%= customer.created_at&.strftime('%Y-%m-%d %H:%M') %> diff --git a/app/views/admins/department_applies/shared/_list.html.erb b/app/views/admins/department_applies/shared/_list.html.erb index 0a1d803be..87d5ab66f 100644 --- a/app/views/admins/department_applies/shared/_list.html.erb +++ b/app/views/admins/department_applies/shared/_list.html.erb @@ -1,18 +1,20 @@ + - + <% if applies.present? %> - <% applies.each do |apply| %> + <% applies.each_with_index do |apply, index| %> + diff --git a/app/views/admins/department_members/create.js.erb b/app/views/admins/department_members/create.js.erb index 4355c7432..6bf0a6ac3 100644 --- a/app/views/admins/department_members/create.js.erb +++ b/app/views/admins/department_members/create.js.erb @@ -1,4 +1,6 @@ $('.modal.admin-add-department-member-modal').modal('hide'); $.notify({ message: '操作成功' }); -$('.department-list-table .department-item-<%= current_department.id %>').html("<%= j(render partial: 'admins/departments/shared/department_item', locals: { department: current_department }) %>") \ No newline at end of file +var index = $(".department-item-<%= current_department.id %>").children(":first").html(); +$('.department-list-table .department-item-<%= current_department.id %>').html("<%= j(render partial: 'admins/departments/shared/department_item', locals: { department: current_department, index: 1 }) %>"); +$(".department-item-<%= current_department.id %>").children(":first").html(index); \ No newline at end of file diff --git a/app/views/admins/departments/shared/_department_item.html.erb b/app/views/admins/departments/shared/_department_item.html.erb index 64b4ee70b..62f3a81ac 100644 --- a/app/views/admins/departments/shared/_department_item.html.erb +++ b/app/views/admins/departments/shared/_department_item.html.erb @@ -1,3 +1,4 @@ + <% not_list = defined?(:users_count) %> diff --git a/app/views/admins/departments/shared/_list.html.erb b/app/views/admins/departments/shared/_list.html.erb index 6af63d6f4..09ba2a65f 100644 --- a/app/views/admins/departments/shared/_list.html.erb +++ b/app/views/admins/departments/shared/_list.html.erb @@ -1,10 +1,11 @@
序号 ID 部门名称 单位名称创建者创建者 <%= sort_tag('创建于', name: 'created_at', path: admins_department_applies_path) %> 操作
<%= list_index_no((params[:page] || 1).to_i, index) %> <%= apply.id %> <%= apply.name %> <%= apply.school.try(:name) %><%= list_index_no((params[:page] || 1).to_i, index) %><%= overflow_hidden_span department.name, width: 150 %>
+ - + @@ -14,9 +15,9 @@ <% if departments.present? %> - <% departments.each do |department| %> + <% departments.each_with_index do |department, index| %> - <%= render 'admins/departments/shared/department_item', department: department %> + <%= render partial: 'admins/departments/shared/department_item', locals: {department: department, index: index} %> <% end %> <% else %> diff --git a/app/views/admins/departments/update.js.erb b/app/views/admins/departments/update.js.erb index 359bac59c..d20ca9524 100644 --- a/app/views/admins/departments/update.js.erb +++ b/app/views/admins/departments/update.js.erb @@ -1,4 +1,6 @@ $('.modal.admin-edit-department-modal').modal('hide'); $.notify({ message: '操作成功' }); -$('.department-list-table .department-item-<%= current_department.id %>').html("<%= j(render partial: 'admins/departments/shared/department_item', locals: { department: current_department }) %>") \ No newline at end of file +var index = $(".department-item-<%= current_department.id %>").children(":first").html(); +$('.department-list-table .department-item-<%= current_department.id %>').html("<%= j(render partial: 'admins/departments/shared/department_item', locals: {department: current_department, index: 1}) %>"); +$(".department-item-<%= current_department.id %>").children(":first").html(index); \ No newline at end of file diff --git a/app/views/admins/identity_authentications/shared/_list.html.erb b/app/views/admins/identity_authentications/shared/_list.html.erb index 607feb93a..6e12d1c54 100644 --- a/app/views/admins/identity_authentications/shared/_list.html.erb +++ b/app/views/admins/identity_authentications/shared/_list.html.erb @@ -3,6 +3,7 @@
序号 部门名称 单位名称 用户数已职业认证已职业认证 部门管理员 统计链接 云主机数
+ <% unless is_processed %> - + <% unless is_processed %> <% if applies.present? %> - <% applies.each do |apply| %> + <% applies.each_with_index do |apply, index| %> <% user = apply.user %> + <% unless is_processed %> <% end %> diff --git a/app/views/admins/laboratories/shared/_laboratory_item.html.erb b/app/views/admins/laboratories/shared/_laboratory_item.html.erb index 81a45ca71..765616926 100644 --- a/app/views/admins/laboratories/shared/_laboratory_item.html.erb +++ b/app/views/admins/laboratories/shared/_laboratory_item.html.erb @@ -1,4 +1,5 @@ <% school = laboratory.school %> +
序号 <%= check_box_tag('all-check', 1, false, id: nil, class: 'batch-all-check-box', @@ -13,7 +14,7 @@ 姓名 身份证号 学校/单位职称职称 照片 @@ -33,9 +34,10 @@
<%= list_index_no((params[:page] || 1).to_i, index) %><%= check_box_tag('ids[]', apply.id, false, id: nil, class: 'batch-check-box') %><%= list_index_no((params[:page] || 1).to_i, index) %> <%= school&.name || 'EduCoder主站' %> <% if laboratory.identifier %> diff --git a/app/views/admins/laboratories/shared/_list.html.erb b/app/views/admins/laboratories/shared/_list.html.erb index 2520b3276..a731be44a 100644 --- a/app/views/admins/laboratories/shared/_list.html.erb +++ b/app/views/admins/laboratories/shared/_list.html.erb @@ -1,6 +1,7 @@ + @@ -9,14 +10,14 @@ - + <% if laboratories.present? %> - <% laboratories.each do |laboratory| %> + <% laboratories.each_with_index do |laboratory, index| %> - <%= render 'admins/laboratories/shared/laboratory_item', laboratory: laboratory %> + <%= render partial: 'admins/laboratories/shared/laboratory_item', locals: {laboratory: laboratory, index: index} %> <% end %> <% else %> diff --git a/app/views/admins/laboratories/update.js.erb b/app/views/admins/laboratories/update.js.erb index 1b9f307a6..149539ad6 100644 --- a/app/views/admins/laboratories/update.js.erb +++ b/app/views/admins/laboratories/update.js.erb @@ -1 +1,3 @@ -$(".laboratory-item-<%= @laboratory.id %>").html("<%= j render partial: "admins/laboratories/shared/laboratory_item",locals: {laboratory: @laboratory} %>") \ No newline at end of file +var index = $(".laboratory-item-<%= @laboratory.id %>").children(":first").html(); +$(".laboratory-item-<%= @laboratory.id %>").html("<%= j render partial: "admins/laboratories/shared/laboratory_item",locals: {laboratory: @laboratory, index: 1} %>"); +$(".laboratory-item-<%= @laboratory.id %>").children(":first").html(index); \ No newline at end of file diff --git a/app/views/admins/laboratories/update_sync_course.js.erb b/app/views/admins/laboratories/update_sync_course.js.erb index 5ae68f673..663f56ee1 100644 --- a/app/views/admins/laboratories/update_sync_course.js.erb +++ b/app/views/admins/laboratories/update_sync_course.js.erb @@ -1 +1,3 @@ -$("#laboratory-item-<%= @laboratory.id %>").html("<%= j render partial: 'admins/laboratories/shared/laboratory_item', locals: {laboratory: @laboratory} %>") \ No newline at end of file +var index = $(".laboratory-item-<%= @laboratory.id %>").children(":first").html(); +$("#laboratory-item-<%= @laboratory.id %>").html("<%= j render partial: 'admins/laboratories/shared/laboratory_item', locals: {laboratory: @laboratory, index: 1} %>"); +$(".laboratory-item-<%= @laboratory.id %>").children(":first").html(index); \ No newline at end of file diff --git a/app/views/admins/laboratory_shixuns/shared/_list.html.erb b/app/views/admins/laboratory_shixuns/shared/_list.html.erb index e1244c472..462486f4b 100644 --- a/app/views/admins/laboratory_shixuns/shared/_list.html.erb +++ b/app/views/admins/laboratory_shixuns/shared/_list.html.erb @@ -1,21 +1,22 @@
序号 单位名称 域名 统计链接同步课堂 同步实践课程 同步实训操作操作
- + + - + <% if laboratory_shixuns.present? %> - <% laboratory_shixuns.each do |laboratory_shixun| %> + <% laboratory_shixuns.each_with_index do |laboratory_shixun, index| %> - <%= render partial: 'admins/laboratory_shixuns/shared/td', locals: { laboratory_shixun: laboratory_shixun } %> + <%= render partial: 'admins/laboratory_shixuns/shared/td', locals: { laboratory_shixun: laboratory_shixun, index: index } %> <% end %> <% else %> diff --git a/app/views/admins/laboratory_shixuns/shared/_td.html.erb b/app/views/admins/laboratory_shixuns/shared/_td.html.erb index dbdf0df75..d987b53b4 100644 --- a/app/views/admins/laboratory_shixuns/shared/_td.html.erb +++ b/app/views/admins/laboratory_shixuns/shared/_td.html.erb @@ -1,5 +1,6 @@ <%- shixun = laboratory_shixun.shixun -%> +
实训名称序号实训名称 技术平台 技术体系 封面 创建者状态状态 执行时间 操作
<%= list_index_no((params[:page] || 1).to_i, index) %> <%= link_to "/shixuns/#{shixun.identifier}", target: '_blank' do %> <%= shixun.name %> diff --git a/app/views/admins/laboratory_subjects/shared/_list.html.erb b/app/views/admins/laboratory_subjects/shared/_list.html.erb index 55f67dea8..c40d02260 100644 --- a/app/views/admins/laboratory_subjects/shared/_list.html.erb +++ b/app/views/admins/laboratory_subjects/shared/_list.html.erb @@ -1,7 +1,8 @@ - + + @@ -13,10 +14,11 @@ <% if laboratory_subjects.present? %> - <% laboratory_subjects.each do |laboratory_subject| %> + <% laboratory_subjects.each_with_index do |laboratory_subject, index| %> <%- subject = laboratory_subject.subject -%> +
课程名称序号课程名称 技术体系 等级体系 封面
<%= list_index_no((params[:page] || 1).to_i, index) %> <%= link_to(subject.name, "/paths/#{subject.id}", target: '_blank') %> 首页 diff --git a/app/views/admins/laboratory_users/create.js.erb b/app/views/admins/laboratory_users/create.js.erb index f43fd7887..604e62943 100644 --- a/app/views/admins/laboratory_users/create.js.erb +++ b/app/views/admins/laboratory_users/create.js.erb @@ -1,4 +1,6 @@ $('.modal.admin-add-laboratory-user-modal').modal('hide'); $.notify({ message: '操作成功' }); -$('.laboratory-list-table .laboratory-item-<%= current_laboratory.id %>').html("<%= j(render partial: 'admins/laboratories/shared/laboratory_item', locals: { laboratory: current_laboratory }) %>") \ No newline at end of file +var index = $(".laboratory-item-<%= current_laboratory.id %>").children(":first").html(); +$('.laboratory-list-table .laboratory-item-<%= current_laboratory.id %>').html("<%= j(render partial: 'admins/laboratories/shared/laboratory_item', locals: {laboratory: current_laboratory, index: 1}) %>"); +$(".laboratory-item-<%= current_laboratory.id %>").children(":first").html(index); \ No newline at end of file diff --git a/app/views/admins/library_applies/shared/_list.html.erb b/app/views/admins/library_applies/shared/_list.html.erb index 783d0db30..fde3d1d1a 100644 --- a/app/views/admins/library_applies/shared/_list.html.erb +++ b/app/views/admins/library_applies/shared/_list.html.erb @@ -3,11 +3,12 @@ + - + <% if is_processed %> @@ -18,10 +19,11 @@ <% if applies.present? %> - <% applies.each do |apply| %> + <% applies.each_with_index do |apply, index| %> <% user = apply.library.user %> <% library = apply.library %> +
序号 头像 姓名 教学案例 案例描述时间时间拒绝原因 状态
<%= list_index_no((params[:page] || 1).to_i, index) %> <%= link_to "/users/#{user.login}", class: 'professional-authentication-avatar', target: '_blank', data: { toggle: 'tooltip', title: '个人主页' } do %> diff --git a/app/views/admins/partners/shared/_list.html.erb b/app/views/admins/partners/shared/_list.html.erb index 0bebc2a4b..71153c175 100644 --- a/app/views/admins/partners/shared/_list.html.erb +++ b/app/views/admins/partners/shared/_list.html.erb @@ -1,15 +1,17 @@ - + + <% if partners.present? %> - <% partners.each do |partner| %> + <% partners.each_with_index do |partner, index| %> + diff --git a/app/views/admins/professional_authentications/shared/_list.html.erb b/app/views/admins/professional_authentications/shared/_list.html.erb index 6ec6355ba..7ffa5837e 100644 --- a/app/views/admins/professional_authentications/shared/_list.html.erb +++ b/app/views/admins/professional_authentications/shared/_list.html.erb @@ -3,6 +3,7 @@
名称序号名称 <%= sort_tag('添加时间', name: 'created_at', path: admins_partners_path) %> 操作
<%= list_index_no((params[:page] || 1).to_i, index) %> <%= link_to partner.school&.name || partner.name, customers_partner_path(partner), target: '_blank' %>
+ <% unless is_processed %> - + <% unless is_processed %> <% if applies.present? %> - <% applies.each do |apply| %> + <% applies.each_with_index do |apply, index| %> <% user = apply.user %> + <% unless is_processed %> <% end %> diff --git a/app/views/admins/project_package_applies/shared/_list.html.erb b/app/views/admins/project_package_applies/shared/_list.html.erb index d94c96184..bec0912ca 100644 --- a/app/views/admins/project_package_applies/shared/_list.html.erb +++ b/app/views/admins/project_package_applies/shared/_list.html.erb @@ -3,11 +3,12 @@
序号 <%= check_box_tag('all-check', 1, false, id: nil, class: 'batch-all-check-box', @@ -12,7 +13,7 @@ 头像 姓名 学校/单位职称职称 照片 @@ -31,9 +32,10 @@
<%= list_index_no((params[:page] || 1).to_i, index) %><%= check_box_tag('ids[]', apply.id, false, id: nil, class: 'batch-check-box') %>
+ - + <% if is_processed %> @@ -18,10 +19,11 @@ <% if applies.present? %> - <% applies.each do |apply| %> + <% applies.each_with_index do |apply, index| %> <% package = apply.project_package %> <% user = package.creator %> +
序号 头像 姓名 众包需求 需求描述时间时间拒绝原因 状态
<%= list_index_no((params[:page] || 1).to_i, index) %> <%= link_to "/users/#{user.login}", class: 'professional-authentication-avatar', target: '_blank', data: { toggle: 'tooltip', title: '个人主页' } do %> diff --git a/app/views/admins/projects/shared/_list.html.erb b/app/views/admins/projects/shared/_list.html.erb index 8a84a72d0..e2a6307ad 100644 --- a/app/views/admins/projects/shared/_list.html.erb +++ b/app/views/admins/projects/shared/_list.html.erb @@ -1,6 +1,7 @@ + @@ -11,14 +12,15 @@ - + <% if projects.present? %> - <% projects.each do |project| %> + <% projects.each_with_index do |project, index| %> +
序号 ID 项目名称 公开里程碑 成员 管理员<%= sort_tag('创建时间', name: 'created_at', path: admins_projects_path) %><%= sort_tag('创建时间', name: 'created_at', path: admins_projects_path) %> 操作
<%= list_index_no((params[:page] || 1).to_i, index) %> <%= project.id %> <%= link_to(project.name, "/projects/#{project.id}", target: '_blank') %> diff --git a/app/views/admins/schools/index.html.erb b/app/views/admins/schools/index.html.erb index 9c41067ee..56cbadd9d 100644 --- a/app/views/admins/schools/index.html.erb +++ b/app/views/admins/schools/index.html.erb @@ -4,7 +4,7 @@
<%= form_tag(admins_schools_path, method: :get, class: 'form-inline search-form flex-1', remote: true) do %> - <%= text_field_tag(:keyword, params[:keyword], class: 'form-control col-sm-2 ml-3', placeholder: '部门名称检索') %> + <%= text_field_tag(:keyword, params[:keyword], class: 'form-control col-sm-2 ml-3', placeholder: '单位名称检索') %> <%= submit_tag('搜索', class: 'btn btn-primary ml-3', 'data-disable-with': '搜索中...') %> <% end %> diff --git a/app/views/admins/schools/shared/_list.html.erb b/app/views/admins/schools/shared/_list.html.erb index ec7475028..ff0b17992 100644 --- a/app/views/admins/schools/shared/_list.html.erb +++ b/app/views/admins/schools/shared/_list.html.erb @@ -1,6 +1,7 @@ + @@ -11,13 +12,14 @@ - + <% if schools.present? %> - <% schools.each do |school| %> + <% schools.each_with_index do |school, index| %> +
序号 ID LOGO 标识码<%= sort_tag('用户数', name: 'users_count', path: admins_schools_path) %> 部门数 <%= sort_tag('创建时间', name: 'created_at', path: admins_schools_path) %>操作操作
<%= list_index_no((params[:page] || 1).to_i, index) %> <%= school.id %> <% if Util::FileManage.exists?(school) %> diff --git a/app/views/admins/shixun_authorizations/shared/_list.html.erb b/app/views/admins/shixun_authorizations/shared/_list.html.erb index c1dec5f45..c3828ec86 100644 --- a/app/views/admins/shixun_authorizations/shared/_list.html.erb +++ b/app/views/admins/shixun_authorizations/shared/_list.html.erb @@ -3,11 +3,12 @@ + - + <% if is_processed %> @@ -19,12 +20,13 @@ <% if applies.present? %> - <% applies.each do |apply| %> + <% applies.each_with_index do |apply, index| %> <% user = apply.user %> <% shixun = shixun_map[apply.container_id] %> <% content_review = shixun.shixun_reviews.select{|sr| sr.review_type == 'Content'}.first %> <% perference_review = shixun.shixun_reviews.select{|sr| sr.review_type == 'Performance'}.first %> +
序号 头像 创建者 实训名称 审核情况任务数任务数 时间拒绝原因
<%= list_index_no((params[:page] || 1).to_i, index) %> <%= link_to "/users/#{user.login}", class: 'shixun-authorization-avatar', target: '_blank', data: { toggle: 'tooltip', title: '个人主页' } do %> diff --git a/app/views/admins/shixun_recycles/shared/_list.html.erb b/app/views/admins/shixun_recycles/shared/_list.html.erb index 60d2742e9..5518fc753 100644 --- a/app/views/admins/shixun_recycles/shared/_list.html.erb +++ b/app/views/admins/shixun_recycles/shared/_list.html.erb @@ -1,16 +1,18 @@ + - + <% if shixuns.present? %> - <% shixuns.each do |shixun| %> + <% shixuns.each_with_index do |shixun, index| %> + diff --git a/app/views/admins/subject_authorizations/shared/_list.html.erb b/app/views/admins/subject_authorizations/shared/_list.html.erb index 28a699e22..94503dad7 100644 --- a/app/views/admins/subject_authorizations/shared/_list.html.erb +++ b/app/views/admins/subject_authorizations/shared/_list.html.erb @@ -3,9 +3,10 @@
序号 ID 实训名称子站源子站源 创建者 <%= sort_tag('创建于', name: 'created_at', path: admins_shixun_recycles_path) %> 操作
<%= list_index_no((params[:page] || 1).to_i, index) %> <%= shixun.identifier %> <%= link_to overflow_hidden_span(shixun.name), "/shixuns/#{shixun.identifier}", :target => "_blank", :title => shixun.name %> <%= shixun.laboratory&.school&.name %>
+ - + @@ -20,10 +21,11 @@ <% if applies.present? %> - <% applies.each do |apply| %> + <% applies.each_with_index do |apply, index| %> <% user = apply.user %> <% subject = subject_map[apply.container_id] %> +
序号 头像 创建者实践课程名称实践课程名称 阶段数 实训数 关卡数
<%= list_index_no((params[:page] || 1).to_i, index) %> <%= link_to "/users/#{user.login}", class: 'subject-authorization-avatar', target: '_blank', data: { toggle: 'tooltip', title: '个人主页' } do %> diff --git a/app/views/admins/subjects/shared/_list.html.erb b/app/views/admins/subjects/shared/_list.html.erb index 5a37b64e7..33d37f21d 100644 --- a/app/views/admins/subjects/shared/_list.html.erb +++ b/app/views/admins/subjects/shared/_list.html.erb @@ -1,11 +1,12 @@ + - - - - + + + + @@ -17,8 +18,9 @@ <% if subjects.present? %> - <% subjects.each do |subject| %> + <% subjects.each_with_index do |subject, index| %> +
序号 名称阶段数实训数技术体系等级体系阶段数实训数技术体系等级体系 封面 创建者 单位
<%= list_index_no((params[:page] || 1).to_i, index) %> <%= link_to(subject.name, "/paths/#{subject.id}", target: '_blank') %> 首页 diff --git a/app/views/admins/unit_applies/shared/_apply_item.html.erb b/app/views/admins/unit_applies/shared/_apply_item.html.erb index 084826d72..b7d38b776 100644 --- a/app/views/admins/unit_applies/shared/_apply_item.html.erb +++ b/app/views/admins/unit_applies/shared/_apply_item.html.erb @@ -1,3 +1,4 @@ +<%= list_index_no((params[:page] || 1).to_i, index) %> <%= apply.id %> <%= overflow_hidden_span apply.name %> diff --git a/app/views/admins/unit_applies/shared/_list.html.erb b/app/views/admins/unit_applies/shared/_list.html.erb index c28ce7967..75b9c720b 100644 --- a/app/views/admins/unit_applies/shared/_list.html.erb +++ b/app/views/admins/unit_applies/shared/_list.html.erb @@ -1,9 +1,10 @@ + - + @@ -12,9 +13,9 @@ <% if applies.present? %> - <% applies.each do |apply| %> + <% applies.each_with_index do |apply, index| %> - <%= render partial: "admins/unit_applies/shared/apply_item", locals: {apply: apply} %> + <%= render partial: "admins/unit_applies/shared/apply_item", locals: {apply: apply, index: index} %> <% end %> <% else %> diff --git a/app/views/admins/user_statistics/shared/_list.html.erb b/app/views/admins/user_statistics/shared/_list.html.erb index 5759d2f38..1e63fd0ac 100644 --- a/app/views/admins/user_statistics/shared/_list.html.erb +++ b/app/views/admins/user_statistics/shared/_list.html.erb @@ -1,20 +1,22 @@
序号 ID 单位名称地区地区 详细地址 申请者 <%= sort_tag('创建于', name: 'created_at', path: admins_unit_applies_path) %>
+ - - - - + + + + <% if users.present? %> - <% users.each do |user| %> + <% users.each_with_index do |user, index| %> +
序号 姓名 单位部门 学习关卡数<%#= sort_tag('学习关卡数', name: 'study_challenge_count', path: admins_user_statistics_path) %>完成关卡数<%#= sort_tag('完成关卡数', name: 'finish_challenge_count', path: admins_user_statistics_path) %><%= sort_tag('学习实训数', name: 'study_shixun_count', path: admins_user_statistics_path) %><%= sort_tag('完成实训数', name: 'finish_shixun_count', path: admins_user_statistics_path) %>评测次数完成关卡数<%#= sort_tag('完成关卡数', name: 'finish_challenge_count', path: admins_user_statistics_path) %><%= sort_tag('学习实训数', name: 'study_shixun_count', path: admins_user_statistics_path) %><%= sort_tag('完成实训数', name: 'finish_shixun_count', path: admins_user_statistics_path) %>评测次数 实战时间
<%= list_index_no((params[:page] || 1).to_i, index) %> <%= link_to "/users/#{user.login}", target: '_blank' do %> <%= overflow_hidden_span user.real_name, width: 100 %> diff --git a/app/views/admins/users/shared/_user_list.html.erb b/app/views/admins/users/shared/_user_list.html.erb index 0a21baafe..36243e547 100644 --- a/app/views/admins/users/shared/_user_list.html.erb +++ b/app/views/admins/users/shared/_user_list.html.erb @@ -1,8 +1,9 @@ - - + + + @@ -15,8 +16,9 @@ <% if users.present? %> - <% users.each do |user| %> + <% users.each_with_index do |user, index| %> +
真实姓名邮件地址序号真实姓名邮件地址 手机号码 单位 角色
<%= list_index_no((params[:page] || 1).to_i, index) %> <%= link_to "/users/#{user.login}", target: '_blank' do %> <%= overflow_hidden_span user.real_name, width: 100 %> diff --git a/app/views/admins/video_applies/shared/_list.html.erb b/app/views/admins/video_applies/shared/_list.html.erb index 5e472bd4b..3466d21ba 100644 --- a/app/views/admins/video_applies/shared/_list.html.erb +++ b/app/views/admins/video_applies/shared/_list.html.erb @@ -3,12 +3,13 @@ + - + <% if is_processed %> @@ -19,10 +20,11 @@ <% if applies.present? %> - <% applies.each do |v| %> + <% applies.each_with_index do |v, index| %> <% video = v.video %> <% user = video.user %> + diff --git a/app/views/admins/shixun_settings/shared/_td.html.erb b/app/views/admins/shixun_settings/shared/_td.html.erb index 905183873..fc5af645a 100644 --- a/app/views/admins/shixun_settings/shared/_td.html.erb +++ b/app/views/admins/shixun_settings/shared/_td.html.erb @@ -48,6 +48,7 @@ <%= check_box_tag :homepage_show,!shixun.homepage_show,shixun.homepage_show,remote:true,data:{id:shixun.id,toggle:"tooltip",placement:"top"},class:"shixun-setting-form",title:"首页" %> <%= check_box_tag :task_pass,!shixun.task_pass,shixun.task_pass,remote:true,data:{id:shixun.id,toggle:"tooltip",placement:"top"},class:"shixun-setting-form" ,title:"跳关"%> <%= check_box_tag :code_hidden,!shixun.code_hidden,shixun.code_hidden,remote:true,data:{id:shixun.id,toggle:"tooltip",placement:"top"},class:"shixun-setting-form" ,title:"隐藏目录"%> + <%= check_box_tag :vip,!shixun.vip,shixun.vip,remote:true,data:{id:shixun.id,toggle:"tooltip",placement:"top"},class:"shixun-setting-form" ,title:"vip"%>
序号 头像 姓名 视频名称 视频大小 播放链接时间时间拒绝原因 状态
<%= list_index_no((params[:page] || 1).to_i, index) %> <%= link_to "/users/#{user.login}", class: 'professional-authentication-avatar', target: '_blank', data: { toggle: 'tooltip', title: '个人主页' } do %> From 00efb1ae25a0377093e1680a8a8488baa7bf8c1f Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Tue, 10 Dec 2019 16:57:15 +0800 Subject: [PATCH 6/8] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E5=A2=9E=E5=8A=A0vip=E7=9A=84=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/admins/shixun_settings_controller.rb | 5 +++-- app/queries/admins/shixun_settings_query.rb | 1 + app/views/admins/shixun_settings/index.html.erb | 6 ++++++ app/views/admins/shixun_settings/shared/_list.html.erb | 2 +- app/views/admins/shixun_settings/shared/_td.html.erb | 1 + db/migrate/20191210084737_add_vip_to_shixun.rb | 5 +++++ 6 files changed, 17 insertions(+), 3 deletions(-) create mode 100644 db/migrate/20191210084737_add_vip_to_shixun.rb diff --git a/app/controllers/admins/shixun_settings_controller.rb b/app/controllers/admins/shixun_settings_controller.rb index bd54018cd..6dbbc077a 100644 --- a/app/controllers/admins/shixun_settings_controller.rb +++ b/app/controllers/admins/shixun_settings_controller.rb @@ -15,7 +15,8 @@ class Admins::ShixunSettingsController < Admins::BaseController hidden: params[:hidden].present? ? params[:hidden] : false, homepage_show: params[:homepage_show].present? ? params[:homepage_show] : false, task_pass: params[:task_pass].present? ? params[:task_pass] : false, - code_hidden: params[:code_hidden].present? ? params[:code_hidden] : false + code_hidden: params[:code_hidden].present? ? params[:code_hidden] : false, + vip: params[:vip].present? ? params[:vip] : false } @shixuns_type_check = MirrorRepository.pluck(:type_name,:id) @@ -126,6 +127,6 @@ class Admins::ShixunSettingsController < Admins::BaseController end def setting_params - params.permit(:use_scope,:excute_time,:close,:status,:can_copy,:webssh,:hidden,:homepage_show,:task_pass,:code_hidden,:page_no, :id,tag_repertoires:[]) + params.permit(:use_scope,:excute_time,:close,:status,:can_copy,:webssh,:hidden,:homepage_show,:task_pass,:code_hidden,:vip,:page_no,:id,tag_repertoires:[]) end end diff --git a/app/queries/admins/shixun_settings_query.rb b/app/queries/admins/shixun_settings_query.rb index ab871b58e..377e7bf60 100644 --- a/app/queries/admins/shixun_settings_query.rb +++ b/app/queries/admins/shixun_settings_query.rb @@ -51,6 +51,7 @@ class Admins::ShixunSettingsQuery < ApplicationQuery all_shixuns = all_shixuns.where(homepage_show: params[:homepage_show]) if params[:homepage_show] all_shixuns = all_shixuns.where(task_pass: params[:task_pass]) if params[:task_pass] all_shixuns = all_shixuns.where(code_hidden: params[:code_hidden]) if params[:code_hidden] + all_shixuns = all_shixuns.where(vip: params[:vip]) if params[:vip] custom_sort(all_shixuns, params[:sort_by], params[:sort_direction]) end diff --git a/app/views/admins/shixun_settings/index.html.erb b/app/views/admins/shixun_settings/index.html.erb index 7aab73f64..66286926a 100644 --- a/app/views/admins/shixun_settings/index.html.erb +++ b/app/views/admins/shixun_settings/index.html.erb @@ -65,6 +65,12 @@ 只看已隐藏文件目录 +
+ +
<% end %> diff --git a/app/views/admins/shixun_settings/shared/_list.html.erb b/app/views/admins/shixun_settings/shared/_list.html.erb index aee4307b1..549c7edf4 100644 --- a/app/views/admins/shixun_settings/shared/_list.html.erb +++ b/app/views/admins/shixun_settings/shared/_list.html.erb @@ -15,7 +15,7 @@
操作
- ssh/隐藏/首页/跳关/隐藏目录 + ssh/隐藏/首页/跳关/隐藏目录/vip