Merge branch 'dev_aliyun' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun
commit
c57e2add4c
@ -0,0 +1,21 @@
|
||||
$(document).on('turbolinks:load', function() {
|
||||
if ($('body.admins-library-applies-index-page').length > 0) {
|
||||
var $searchFrom = $('.library-applies-list-form');
|
||||
$searchFrom.find('select[name="status"]').val('pending');
|
||||
|
||||
$searchFrom.on('click', '.search-form-tab', function(){
|
||||
var $link = $(this);
|
||||
|
||||
$searchFrom.find('input[name="keyword"]').val('');
|
||||
$searchFrom.find('select[name="status"]').val('processed');
|
||||
|
||||
if($link.data('value') === 'processed'){
|
||||
$searchFrom.find('.status-filter').show();
|
||||
} else {
|
||||
$searchFrom.find('.status-filter').hide();
|
||||
$searchFrom.find('select[name="status"]').val('pending');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
})
|
@ -0,0 +1,33 @@
|
||||
$(document).on('turbolinks:load', function() {
|
||||
if ($('body.admins-shixun-settings-index-page').length > 0) {
|
||||
$(".shixun-settings-select").on("change", function () {
|
||||
var s_value = $(this).val();
|
||||
var s_name = $(this).attr("name");
|
||||
var json = {};
|
||||
json[s_name] = s_value;
|
||||
$.ajax({
|
||||
url: "/admins/shixun_settings",
|
||||
type: "GET",
|
||||
dataType:'script',
|
||||
data: json
|
||||
})
|
||||
});
|
||||
|
||||
$(".shixun-setting-form").on("change",function () {
|
||||
var s_id = $(this).attr("data-id");
|
||||
var s_value = $(this).val();
|
||||
var s_name = $(this).attr("name");
|
||||
var json = {};
|
||||
var s_index = $(this).parent("td").siblings(".shixun-line-no").text();
|
||||
json[s_name] = s_value;
|
||||
json["page_no"] = s_index;
|
||||
$.ajax({
|
||||
url: "/admins/shixun_settings/" + s_id,
|
||||
type: "PUT",
|
||||
dataType:'script',
|
||||
data: json
|
||||
})
|
||||
})
|
||||
}
|
||||
});
|
||||
|
@ -0,0 +1,6 @@
|
||||
$(document).on('turbolinks:load', function() {
|
||||
$('select#tag-choosed').select2({
|
||||
placeholder: "请选择分类",
|
||||
allowClear: true
|
||||
});
|
||||
});
|
@ -0,0 +1,9 @@
|
||||
.admins-library-applies-index-page {
|
||||
.library-applies-list-container {
|
||||
span {
|
||||
&.apply-status-agreed { color: #28a745; }
|
||||
&.apply-status-refused { color: #dc3545; }
|
||||
&.apply-status-processed { color: #6c757d; }
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
.admins-shixuns-index-page{
|
||||
.shixuns-list-container{
|
||||
.shixuns-status-1 { color: #6c757d; }
|
||||
.shixuns-status-2 { color: #28a745; }
|
||||
.shixuns-status-3 { color: #dc3545; }
|
||||
}
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
input[type="checkbox"]{
|
||||
font-size:18px;
|
||||
}
|
||||
.select2 input::-webkit-input-placeholder{
|
||||
color:#ccc;
|
||||
}
|
||||
.select2 .select2-selection__choice{
|
||||
border: 1px solid #eee !important;
|
||||
}
|
||||
.setting-chosen{
|
||||
font-weight: 400;
|
||||
font-size: 10px;
|
||||
color:#333;
|
||||
}
|
@ -1 +1 @@
|
||||
.select2-container--bootstrap4 .select2-selection--single{height:calc(1.5em + .75rem + 2px)!important}.select2-container--bootstrap4 .select2-selection--single .select2-selection__placeholder{color:#757575;line-height:calc(1.5em + .75rem)}.select2-container--bootstrap4 .select2-selection--single .select2-selection__arrow{position:absolute;top:50%;right:3px;width:20px}.select2-container--bootstrap4 .select2-selection--single .select2-selection__arrow b{top:60%;border-color:#343a40 transparent transparent;border-style:solid;border-width:5px 4px 0;width:0;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute}.select2-container--bootstrap4 .select2-selection--single .select2-selection__rendered{line-height:calc(1.5em + .75rem)}.select2-search--dropdown .select2-search__field{border:1px solid #ced4da;border-radius:.25rem}.select2-results__message{color:#6c757d}.select2-container--bootstrap4 .select2-selection--multiple{min-height:calc(1.5em + .75rem + 2px)!important}.select2-container--bootstrap4 .select2-selection--multiple .select2-selection__rendered{-webkit-box-sizing:border-box;box-sizing:border-box;list-style:none;margin:0;padding:0 5px;width:100%}.select2-container--bootstrap4 .select2-selection--multiple .select2-selection__choice{color:#343a40;border:1px solid #bdc6d0;border-radius:.2rem;padding:0 5px 0 0;cursor:pointer;float:left;margin-top:.3em;margin-right:5px}.select2-container--bootstrap4 .select2-selection--multiple .select2-selection__choice__remove{color:#bdc6d0;font-weight:700;margin-left:3px;margin-right:1px;padding-right:3px;padding-left:3px;float:left}.select2-container--bootstrap4 .select2-selection--multiple .select2-selection__choice__remove:hover{color:#343a40}.select2-container{display:block}.select2-container :focus{outline:0}.input-group .select2-container--bootstrap4{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1}.input-group-prepend~.select2-container--bootstrap4 .select2-selection{border-top-left-radius:0;border-bottom-left-radius:0}.select2-container--bootstrap4 .select2-selection{border:1px solid #ced4da;border-radius:.25rem;width:100%}.select2-container--bootstrap4.select2-container--focus .select2-selection{border-color:#17a2b8;-webkit-box-shadow:0 0 0 .2rem rgba(0,123,255,.25);box-shadow:0 0 0 .2rem rgba(0,123,255,.25)}.select2-container--bootstrap4.select2-container--focus.select2-container--open .select2-selection{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--bootstrap4.select2-container--disabled.select2-container--focus .select2-selection,.select2-container--bootstrap4.select2-container--disabled .select2-selection{background-color:#e9ecef;cursor:not-allowed;border-color:#ced4da;-webkit-box-shadow:none;box-shadow:none}.select2-container--bootstrap4.select2-container--disabled.select2-container--focus .select2-search__field,.select2-container--bootstrap4.select2-container--disabled .select2-search__field{background-color:transparent}form.was-validated select:invalid~.select2-container--bootstrap4 .select2-selection,select.is-invalid~.select2-container--bootstrap4 .select2-selection{border-color:#dc3545}form.was-validated select:valid~.select2-container--bootstrap4 .select2-selection,select.is-valid~.select2-container--bootstrap4 .select2-selection{border-color:#28a745}.select2-container--bootstrap4 .select2-dropdown{border-color:#ced4da;border-top:none;border-top-left-radius:0;border-top-right-radius:0}.select2-container--bootstrap4 .select2-dropdown.select2-dropdown--above{border-top:1px solid #ced4da;border-top-left-radius:.25rem;border-top-right-radius:.25rem}.select2-container--bootstrap4 .select2-dropdown .select2-results__option[aria-selected=true]{background-color:#e9ecef}.select2-container--bootstrap4 .select2-results__option--highlighted,.select2-container--bootstrap4 .select2-results__option--highlighted.select2-results__option[aria-selected=true]{background-color:#007bff;color:#f8f9fa}.select2-container--bootstrap4 .select2-results__option[role=group]{padding:0}.select2-container--bootstrap4 .select2-results>.select2-results__options{max-height:15em;overflow-y:auto}.select2-container--bootstrap4 .select2-results__group{padding:6px;display:list-item;color:#6c757d}.select2-container--bootstrap4 .select2-selection__clear{width:1.2em;height:1.2em;line-height:1.15em;padding-left:.3em;margin-top:.5em;border-radius:100%;background-color:#6c757d;color:#f8f9fa;float:right;margin-right:.3em}.select2-container--bootstrap4 .select2-selection__clear:hover{background-color:#343a40}
|
||||
.select2-container--bootstrap4 .select2-selection--single{height:calc(1.5em + .75rem + 2px)!important}.select2-container--bootstrap4 .select2-selection--single .select2-selection__placeholder{color:#757575;line-height:calc(1.5em + .75rem)}.select2-container--bootstrap4 .select2-selection--single .select2-selection__arrow{position:absolute;top:50%;right:3px;width:20px}.select2-container--bootstrap4 .select2-selection--single .select2-selection__arrow b{top:60%;border-color:#343a40 transparent transparent;border-style:solid;border-width:5px 4px 0;width:0;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute}.select2-container--bootstrap4 .select2-selection--single .select2-selection__rendered{line-height:calc(1.5em + .75rem)}.select2-search--dropdown .select2-search__field{border:1px solid #ced4da;border-radius:.25rem}.select2-results__message{color:#6c757d}.select2-container--bootstrap4 .select2-selection--multiple{min-height:calc(1.5em + .75rem + 2px)!important}.select2-container--bootstrap4 .select2-selection--multiple .select2-selection__rendered{-webkit-box-sizing:border-box;box-sizing:border-box;list-style:none;margin:0;padding:0 5px;width:100%}.select2-container--bootstrap4 .select2-selection--multiple .select2-selection__choice{color:#343a40;border:1px solid #bdc6d0;border-radius:.2rem;padding:0 5px 0 0;cursor:pointer;float:left;margin-top:.3em;margin-right:5px}.select2-container--bootstrap4 .select2-selection--multiple .select2-selection__choice__remove{color:#bdc6d0;font-weight:700;margin-left:3px;margin-right:1px;padding-right:3px;padding-left:3px;float:left}.select2-container--bootstrap4 .select2-selection--multiple .select2-selection__choice__remove:hover{color:#343a40}.select2-container{display:block}.select2-container :focus{outline:0}.input-group .select2-container--bootstrap4{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1}.input-group-prepend~.select2-container--bootstrap4 .select2-selection{border-top-left-radius:0;border-bottom-left-radius:0}.select2-container--bootstrap4 .select2-selection{border:1px solid #ced4da;border-radius:.25rem;width:100%}.select2-container--bootstrap4.select2-container--focus .select2-selection{border-color:#17a2b8;-webkit-box-shadow:0 0 0 .2rem rgba(0,123,255,.25);box-shadow:0 0 0 .2rem rgba(0,123,255,.25)}.select2-container--bootstrap4.select2-container--focus.select2-container--open .select2-selection{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--bootstrap4.select2-container--disabled.select2-container--focus .select2-selection,.select2-container--bootstrap4.select2-container--disabled .select2-selection{background-color:#e9ecef;cursor:not-allowed;border-color:#ced4da;-webkit-box-shadow:none;box-shadow:none}.select2-container--bootstrap4.select2-container--disabled.select2-container--focus .select2-search__field,.select2-container--bootstrap4.select2-container--disabled .select2-search__field{background-color:transparent}form.was-validated select:invalid~.select2-container--bootstrap4 .select2-selection,select.is-invalid~.select2-container--bootstrap4 .select2-selection{border-color:#dc3545}form.was-validated select:valid~.select2-container--bootstrap4 .select2-selection,select.is-valid~.select2-container--bootstrap4 .select2-selection{border-color:#28a745}.select2-container--bootstrap4 .select2-dropdown{border-color:#ced4da;border-top:none;border-top-left-radius:0;border-top-right-radius:0}.select2-container--bootstrap4 .select2-dropdown.select2-dropdown--above{border-top:1px solid #ced4da;border-top-left-radius:.25rem;border-top-right-radius:.25rem}.select2-container--bootstrap4 .select2-dropdown .select2-results__option[aria-selected=true]{background-color:#e9ecef}.select2-container--bootstrap4 .select2-results__option--highlighted,.select2-container--bootstrap4 .select2-results__option--highlighted.select2-results__option[aria-selected=true]{background-color:#007bff;color:#f8f9fa}.select2-container--bootstrap4 .select2-results__option[role=group]{padding:0}.select2-container--bootstrap4 .select2-results>.select2-results__options{max-height:15em;overflow-y:auto}.select2-container--bootstrap4 .select2-results__group{padding:6px;display:list-item;color:#6c757d}.select2-container--bootstrap4 .select2-selection__clear{width:1.2em;height:1.2em;line-height:1.15em;padding-left:.3em;margin-top:.5em;border-radius:100%;background-color:#ccc;color:#f8f9fa;float:right;margin-right:.3em}.select2-container--bootstrap4 .select2-selection__clear:hover{background-color:#343a40}
|
@ -0,0 +1,25 @@
|
||||
class Admins::LibraryAppliesController < Admins::BaseController
|
||||
def index
|
||||
params[:status] ||= 'pending'
|
||||
applies = Admins::LibraryApplyQuery.call(params)
|
||||
|
||||
@library_applies = paginate applies.preload(library: :user)
|
||||
end
|
||||
|
||||
def agree
|
||||
Libraries::AgreeApplyService.new(current_library_apply, current_user).call
|
||||
render_success_js
|
||||
end
|
||||
|
||||
def refuse
|
||||
Libraries::RefuseApplyService.new(current_library_apply, current_user, reason: params[:reason]).call
|
||||
|
||||
render_success_js
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def current_library_apply
|
||||
@_current_library_apply ||= LibraryApply.find(params[:id])
|
||||
end
|
||||
end
|
@ -0,0 +1,86 @@
|
||||
class Admins::ShixunSettingsController < Admins::BaseController
|
||||
|
||||
def index
|
||||
params[:sort_by] = params[:sort_by].presence || 'created_on'
|
||||
params[:sort_direction] = params[:sort_direction].presence || 'desc'
|
||||
|
||||
shixun_settings = Admins::ShixunSettingsQuery.call(params)
|
||||
@editing_shixuns = shixun_settings.where(status:0).size
|
||||
@pending_shixuns = shixun_settings.where(status:1).size
|
||||
@processed_shixuns = shixun_settings.where(status:2).size
|
||||
@closed_shixuns = shixun_settings.where(status:3).size
|
||||
@shixuns_type_check = MirrorRepository.pluck(:type_name,:id)
|
||||
@shixun_tags = TagRepertoire.order("name asc").pluck(:name,:id)
|
||||
@params_page = params[:page] || 1
|
||||
@shixun_settings = paginate shixun_settings.preload(:user,:tag_repertoires)
|
||||
|
||||
respond_to do |format|
|
||||
format.js
|
||||
format.html
|
||||
format.xls{
|
||||
filename = "实训详情_#{Time.now.strftime('%Y-%m-%d %H:%M:%S')}.xls"
|
||||
send_data(shixun_list_xls(shixun_settings), :type => 'application/octet-stream', :filename => filename_for_content_disposition(filename))
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
def update
|
||||
@shixun = Shixun.find_by(id:params[:id])
|
||||
@page_no = params[:page_no] || "1"
|
||||
@shixun_tags = TagRepertoire.order("name asc").pluck(:name,:id)
|
||||
tag_ids = params[:tag_repertoires]
|
||||
if tag_ids.present?
|
||||
@shixun&.shixun_tag_repertoires.delete_all
|
||||
tag_repertoire_ids = @shixun&.tag_repertoires&.pluck(:id)
|
||||
tag_ids.each do |id|
|
||||
unless tag_repertoire_ids.include?(id)
|
||||
tag_repertoire = @shixun.shixun_tag_repertoires.new(shixun_id:@shixun.id,tag_repertoire_id:id)
|
||||
tag_repertoire.save
|
||||
end
|
||||
end
|
||||
else
|
||||
unless @shixun.update_attributes(setting_params)
|
||||
redirect_to admins_shixun_settings_path
|
||||
flash[:danger] = "更新失败"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
def shixun_list_xls shixuns
|
||||
xls_report = StringIO.new
|
||||
book = Spreadsheet::Workbook.new
|
||||
sheet1 = book.create_worksheet :name => "sheet"
|
||||
blue = Spreadsheet::Format.new :color => :blue, :weight => :bold, :size => 10
|
||||
sheet1.row(0).default_format = blue
|
||||
sheet1.row(0).concat(["实训ID","实训名称","技术平台", "Fork源", "实践任务","选择题任务","挑战人数", "通关人数", "状态","创建者", "单位", "职业", "关卡序号","关卡名称","技能标签"])
|
||||
count_row = 1
|
||||
shixuns.find_each do |shixun|
|
||||
sheet1[count_row, 0] = shixun.identifier
|
||||
sheet1[count_row, 1] = shixun.name
|
||||
sheet1[count_row, 2] = shixun.shixun_main_name
|
||||
sheet1[count_row, 3] = shixun.fork_identifier
|
||||
sheet1[count_row, 4] = shixun.challenges.practice_type.count
|
||||
sheet1[count_row, 5] = shixun.challenges.choose_type.count
|
||||
sheet1[count_row, 6] = shixun.myshixuns.count
|
||||
sheet1[count_row, 7] = shixun.myshixuns.finished.count
|
||||
sheet1[count_row, 8] = shixun.shixun_status
|
||||
sheet1[count_row, 9] = shixun.owner.show_real_name
|
||||
sheet1[count_row, 10] = shixun.owner.school_name
|
||||
sheet1[count_row, 11] = shixun.owner.identity
|
||||
shixun.challenges.each do |challenge|
|
||||
sheet1[count_row, 12] = "第#{challenge.position}关"
|
||||
sheet1[count_row, 13] = challenge.subject
|
||||
sheet1[count_row, 14] = challenge.tags_show
|
||||
count_row += 1
|
||||
end
|
||||
count_row += 1
|
||||
end
|
||||
book.write xls_report
|
||||
xls_report.string
|
||||
end
|
||||
|
||||
def setting_params
|
||||
params.permit(:use_scope,:excute_time,:close,:status,:can_copy,:webssh,:hidden,:homepage_show,:task_pass,:code_hidden,:id,tag_repertoires:[])
|
||||
end
|
||||
end
|
@ -0,0 +1,64 @@
|
||||
class Admins::ShixunsController < Admins::BaseController
|
||||
|
||||
def index
|
||||
params[:sort_by] = params[:sort_by].presence || 'created_on'
|
||||
params[:sort_direction] = params[:sort_direction].presence || 'desc'
|
||||
shixuns = Admins::ShixunQuery.call(params)
|
||||
@editing_shixuns = shixuns.where(status:0).size
|
||||
@pending_shixuns = shixuns.where(status:1).size
|
||||
@processed_shixuns = shixuns.where(status:2).size
|
||||
@closed_shixuns = shixuns.where(status:3).size
|
||||
@shixuns_type_check = MirrorRepository.pluck(:type_name,:id)
|
||||
@params_page = params[:page] || 1
|
||||
@shixuns = paginate shixuns.preload(:user,:challenges)
|
||||
|
||||
respond_to do |format|
|
||||
format.js
|
||||
format.html
|
||||
format.xls{
|
||||
filename = "实训详情_#{Time.now.strftime('%Y-%m-%d %H:%M:%S')}.xls"
|
||||
send_data(shixun_list_xls(shixuns), :type => 'application/octet-stream', :filename => filename_for_content_disposition(filename))
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
def destroy
|
||||
Shixun.find(params[:id]).destroy!
|
||||
|
||||
render_delete_success
|
||||
end
|
||||
|
||||
private
|
||||
def shixun_list_xls shixuns
|
||||
xls_report = StringIO.new
|
||||
book = Spreadsheet::Workbook.new
|
||||
sheet1 = book.create_worksheet :name => "sheet"
|
||||
blue = Spreadsheet::Format.new :color => :blue, :weight => :bold, :size => 10
|
||||
sheet1.row(0).default_format = blue
|
||||
sheet1.row(0).concat(["实训ID","实训名称","技术平台", "Fork源", "实践任务","选择题任务","挑战人数", "通关人数", "状态","创建者", "单位", "职业", "关卡序号","关卡名称","技能标签"])
|
||||
count_row = 1
|
||||
shixuns.find_each do |shixun|
|
||||
sheet1[count_row, 0] = shixun.identifier
|
||||
sheet1[count_row, 1] = shixun.name
|
||||
sheet1[count_row, 2] = shixun.shixun_main_name
|
||||
sheet1[count_row, 3] = shixun.fork_identifier
|
||||
sheet1[count_row, 4] = shixun.challenges.practice_type.count
|
||||
sheet1[count_row, 5] = shixun.challenges.choose_type.count
|
||||
sheet1[count_row, 6] = shixun.myshixuns.count
|
||||
sheet1[count_row, 7] = shixun.myshixuns.finished.count
|
||||
sheet1[count_row, 8] = shixun.shixun_status
|
||||
sheet1[count_row, 9] = shixun.owner.show_real_name
|
||||
sheet1[count_row, 10] = shixun.owner.school_name
|
||||
sheet1[count_row, 11] = shixun.owner.identity
|
||||
shixun.challenges.each do |challenge|
|
||||
sheet1[count_row, 12] = "第#{challenge.position}关"
|
||||
sheet1[count_row, 13] = challenge.subject
|
||||
sheet1[count_row, 14] = challenge.tags_show
|
||||
count_row += 1
|
||||
end
|
||||
count_row += 1
|
||||
end
|
||||
book.write xls_report
|
||||
xls_report.string
|
||||
end
|
||||
end
|
@ -0,0 +1,29 @@
|
||||
class Admins::LibraryApplyQuery < ApplicationQuery
|
||||
include CustomSortable
|
||||
|
||||
attr_reader :params
|
||||
|
||||
sort_columns :updated_at, default_by: :updated_at, default_direction: :desc
|
||||
|
||||
def initialize(params)
|
||||
@params = params
|
||||
end
|
||||
|
||||
def call
|
||||
status =
|
||||
case params[:status]
|
||||
when 'processed' then %w(agreed refused)
|
||||
else params[:status]
|
||||
end
|
||||
applies = LibraryApply.where(status: status) if status.present?
|
||||
|
||||
# 关键字模糊查询
|
||||
keyword = params[:keyword].to_s.strip
|
||||
if keyword.present?
|
||||
applies = applies.joins(:library)
|
||||
.where('title LIKE :keyword OR uuid LIKE :keyword', keyword: "%#{keyword}%")
|
||||
end
|
||||
|
||||
custom_sort(applies, params[:sort_by], params[:sort_direction])
|
||||
end
|
||||
end
|
@ -0,0 +1,48 @@
|
||||
class Admins::ShixunQuery < ApplicationQuery
|
||||
include CustomSortable
|
||||
|
||||
attr_reader :params
|
||||
|
||||
sort_columns :created_at, default_by: :created_at, default_direction: :desc
|
||||
|
||||
def initialize(params)
|
||||
@params = params
|
||||
end
|
||||
|
||||
def call
|
||||
all_shixuns = Shixun.all
|
||||
status =
|
||||
case params[:status]
|
||||
when "editing" then [0]
|
||||
when "pending" then [1]
|
||||
when "processed" then [2]
|
||||
when "closed" then [3]
|
||||
else
|
||||
[0,1,2,3]
|
||||
end
|
||||
|
||||
all_shixuns = all_shixuns.where(status: status) if status.present?
|
||||
|
||||
if params[:tag].present?
|
||||
all_shixuns = all_shixuns.joins(:mirror_repositories).where("mirror_repositories.id = ?",params[:tag].to_i)
|
||||
end
|
||||
|
||||
# 关键字模糊查询
|
||||
keyword = params[:keyword].to_s.strip
|
||||
if keyword.present?
|
||||
search_type = params[:search_type] || "0"
|
||||
case search_type
|
||||
when "0"
|
||||
all_shixuns = all_shixuns.joins(:user)
|
||||
.where('CONCAT(lastname, firstname) like :keyword', keyword: "%#{keyword}%")
|
||||
when "1"
|
||||
all_shixuns = all_shixuns.where('name like :keyword', keyword: "%#{keyword}%")
|
||||
else
|
||||
all_shixuns = all_shixuns.joins(user: {user_extension: :school}).where('schools.name LIKE ?', "%#{keyword}%")
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
custom_sort(all_shixuns, params[:sort_by], params[:sort_direction])
|
||||
end
|
||||
end
|
@ -0,0 +1,54 @@
|
||||
class Admins::ShixunSettingsQuery < ApplicationQuery
|
||||
include CustomSortable
|
||||
|
||||
attr_reader :params
|
||||
|
||||
sort_columns :created_at, default_by: :created_at, default_direction: :desc
|
||||
|
||||
def initialize(params)
|
||||
@params = params
|
||||
end
|
||||
|
||||
def call
|
||||
all_shixuns = Shixun.all
|
||||
status =
|
||||
case params[:status]
|
||||
when "editing" then [0]
|
||||
when "pending" then [1]
|
||||
when "processed" then [2]
|
||||
when "closed" then [3]
|
||||
else
|
||||
[0,1,2,3]
|
||||
end
|
||||
|
||||
all_shixuns = all_shixuns.where(status: status) if status.present?
|
||||
|
||||
if params[:tag].present?
|
||||
all_shixuns = all_shixuns.joins(:mirror_repositories).where("mirror_repositories.id = ?",params[:tag].to_i)
|
||||
end
|
||||
|
||||
# 关键字模糊查询
|
||||
keyword = params[:keyword].to_s.strip
|
||||
if keyword.present?
|
||||
search_type = params[:search_type] || "0"
|
||||
case search_type
|
||||
when "0"
|
||||
all_shixuns = all_shixuns.joins(:user)
|
||||
.where('CONCAT(lastname, firstname) like :keyword', keyword: "%#{keyword}%")
|
||||
when "1"
|
||||
all_shixuns = all_shixuns.where('name like :keyword', keyword: "%#{keyword}%")
|
||||
else
|
||||
all_shixuns = all_shixuns.joins(user: {user_extension: :school}).where('schools.name LIKE ?', "%#{keyword}%")
|
||||
end
|
||||
end
|
||||
|
||||
all_shixuns = all_shixuns.where(can_copy: params[:can_copy]) if params[:can_copy]
|
||||
all_shixuns = all_shixuns.where(webssh: params[:webssh]) if params[:webssh]
|
||||
all_shixuns = all_shixuns.where(hidden: params[:hidden]) if params[:hidden]
|
||||
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]
|
||||
|
||||
custom_sort(all_shixuns, params[:sort_by], params[:sort_direction])
|
||||
end
|
||||
end
|
@ -0,0 +1,32 @@
|
||||
<% define_admin_breadcrumbs do %>
|
||||
<% add_admin_breadcrumb('教学案例发布') %>
|
||||
<% end %>
|
||||
|
||||
<div class="box search-form-container flex-column mb-0 pb-0 library-applies-list-form">
|
||||
<ul class="nav nav-tabs w-100 search-form-tabs">
|
||||
<li class="nav-item">
|
||||
<%= link_to '待审批', admins_library_applies_path(status: :pending), remote: true, 'data-value': 'pending',
|
||||
class: "nav-link search-form-tab #{params[:status] == 'pending' ? 'active' : ''}" %>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<%= link_to '已审批', admins_library_applies_path(status: :processed), remote: true, 'data-value': 'processed',
|
||||
class: "nav-link search-form-tab #{params[:status] != 'pending' ? 'active' : ''}" %>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<%= form_tag(admins_library_applies_path(unsafe_params), method: :get, class: 'form-inline search-form justify-content-end mt-3', remote: true) do %>
|
||||
<div class="form-group status-filter" style="<%= params[:status] != 'pending' ? '' : 'display: none;' %>">
|
||||
<label for="status">审核状态:</label>
|
||||
<% status_options = [['全部', 'processed'], ['已同意', 'agreed'], ['已拒绝', 'refused']] %>
|
||||
<%= select_tag(:status, options_for_select(status_options) ,class: 'form-control') %>
|
||||
</div>
|
||||
<%= text_field_tag(:keyword, params[:keyword], class: 'form-control col-sm-2 ml-3', placeholder: '编号/名称检索') %>
|
||||
<%= submit_tag('搜索', class: 'btn btn-primary ml-3') %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="box library-applies-list-container">
|
||||
<%= render(partial: 'admins/library_applies/shared/list', locals: { applies: @library_applies }) %>
|
||||
</div>
|
||||
|
||||
<%= render(partial: 'admins/shared/admin_common_refuse_modal') %>
|
@ -0,0 +1 @@
|
||||
$('.library-applies-list-container').html("<%= j( render partial: 'admins/library_applies/shared/list', locals: { applies: @library_applies } ) %>");
|
@ -0,0 +1,56 @@
|
||||
<% is_processed = params[:status].to_s != 'pending' %>
|
||||
|
||||
<table class="table table-hover text-center library_applies-list-table">
|
||||
<thead class="thead-light">
|
||||
<tr>
|
||||
<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>
|
||||
<% if is_processed %>
|
||||
<th width="16%">拒绝原因</th>
|
||||
<th width="8%">状态</th>
|
||||
<% else %>
|
||||
<th width="20%">操作</th>
|
||||
<% end %>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% if applies.present? %>
|
||||
<% applies.each do |apply| %>
|
||||
<% user = apply.library.user %>
|
||||
<% library = apply.library %>
|
||||
<tr class="library_applies-item library_applies-<%= apply.id %>">
|
||||
<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" />
|
||||
<% end %>
|
||||
</td>
|
||||
<td><%= user.real_name %></td>
|
||||
<td class="text-left"><%= link_to library.title, library_path(library), :target => "_blank" %></td>
|
||||
<td class="text-left"><%= overflow_hidden_span library.content[0..50] + "..."%></td>
|
||||
<td><%= apply.updated_at.strftime('%Y-%m-%d %H:%M') %></td>
|
||||
|
||||
<% if is_processed %>
|
||||
<td class="text-secondary"><%= overflow_hidden_span apply.reason %></td>
|
||||
<td><span class="apply-status-<%= apply.status %>"><%= t("library_apply.status.#{apply.status}") %></span></td>
|
||||
<% else %>
|
||||
<td class="action-container">
|
||||
<%= agree_link '同意', agree_admins_library_apply_path(apply, element: ".library_applies-#{apply.id}"), 'data-confirm': '确认审核通过?' %>
|
||||
<%= javascript_void_link('拒绝', class: 'action refuse-action',
|
||||
data: {
|
||||
toggle: 'modal', target: '.admin-common-refuse-modal', id: apply.id,
|
||||
url: refuse_admins_library_apply_path(apply, element: ".library_applies-#{apply.id}")
|
||||
}) %>
|
||||
</td>
|
||||
<% end %>
|
||||
</tr>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<%= render 'admins/shared/no_data_for_table' %>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<%= render partial: 'admins/shared/paginate', locals: { objects: applies } %>
|
@ -0,0 +1,76 @@
|
||||
<% define_admin_breadcrumbs do %>
|
||||
<% add_admin_breadcrumb('实训配置', admins_shixun_settings_path) %>
|
||||
<% end %>
|
||||
|
||||
<div class="box search-form-container shixun-settings-list-form">
|
||||
<%= form_tag(admins_shixun_settings_path, method: :get, class: 'form-inline search-form', remote: true) do %>
|
||||
<div class="d-flex flex-column w-100">
|
||||
<div class="d-flex position-r">
|
||||
<div class="form-group mr-2">
|
||||
<label for="status">状态:</label>
|
||||
<% status_options = [['全部', ''], ["编辑中(#{@editing_shixuns})", "editing"], ["待审核(#{@pending_shixuns})", 'pending'], ["已发布(#{@processed_shixuns})", 'processed'],["已关闭(#{@closed_shixuns})",'closed']] %>
|
||||
<%= select_tag(:status, options_for_select(status_options), class: 'form-control') %>
|
||||
</div>
|
||||
<div class="form-group mr-2">
|
||||
<label for="tag-choosed">技术平台:</label>
|
||||
<%= select_tag(:tag, options_for_select(@shixuns_type_check.unshift(["",nil])), class: 'form-control',id:"tag-choosed") %>
|
||||
</div>
|
||||
<div class="form-group mr-2">
|
||||
<label>搜索类型:</label>
|
||||
<% auto_trial_options = [['创建者姓名', 0], ['实训名称', 1], ['学校名称', 2]] %>
|
||||
<%= select_tag(:search_type, options_for_select(auto_trial_options), class: 'form-control') %>
|
||||
</div>
|
||||
<%= text_field_tag(:keyword, params[:keyword], class: 'form-control col-sm-2 ml-3', placeholder: '输入关键字搜索') %>
|
||||
<%= submit_tag('搜索', class: 'btn btn-primary ml-3') %>
|
||||
<%= link_to "清除",admins_shixun_settings_path(status:nil,tag:nil,search_type:nil,keyword:nil),class: "btn btn-default" %>
|
||||
|
||||
<div class="">
|
||||
<a href="<%= admins_shixun_settings_path( :format => "xls") %>" class="btn btn-primary export-absolute" id="shixun_xls">导出</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="d-flex mt-3">
|
||||
<div class="mr-5">
|
||||
<label for="can_copy">
|
||||
<%= check_box_tag :can_copy,true,false,remote:true,class:"shixun-settings-select" %>
|
||||
<span class="only_view">只看可复制</span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="mr-5">
|
||||
<label for="webssh">
|
||||
<%= check_box_tag :webssh,1,false,remote:true, class:"shixun-settings-select" %>
|
||||
<span class="only_view">只看可ssh</span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="mr-5">
|
||||
<label for="hidden">
|
||||
<%= check_box_tag :hidden,true,false,remote:true, class:"shixun-settings-select" %>
|
||||
<span class="only_view">只看已隐藏</span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="mr-5">
|
||||
<label for="homepage_show">
|
||||
<%= check_box_tag :homepage_show,true,false,remote:true, class:"shixun-settings-select" %>
|
||||
<span class="only_view">只看首页显示</span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="mr-5">
|
||||
<label for="task_pass">
|
||||
<%= check_box_tag :task_pass, true, false, remote:true, class:"shixun-settings-select" %>
|
||||
<span class="only_view">只看可跳关</span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="mr-5">
|
||||
<label for="code_hidden">
|
||||
<%= check_box_tag :code_hidden, true, false, remote:true, class:"shixun-settings-select" %>
|
||||
<span class="only_view">只看已隐藏文件目录</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="box shixun-settings-list-container">
|
||||
<%= render partial: 'admins/shixun_settings/shared/list', locals: { shixun_settings: @shixun_settings } %>
|
||||
</div>
|
||||
|
@ -0,0 +1 @@
|
||||
$(".shixun-settings-list-container").html("<%= j render partial: "admins/shixun_settings/shared/list",locals: {shixun_settings:@shixun_settings} %>")
|
@ -0,0 +1,31 @@
|
||||
<table class="table text-center shixun-settings-list-table">
|
||||
<thead>
|
||||
<th width="4%">序号</th>
|
||||
<th width="8%">ID</th>
|
||||
<th width="12%" class="text-left">实训名称</th>
|
||||
<th width="8%">技术平台</th>
|
||||
<th width="8%">权限</th>
|
||||
<th width="15%">技术体系</th>
|
||||
<th width="12%">上传图片</th>
|
||||
<th width="5%">创建者</th>
|
||||
<th width="5%">关闭</th>
|
||||
<th width="4%">复制</th>
|
||||
<th width="7%">代码执行时间</th>
|
||||
<th>
|
||||
操作
|
||||
<div class="setting-chosen">
|
||||
ssh/隐藏/首页/跳关/隐藏目录
|
||||
</div>
|
||||
</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% shixun_settings.each_with_index do |shixun,index| %>
|
||||
<tr id="setting-item-<%= shixun.id %>">
|
||||
<% page_no = (@params_page.to_i - 1) * 20 + index + 1 %>
|
||||
<%= render partial: "admins/shixun_settings/shared/td",locals: {shixun: shixun,page_no:page_no} %>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<%= render partial: 'admins/shared/paginate', locals: { objects: shixun_settings } %>
|
@ -0,0 +1,58 @@
|
||||
<td class="shixun-line-no"><%= page_no %></td>
|
||||
<td><%= shixun.identifier %></td>
|
||||
<td class="text-left">
|
||||
<span>
|
||||
<%= link_to overflow_hidden_span(shixun.name,width:160), "/shixuns/#{shixun.identifier}", :target => "_blank", :title => shixun.name %>
|
||||
</span>
|
||||
</td>
|
||||
<td>
|
||||
<%= display_text shixun.shixun_main_name %>
|
||||
</td>
|
||||
<td>
|
||||
<% status_options = [['超级管理员', '0'], ["合作团队", "1"]] %>
|
||||
<%= select_tag(:use_scope, options_for_select(status_options,shixun.use_scope),class:"form-control shixun-setting-form",data:{id:shixun.id}) %>
|
||||
</td>
|
||||
<td>
|
||||
<%= select_tag(:tag_repertoires, options_for_select(@shixun_tags,shixun.tag_repertoires.pluck(:id)),multiple:true,class:"form-control shixun-setting-form",data:{id:shixun.id},id:"tags-chosen-#{shixun.id}") %>
|
||||
</td>
|
||||
<td>
|
||||
<!-- 图片上传,稍后添加-->
|
||||
|
||||
<a href="javascript:void(0);" id="object_upload_img_<%= shixun.id %>" onclick="$('#upload_img_<%= shixun.id %>').click();">
|
||||
<%= File.exist?(disk_filename("Shixun",shixun.id)) ? "重新上传" : "上传图片" %>
|
||||
</a>
|
||||
<% if File.exist?(disk_filename("Shixun",shixun.id)) %>
|
||||
<%= image_tag(url_to_avatar(shixun), :class => "w80 h80 fl ml5 shixun_image_show", :id => "shixun_image_show_#{shixun.id}") %>
|
||||
<% else %>
|
||||
<img src="" class="w80 h80 fl ml5 shixun_image_show none" id="shixun_image_show_<%= shixun.id %>"/>
|
||||
<% end %>
|
||||
|
||||
</td>
|
||||
<td><%= link_to shixun.owner.try(:show_real_name),"/users/#{shixun.owner.login}",target:'_blank' %></td>
|
||||
<td>
|
||||
<% if shixun.status.to_i < 3 %>
|
||||
<%= link_to "关闭", admins_shixun_setting_path(shixun,status:3,page_no:page_no),method: :put, :class => "", :remote => true %>
|
||||
<% else %>
|
||||
<span>已关闭</span>
|
||||
<% end %>
|
||||
</td>
|
||||
<td>
|
||||
<%= check_box_tag :can_copy,!shixun.can_copy,shixun.can_copy,remote:true,data:{id:shixun.id},class:"shixun-setting-form" %>
|
||||
</td>
|
||||
<td>
|
||||
<input name="excute_time" value="<%= shixun.excute_time %>" class="form-control shixun-setting-form" data-id="<%= shixun.id %>">
|
||||
</td>
|
||||
<td class="operate">
|
||||
<%= check_box_tag :webssh,(shixun.webssh == 1 ? 0 : 1),(shixun.webssh == 1 ? true : false),remote:true,data:{id:shixun.id,toggle:"tooltip",placement:"top"},class:"shixun-setting-form",title:"ssh" %>
|
||||
<%= check_box_tag :hidden,!shixun.hidden,shixun.hidden,remote:true,data:{id:shixun.id,toggle:"tooltip",placement:"top"},class:"shixun-setting-form" ,title:"隐藏"%>
|
||||
<%= 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:"隐藏目录"%>
|
||||
</td>
|
||||
|
||||
<script>
|
||||
$("#tags-chosen-<%= shixun.id %>").select2({
|
||||
multiple: true,
|
||||
maximumSelectionLength: 3,
|
||||
placeholder: '请选择技术体系'});
|
||||
</script>
|
@ -0,0 +1 @@
|
||||
$("#setting-item-<%= @shixun.id %>").html("<%= j render partial: "admins/shixun_settings/shared/td",locals: {shixun: @shixun,page_no:@page_no} %>")
|
@ -0,0 +1,33 @@
|
||||
<% define_admin_breadcrumbs do %>
|
||||
<% add_admin_breadcrumb('实训列表', admins_shixuns_path) %>
|
||||
<% end %>
|
||||
|
||||
<div class="box search-form-container shixuns-list-form">
|
||||
<%= form_tag(admins_shixuns_path, method: :get, class: 'form-inline search-form', remote: true) do %>
|
||||
<div class="form-group mr-2">
|
||||
<label for="status">状态:</label>
|
||||
<% status_options = [['全部', ''], ["编辑中(#{@editing_shixuns})", "editing"], ["待审核(#{@pending_shixuns})", 'pending'], ["已发布(#{@processed_shixuns})", 'processed'],["已关闭(#{@closed_shixuns})",'closed']] %>
|
||||
<%= select_tag(:status, options_for_select(status_options), class: 'form-control') %>
|
||||
</div>
|
||||
|
||||
<div class="form-group mr-2">
|
||||
<label for="tag-choosed">技术平台:</label>
|
||||
<%= select_tag(:tag, options_for_select(@shixuns_type_check.unshift(["",nil])), class: 'form-control',id:"tag-choosed") %>
|
||||
</div>
|
||||
|
||||
<div class="form-group ml-3">
|
||||
<label>搜索类型:</label>
|
||||
<% auto_trial_options = [['创建者姓名', 0], ['实训名称', 1], ['学校名称', 2]] %>
|
||||
<%= select_tag(:search_type, options_for_select(auto_trial_options), class: 'form-control') %>
|
||||
</div>
|
||||
<%= text_field_tag(:keyword, params[:keyword], class: 'form-control col-sm-2 ml-3', placeholder: '输入关键字搜索') %>
|
||||
<%= submit_tag('搜索', class: 'btn btn-primary ml-3') %>
|
||||
<%= link_to "清除",admins_shixuns_path(status:nil,tag:nil,search_type:nil,keyword:nil),class: "btn btn-default" %>
|
||||
<% end %>
|
||||
<a href="<%= admins_shixuns_path( :format => "xls") %>" class="btn btn-primary" id="shixun_xls">导出</a>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="box shixuns-list-container">
|
||||
<%= render partial: 'admins/shixuns/shared/list', locals: { shixuns: @shixuns } %>
|
||||
</div>
|
@ -0,0 +1 @@
|
||||
$(".shixuns-list-container").html("<%= j render partial: "admins/shixuns/shared/list",locals: {shixuns:@shixuns} %>")
|
@ -0,0 +1,51 @@
|
||||
<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="28%" class="text-left">实训名称</th>
|
||||
<th width="8%">技术平台</th>
|
||||
<th width="5%">Fork源</th>
|
||||
<th width="5%">实践</th>
|
||||
<th width="5%">选择</th>
|
||||
<th width="6%">状态</th>
|
||||
<th width="7%">创建者</th>
|
||||
<th class="eud-pointer" width="13%"><%= sort_tag('创建于', name: 'created_at', path: admins_shixuns_path) %></th>
|
||||
<th width="5%">单测</th>
|
||||
<th width="6%">操作</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% shixuns.each_with_index do |shixun,index| %>
|
||||
<tr>
|
||||
<td><%= (@params_page.to_i - 1) * 20 + index + 1%></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.shixun_main_name.nil? ? "--" : shixun.shixun_main_name %>
|
||||
</td>
|
||||
<td>
|
||||
<% if shixun.try(:fork_from).nil? %>
|
||||
--
|
||||
<% else%>
|
||||
<%= link_to shixun.try(:identifier), shixun_path(shixun.try(:identifier)), target: '_blank'%>
|
||||
<% end%>
|
||||
</td>
|
||||
<td><%= shixun.challenges.where(:st => 0).size %></td>
|
||||
<td><%= shixun.challenges.where(:st => 1).size %></td>
|
||||
<td class="shixuns-status-<%= shixun.status %>"><%= shixun_authentication_status shixun %></td>
|
||||
<td><%= link_to shixun.owner.try(:show_real_name),"/users/#{shixun.owner.try(:login)}",target:'_blank' %></td>
|
||||
<td><%= format_time shixun.created_at %></td>
|
||||
<td class="homepage_teacher">
|
||||
<input type="checkbox" name="sigle_show" value="<%= shixun.id %>" <%= shixun.sigle_training ? "checked" : "" %> class="ml-3 mr5 magic-checkbox" id="join_teacher_homepage_<%= shixun.id %>">
|
||||
<label style="top:-14px;" class="ml20" for="join_teacher_homepage_<%= shixun.id %>"></label>
|
||||
</td>
|
||||
<td class="operate">
|
||||
<% if shixun.status == 0 %>
|
||||
<%= link_to(l(:button_delete), admins_shixun_path(shixun), :method => :delete, :data => { confirm: "您确定要删除吗?" } ) %>
|
||||
<% end %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<%= render partial: 'admins/shared/paginate', locals: { objects: shixuns } %>
|
@ -0,0 +1,10 @@
|
||||
json.shixun_counts @shixuns_count
|
||||
|
||||
json.shixuns do
|
||||
json.array! @shixuns do |s|
|
||||
json.shixun_id s.id
|
||||
json.shixun_name s.name
|
||||
json.shixun_user s.user.real_name
|
||||
json.shixun_user_count s.myshixuns_count
|
||||
end
|
||||
end
|
@ -0,0 +1,10 @@
|
||||
json.shixun_id @shixun.id
|
||||
json.shixun_name @shixun.name
|
||||
|
||||
json.challenges do
|
||||
json.array! @shixun_challenges do |s|
|
||||
json.challenge_name s.subject
|
||||
end
|
||||
end
|
||||
|
||||
json.challenge_counts @shixun_challenges_count
|
@ -0,0 +1,7 @@
|
||||
zh-CN:
|
||||
library_apply:
|
||||
status:
|
||||
'pending': '待审批'
|
||||
'processed': '已审批'
|
||||
'refused': '已拒绝'
|
||||
'agreed': '已同意'
|
@ -1,5 +1,9 @@
|
||||
'zh-CN':
|
||||
zh-CN:
|
||||
error:
|
||||
record_not_found: 您访问的页面不存在或已被删除
|
||||
forbidden: 您没有权限进行该操作
|
||||
unauthorized: 未登录
|
||||
|
||||
button_test: 测试
|
||||
button_edit: 编辑
|
||||
button_delete: 删除
|
@ -0,0 +1,5 @@
|
||||
class MigrateGtopicBankIsPublic < ActiveRecord::Migration[5.2]
|
||||
def change
|
||||
change_column :gtopic_banks, :is_public, :boolean, default: 0
|
||||
end
|
||||
end
|
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in new issue