Merge remote-tracking branch 'origin/dev_aliyun' into dev_aliyun

dev_daiao
杨树明 5 years ago
commit 4f9d70afea

@ -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

@ -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

@ -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)
@ -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

@ -1,8 +1,8 @@
class HacksController < ApplicationController
before_action :require_login, except: [:index]
before_action :find_hack, only: [:edit, :update, :publish, :start, :update_set, :delete_set]
before_action :require_teacher_identity, only: [:create, :update_set, :edit, :update]
before_action :require_auth_identity, only: [:update, :edit, :publish, :update_set, :delete_set]
before_action :find_hack, only: [:edit, :update, :publish, :start, :update_set, :delete_set, :destroy]
before_action :require_teacher_identity, only: [:create]
before_action :require_auth_identity, only: [:update, :edit, :publish, :update_set, :delete_set, :destroy]
# 开启编程,如果第一次开启,创建一条记录,如果已经开启过的话,直接返回标识即可
@ -112,6 +112,11 @@ class HacksController < ApplicationController
def new;end
def destroy
@hack.destroy
render_ok
end
private
# 实名认证老师,管理员与运营人员权限
def require_teacher_identity

@ -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

@ -1,30 +1,31 @@
<table class="table table-hover text-center subject-list-table">
<thead class="thead-light">
<tr>
<th width="4%">序号</th>
<th width="4%">ID</th>
<th width="10%" class="text-left">课堂名称</th>
<th width="6%">成员</th>
<th width="5%">成员</th>
<th width="4%">资源</th>
<th width="4%">普通作业</th>
<th width="4%">分组作业</th>
<th width="4%">实训作业</th>
<th width="4%">试卷</th>
<th width="7%">评测次数</th>
<th width="6%">评测次数</th>
<th width="4%">私有</th>
<th width="6%">状态</th>
<th width="10%">单位</th>
<th width="7%">创建者</th>
<th width="10%"><%= sort_tag('创建时间', name: 'created_at', path: admins_courses_path) %></th>
<th width="4%">首页</th>
<th width="6%">邮件通知</th>
<th width="6%">操作</th>
<th width="5%">邮件通知</th>
<th width="5%">操作</th>
</tr>
</thead>
<tbody>
<% if courses.present? %>
<% courses.each do |course| %>
<% courses.each_with_index do |course, index| %>
<tr class="course-item-<%= course.id %>">
<%= render 'admins/courses/shared/td', course: course %>
<%= render partial: 'admins/courses/shared/td', locals: {course: course, no: index} %>
</tr>
<% end %>
<% else %>

@ -1,3 +1,4 @@
<td><%= list_index_no((params[:page] || 1).to_i, no) %></td>
<td><%= course.id %></td>
<td class="text-left">
<%= link_to(course.name, "/courses/#{course.id}", target: '_blank') %>

@ -1 +1,3 @@
$("#course-item-<%= @course.id %>").html("<%= j render partial: "admins/courses/shared/td",locals: {course: @course} %>")
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);

@ -1,15 +1,17 @@
<table class="table table-hover text-center customer-list-table">
<thead class="thead-light">
<tr>
<th width="50%" class="text-left">客户名称</th>
<th width="10%">序号</th>
<th width="40%" class="text-left">客户名称</th>
<th width="30%"><%= sort_tag('添加时间', name: 'created_at', path: admins_partner_customers_path(current_partner)) %></th>
<th width="20%">操作</th>
</tr>
</thead>
<tbody>
<% if customers.present? %>
<% customers.each do |customer| %>
<% customers.each_with_index do |customer, index| %>
<tr class="customer-item-<%= customer.id %>">
<td><%= list_index_no((params[:page] || 1).to_i, index) %></td>
<td class="text-left"><%= customer.school&.name %></td>
<td><%= customer.created_at&.strftime('%Y-%m-%d %H:%M') %></td>
<td>

@ -1,18 +1,20 @@
<table class="table table-hover text-center department_applies-list-table">
<thead class="thead-light">
<tr>
<th width="4%">序号</th>
<th width="8%">ID</th>
<th width="22%" class="text-left">部门名称</th>
<th width="20%" class="text-left">单位名称</th>
<th width="15%">创建者</th>
<th width="11%">创建者</th>
<th width="15%"><%= sort_tag('创建于', name: 'created_at', path: admins_department_applies_path) %></th>
<th width="20%">操作</th>
</tr>
</thead>
<tbody>
<% if applies.present? %>
<% applies.each do |apply| %>
<% applies.each_with_index do |apply, index| %>
<tr class="department-apply-<%= apply.id %>">
<td><%= list_index_no((params[:page] || 1).to_i, index) %></td>
<td><%= apply.id %></td>
<td class="text-left"> <%= apply.name %></td>
<td class="text-left"> <%= apply.school.try(:name) %></td>

@ -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 }) %>")
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);

@ -1,3 +1,4 @@
<td><%= list_index_no((params[:page] || 1).to_i, index) %></td>
<% not_list = defined?(:users_count) %>
<td class="text-left"><%= overflow_hidden_span department.name, width: 150 %></td>

@ -1,10 +1,11 @@
<table class="table table-hover text-center department-list-table">
<thead class="thead-light">
<tr>
<th width="4%">序号</th>
<th width="14%" class="text-left">部门名称</th>
<th width="14%" class="text-left">单位名称</th>
<th width="6%">用户数</th>
<th width="10%">已职业认证</th>
<th width="6%">已职业认证</th>
<th width="20%">部门管理员</th>
<th width="8%">统计链接</th>
<th width="8%">云主机数</th>
@ -14,9 +15,9 @@
</thead>
<tbody>
<% if departments.present? %>
<% departments.each do |department| %>
<% departments.each_with_index do |department, index| %>
<tr class="department-item-<%= department.id %>">
<%= render 'admins/departments/shared/department_item', department: department %>
<%= render partial: 'admins/departments/shared/department_item', locals: {department: department, index: index} %>
</tr>
<% end %>
<% else %>

@ -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 }) %>")
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);

@ -3,6 +3,7 @@
<table class="table table-hover text-center identity-authentication-list-table">
<thead class="thead-light">
<tr>
<th width="4%">序号</th>
<% unless is_processed %>
<th width="4%">
<%= check_box_tag('all-check', 1, false, id: nil, class: 'batch-all-check-box',
@ -13,7 +14,7 @@
<th width="10%">姓名</th>
<th width="14%">身份证号</th>
<th width="20%">学校/单位</th>
<th width="12%">职称</th>
<th width="8%">职称</th>
<% unless is_processed %>
<th width="8%">
照片
@ -33,9 +34,10 @@
</thead>
<tbody>
<% if applies.present? %>
<% applies.each do |apply| %>
<% applies.each_with_index do |apply, index| %>
<% user = apply.user %>
<tr class="identity-authentication-item identity-authentication-<%= apply.id %>">
<td><%= list_index_no((params[:page] || 1).to_i, index) %></td>
<% unless is_processed %>
<td><%= check_box_tag('ids[]', apply.id, false, id: nil, class: 'batch-check-box') %></td>
<% end %>

@ -1,4 +1,5 @@
<% school = laboratory.school %>
<td><%= list_index_no((params[:page] || 1).to_i, index) %></td>
<td class="text-left"><%= school&.name || 'EduCoder主站' %></td>
<td class="text-left">
<% if laboratory.identifier %>

@ -1,6 +1,7 @@
<table class="table table-hover text-center laboratory-list-table">
<thead class="thead-light">
<tr>
<th width="4%">序号</th>
<th width="14%" class="text-left">单位名称</th>
<th width="16%" class="text-left">域名</th>
<th width="6%">统计链接</th>
@ -9,14 +10,14 @@
<th width="4%" title="同步显示主站下该单位的课堂">同步课堂</th>
<th width="4%" title="同步显示主站下该单位用户创建的实践课程">同步实践课程</th>
<th width="4%" title="同步显示主站下该单位用户创建的实训">同步实训</th>
<th width="20%">操作</th>
<th width="16%">操作</th>
</tr>
</thead>
<tbody>
<% if laboratories.present? %>
<% laboratories.each do |laboratory| %>
<% laboratories.each_with_index do |laboratory, index| %>
<tr class="laboratory-item laboratory-item-<%= laboratory.id %>">
<%= render 'admins/laboratories/shared/laboratory_item', laboratory: laboratory %>
<%= render partial: 'admins/laboratories/shared/laboratory_item', locals: {laboratory: laboratory, index: index} %>
</tr>
<% end %>
<% else %>

@ -1 +1,3 @@
$(".laboratory-item-<%= @laboratory.id %>").html("<%= j render partial: "admins/laboratories/shared/laboratory_item",locals: {laboratory: @laboratory} %>")
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);

@ -1 +1,3 @@
$("#laboratory-item-<%= @laboratory.id %>").html("<%= j render partial: 'admins/laboratories/shared/laboratory_item', locals: {laboratory: @laboratory} %>")
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);

@ -1,21 +1,22 @@
<table class="table text-center laboratory-shixun-list-table">
<thead class="thead-light">
<tr>
<th width="28%" class="text-left">实训名称</th>
<th width="4%">序号</th>
<th width="26%" class="text-left">实训名称</th>
<th width="12%">技术平台</th>
<th width="14%" class="text-left">技术体系</th>
<th width="10%">封面</th>
<th width="8%">创建者</th>
<th width="8%">状态</th>
<th width="6%">状态</th>
<th width="8%">执行时间</th>
<th width="16%">操作</th>
</tr>
</thead>
<tbody>
<% if laboratory_shixuns.present? %>
<% laboratory_shixuns.each do |laboratory_shixun| %>
<% laboratory_shixuns.each_with_index do |laboratory_shixun, index| %>
<tr class="laboratory-shixun-item-<%= laboratory_shixun.id %>">
<%= 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 } %>
</tr>
<% end %>
<% else %>

@ -1,5 +1,6 @@
<%- shixun = laboratory_shixun.shixun -%>
<td><%= list_index_no((params[:page] || 1).to_i, index) %></td>
<td class="text-left">
<%= link_to "/shixuns/#{shixun.identifier}", target: '_blank' do %>
<%= shixun.name %>

@ -1,7 +1,8 @@
<table class="table text-center laboratory-subject-list-table">
<thead class="thead-light">
<tr>
<th width="28%" class="text-left">课程名称</th>
<th width="4%">序号</th>
<th width="24%" class="text-left">课程名称</th>
<th width="12%">技术体系</th>
<th width="10%">等级体系</th>
<th width="10%">封面</th>
@ -13,10 +14,11 @@
</thead>
<tbody>
<% if laboratory_subjects.present? %>
<% laboratory_subjects.each do |laboratory_subject| %>
<% laboratory_subjects.each_with_index do |laboratory_subject, index| %>
<tr class="laboratory-subject-item-<%= laboratory_subject.id %>">
<%- subject = laboratory_subject.subject -%>
<td><%= list_index_no((params[:page] || 1).to_i, index) %></td>
<td class="text-left">
<%= link_to(subject.name, "/paths/#{subject.id}", target: '_blank') %>
<span class="badge badge-pill badge-success homepage-badge" style="<%= laboratory_subject.homepage? ? '' : 'display:none' %>">首页</span>

@ -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 }) %>")
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);

@ -3,11 +3,12 @@
<table class="table table-hover text-center library_applies-list-table">
<thead class="thead-light">
<tr>
<th width="4%">序号</th>
<th width="8%">头像</th>
<th width="14%">姓名</th>
<th width="26%" class="text-left">教学案例</th>
<th width="26%" class="text-left">案例描述</th>
<th width="16%">时间</th>
<th width="12%">时间</th>
<% if is_processed %>
<th width="16%">拒绝原因</th>
<th width="8%">状态</th>
@ -18,10 +19,11 @@
</thead>
<tbody>
<% if applies.present? %>
<% applies.each do |apply| %>
<% applies.each_with_index do |apply, index| %>
<% user = apply.library.user %>
<% library = apply.library %>
<tr class="library_applies-item library_applies-<%= apply.id %>">
<td><%= list_index_no((params[:page] || 1).to_i, index) %></td>
<td>
<%= link_to "/users/#{user.login}", class: 'professional-authentication-avatar', target: '_blank', data: { toggle: 'tooltip', title: '个人主页' } do %>
<img src="/images/<%= url_to_avatar(user) %>" class="rounded-circle" width="40" height="40" />

@ -1,9 +1,10 @@
<table class="table table-hover text-center myshixun-list-table">
<thead class="thead-light">
<tr>
<th width="4%">序号</th>
<th width="6%">ID</th>
<th width="10%">标识</th>
<th width="22%" class="text-left">实训名称</th>
<th width="18%" class="text-left">实训名称</th>
<th width="10%">实训老师</th>
<th width="6%">完成</th>
<th width="6%">经验值</th>
@ -14,8 +15,9 @@
</thead>
<tbody>
<% if myshixuns.present? %>
<% myshixuns.each do |myshixun| %>
<% myshixuns.each_with_index do |myshixun, index| %>
<tr class="myshixun-item-<%= myshixun.id %>">
<td><%= list_index_no(@params_page.to_i, index) %></td>
<td><%= myshixun.id %></td>
<td><%= myshixun.identifier %></td>
<td class="text-left">

@ -1,15 +1,17 @@
<table class="table table-hover text-center partner-list-table">
<thead class="thead-light">
<tr>
<th width="50%" class="text-left">名称</th>
<th width="10%">序号</th>
<th width="40%" class="text-left">名称</th>
<th width="30%"><%= sort_tag('添加时间', name: 'created_at', path: admins_partners_path) %></th>
<th width="20%">操作</th>
</tr>
</thead>
<tbody>
<% if partners.present? %>
<% partners.each do |partner| %>
<% partners.each_with_index do |partner, index| %>
<tr class="partner-item-<%= partner.id %>">
<td><%= list_index_no((params[:page] || 1).to_i, index) %></td>
<td class="text-left">
<%= link_to partner.school&.name || partner.name, customers_partner_path(partner), target: '_blank' %>
</td>

@ -3,6 +3,7 @@
<table class="table table-hover text-center professional-authentication-list-table">
<thead class="thead-light">
<tr>
<th width="4%">序号</th>
<% unless is_processed %>
<th width="4%">
<%= check_box_tag('all-check', 1, false, id: nil, class: 'batch-all-check-box',
@ -12,7 +13,7 @@
<th width="8%">头像</th>
<th width="14%">姓名</th>
<th width="20%">学校/单位</th>
<th width="12%">职称</th>
<th width="8%">职称</th>
<% unless is_processed %>
<th width="14%">
照片
@ -31,9 +32,10 @@
</thead>
<tbody>
<% if applies.present? %>
<% applies.each do |apply| %>
<% applies.each_with_index do |apply, index| %>
<% user = apply.user %>
<tr class="professional-authentication-item professional-authentication-<%= apply.id %>">
<td><%= list_index_no((params[:page] || 1).to_i, index) %></td>
<% unless is_processed %>
<td><%= check_box_tag('ids[]', apply.id, false, id: nil, class: 'batch-check-box') %></td>
<% end %>

@ -3,11 +3,12 @@
<table class="table table-hover text-center library_applies-list-table">
<thead class="thead-light">
<tr>
<th width="4%">序号</th>
<th width="8%">头像</th>
<th width="14%">姓名</th>
<th width="26%" class="text-left">众包需求</th>
<th width="26%" class="text-left">需求描述</th>
<th width="16%">时间</th>
<th width="12%">时间</th>
<% if is_processed %>
<th width="16%">拒绝原因</th>
<th width="8%">状态</th>
@ -18,10 +19,11 @@
</thead>
<tbody>
<% if applies.present? %>
<% applies.each do |apply| %>
<% applies.each_with_index do |apply, index| %>
<% package = apply.project_package %>
<% user = package.creator %>
<tr class="project-package-item project-package-applies-<%= apply.id %>">
<td><%= list_index_no((params[:page] || 1).to_i, index) %></td>
<td>
<%= link_to "/users/#{user.login}", class: 'professional-authentication-avatar', target: '_blank', data: { toggle: 'tooltip', title: '个人主页' } do %>
<img src="/images/<%= url_to_avatar(user) %>" class="rounded-circle" width="40" height="40" />

@ -1,6 +1,7 @@
<table class="table table-hover text-center subject-list-table">
<thead class="thead-light">
<tr>
<th width="4%">序号</th>
<th width="4%">ID</th>
<th width="15%" class="text-left">项目名称</th>
<th width="6%">公开</th>
@ -11,14 +12,15 @@
<th width="6%">里程碑</th>
<th width="10%">成员</th>
<th width="10%">管理员</th>
<th width="15%"><%= sort_tag('创建时间', name: 'created_at', path: admins_projects_path) %></th>
<th width="11%"><%= sort_tag('创建时间', name: 'created_at', path: admins_projects_path) %></th>
<th width="10%">操作</th>
</tr>
</thead>
<tbody>
<% if projects.present? %>
<% projects.each do |project| %>
<% projects.each_with_index do |project, index| %>
<tr class="project-item-<%= project.id %>">
<td><%= list_index_no((params[:page] || 1).to_i, index) %></td>
<td><%= project.id %></td>
<td class="text-left">
<%= link_to(project.name, "/projects/#{project.id}", target: '_blank') %>

@ -4,7 +4,7 @@
<div class="box search-form-container school-list-form">
<%= 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 %>

@ -1,6 +1,7 @@
<table class="table table-hover text-center school-list-table">
<thead class="thead-light">
<tr>
<th width="4%">序号</th>
<th width="6%">ID</th>
<th width="6%">LOGO</th>
<th width="8%">标识码</th>
@ -11,13 +12,14 @@
<th width="6%"><%= sort_tag('用户数', name: 'users_count', path: admins_schools_path) %></th>
<th width="6%">部门数</th>
<th width="12%"><%= sort_tag('创建时间', name: 'created_at', path: admins_schools_path) %></th>
<th width="14%">操作</th>
<th width="10%">操作</th>
</tr>
</thead>
<tbody>
<% if schools.present? %>
<% schools.each do |school| %>
<% schools.each_with_index do |school, index| %>
<tr class="school-item-<%= school.id %>">
<td><%= list_index_no((params[:page] || 1).to_i, index) %></td>
<td><%= school.id %></td>
<td>
<% if Util::FileManage.exists?(school) %>

@ -3,11 +3,12 @@
<table class="table table-hover text-center shixun-authorization-list-table">
<thead class="thead-light">
<tr>
<th width="4%">序号</th>
<th width="8%">头像</th>
<th width="8%">创建者</th>
<th width="28%" class="text-left">实训名称</th>
<th width="8%">审核情况</th>
<th width="12%">任务数</th>
<th width="8%">任务数</th>
<th width="16%">时间</th>
<% if is_processed %>
<th width="12%">拒绝原因</th>
@ -19,12 +20,13 @@
</thead>
<tbody>
<% 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 %>
<tr class="shixun-authorization-item shixun-authorization-<%= apply.id %>">
<td><%= list_index_no((params[:page] || 1).to_i, index) %></td>
<td>
<%= link_to "/users/#{user.login}", class: 'shixun-authorization-avatar', target: '_blank', data: { toggle: 'tooltip', title: '个人主页' } do %>
<img src="/images/<%= url_to_avatar(user) %>" class="rounded-circle" width="40" height="40" />

@ -1,16 +1,18 @@
<table class="table table-hover text-center shixuns-list-table">
<thead class="thead-light">
<th width="4%">序号</th>
<th width="8%">ID</th>
<th width="32%" class="text-left">实训名称</th>
<th width="20%">子站源</th>
<th width="16%">子站源</th>
<th width="10%">创建者</th>
<th width="20%"><%= sort_tag('创建于', name: 'created_at', path: admins_shixun_recycles_path) %></th>
<th width="10%">操作</th>
</thead>
<tbody>
<% if shixuns.present? %>
<% shixuns.each do |shixun| %>
<% shixuns.each_with_index do |shixun, index| %>
<tr id="shixun_recycle_item_<%= shixun.id %>">
<td><%= list_index_no((params[:page] || 1).to_i, index) %></td>
<td><%= shixun.identifier %></td>
<td class="text-left"><span><%= link_to overflow_hidden_span(shixun.name), "/shixuns/#{shixun.identifier}", :target => "_blank", :title => shixun.name %></span></td>
<td><%= shixun.laboratory&.school&.name %></td>

@ -65,6 +65,12 @@
<span class="only_view">只看已隐藏文件目录</span>
</label>
</div>
<div class="mr-5">
<label for="vip">
<%= check_box_tag :vip, !@sort_json[:vip],@sort_json[:vip], class:"shixun-settings-select" %>
<span class="only_view">只看vip</span>
</label>
</div>
</div>
</div>
<% end %>

@ -15,7 +15,7 @@
<th>
操作
<div class="setting-chosen">
ssh/隐藏/首页/跳关/隐藏目录
ssh/隐藏/首页/跳关/隐藏目录/vip
</div>
</th>
</thead>

@ -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"%>
</td>
<script>

@ -3,9 +3,10 @@
<table class="table table-hover text-center subject-authorization-list-table">
<thead class="thead-light">
<tr>
<th width="4%">序号</th>
<th width="8%">头像</th>
<th width="10%">创建者</th>
<th width="28%" class="text-left">实践课程名称</th>
<th width="24%" class="text-left">实践课程名称</th>
<th width="6%">阶段数</th>
<th width="6%">实训数</th>
<th width="6%">关卡数</th>
@ -20,10 +21,11 @@
</thead>
<tbody>
<% if applies.present? %>
<% applies.each do |apply| %>
<% applies.each_with_index do |apply, index| %>
<% user = apply.user %>
<% subject = subject_map[apply.container_id] %>
<tr class="subject-authorization-item subject-authorization-<%= apply.id %>">
<td><%= list_index_no((params[:page] || 1).to_i, index) %></td>
<td>
<%= link_to "/users/#{user.login}", class: 'subject-authorization-avatar', target: '_blank', data: { toggle: 'tooltip', title: '个人主页' } do %>
<img src="/images/<%= url_to_avatar(user) %>" class="rounded-circle" width="40" height="40" />

@ -1,11 +1,12 @@
<table class="table table-hover text-center subject-list-table">
<thead class="thead-light">
<tr>
<th width="4%">序号</th>
<th width="14%" class="text-left">名称</th>
<th width="6%">阶段数</th>
<th width="6%">实训数</th>
<th width="8%">技术体系</th>
<th width="8%">等级体系</th>
<th width="5%">阶段数</th>
<th width="5%">实训数</th>
<th width="7%">技术体系</th>
<th width="7%">等级体系</th>
<th width="8%">封面</th>
<th width="7%">创建者</th>
<th width="10%">单位</th>
@ -17,8 +18,9 @@
</thead>
<tbody>
<% if subjects.present? %>
<% subjects.each do |subject| %>
<% subjects.each_with_index do |subject, index| %>
<tr class="subject-item-<%= subject.id %>">
<td><%= list_index_no((params[:page] || 1).to_i, index) %></td>
<td class="text-left">
<%= link_to(subject.name, "/paths/#{subject.id}", target: '_blank') %>
<span class="badge badge-pill badge-success homepage-show-badge" style="<%= subject.homepage_show? ? '' : 'display:none' %>">首页</span>

@ -1,3 +1,4 @@
<td><%= list_index_no((params[:page] || 1).to_i, index) %></td>
<td><%= apply.id %></td>
<td class="text-left"><%= overflow_hidden_span apply.name %></td>
<td class="text-left">

@ -1,9 +1,10 @@
<table class="table table-hover text-center unit-applies-list-table">
<thead class="thead-light">
<tr>
<th width="4%">序号</th>
<th width="8%">ID</th>
<th width="20%" class="text-left">单位名称</th>
<th width="12%" class="text-left">地区</th>
<th width="8%" class="text-left">地区</th>
<th width="20%" class="text-left">详细地址</th>
<th width="10%">申请者</th>
<th width="15%"><%= sort_tag('创建于', name: 'created_at', path: admins_unit_applies_path) %></th>
@ -12,9 +13,9 @@
</thead>
<tbody>
<% if applies.present? %>
<% applies.each do |apply| %>
<% applies.each_with_index do |apply, index| %>
<tr class="unit-apply-<%= apply.id %>">
<%= render partial: "admins/unit_applies/shared/apply_item", locals: {apply: apply} %>
<%= render partial: "admins/unit_applies/shared/apply_item", locals: {apply: apply, index: index} %>
</tr>
<% end %>
<% else %>

@ -1,20 +1,22 @@
<table class="table table-hover text-center user-statistic-list-table">
<thead class="thead-light">
<tr>
<th width="4%">序号</th>
<th width="14%" class="text-left">姓名</th>
<th width="22%" class="text-left">单位部门</th>
<th width="10%">学习关卡数<%#= sort_tag('学习关卡数', name: 'study_challenge_count', path: admins_user_statistics_path) %></th>
<th width="10%">完成关卡数<%#= sort_tag('完成关卡数', name: 'finish_challenge_count', path: admins_user_statistics_path) %></th>
<th width="10%"><%= sort_tag('学习实训数', name: 'study_shixun_count', path: admins_user_statistics_path) %></th>
<th width="10%"><%= sort_tag('完成实训数', name: 'finish_shixun_count', path: admins_user_statistics_path) %></th>
<th width="10%">评测次数</th>
<th width="9%">完成关卡数<%#= sort_tag('完成关卡数', name: 'finish_challenge_count', path: admins_user_statistics_path) %></th>
<th width="9%"><%= sort_tag('学习实训数', name: 'study_shixun_count', path: admins_user_statistics_path) %></th>
<th width="9%"><%= sort_tag('完成实训数', name: 'finish_shixun_count', path: admins_user_statistics_path) %></th>
<th width="9%">评测次数</th>
<th width="14%">实战时间</th>
</tr>
</thead>
<tbody>
<% if users.present? %>
<% users.each do |user| %>
<% users.each_with_index do |user, index| %>
<tr class="user-statistic-item-<%= user.id %>">
<td><%= list_index_no((params[:page] || 1).to_i, index) %></td>
<td class="text-left">
<%= link_to "/users/#{user.login}", target: '_blank' do %>
<%= overflow_hidden_span user.real_name, width: 100 %>

@ -1,8 +1,9 @@
<table class="table table-hover users-list-table">
<thead class="thead-light">
<tr>
<th width="10%" class="text-left">真实姓名</th>
<th width="15%">邮件地址</th>
<th width="4%">序号</th>
<th width="8%" class="text-left">真实姓名</th>
<th width="13%">邮件地址</th>
<th width="10%">手机号码</th>
<th width="14%">单位</th>
<th width="7%">角色</th>
@ -15,8 +16,9 @@
</thead>
<tbody>
<% if users.present? %>
<% users.each do |user| %>
<% users.each_with_index do |user, index| %>
<tr class="user-item-<%= user.id %>">
<td><%= list_index_no((params[:page] || 1).to_i, index) %></td>
<td class="text-left">
<%= link_to "/users/#{user.login}", target: '_blank' do %>
<%= overflow_hidden_span user.real_name, width: 100 %>

@ -3,12 +3,13 @@
<table class="table table-hover text-center library_applies-list-table">
<thead class="thead-light">
<tr>
<th width="4%">序号</th>
<th width="8%">头像</th>
<th width="14%">姓名</th>
<th width="26%" class="text-left">视频名称</th>
<th width="13%">视频大小</th>
<th width="13%" class="text-left">播放链接</th>
<th width="16%">时间</th>
<th width="12%">时间</th>
<% if is_processed %>
<th width="16%">拒绝原因</th>
<th width="8%">状态</th>
@ -19,10 +20,11 @@
</thead>
<tbody>
<% if applies.present? %>
<% applies.each do |v| %>
<% applies.each_with_index do |v, index| %>
<% video = v.video %>
<% user = video.user %>
<tr class="video-applies-item video-applies-<%= v.id %>">
<td><%= list_index_no((params[:page] || 1).to_i, index) %></td>
<td>
<%= link_to "/users/#{user.login}", class: 'professional-authentication-avatar', target: '_blank', data: { toggle: 'tooltip', title: '个人主页' } do %>
<img src="/images/<%= url_to_avatar(user) %>" class="rounded-circle" width="40" height="40" />

@ -0,0 +1,5 @@
class AddVipToShixun < ActiveRecord::Migration[5.2]
def change
add_column :shixuns, :vip, :boolean, default: 0
end
end

@ -402,28 +402,25 @@ class Sendresource extends Component{
<Tooltip placement="bottom" title={this.props.isStudent()===true?"不支持学生延迟发布":""}>
<Radio style={radioStyle} value={1} className={"fl"} disabled={this.props.isStudent()}>
<span className={"mr5"}>延期发布</span>
{this.props.course_groups.length===0?
<DatePicker
dropdownClassName="hideDisable"
showTime={{ format: 'HH:mm' }}
locale={locale}
format={dateFormat}
placeholder="请选择发布时间"
id={"startime"}
showToday={false}
width={"210px"}
value={this.state.Radiovalue===1?datatime===undefined||datatime===""?undefined:moment(datatime, dateFormat):undefined}
onChange={(e,index)=>this.onChangeTimepublish(e,index,undefined,1)}
disabledTime={disabledDateTime}
disabledDate={disabledDate}
disabled={this.state.Radiovalue===1?false:true}
/>:""}
<DatePicker
dropdownClassName="hideDisable"
showTime={{ format: 'HH:mm' }}
locale={locale}
format={dateFormat}
placeholder="请选择发布时间"
id={"startime"}
showToday={false}
width={"210px"}
value={this.state.Radiovalue===1?datatime===undefined||datatime===""?undefined:moment(datatime, dateFormat):undefined}
onChange={(e,index)=>this.onChangeTimepublish(e,index,undefined,1)}
disabledTime={disabledDateTime}
disabledDate={disabledDate}
disabled={this.state.Radiovalue===1?false:true}
/>
</Radio>
</Tooltip>
<span className={"fl mt5 color-grey-c"}>(按照设置的时间定时发布)</span>
</Radio.Group>
</div>

Loading…
Cancel
Save