init project

This commit is contained in:
Jasder
2020-03-09 00:40:16 +08:00
commit 2937b2a94d
6549 changed files with 7215173 additions and 0 deletions

View File

@@ -0,0 +1 @@
json.partial! 'users/user', user: @user

View File

@@ -0,0 +1,2 @@
json.status 0
json.message "邮箱或者手机号码可用"

View File

@@ -0,0 +1,15 @@
<% define_admin_breadcrumbs do %>
<% add_admin_breadcrumb('关于我们') %>
<% end %>
<div class="box edit-about-us-container">
<%= simple_form_for(@doc, url: admins_about_path) do |f| %>
<div class="form-group" id="about-us-editor">
<%= text_area_tag('about_us', @doc.about_us, style: 'display: none') %>
</div>
<div class="form-row mt-4">
<%= f.button :submit, value: '保存', class: 'btn-primary mr-3 px-4', 'data-disable-with': '保存中...' %>
</div>
<% end %>
</div>

View File

@@ -0,0 +1,15 @@
<% define_admin_breadcrumbs do %>
<% add_admin_breadcrumb('服务协议') %>
<% end %>
<div class="box edit-agreement-container">
<%= simple_form_for(@doc, url: admins_agreement_path) do |f| %>
<div class="form-group" id="agreement-editor">
<%= text_area_tag('agreement', @doc.agreement, style: 'display: none') %>
</div>
<div class="form-row mt-4">
<%= f.button :submit, value: '保存', class: 'btn-primary mr-3 px-4', 'data-disable-with': '保存中...' %>
</div>
<% end %>
</div>

View File

@@ -0,0 +1,8 @@
if($(".auth-schools-user-add").length > 0){
$(".auth-schools-user-add").modal("hide")
}
<% if @school_users.size > 0 %>
$("#table-school-<%= @school_id %>").find(".school_user_list").html("<%= j render partial: "admins/auth_schools/shared/school_user_list", locals: {users: @school_users, school_id: @school_id} %> ")
<% end %>
show_success_flash()

View File

@@ -0,0 +1,4 @@
$(".auth-schools-list-container").html("<%= j render partial: "admins/auth_schools/shared/list", locals: {schools: @schools} %>")
$(".auth-schools-new-add").modal("hide")
show_success_flash()

View File

@@ -0,0 +1,14 @@
<% define_admin_breadcrumbs do %>
<% add_admin_breadcrumb('认证单位列表') %>
<% end %>
<div class="box search-form-container auth-schools-list-form">
<%= javascript_void_link '新增', class: 'btn btn-primary', data: { toggle: 'modal', target: '.auth-schools-new-add' } %>
</div>
<div class="box admin-list-container auth-schools-list-container">
<%= render(partial: 'admins/auth_schools/shared/list', locals: { schools: @schools }) %>
</div>
<%= render partial: "admins/auth_schools/shared/new_modal" %>
<%= render partial: "admins/auth_schools/shared/user_add_modal" %>

View File

@@ -0,0 +1 @@
$(".auth-schools-list-container").html("<%= j render partial: "admins/auth_schools/shared/list", locals: {schools: @schools} %>")

View File

@@ -0,0 +1,3 @@
$("#table-school-<%= params[:school_id] %>").find("#manager-<%= params[:user_id] %>").remove()
show_success_flash()

View File

@@ -0,0 +1,4 @@
if($("#add-users-list").length > 0){
$("#add-users-list").html("<%= j render partial: "admins/auth_schools/shared/add_users_list", locals: {users: @users, school_id: params[:school_id]} %>")
}

View File

@@ -0,0 +1,3 @@
if($("#add-schools-list").length > 0){
$("#add-schools-list").html("<%= j render partial: "admins/auth_schools/shared/add_schools_list", locals: {schools: @schools} %>")
}

View File

@@ -0,0 +1,23 @@
<%= form_tag(add_school_admins_auth_schools_path, method: :post, remote: true) do %>
<div class="add-school-list-item">
<div class="list-item-title">单位名称</div>
<div class="school-search-list">
<% if schools.size > 0 %>
<% schools.each do |school| %>
<div class="school-list-item">
<%= check_box_tag("school_id[]", school.id, false, id: "check_school_#{school.id}") %>
<label for="check_school_<%= school.id %>">
<%= school.try(:name) %>
</label>
</div>
<% end %>
<% else %>
<p class="padding10-5 color-grey-c">没有相关的单位</p>
<% end %>
</div>
</div>
<div class="text-right mt10">
<%= submit_tag("确认",class: "btn btn-primary submit-btn") %>
</div>
<% end %>

View File

@@ -0,0 +1,31 @@
<%= form_tag(add_manager_admins_auth_schools_path, method: :post, remote: true) do %>
<%= hidden_field_tag("school_id",school_id) %>
<div class="add-school-list-item">
<div class="list-item-title">
<span class="list-item-title-1">姓名</span>
<span class="list-item-title-2">单位</span>
</div>
<div class="school-search-list">
<% if users.size > 0 %>
<% users.each do |user| %>
<div class="school-list-item">
<%= check_box_tag("user_id[]", user.id, false, id: "check_user_#{user.id}") %>
<label for="check_user_<%= user.id %>">
<span class="list-item-title-1">
<%= user.try(:show_real_name) %>
</span>
<span class="list-item-title-2">
<%= user.try(:school_name) %>
</span>
</label>
</div>
<% end %>
<% else %>
<p class="padding10-5 color-grey-c">没有相关的单位</p>
<% end %>
</div>
</div>
<div class="text-right mt10">
<%= submit_tag("确认",class: "btn btn-primary submit-btn") %>
</div>
<% end %>

View File

@@ -0,0 +1,38 @@
<table class="table" cellspacing="0" cellpadding="0">
<thead>
<th width="10%">序号</th>
<th width="30%">学校名称</th>
<th width="50%">学校管理员</th>
<th width="10%">操作</th>
</thead>
<tbody>
<% if schools.size > 0 %>
<% schools.each_with_index do |school, index| %>
<tr id="table-school-<%= school.id %>">
<td><%= list_index_no(@params_page.to_i, index) %></td>
<td>
<%= link_to "#{school.name}", "/ecs/department?school_id=#{school.id}", target: "_blank" %>
</td>
<td>
<div class="add-manager-i">
<%= link_to "<i class='fa fa-plus-circle font-18 color-grey-c'></i>".html_safe, "javascript:void(0)", class: "action", onclick: "show_add_manager('#{school.id}')" %>
</div>
<div class="inline-block school_user_list">
<% if school.users.size > 0 %>
<%= render partial: "admins/auth_schools/shared/school_user_list", locals: {users: school.users, school_id: school.id} %>
<% end %>
</div>
</td>
<td>
<%= link_to "<i class='fa fa-trash-o color-grey-c font-18 padding10-5'></i>".html_safe, admins_auth_school_path(school), method: :delete, data: {confirm: "确认删除吗?"}, remote: true %>
</td>
</tr>
<% end %>
<% else %>
<%= render 'admins/shared/no_data_for_table' %>
<% end %>
</tbody>
</table>
<%= render partial: 'admins/shared/paginate', locals: { objects: schools } %>

View File

@@ -0,0 +1,32 @@
<div class="modal fade auth-schools-new-add" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">新增认证单位</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<%= form_tag(search_school_admins_auth_schools_path,method: :get ,remote: true) do %>
<div class="form-group d-flex mbt10">
<div class="w-75 d-flex flex-column">
<%= text_field_tag(:name, nil, class: 'form-control', placeholder: '请输入单位名称搜索') %>
</div>
<%= submit_tag("搜索",class:"btn btn-primary search-school", 'data-disable-with': "搜索中...") %>
</div>
<% end %>
<div id="add-schools-list">
<div class="add-school-list-item">
<div class="list-item-title">单位名称</div>
<div class="school-search-list">
<div class="school-list-item">
<span class="color-grey-c">请输入单位名称</span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,6 @@
<% users.each do |user| %>
<span class="collegeManage" id="manager-<%= user.id %>">
<%= link_to user.show_real_name, "/users/#{user.login}", target: "_blank" %>
<%= link_to "×", remove_manager_admins_auth_schools_path(user_id: user.id, school_id: school_id),method: :post, class: "font-16 ml3", remote: true %>
</span>
<% end %>

View File

@@ -0,0 +1,36 @@
<div class="modal fade auth-schools-user-add" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">添加管理员</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<%= form_tag(search_manager_admins_auth_schools_path, method: :get ,remote: true) do %>
<%= hidden_field("school_id","",id:"school_id_input") %>
<div class="form-group d-flex mbt10">
<div class="w-75 d-flex flex-column">
<%= text_field_tag(:name, nil, class: 'form-control', placeholder: '请输入用户姓名搜索') %>
</div>
<%= submit_tag("搜索",class:"btn btn-primary search-school", 'data-disable-with': "搜索中...") %>
</div>
<% end %>
<div id="add-users-list">
<div class="add-school-list-item">
<div class="list-item-title">
<span class="list-item-title-1">姓名</span>
<span class="list-item-title-2">单位</span>
</div>
<div class="school-search-list">
<div class="school-list-item">
<span class="color-grey-c">请输入用户姓名搜索</span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,44 @@
<%
define_admin_breadcrumbs do
add_admin_breadcrumb('云上实验室', admins_laboratories_path)
add_admin_breadcrumb('轮播图')
end
%>
<div class="card mb-5 carousels-card">
<div class="card-header d-flex justify-content-between align-items-center">
<span class="flex-1">首页轮播图<span class="text-secondary font-12">(拖动排序)</span></span>
<%= javascript_void_link '添加', class: 'btn btn-primary btn-sm add-btn', data: { toggle: 'modal', target: '.admin-add-carousel-modal' } %>
</div>
<div class="card-body row" id="carousels-container" data-laboratory-id="<%= current_laboratory.id %>">
<% @images.each_with_index do |image, index| %>
<div class="col-12 custom-carousel-item custom-carousel-item-<%= image.id %>" data-id="<%= image.id %>">
<div class="border rounded relative p-3 mb-3 drag row align-items-center <%= image.online? ? '' : 'not_active' %>">
<div class="col-2 col-md-1 custom-carousel-item-no"><%= index + 1 %></div>
<div class="col-10 col-md-3 custom-carousel-item-img" data-source-id="<%= image.id %>" data-source-type="PortalImage" data-toggle="modal" data-target=".admin-upload-file-modal">
<img src="<%= Util::FileManage.exist?('PortalImage', image.id) ? Util::FileManage.disk_file_url('PortalImage', image.id) : '' %>" data-toggle="tooltip" data-title="重新上传"/>
</div>
<div class="col-10 col-md-7">
<div class="input-group">
<input type="text" value="<%= image.name %>" class="form-control name-input" placeholder="请输入名称" />
<input type="text" value="<%= image.link %>" class="form-control link-input" placeholder="请输入跳转地址">
<div class="input-group-prepend">
<button class="input-group-text save-data-btn" data-id="<%= image.id %>">保存</button>
</div>
</div>
</div>
<div class="col-2 col-md-1 operate-box">
<%= check_box_tag(:online, 1, image.online?, id: nil, class: 'online-check-box', data: { id: image.id, toggle: 'tooltip', title: '首页展示' }) %>
<%= delete_link '删除', admins_laboratory_carousel_path(image, laboratory_id: image.laboratory_id, element: ".custom-carousel-item-#{image.id}", not_refresh: true), class: 'delete-btn' do %>
<i class="fa fa-trash-o" data-id="<%= image.id %>"></i>
<% end %>
</div>
</div>
</div>
<% end %>
</div>
</div>
<%= render partial: 'admins/carousels/shared/add_carousel_modal', locals: { laboratory_id: current_laboratory } %>
<%= render partial: 'admins/shared/modal/upload_file_modal' %>

View File

@@ -0,0 +1,36 @@
<div class="modal fade admin-add-carousel-modal" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">添加轮播图</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<%= simple_form_for(PortalImage.new, url: admins_laboratory_carousels_path(laboratory_id: laboratory_id), html: { class: 'admin-add-carousel-form', enctype: 'multipart/form-data' }) do |f| %>
<div class="form-group">
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text">图片</span>
</div>
<div class="custom-file flex-row-reverse" style="overflow: hidden">
<input type="file" name="portal_image[image]" class="img-file-input" id="img-file-input" accept="image/*">
<label class="custom-file-label file-names" for="img-file-input">选择文件</label>
</div>
</div>
</div>
<%= f.input :name, label: '名称', placeholder: '请输入名称' %>
<%= f.input :link, as: :url, label: '跳转地址', placeholder: '请输入跳转地址' %>
<div class="error text-danger"></div>
<% end %>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
<button type="button" class="btn btn-primary submit-btn">确认</button>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,5 @@
$.notify({ message: '操作成功' },{ type: 'success' });
setTimeout(function(){
window.location.reload();
}, 500)

View File

@@ -0,0 +1,2 @@
$('.admin-modal-container').html("<%= j( render partial: 'admins/mirror_repositories/shared/choose_mirror_modal', locals: { mirror: @mirror, new_mirror: @new_mirror } ) %>");
$('.modal.admin-choose-mirror-modal').modal('show');

View File

@@ -0,0 +1,41 @@
<%
define_admin_breadcrumbs do
add_admin_breadcrumb('联系我们')
end
%>
<div class="row">
<% @cooperations.each do |cooperation| %>
<div class="mb-4 col-12 col-lg-6">
<div class="card">
<div class="card-header"><%= cooperation.user_type_text %></div>
<div class="card-body">
<%= simple_form_for(cooperation, url: admins_contact_us_path(id: cooperation.id), wrapper: :horizontal_form) do |f| %>
<%= f.input :name, label: '联系人:' %>
<%= f.input :qq, label: 'QQ:' %>
<%= f.input :mail, label: 'Email:' %>
<div class="text-right">
<%= f.button :submit, value: '保存', class: 'btn-primary btn-sm', 'data-disable-with': '保存中...' %>
</div>
<% end %>
</div>
</div>
</div>
<% end %>
<div class="mb-4 col-12 col-lg-6">
<div class="card">
<div class="card-header">公司地址</div>
<div class="card-body">
<%= simple_form_for(@help, url: update_address_admins_contact_us_path, wrapper: :horizontal_form) do |f| %>
<%= f.input :status, label: '地址:' %>
<div class="text-right">
<%= f.button :submit, value: '保存', class: 'btn-primary btn-sm', 'data-disable-with': '保存中...' %>
</div>
<% end %>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,38 @@
<%
define_admin_breadcrumbs do
add_admin_breadcrumb('合作伙伴')
end
%>
<% @data.each do |type, objs| %>
<div class="card mb-5 coo-img-card">
<div class="card-header d-flex justify-content-between align-items-center">
<span class="flex-1"><%= t("enumerize.coo_img.img_type.#{type}") %></span>
<%= javascript_void_link '添加', class: 'btn btn-primary btn-sm add-btn', data: { img_type: type, toggle: 'modal', target: '.admin-add-cooperative-modal' } %>
</div>
<div class="card-body row" id="coo-img-container-<%= type %>">
<% objs.sort_by(&:position).each do |obj| %>
<div class="col-12 col-md-6 col-lg-3 coo-img-item coo-img-item-<%= obj.id %>" data-id="<%= obj.id %>">
<div class="border rounded relative p-3 mb-3 drag">
<%= delete_link '删除', admins_cooperative_path(obj, element: ".coo-img-item-#{obj.id}", not_refresh: true) do %>
<i class="fa fa-trash-o delete-btn" data-id="<%= obj.id %>"></i>
<% end %>
<div class="coo-img-item-img" data-source-id="<%= obj.id %>" data-source-type="CooImg" data-toggle="modal" data-target=".admin-upload-file-modal">
<img src="<%= obj.url_states || (Util::FileManage.exist?('CooImg', obj.id) ? Util::FileManage.disk_file_url('CooImg', obj.id) : '') %>" data-toggle="tooltip" data-title="重新上传"/>
</div>
<div class="input-group input-group-sm">
<input type="text" value="<%= obj.src_states %>" class="form-control url-input" placeholder="请输入跳转地址">
<div class="input-group-prepend">
<button class="input-group-text save-url-btn" data-id="<%= obj.id %>">保存</button>
</div>
</div>
</div>
</div>
<% end %>
</div>
</div>
<% end %>
<%= render partial: 'admins/cooperatives/shared/add_cooperative_modal' %>
<%= render partial: 'admins/shared/modal/upload_file_modal' %>

View File

@@ -0,0 +1,37 @@
<div class="modal fade admin-add-cooperative-modal" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">添加合作伙伴</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<%= simple_form_for(CooImg.new, url: admins_cooperatives_path, html: { class: 'admin-add-cooperative-form', enctype: 'multipart/form-data' }) do |f| %>
<%= f.input :img_type, as: :hidden %>
<div class="form-group">
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text">图片</span>
</div>
<div class="custom-file flex-row-reverse">
<input type="file" name="coo_img[image]" class="img-file-input" id="img-file-input" accept="image/*">
<label class="custom-file-label file-names" for="img-file-input">选择文件</label>
</div>
</div>
</div>
<%= f.input :src_states, as: :url, label: '链接地址', placeholder: '请输入跳转地址' %>
<div class="error text-danger"></div>
<% end %>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
<button type="button" class="btn btn-primary submit-btn">确认</button>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,22 @@
<% define_admin_breadcrumbs do %>
<% add_admin_breadcrumb('课程列表') %>
<% end %>
<div class="box search-form-container course-list-list-form">
<%= form_tag(admins_course_lists_path, method: :get, class: 'form-inline search-form flex-1', remote: true) do %>
<div class="form-group">
<label>搜索类型:</label>
<% auto_trial_options = [['创建者姓名', 0], ['课程名称', 1]] %>
<%= 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','data-disable-with': '搜索中...') %>
<%= link_to "清除",admins_course_lists_path,class: "btn btn-default",id:"course-lists-clear-search",'data-disable-with': '清除中...' %>
<% end %>
</div>
<div class="box admin-list-container course-list-list-container">
<%= render partial: 'admins/course_lists/shared/list', locals: { courses: @course_lists } %>
</div>
<%= render 'admins/course_lists/shared/merge_course_list_modal' %>

View File

@@ -0,0 +1 @@
$(".course-list-list-container").html("<%= j render partial: 'admins/course_lists/shared/list', locals: { courses: @course_lists }%>");

View File

@@ -0,0 +1,37 @@
<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="38%" class="text-left">课程名称</th>
<th width="10%">课堂数</th>
<th width="10%">创建者</th>
<th width="12%"><%= sort_tag('创建时间', name: 'created_at', path: admins_course_lists_path) %></th>
<th width="18%">操作</th>
</thead>
<tbody>
<% if courses.present? %>
<% courses.each_with_index do |course_list,index| %>
<tr id="course-list-item-<%= course_list.id %>">
<td><%= list_index_no(@params_page.to_i, index) %></td>
<td><%= course_list.id %></td>
<td class="text-left"><%= course_list.name %></td>
<% course_count = course_list.courses.size %>
<td><%= course_count %></td>
<td><%= link_to course_list.user.try(:real_name),"/users/#{course_list.user.try(:login)}",target:'_blank' %></td>
<td><%= format_time course_list.created_at %></td>
<td class="operate">
<% if course_count == 0 %>
<%= delete_link '删除', admins_course_list_path(course_list, element: ".course-list-item-#{course_list.id}"), class: 'delete-department-action' %>
<% end %>
<%= javascript_void_link '修改', class: 'action', data: { course_list_id: course_list.id,
toggle: 'modal', target: '.admin-merge-course-list-modal', url: merge_admins_course_lists_path } %>
</td>
</tr>
<% end %>
<% else %>
<%= render 'admins/shared/no_data_for_table' %>
<% end %>
</tbody>
</table>
<%= render partial: 'admins/shared/paginate', locals: { objects: courses } %>

View File

@@ -0,0 +1,29 @@
<div class="modal fade admin-merge-course-list-modal" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">修改课程</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<form class="admin-merge-course-list-form" data-url="<%= merge_admins_course_lists_path %>">
<%= hidden_field_tag(:origin_course_list_id, nil) %>
<div class="form-group d-flex">
<label for="course_list_id" class="col-form-label">更改为:</label>
<div class="d-flex flex-column-reverse w-75">
<input id="course_list_name" name="course_list_name" placeholder="请输入课程名称" class="form-control">
</div>
</div>
<div class="error text-danger"></div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
<button type="button" class="btn btn-primary submit-btn">确认</button>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,2 @@
alert("删除成功");
$(".course-item-<%= @course.id %>").find(".delete-course-action").remove();

View File

@@ -0,0 +1,34 @@
<% define_admin_breadcrumbs do %>
<% add_admin_breadcrumb('课堂列表') %>
<% end %>
<div class="box search-form-container course-list-form">
<%= form_tag(admins_courses_path, method: :get, class: 'form-inline search-form flex-1', remote: true) do %>
<div class="form-group mr-1">
<label for="status">状态:</label>
<% status_options = [['全部', ''], ["正在进行(#{@processed_courses})", 'processing'], ["已结束#{@ended_courses}", 'ended']] %>
<%= select_tag(:status, options_for_select(status_options), class: 'form-control') %>
</div>
<div class="form-group col-12 col-md-3">
<label for="school_name">单位:</label>
<%= select_tag :school_id, options_for_select([''], params[:school_id]), class: 'form-control school-select flex-1' %>
</div>
<%= text_field_tag(:keyword, params[:keyword], class: 'form-control col-12 col-md-2 mr-3', placeholder: '创建者/课堂名称/课程名称检索') %>
<div class="form-check mr-2">
<%= hidden_field_tag(:homepage_show, false, id:'') %>
<%= check_box_tag(:homepage_show, true, params[:homepage_show].to_s == 'true', class: 'form-check-input course-homepage-show') %>
<label class="form-check-label" for="homepage_show">只看首页展示</label>
</div>
<%= submit_tag('搜索', class: 'btn btn-primary ml-3', 'data-disable-with': '搜索中...') %>
<input type="reset" class="btn btn-secondary clear-btn" value="清空"/>
<% end %>
<a href="javascript:void(0)" class="btn btn-primary" id="course-export" data-disable-with = '导出中...'>导出</a>
</div>
<div class="box admin-list-container course-list-container">
<%= render partial: 'admins/courses/shared/list', locals: { courses: @courses } %>
</div>

View File

@@ -0,0 +1 @@
$('.course-list-container').html("<%= j( render partial: 'admins/courses/shared/list', locals: { courses: @courses } ) %>");

View File

@@ -0,0 +1,29 @@
wb = xlsx_package.workbook
wb.styles do |s|
blue_cell = s.add_style :bg_color => "FAEBDC", :sz => 10,:height => 25,:b => true, :border => { :style => :thin, :color =>"000000" },:alignment => {wrap_text: true,:horizontal => :center,:vertical => :center}
wb.add_worksheet(name: "课堂列表") do |sheet|
sheet.add_row %w(ID 课堂名称 成员 资源 普通作业 分组作业 实训作业 试卷 评测次数 私有 状态 单位 创建者 创建时间 动态时间), :height => 25,:style => blue_cell
@courses.each do |course|
data = [
course.id,
course.name,
course.course_members_count,
get_attachment_count(course, 0),
course.course_homework_count(1),
course.course_homework_count(3),
course.course_homework_count(4),
course.exercises_count,
course.evaluate_count,
course.is_public == 1 ? "--" : "√",
course.is_end ? "已结束" : "正在进行",
course.school&.name,
course.teacher&.real_name,
course.created_at&.strftime('%Y-%m-%d %H:%M'),
course.max_activity_time ? course.max_activity_time&.strftime('%Y-%m-%d %H:%M') : "--"
]
sheet.add_row(data)
end
end
end

View File

@@ -0,0 +1,30 @@
<div class="modal fade admin-import-course-member-modal" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">导入课堂成员</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<form class="admin-import-course-member-form" enctype="multipart/form-data">
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text">文件</span>
</div>
<div class="custom-file">
<input type="file" name="file" id="import-course-member-input" class="upload-file-input" accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet">
<label class="custom-file-label file-names" for="import-course-member-input">选择文件</label>
</div>
</div>
<div class="error text-danger"></div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
<button type="button" class="btn btn-primary submit-btn">确认</button>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,37 @@
<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="5%">成员</th>
<th width="4%">资源</th>
<th width="4%">普通作业</th>
<th width="4%">分组作业</th>
<th width="4%">实训作业</th>
<th width="4%">试卷</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="5%">邮件通知</th>
<th width="5%">操作</th>
</tr>
</thead>
<tbody>
<% if courses.present? %>
<% courses.each_with_index do |course, index| %>
<tr class="course-item-<%= course.id %>">
<%= render partial: 'admins/courses/shared/td', locals: {course: course, no: index} %>
</tr>
<% end %>
<% else %>
<%= render 'admins/shared/no_data_for_table' %>
<% end %>
</tbody>
</table>
<%= render partial: 'admins/shared/paginate', locals: { objects: courses } %>

View File

@@ -0,0 +1,28 @@
<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') %>
</td>
<td><%= course.course_members_count %></td>
<td><%= get_attachment_count(course, 0) %></td>
<td><%= course.course_homework_count(1) %></td>
<td><%= course.course_homework_count(3) %></td>
<td><%= course.course_homework_count(4) %></td>
<td><%= course.exercises_count %></td>
<td><%= course.evaluate_count %></td>
<td><%= course.is_public == 1 ? "--" : "√" %></td>
<td><%= course.is_end ? "已结束" : "正在进行" %></td>
<td><%= course.school&.name %></td>
<td><%= course.teacher&.real_name %></td>
<td><%= course.created_at&.strftime('%Y-%m-%d %H:%M') %></td>
<td>
<%= check_box_tag :homepage_show,!course.homepage_show,course.homepage_show,remote:true,data:{id:course.id},class:"course-setting-form" %>
</td>
<td>
<%= check_box_tag :email_notify,!course.email_notify,course.email_notify,remote:true,data:{id:course.id},class:"course-setting-form" %>
</td>
<td class="action-container">
<% if course.is_delete == 0 %>
<%= delete_link '删除', admins_course_path(course, element: ".course-item-#{course.id}"), class: 'delete-course-action' %>
<% end %>
</td>

View File

@@ -0,0 +1,3 @@
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);

View File

@@ -0,0 +1,19 @@
<% define_admin_breadcrumbs do %>
<% add_admin_breadcrumb('合作伙伴', admins_partners_path) %>
<% add_admin_breadcrumb(current_partner.school&.name || current_partner.name) %>
<% end %>
<div class="box search-form-container customer-list-form">
<%= form_tag(admins_partner_customers_path(current_partner), method: :get, class: 'form-inline search-form', remote: true) do %>
<%= text_field_tag(:keyword, params[:keyword], class: 'form-control col-md-4 ml-3', placeholder: '客户名称检索') %>
<%= submit_tag('搜索', class: 'btn btn-primary ml-3', 'data-disable-with': '搜索中...') %>
<% end %>
<%= javascript_void_link('添加', class: 'btn btn-primary', data: { toggle: 'modal', target: '.admin-select-school-modal' }) %>
</div>
<div class="box admin-list-container customer-list-container">
<%= render 'admins/customers/shared/list', customers: @customers %>
</div>
<%= render partial: 'admins/shared/modal/select_school_modal', locals: { title: '添加客户', multiple: true, url: admins_partner_customers_path(current_partner) } %>

View File

@@ -0,0 +1 @@
$('.customer-list-container').html("<%= j(render partial: 'admins/customers/shared/list', locals: { customers: @customers }) %>");

View File

@@ -0,0 +1,28 @@
<table class="table table-hover text-center customer-list-table">
<thead class="thead-light">
<tr>
<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_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>
<%= delete_link '删除', admins_partner_customer_path(current_partner, customer, element: ".customer-item-#{customer.id}"), class: 'delete-customer-action' %>
</td>
</tr>
<% end %>
<% else %>
<%= render 'admins/shared/no_data_for_table' %>
<% end %>
</tbody>
</table>
<%= render partial: 'admins/shared/paginate', locals: { objects: customers } %>

View File

@@ -0,0 +1,13 @@
wb = xlsx_package.workbook
wb.add_worksheet(name: '统计总表') do |sheet|
sheet.add_row %w(ID 单位名称 教师总人数 学生总人数 课堂总数 正在进行课堂数 总实训数 实训评测总数 实训作业总数 其它作业总数 动态时间)
@schools.each do |school|
sheet.add_row([
school[:id].to_s, school[:name].to_s, (school[:teacher_count] || 0).to_s, (school[:student_count] || 0).to_s,
(school[:course_count] || 0).to_s, (school[:active_course_count] || 0).to_s,
(school[:shixun_count] || 0).to_s,(school[:shixun_evaluate_count] || 0).to_s, (school[:homework_count] || 0).to_s,
(school[:other_homework_count] || 0).to_s, format_time(school[:nearly_course_time])
])
end
end

View File

@@ -0,0 +1,29 @@
<% define_admin_breadcrumbs do %>
<% add_admin_breadcrumb('统计总表', admins_daily_school_statistics_path) %>
<% end %>
<div class="box search-form-container daily-school-statistic-list-form">
<%= form_tag(admins_daily_school_statistics_path, method: :get, class: 'form-inline search-form', remote: true) do %>
<%= text_field_tag(:keyword, params[:keyword], class: 'form-control col-sm-2 ml-3', placeholder: 'ID/单位名称搜索') %>
<%= submit_tag('搜索', class: 'btn btn-primary ml-3', 'data-disable-with': '搜索中...') %>
<% end %>
<%#= link_to '导出Excel', export_admins_daily_school_statistics_path(format: :xlsx), class: 'btn btn-outline-primary export-action' %>
<%= javascript_void_link '导出Excel', class: 'btn btn-outline-primary export-action', 'data-url': export_admins_daily_school_statistics_path(format: :xlsx) %>
</div>
<div class="box py-0 pt-4 pl-4">
统计总计:
教师总人数<span class="text-danger"><%= @teacher_total %></span>人,
学生总人数<span class="text-danger"><%= @student_total %></span>人,
课堂总数<span class="text-danger"><%= @course_total %></span>个,
正在进行课堂总数<span class="text-danger"><%= @active_course_total %></span>个,
实训总数<span class="text-danger"><%= @shixun_total %></span>个,
实训评测总数<span class="text-danger"><%= @shixun_evaluate_total %></span>个,
实训作业总数<span class="text-danger"><%= @shixun_homework_total %></span>个,
其它作业总数<span class="text-danger"><%= @other_homework_total %></span>个
</div>
<div class="box admin-list-container daily-school-statistic-list-container">
<%= render partial: 'admins/daily_school_statistics/shared/list', locals: { statistics: @statistics } %>
</div>

View File

@@ -0,0 +1 @@
$(".daily-school-statistic-list-container").html("<%= j(render partial: 'admins/daily_school_statistics/shared/list', locals: { statistics: @statistics }) %>")

View File

@@ -0,0 +1,48 @@
<table class="table table-hover daily-school-statistic-list-table">
<thead class="thead-light">
<tr>
<th width="4%">序号</th>
<th width="12%" class="text-left">单位名称</th>
<th width="10%"><%= sort_tag('教师总数', name: 'teacher_count', path: admins_daily_school_statistics_path) %></th>
<th width="10%"><%= sort_tag('学生总数', name: 'student_count', path: admins_daily_school_statistics_path) %></th>
<th width="10%"><%= sort_tag('课堂总数', name: 'course_count', path: admins_daily_school_statistics_path) %></th>
<th width="14%"><%= sort_tag('正在进行课堂数', name: 'active_course_count', path: admins_daily_school_statistics_path) %></th>
<th width="10%"><%= sort_tag('实训总数', name: 'shixun_count', path: admins_daily_school_statistics_path) %></th>
<th width="13%">
<%= sort_tag(name: 'shixun_evaluate_count', path: admins_daily_school_statistics_path) do %>
实训评测总数
<i class="fa fa-question-circle" data-toggle="tooltip" data-html="true" data-placement="top" title="数据更新时间为<br/>当日6点、12点、18点、24点"></i>
<% end %>
</th>
<th width="11%"><%= sort_tag('实训作业总数', name: 'homework_count', path: admins_daily_school_statistics_path) %></th>
<th width="11%"><%= sort_tag('其它作业总数', name: 'other_homework_count', path: admins_daily_school_statistics_path) %></th>
<th width="9%"><%= sort_tag('动态时间', name: 'nearly_course_time', path: admins_daily_school_statistics_path) %></th>
</tr>
</thead>
<tbody>
<% if statistics.present? %>
<% statistics.each_with_index do |statistic, index| %>
<tr>
<td><%= list_index_no(@params_page.to_i, index) %></td>
<td class="text-left">
<%= link_to statistic[:name], "/colleges/#{statistic[:id]}/statistics",
target: '_blank', data: { toggle: 'tooltip', title: '点击查看学校统计概况' } %>
</td>
<td><%= statistic[:teacher_count].to_i %></td>
<td><%= statistic[:student_count].to_i %></td>
<td><%= statistic[:course_count].to_i %></td>
<td><%= statistic[:active_course_count].to_i %></td>
<td><%= statistic[:shixun_count].to_i %></td>
<td><%= statistic[:shixun_evaluate_count].to_i %></td>
<td><%= statistic[:homework_count].to_i %></td>
<td><%= statistic[:other_homework_count].to_i %></td>
<td><%= statistic[:nearly_course_time]&.strftime('%Y-%m-%d %H:%M') %></td>
</tr>
<% end %>
<% else %>
<%= render 'admins/shared/no_data_for_table' %>
<% end %>
</tbody>
</table>
<%= render partial: 'admins/shared/paginate', locals: { objects: statistics } %>

View File

@@ -0,0 +1,218 @@
<% define_admin_breadcrumbs do %>
<% add_admin_breadcrumb('概览', admins_path) %>
<% end %>
<div class="header bg-gradient-primary pb-8 pt-md-8">
<div class="container-fluid">
<div class="header-body">
<!-- Card stats -->
<div class="row">
<div class="col-xl-3 col-lg-6">
<div class="card card-stats mb-4 mb-xl-0">
<div class="card-body">
<div class="row">
<div class="col">
<h5 class="card-title text-uppercase text-muted mb-0">当日活跃用户</h5>
<span class="h2 font-weight-bold mb-0"><%= @active_user_count %></span>
</div>
<div class="col-auto">
<div class="icon icon-shape rounded-circle shadow">
<i class="fa fa-users"></i>
</div>
</div>
</div>
<!-- <p class="mt-3 mb-0 text-muted text-sm">-->
<!-- <span class="text-success mr-2"><i class="fa fa-arrow-up"></i> 3.48%</span>-->
<!-- <span class="text-nowrap">Since last month</span>-->
<!-- </p>-->
</div>
</div>
</div>
<div class="col-xl-3 col-lg-6">
<div class="card card-stats mb-4 mb-xl-0">
<div class="card-body">
<div class="row">
<div class="col">
<h5 class="card-title text-uppercase text-muted mb-0">7天内活跃用户数</h5>
<span class="h2 font-weight-bold mb-0"><%= @weekly_active_user_count %></span>
</div>
<div class="col-auto">
<div class="icon icon-shape rounded-circle shadow">
<i class="fa fa-users"></i>
</div>
</div>
</div>
<!-- <p class="mt-3 mb-0 text-muted text-sm">-->
<!-- <span class="text-danger mr-2"><i class="fas fa-arrow-down"></i> 3.48%</span>-->
<!-- <span class="text-nowrap">Since last week</span>-->
<!-- </p>-->
</div>
</div>
</div>
<div class="col-xl-3 col-lg-6">
<div class="card card-stats mb-4 mb-xl-0">
<div class="card-body">
<div class="row">
<div class="col">
<h5 class="card-title text-uppercase text-muted mb-0">30天内活跃用户数</h5>
<span class="h2 font-weight-bold mb-0"><%= @month_active_user_count %></span>
</div>
<div class="col-auto">
<div class="icon icon-shape rounded-circle shadow">
<i class="fa fa-users"></i>
</div>
</div>
</div>
<!-- <p class="mt-3 mb-0 text-muted text-sm">-->
<!-- <span class="text-warning mr-2"><i class="fas fa-arrow-down"></i> 1.10%</span>-->
<!-- <span class="text-nowrap">Since yesterday</span>-->
<!-- </p>-->
</div>
</div>
</div>
<div class="col-xl-3 col-lg-6">
<div class="card card-stats mb-4 mb-xl-0">
<div class="card-body">
<div class="row">
<div class="col">
<h5 class="card-title text-uppercase text-muted mb-0">30天内新增用户数</h5>
<span class="h2 font-weight-bold mb-0"><%= @new_user_count %></span>
</div>
<div class="col-auto">
<div class="icon icon-shape rounded-circle shadow">
<i class="fa fa-user-plus"></i>
</div>
</div>
</div>
<!-- <p class="mt-3 mb-0 text-muted text-sm">-->
<!-- <span class="text-success mr-2"><i class="fas fa-arrow-up"></i> 12%</span>-->
<!-- <span class="text-nowrap">Since last month</span>-->
<!-- </p>-->
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="container-fluid mt--7 pie-statistic">
<div class="row mt-5">
<div class="col-xl-8 mb-5 mb-xl-0">
<div class="card shadow">
<!-- <div class="card-header border-0">-->
<!-- <div class="row align-items-center">-->
<!-- <h5 class="mb-0">近7天评测次数</h5>-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="table-responsive">-->
<!-- <div id="evaluate-pie" class="pie"></div>-->
<!-- </div>-->
</div>
</div>
<div class="col-xl-4">
<div class="card shadow">
<div class="card-header border-0">
<div class="row align-items-center">
<h5 class="mb-0">30天内新增用户</h5>
</div>
</div>
<div class="table-responsive">
<div id="month-active-user" class="pie"></div>
</div>
</div>
</div>
</div>
</div>
<!--<div class="container-fluid mt--7">-->
<!-- <div class="row mt-5">-->
<!-- <div class="col-xl-8 mb-5 mb-xl-0">-->
<!-- <div class="card shadow">-->
<!-- <div class="card-header border-0">-->
<!-- <div class="row align-items-center">-->
<!-- <div class="col">-->
<!-- <h3 class="mb-0">Page visits</h3>-->
<!-- </div>-->
<!-- <div class="col text-right">-->
<!-- <a href="#!" class="btn btn-sm btn-primary">Test</a>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="table-responsive">-->
<!-- <table class="table align-items-center table-flush">-->
<!-- <thead class="thead-light">-->
<!-- <tr>-->
<!-- <th scope="col">Test</th>-->
<!-- <th scope="col">Test</th>-->
<!-- <th scope="col">Test</th>-->
<!-- <th scope="col">Test</th>-->
<!-- </tr>-->
<!-- </thead>-->
<!-- <tbody>-->
<%# 5.times do %>
<!-- <tr>-->
<!-- <th scope="row">/test/</th>-->
<!-- <td>4,569</td>-->
<!-- <td>340</td>-->
<!-- <td>-->
<!-- <i class="fas fa-arrow-up text-success mr-3"></i> 46,53%-->
<!-- </td>-->
<!-- </tr>-->
<%# end %>
<!-- </tbody>-->
<!-- </table>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="col-xl-4">-->
<!-- <div class="card shadow">-->
<!-- <div class="card-header border-0">-->
<!-- <div class="row align-items-center">-->
<!-- <div class="col">-->
<!-- <h3 class="mb-0">Test</h3>-->
<!-- </div>-->
<!-- <div class="col text-right">-->
<!-- <a href="#!" class="btn btn-sm btn-primary">Test</a>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="table-responsive">-->
<!-- <table class="table align-items-center table-flush">-->
<!-- <thead class="thead-light">-->
<!-- <tr>-->
<!-- <th scope="col">Test</th>-->
<!-- <th scope="col">Test</th>-->
<!-- <th scope="col"></th>-->
<!-- </tr>-->
<!-- </thead>-->
<!-- <tbody>-->
<%# 5.times do %>
<!-- <tr>-->
<!-- <th scope="row">-->
<!-- Test-->
<!-- </th>-->
<!-- <td>-->
<!-- 1,480-->
<!-- </td>-->
<!-- <td>-->
<!-- <div class="d-flex align-items-center">-->
<!-- <span class="mr-2">60%</span>-->
<!-- <div>-->
<!-- <div class="progress">-->
<!-- <div class="progress-bar bg-gradient-danger" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: 60%;"></div>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<!-- </td>-->
<!-- </tr>-->
<%# end %>
<!-- </tbody>-->
<!-- </table>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<!--</div>-->

View File

@@ -0,0 +1,18 @@
<% define_admin_breadcrumbs do %>
<% add_admin_breadcrumb('部门审批') %>
<% end %>
<div class="box search-form-container flex-column mb-0 pb-0 department-applies-list-form">
<%= form_tag(admins_department_applies_path(unsafe_params), method: :get, class: 'form-inline search-form mt-3', remote: true) do %>
<%= 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':"搜索中...") %>
<%= link_to "清除",admins_department_applies_path(keyword:nil),class:"btn btn-default",remote:true %>
<% end %>
</div>
<div class="box admin-list-container department-applies-list-container">
<%= render(partial: 'admins/department_applies/shared/list', locals: { applies: @depart_applies }) %>
</div>
<%= render(partial: 'admins/shared/admin_common_refuse_modal') %>
<%= render 'admins/departments/shared/merge_department_modal' %>

View File

@@ -0,0 +1 @@
$(".department-applies-list-container").html("<%= j render partial: "admins/department_applies/shared/list",locals: {applies:@depart_applies} %>")

View File

@@ -0,0 +1,41 @@
<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="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_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>
<td><%= apply&.user&.real_name %></td>
<td><%= format_time apply.created_at %></td>
<td class="action-container">
<%= agree_link '批准', agree_admins_department_apply_path(apply, element: ".department-apply-#{apply.id}"), 'data-confirm': '确认批准通过?' %>
<%= javascript_void_link('删除', class: 'action refuse-action',
data: {
toggle: 'modal', target: '.admin-common-refuse-modal', id: apply.id, title: "删除原因", type: "delete",
url: admins_department_apply_path(apply,tip:"unapplied", element: ".department-apply-#{apply.id}")
}) %>
<%= javascript_void_link '更改', class: 'action', data: { school_id: apply.school_id, department_id: apply.id,
toggle: 'modal', target: '.admin-merge-department-modal', url: merge_admins_department_applies_path } %>
</td>
</tr>
<% end %>
<% else %>
<%= render 'admins/shared/no_data_for_table' %>
<% end %>
</tbody>
</table>
<%= render partial: 'admins/shared/paginate', locals: { objects: applies } %>

View File

@@ -0,0 +1,6 @@
$('.modal.admin-add-department-member-modal').modal('hide');
$.notify({ message: '操作成功' });
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);

View File

@@ -0,0 +1,2 @@
$.notify({ message: '操作成功' });
$('.department-list-container .department-item-<%= current_department.id %> .member-user-item-<%= @member.user_id %>').remove();

View File

@@ -0,0 +1,2 @@
$('.admin-modal-container').html("<%= j( render partial: 'admins/departments/shared/edit_department_modal', locals: { department: current_department } ) %>");
$('.modal.admin-edit-department-modal').modal('show');

View File

@@ -0,0 +1,33 @@
<% define_admin_breadcrumbs do %>
<% add_admin_breadcrumb('部门列表') %>
<% end %>
<div class="box search-form-container department-list-form">
<%= form_tag(admins_departments_path, method: :get, class: 'form-inline search-form flex-1', remote: true) do %>
<div class="form-check mr-3">
<%= hidden_field_tag(:with_member, false,id:'') %>
<%= check_box_tag(:with_member, true, params[:with_member].to_s == 'true', class: 'form-check-input') %>
<label class="form-check-label" for="with_member">有部门管理员</label>
</div>
<div class="form-check mr-3">
<%= hidden_field_tag(:with_identifier, false,id:'') %>
<%= check_box_tag(:with_identifier, true, params[:with_identifier].to_s == 'true', class: 'form-check-input') %>
<label class="form-check-label" for="with_identifier">有统计链接</label>
</div>
<%= 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 %>
<%= javascript_void_link '新建部门', class: 'btn btn-primary', data: { toggle: 'modal', target: '.admin-create-department-modal' } %>
</div>
<div class="box admin-list-container department-list-container">
<%= render partial: 'admins/departments/shared/list',
locals: { departments: @departments, users_count: @users_count, professional_auth_count: @professional_auth_count } %>
</div>
<%= render 'admins/departments/shared/create_department_modal' %>
<%= render 'admins/departments/shared/add_department_member_modal' %>
<%= render 'admins/departments/shared/merge_department_modal' %>

View File

@@ -0,0 +1 @@
$('.department-list-container').html("<%= j(render partial: 'admins/departments/shared/list', locals: { departments: @departments, users_count: @users_count, professional_auth_count: @professional_auth_count }) %>");

View File

@@ -0,0 +1,30 @@
<div class="modal fade admin-add-department-member-modal" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">添加部门管理员</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<form class="admin-add-department-member-form">
<%= hidden_field_tag(:department_id, nil) %>
<div class="form-group d-flex">
<label for="school_id" class="col-form-label">部门管理员:</label>
<div class="d-flex flex-column-reverse w-75">
<select id="user_ids" name="user_ids" class="form-control department-member-select"></select>
</div>
</div>
<div class="error text-danger"></div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
<button type="button" class="btn btn-primary submit-btn">确认</button>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,35 @@
<div class="modal fade admin-create-department-modal" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">新建部门</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<form class="admin-create-department-form" data-url="<%= admins_departments_path %>">
<div class="form-group d-flex">
<label for="school_id" class="col-form-label">所属单位:</label>
<div class="d-flex flex-column-reverse w-75">
<select id="school_id" name="school_id" class="form-control school-select"></select>
</div>
</div>
<div class="form-group d-flex">
<label for="new_mirror_id" class="col-form-label">部门名称:</label>
<div class="w-75 d-flex flex-column">
<%= text_field_tag(:department_name, nil, class: 'form-control', placeholder: '请输入部门名称') %>
</div>
</div>
<div class="error text-danger"></div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
<button type="button" class="btn btn-primary submit-btn">确认</button>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,36 @@
<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>
<td class="text-left"><%= overflow_hidden_span department.school.name, width: 150 %></td>
<% if not_list %>
<td><%= department.user_extensions.count %></td>
<td><%= department.user_extensions.joins(:user).where(users: { professional_certification: true }).count %></td>
<% else %>
<td><%= users_count.fetch(department.id, 0) %></td>
<td><%= professional_auth_count.fetch(department.id, 0) %></td>
<% end %>
<td class="member-container">
<%= render partial: 'admins/departments/shared/member_users', locals: { department: department } %>
</td>
<td>
<% if department.identifier.present? %>
<%= link_to department.identifier.to_s, "/colleges/#{department.identifier}/statistics", target: '_blank' %>
<% else %>
--
<% end %>
</td>
<td><%= department.host_count %></td>
<td><%= department.created_at&.strftime('%Y-%m-%d %H:%M') %></td>
<td class="action-container">
<%= link_to '编辑', edit_admins_department_path(department), remote: true, class: 'action' %>
<%= javascript_void_link '添加管理员', class: 'action', data: { department_id: department.id, toggle: 'modal', target: '.admin-add-department-member-modal' } %>
<%= javascript_void_link '更改', class: 'action', data: { school_id: department.school_id, department_id: department.id,
toggle: 'modal', target: '.admin-merge-department-modal', url: merge_admins_departments_path } %>
<%= delete_link '删除', admins_department_path(department, element: ".department-item-#{department.id}"), class: 'delete-department-action' %>
</td>

View File

@@ -0,0 +1,25 @@
<div class="modal fade admin-edit-department-modal" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">编辑部门信息</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<%= simple_form_for([:admins, department], html: { class: 'admin-edit-department-form' }, defaults: { wrapper_html: { class: 'offset-md-1 col-md-10' } }) do |f| %>
<%= f.input :name, as: :string, label: '名称' %>
<%= f.input :identifier, as: :string, label: '统计链接' %>
<%= f.input :host_count, as: :integer, label: '云主机数' %>
<div class="error text-danger"></div>
<% end %>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
<button type="button" class="btn btn-primary submit-btn">确认</button>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,29 @@
<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="6%">已职业认证</th>
<th width="20%">部门管理员</th>
<th width="8%">统计链接</th>
<th width="8%">云主机数</th>
<th width="10%"><%= sort_tag('创建时间', name: 'created_at', path: admins_departments_path) %></th>
<th width="14%">操作</th>
</tr>
</thead>
<tbody>
<% if departments.present? %>
<% departments.each_with_index do |department, index| %>
<tr class="department-item-<%= department.id %>">
<%= render partial: 'admins/departments/shared/department_item', locals: {department: department, index: index} %>
</tr>
<% end %>
<% else %>
<%= render 'admins/shared/no_data_for_table' %>
<% end %>
</tbody>
</table>
<%= render partial: 'admins/shared/paginate', locals: { objects: departments } %>

View File

@@ -0,0 +1,12 @@
<div class="member-user">
<% department.member_users.each do |user| %>
<span class="member-user-item member-user-item-<%= user.id %>">
<%= link_to user.real_name, "/users/#{user.login}", target: '_blank', data: { toggle: 'tooltip', title: '个人主页' } %>
<%= link_to(admins_department_department_member_path(department, user_id: user.id),
method: :delete, remote: true, class: 'ml-1 delete-member-action',
data: { confirm: '确认删除吗?' }) do %>
<i class="fa fa-close"></i>
<% end %>
</span>
<% end %>
</div>

View File

@@ -0,0 +1,30 @@
<div class="modal fade admin-merge-department-modal" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">更改部门</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<form class="admin-merge-department-form" data-url="<%= merge_admins_departments_path %>">
<%= hidden_field_tag(:school_id, nil) %>
<%= hidden_field_tag(:origin_department_id, nil) %>
<div class="form-group d-flex">
<label for="school_id" class="col-form-label">更改为:</label>
<div class="d-flex flex-column-reverse w-75">
<select id="department_id" name="department_id" class="form-control department-select"></select>
</div>
</div>
<div class="error text-danger"></div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
<button type="button" class="btn btn-primary submit-btn">确认</button>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,6 @@
$('.modal.admin-edit-department-modal').modal('hide');
$.notify({ message: '操作成功' });
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);

View File

@@ -0,0 +1,5 @@
<% if @message.present? %>
$.notify({ message: "<%= @message %>" });
<% else %>
$(".discipline-list-container").html("<%= j(render :partial => 'admins/disciplines/shared/list') %>");
<% end %>

View File

@@ -0,0 +1,2 @@
$.notify({ message: '删除成功' });
$(".discipline-item-<%= @discipline_id %>").remove();

View File

@@ -0,0 +1,2 @@
$('.admin-modal-container').html("<%= j( render partial: 'admins/disciplines/shared/edit_discipline_modal', locals: { discipline: @discipline } ) %>");
$('.modal.admin-edit-discipline-modal').modal('show');

View File

@@ -0,0 +1,17 @@
<% define_admin_breadcrumbs do %>
<% add_admin_breadcrumb('课程方向', admins_disciplines_path) %>
<% end %>
<div class="box search-form-container discipline-list-form rig">
<div class="flex-1">
<%= javascript_void_link '新增', class: 'btn btn-primary', data: { toggle: 'modal', target: '.admin-create-discipline-modal' } %>
</div>
<%= javascript_void_link '导入数据', class: 'btn btn-primary', data: { toggle: 'modal', target: '.admin-import-discipline-modal'} %>
</div>
<div class="box admin-list-container discipline-list-container">
<%= render(partial: 'admins/disciplines/shared/list') %>
</div>
<%= render 'admins/disciplines/shared/create_discipline_modal' %>
<%= render partial: 'admins/disciplines/shared/import_discipline_modal' %>

View File

@@ -0,0 +1,28 @@
<div class="modal fade admin-create-discipline-modal" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">新建课程方向</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<form class="admin-create-discipline-form" data-url="<%= admins_disciplines_path %>">
<div class="form-group d-flex">
<label for="new_mirror_id" class="col-form-label">名称:</label>
<div class="w-75 d-flex flex-column">
<%= text_field_tag(:name, nil, class: 'form-control', placeholder: '请输入名称') %>
</div>
</div>
<div class="error text-danger"></div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
<button type="button" class="btn btn-primary submit-btn">确认</button>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,23 @@
<div class="modal fade admin-edit-discipline-modal" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">编辑课程方向</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<%= simple_form_for([:admins, discipline], html: { class: 'admin-edit-discipline-form' }, defaults: { wrapper_html: { class: 'offset-md-1 col-md-10' } }) do |f| %>
<%= f.input :name, as: :string, label: '名称' %>
<div class="error text-danger"></div>
<% end %>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
<button type="button" class="btn btn-primary submit-btn">确认</button>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,30 @@
<div class="modal fade admin-import-discipline-modal" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">导入数据</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<form class="admin-import-discipline-form" enctype="multipart/form-data">
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text">文件</span>
</div>
<div class="custom-file">
<input type="file" name="file" class="upload-file-input" id="import-discipline-input" accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet">
<label class="custom-file-label file-names" for="import-discipline-input">选择文件</label>
</div>
</div>
<div class="error text-danger"></div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
<button type="button" class="btn btn-primary submit-btn">确认</button>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,37 @@
<% max_position = @disciplines.pluck(:position).max %>
<table class="table table-hover text-center discipline-list-table">
<thead class="thead-light">
<tr>
<th width="6%">序号</th>
<th width="54%" class="text-left">课程方向</th>
<th width="8%">实践课程</th>
<th width="8%">实训</th>
<th width="8%">题库</th>
<th width="16%">操作</th>
</tr>
</thead>
<tbody>
<% if @disciplines.present? %>
<% @disciplines.each do |discipline| %>
<tr class="discipline-item discipline-item-<%= discipline.id %>">
<td><%= discipline.position %></td>
<td class="text-left">
<span><%= link_to discipline.name, admins_sub_disciplines_path(discipline_id: discipline), :title => discipline.name %></span>
</td>
<td><%= check_box_tag :subject,!discipline.subject,discipline.subject,remote:true,data:{id:discipline.id},class:"discipline-source-form" %></td>
<td><%= check_box_tag :shixun,!discipline.shixun,discipline.shixun,remote:true,data:{id:discipline.id},class:"discipline-source-form" %></td>
<td><%= check_box_tag :question,!discipline.question,discipline.question,remote:true,data:{id:discipline.id},class:"discipline-source-form" %></td>
<td>
<%= javascript_void_link('上移', class: 'move-action', data: { id: discipline.id, opr: "up" }, style: discipline.position == 1 ? 'display:none' : '') %>
<%= javascript_void_link('下移', class: 'move-action', data: { id: discipline.id, opr: "down" }, style: discipline.position == max_position ? 'display:none' : '') %>
<%= link_to '编辑', edit_admins_discipline_path(discipline), remote: true, class: 'action' %>
<%= delete_link '删除', admins_discipline_path(discipline, element: ".discipline-item-#{discipline.id}"), class: 'delete-discipline-action' %>
</td>
</tr>
<% end %>
<% else %>
<%= render 'admins/shared/no_data_for_table' %>
<% end %>
</tbody>
</table>

View File

@@ -0,0 +1,6 @@
<% if @message.present? %>
$.notify({ message: "<%= @message %>" });
<% else %>
$('.modal.admin-edit-discipline-modal').modal("hide");
$(".discipline-list-container").html("<%= j(render :partial => 'admins/disciplines/shared/list') %>");
<% end %>

View File

@@ -0,0 +1,3 @@
$(".ec-templates-new-add").modal("hide")
$(".ec-templates-list-container").html("<%= j render partial: "admins/ec_templates/shared/list", locals: {templates: @templates} %>")
show_success_flash()

View File

@@ -0,0 +1,15 @@
<% define_admin_breadcrumbs do %>
<% add_admin_breadcrumb('导入模板管理') %>
<% end %>
<div class="box search-form-container ec-templates-list-form">
<%= javascript_void_link '新增', class: 'btn btn-primary', data: { toggle: 'modal', target: '.ec-templates-new-add' } %>
</div>
<div class="box admin-list-container ec-templates-list-container">
<%= render(partial: 'admins/ec_templates/shared/list', locals: { templates: @templates }) %>
</div>
<%= render partial: "admins/ec_templates/shared/templates_add_modal" %>
<%#= render partial: "admins/auth_schools/shared/user_add_modal" %>

View File

@@ -0,0 +1 @@
$(".ec-templates-list-container").html("<%= j render partial: "admins/ec_templates/shared/list", locals: {templates: @templates} %>")

View File

@@ -0,0 +1,35 @@
<table class="table" cellspacing="0" cellpadding="0">
<thead>
<th width="8%">序号</th>
<th width="40%">模板名称</th>
<th width="40%">上传模板</th>
<th width="10%">操作</th>
</thead>
<tbody>
<% if templates.size > 0 %>
<% templates.each_with_index do |t, index| %>
<% attachment = t.attachments.first %>
<tr id="template-item-<%= t.id %>">
<td><%= list_index_no(@params_page.to_i, index) %></td>
<td><%= t.name %></td>
<td>
<% if attachment.present? %>
<%= link_to "#{attachment.try(:filename)}",attachment_path(attachment), target: "_blank" %>
<% end %>
</td>
<td>
<%= link_to "<i class='fa fa-edit color-grey-c fa-fw font-18 padding10-5'></i>".html_safe,
"javascript:void(0)", data: {"id": "#{t.id}", "template-id": "#{attachment.present? ? attachment.id : "-1"}",
msg: "编辑", name: "#{t.name}", "template_name": "#{attachment.try(:filename)}"}, class: "edit-template-content" %>
<%= link_to "<i class='fa fa-trash-o color-grey-c fa-fw font-18 padding10-5'></i>".html_safe, admins_ec_template_path(t.id), method: :delete, data: {confirm: "确认删除吗?"}, remote: true, title: "删除" %>
</td>
</tr>
<% end %>
<% else %>
<%= render 'admins/shared/no_data_for_table' %>
<% end %>
</tbody>
</table>
<%= render partial: 'admins/shared/paginate', locals: { objects: templates } %>

View File

@@ -0,0 +1,44 @@
<div class="modal fade ec-templates-new-add" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title"><span class="template_add_title">新建</span>导入模版</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<%= form_tag(create_template_admins_ec_templates_path, method: :post, remote: true ) do %>
<%= hidden_field_tag(:attachment_id,"-1",class:"template_attachment_id") %>
<%= hidden_field_tag(:template_id,"-1",class:"template_show_id") %>
<div class="modal-body">
<div class="form-group d-flex">
<label for="template_name" class="col-form-label mr10">模板名称:</label>
<div class="d-flex flex-column-reverse w-75">
<%= text_field_tag("name","",class: "form-control", placeholder: "请输入模版名称", id: 'template_name') %>
</div>
</div>
<div class="form-group d-flex">
<label for="template_name" class="col-form-label mr10">上传文件:</label>
<div class="d-flex flex-column-reverse w-75">
<div class="template-file-upload">
<span class="template_file_show hide">
<span class="template_file_show_title">
</span>
<i class="fa fa-trash-o color-grey padding5-10 ml-5 delete-template-icon" title="删除"></i>
</span>
<span class="template-file-input">
<%= file_field_tag(:file, id: "upload_template_file") %>
<i class="fa fa-plus-circle font-20"></i> 上传文件
</span>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<%= submit_tag("提交",class:"btn btn-primary", 'data-disable-with': "提交中...") %>
</div>
<% end %>
</div>
</div>
</div>

View File

@@ -0,0 +1,30 @@
<% define_admin_breadcrumbs do %>
<% add_admin_breadcrumb('试卷审批') %>
<% end %>
<div class="box search-form-container flex-column mb-0 pb-0 examination-authentication-list-form">
<ul class="nav nav-tabs w-100 search-form-tabs">
<li class="nav-item">
<%= link_to '待审批', admins_examination_authentications_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_examination_authentications_path(status: :processed), remote: true, 'data-value': 'processed',
class: "nav-link search-form-tab #{params[:status] != 'pending' ? 'active' : ''}" %>
</li>
</ul>
<%= form_tag(admins_examination_authentications_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', 'data-disable-with': '搜索中...') %>
<% end %>
</div>
<div class="box admin-list-container examination-authentication-list-container">
<%= render(partial: 'admins/examination_authentications/shared/list', locals: { applies: @applies }) %>
</div>

View File

@@ -0,0 +1 @@
$('.examination-authentication-list-container').html("<%= j( render partial: 'admins/examination_authentications/shared/list', locals: { applies: @applies } ) %>");

View File

@@ -0,0 +1,35 @@
<div class="modal fade admin-item-show-modal" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">试题信息</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<div class="mt-2">
<p>题型:<%= item.type_string %></p>
<p>难度:<%= item.difficulty_string %></p>
</div>
<div class="mt-2">
<p><%= item.name %></p>
<% item.item_choices.each do |choice| %>
<div class="form-check ml-3">
<% if item.item_type == "MULTIPLE" %>
<%= check_box_tag(:choice, true, choice.is_answer, class: 'form-check-input') %>
<label class="form-check-label" for="choice"><%= choice.choice_text %></label>
<% elsif item.item_type == "SINGLE" || item.item_type == "JUDGMENT" %>
<%= radio_button_tag(:choice, true, choice.is_answer, class: 'form-check-input') %>
<label class="form-check-label" for="choice"><%= choice.choice_text %></label>
<% else %>
答案:<%= choice.choice_text %>
<% end %>
</div>
<% end %>
</div>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,54 @@
<% is_processed = params[:status].to_s != 'pending' %>
<table class="table table-hover text-center professional-authentication-list-table">
<thead class="thead-light">
<tr>
<th width="4%">序号</th>
<th width="8%">头像</th>
<th width="18%">创建者</th>
<th width="14%">学校</th>
<th width="24%">试卷</th>
<th width="16%">提交时间</th>
<% if !is_processed %>
<th width="16%">操作</th>
<% else %>
<th width="16%">审批结果</th>
<% end %>
</tr>
</thead>
<tbody>
<% if applies.present? %>
<% applies.each_with_index do |apply, index| %>
<% user = apply.user %>
<% exam = ExaminationBank.find apply.container_id %>
<tr class="examination-authentication-item examination-authentication-<%= apply.id %>">
<td><%= list_index_no((params[:page] || 1).to_i, index) %></td>
<td>
<%= link_to "/users/#{user.login}", class: 'examination-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><%= raw [user.school_name.presence, user.department_name.presence].compact.join('<br/>') %></td>
<td>
<%= link_to exam.name, "/paperlibrary/see/#{exam.id}", target: "_blank" %>
</td>
<td><%= apply.updated_at.strftime('%Y-%m-%d %H:%M') %></td>
<td class="action-container">
<% if !is_processed %>
<%= agree_link '同意', agree_admins_examination_authentication_path(apply, element: ".examination-authentication-#{apply.id}"), 'data-confirm': '确认同意该审批?', 'data-disable-with': "提交中..." %>
<%= agree_link '拒绝', refuse_admins_examination_authentication_path(apply, element: ".examination-authentication-#{apply.id}"), 'data-confirm': '确认拒绝该审批?', 'data-disable-with': "拒绝中..." %>
<% else %>
<%= apply.status_text %>
<% end %>
</td>
</tr>
<% end %>
<% else %>
<%= render 'admins/shared/no_data_for_table' %>
<% end %>
</tbody>
</table>
<%= render partial: 'admins/shared/paginate', locals: { objects: applies } %>

View File

@@ -0,0 +1,2 @@
$('.admin-modal-container').html("<%= j( render partial: 'admins/item_authentications/shared/item_show_modal', locals: { item: @item } ) %>");
$('.modal.admin-item-show-modal').modal('show');

View File

@@ -0,0 +1,3 @@
$(".graduation-standards-add").removeClass("show").modal("hide")
$(".graduation-standards-list-container").html("<%= j render partial: "admins/graduation_standards/shared/list", locals: { standards: @standards } %>")
show_success_flash()

View File

@@ -0,0 +1,14 @@
<% define_admin_breadcrumbs do %>
<% add_admin_breadcrumb('毕业要求通用标准') %>
<% end %>
<div class="box search-form-container graduation-standards-list-form">
<%= javascript_void_link '新增', class: 'btn btn-primary standard-create-modal', data: { toggle: 'modal', target: '.graduation-standards-add',
id: "-1", content: "", msg: "添加" } %>
</div>
<div class="box admin-list-container graduation-standards-list-container">
<%= render(partial: 'admins/graduation_standards/shared/list', locals: { standards: @standards }) %>
</div>
<%= render partial: "admins/graduation_standards/shared/add_standard_modal" %>

View File

@@ -0,0 +1 @@
$(".graduation-standards-list-container").html("<%= j render partial: "admins/graduation_standards/shared/list", locals: { standards: @standards } %>")

View File

@@ -0,0 +1,22 @@
<div class="modal fade graduation-standards-add" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title"><span id="graduation-modal-type">添加</span>通用标准</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<%= form_tag(create_standard_admins_graduation_standards_path, method: :post ,remote: true) do %>
<%= hidden_field_tag(:graduation_id, "", id: "graduation_standard_id") %>
<div class="modal-body">
<%= text_area_tag(:content,"",placeholder: "请输入通用标准内容", rows: "3", class: "textarea-width-100") %>
</div>
<div class="modal-footer">
<%= submit_tag("提交",class:"btn btn-primary", 'data-disable-with': "提交中...") %>
</div>
<% end %>
</div>
</div>
</div>

View File

@@ -0,0 +1,27 @@
<table class="table" cellspacing="0" cellpadding="0">
<thead>
<th width="8%">序号</th>
<th width="82%">通用标准</th>
<th width="10%">操作</th>
</thead>
<tbody>
<% if standards.size > 0 %>
<% standards.each_with_index do |standard, index| %>
<tr id="standard-item-<%= standard.id %>">
<td><%= list_index_no(@params_page.to_i, index) %></td>
<td><%= standard.content %></td>
<td>
<%= javascript_void_link "<i class='fa fa-edit color-grey-c fa-fw font-18 padding10-5'></i>".html_safe, class: 'standard-create-modal',
data: { toggle: 'modal', target: '.graduation-standards-add', id: "#{standard.id}", content: "#{standard.content}", msg: "编辑" }, title: "编辑" %>
<%= link_to "<i class='fa fa-trash-o color-grey-c fa-fw font-18 padding10-5'></i>".html_safe, admins_graduation_standard_path(standard), method: :delete, data: {confirm: "确认删除吗?"}, remote: true, title: "删除" %>
</td>
</tr>
<% end %>
<% else %>
<%= render 'admins/shared/no_data_for_table' %>
<% end %>
</tbody>
</table>
<%= render partial: 'admins/shared/paginate', locals: { objects: standards } %>

View File

@@ -0,0 +1,15 @@
<% define_admin_breadcrumbs do %>
<% add_admin_breadcrumb('帮助中心') %>
<% end %>
<div class="box edit-help-center-container">
<%= simple_form_for(@doc, url: admins_help_center_path) do |f| %>
<div class="form-group" id="help-center-editor">
<%= text_area_tag('help_center', @doc.help_center, style: 'display: none') %>
</div>
<div class="form-row mt-4">
<%= f.button :submit, value: '保存', class: 'btn-primary mr-3 px-4', 'data-disable-with': '保存中...' %>
</div>
<% end %>
</div>

View File

@@ -0,0 +1,36 @@
<% define_admin_breadcrumbs do %>
<% add_admin_breadcrumb('实名认证') %>
<% end %>
<div class="box search-form-container flex-column mb-0 pb-0 identity-authentication-list-form">
<ul class="nav nav-tabs w-100 search-form-tabs">
<li class="nav-item">
<%= link_to '待审批', admins_identity_authentications_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_identity_authentications_path(status: :processed), remote: true, 'data-value': 'processed',
class: "nav-link search-form-tab #{params[:status] != 'pending' ? 'active' : ''}" %>
</li>
</ul>
<%= form_tag(admins_identity_authentications_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', 'data-disable-with': '搜索中...') %>
<% end %>
</div>
<div class="batch-action-container">
<%= javascript_void_link '批量同意', class: 'btn btn-outline-primary btn-sm batch-agree-btn' %>
</div>
<div class="box admin-list-container identity-authentication-list-container">
<%= render(partial: 'admins/identity_authentications/shared/list', locals: { applies: @applies }) %>
</div>
<%= render(partial: 'admins/shared/admin_common_refuse_modal') %>

View File

@@ -0,0 +1 @@
$('.identity-authentication-list-container').html("<%= j( render partial: 'admins/identity_authentications/shared/list', locals: { applies: @applies } ) %>");

View File

@@ -0,0 +1,95 @@
<% is_processed = params[:status].to_s != 'pending' %>
<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',
data: { toggle: 'tooltip', title: '全选' }) %>
</th>
<% end %>
<th width="8%">头像</th>
<th width="10%">姓名</th>
<th width="14%">身份证号</th>
<th width="20%">学校/单位</th>
<th width="8%">职称</th>
<% unless is_processed %>
<th width="8%">
照片
<i class="fa fa-question-circle" data-toggle="tooltip" data-html="true" data-placement="top" title="审核完成后自动删除图片"></i>
</th>
<% end %>
<% if is_processed %>
<th width="10%">时间</th>
<th width="12%">拒绝原因</th>
<th width="8%">状态</th>
<th width="8%">操作</th>
<% else %>
<th width="16%">时间</th>
<th width="16%">操作</th>
<% end %>
</tr>
</thead>
<tbody>
<% if applies.present? %>
<% 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 %>
<td>
<%= link_to "/users/#{user.login}", class: 'identity-authentication-avatar', target: '_blank', data: { toggle: 'tooltip', title: '个人主页' } do %>
<img src="/images/<%= url_to_avatar(user) %>" class="rounded-circle" width="40" height="40" />
<% end %>
<% if user.from_sub_site? %>
<span class="badge badge-pill badge-info">合作</span>
<% end %>
</td>
<td><%= user.real_name %></td>
<td><%= user.ID_number %></td>
<td><%= raw [user.school_name.presence, user.department_name.presence].compact.join('<br/>') %></td>
<td><%= user.identity %> <%= raw user.user_extension.student? && user.student_id ? "<br/>#{user.student_id}" : '' %></td>
<% unless is_processed %>
<td>
<% if apply.attachment %>
<%= image_tag("/api/attachments/#{apply.attachment.id}", width: 40, height: 40, class: 'preview-image auth-image', data: { toggle: 'tooltip', title: '点击预览' }) %>
<% else %>
<%= content_tag(:span, '图片已删除', class: 'text-secondary') %>
<% end %>
</td>
<% end %>
<td><%= apply.updated_at.strftime('%Y-%m-%d %H:%M') %></td>
<% if is_processed %>
<td class="text-secondary"><%= overflow_hidden_span apply.remarks, width: 140 %></td>
<td><span class="apply-status-<%= apply.status %>"><%= apply.status_text %></span></td>
<td>
<% if apply.status == 1 %>
<%= agree_link '撤销', revoke_admins_identity_authentication_path(apply, element: ".identity-authentication-#{apply.id}"), 'data-confirm': '是否确认撤销认证??' %>
<% end %>
</td>
<% else %>
<td class="action-container">
<%= agree_link '同意', agree_admins_identity_authentication_path(apply, element: ".identity-authentication-#{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_identity_authentication_path(apply, element: ".identity-authentication-#{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 } %>

View File

@@ -0,0 +1,30 @@
<% define_admin_breadcrumbs do %>
<% add_admin_breadcrumb('题库审批') %>
<% end %>
<div class="box search-form-container flex-column mb-0 pb-0 item-authentication-list-form">
<ul class="nav nav-tabs w-100 search-form-tabs">
<li class="nav-item">
<%= link_to '待审批', admins_item_authentications_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_item_authentications_path(status: :processed), remote: true, 'data-value': 'processed',
class: "nav-link search-form-tab #{params[:status] != 'pending' ? 'active' : ''}" %>
</li>
</ul>
<%= form_tag(admins_item_authentications_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', 'data-disable-with': '搜索中...') %>
<% end %>
</div>
<div class="box admin-list-container item-authentication-list-container">
<%= render(partial: 'admins/item_authentications/shared/list', locals: { applies: @applies }) %>
</div>

View File

@@ -0,0 +1 @@
$('.item-authentication-list-container').html("<%= j( render partial: 'admins/item_authentications/shared/list', locals: { applies: @applies } ) %>");

View File

@@ -0,0 +1,35 @@
<div class="modal fade admin-item-show-modal" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">试题信息</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<div class="mt-2">
<p>题型:<%= item.type_string %></p>
<p>难度:<%= item.difficulty_string %></p>
</div>
<div class="mt-2">
<p><%= item.name %></p>
<% item.item_choices.each do |choice| %>
<div class="form-check ml-3">
<% if item.item_type == "MULTIPLE" %>
<%= check_box_tag(:choice, true, choice.is_answer, class: 'form-check-input') %>
<label class="form-check-label" for="choice"><%= choice.choice_text %></label>
<% elsif item.item_type == "SINGLE" || item.item_type == "JUDGMENT" %>
<%= radio_button_tag(:choice, true, choice.is_answer, class: 'form-check-input') %>
<label class="form-check-label" for="choice"><%= choice.choice_text %></label>
<% else %>
答案:<%= choice.choice_text %>
<% end %>
</div>
<% end %>
</div>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,81 @@
<% is_processed = params[:status].to_s != 'pending' %>
<link rel="stylesheet" href="/quill/quill.snow.css"/>
<div id="editor" style="display: none">
</div>
<script src="/quill/quill.min.js"></script>
<table class="table table-hover text-center professional-authentication-list-table">
<thead class="thead-light">
<tr>
<th width="4%">序号</th>
<th width="8%">头像</th>
<th width="14%">创建者</th>
<th width="10%">学校</th>
<th width="24%">试题</th>
<th width="8%">题型</th>
<th width="16%">提交时间</th>
<% if !is_processed %>
<th width="16%">操作</th>
<% else %>
<th width="16%">审批结果</th>
<% end %>
</tr>
</thead>
<tbody>
<% if applies.present? %>
<% applies.each_with_index do |apply, index| %>
<% user = apply.user %>
<% item = ItemBank.find apply.container_id %>
<tr class="item-authentication-item item-authentication-<%= apply.id %>">
<td><%= list_index_no((params[:page] || 1).to_i, index) %></td>
<td>
<%= link_to "/users/#{user.login}", class: 'item-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><%= raw [user.school_name.presence, user.department_name.presence].compact.join('<br/>') %></td>
<td class="text-left">
<% if item.item_type == "PROGRAM" %>
<%= link_to item.name, "/problems/#{item.container&.identifier}/edit", id: "item_name_#{index}", class: "d-inline-block text-truncate",
style: "max-width: 280px", target: "_blank", data: { toggle: 'tooltip', title: "#{item.name}"} %>
<% else %>
<%= link_to item.name, admins_item_authentication_path(apply), remote: true, id: "item_name_#{index}", class: "d-inline-block text-truncate",
style: "max-width: 280px", data: { toggle: 'tooltip', title: "#{item.name}"} %>
<% end %>
</td>
<td><%= item.type_string %></td>
<td><%= apply.updated_at.strftime('%Y-%m-%d %H:%M') %></td>
<td class="action-container">
<% if !is_processed %>
<%= agree_link '同意', agree_admins_item_authentication_path(apply, element: ".item-authentication-#{apply.id}"), 'data-confirm': '确认同意该审批?', 'data-disable-with': "提交中..." %>
<%= agree_link '拒绝', refuse_admins_item_authentication_path(apply, element: ".item-authentication-#{apply.id}"), 'data-confirm': '确认拒绝该审批?', 'data-disable-with': "拒绝中..." %>
<% else %>
<%= apply.status_text %>
<% end %>
</td>
</tr>
<% end %>
<% else %>
<%= render 'admins/shared/no_data_for_table' %>
<% end %>
</tbody>
</table>
<%= render partial: 'admins/shared/paginate', locals: { objects: applies } %>
<script>
var quill = new Quill('#editor', {
theme: 'snow'
});
var content = "";
<% applies.each_with_index do |apply, index| %>
<% item = ItemBank.find apply.container_id %>
content = JSON.parse(<%= item.name %>);
quill.setContents(content);
$("#item_name_<%= index %>").html(quill.container.firstChild.innerHTML);
<% end %>
</script>

View File

@@ -0,0 +1,2 @@
$('.admin-modal-container').html("<%= j( render partial: 'admins/item_authentications/shared/item_show_modal', locals: { item: @item } ) %>");
$('.modal.admin-item-show-modal').modal('show');

View File

@@ -0,0 +1,11 @@
<%# Link to the "First" page
- available local variables
url: url to the first page
current_page: a page object for the currently displayed page
total_pages: total number of pages
per_page: number of items to fetch per page
remote: data-remote
-%>
<li class="page-item first-page">
<%= link_to_unless current_page.first?, t('views.pagination.first').html_safe, url, remote: remote, class: 'page-link' %>
</li>

View File

@@ -0,0 +1,13 @@
<%# Non-link tag that stands for skipped pages...
- available local variables
current_page: a page object for the currently displayed page
total_pages: total number of pages
per_page: number of items to fetch per page
remote: data-remote
-%>
<li class="page-item">
<%= link_to 'javascript:void(0)', { class: 'page-link' } do %>
<%= t('views.pagination.truncate').html_safe %>
<span class="sr-only">(current)</span>
<% end %>
</li>

View File

@@ -0,0 +1,11 @@
<%# Link to the "Last" page
- available local variables
url: url to the last page
current_page: a page object for the currently displayed page
total_pages: total number of pages
per_page: number of items to fetch per page
remote: data-remote
-%>
<li class="page-item last-page">
<%= link_to_unless(current_page.last?, t('views.pagination.last').html_safe, url, remote: remote, class: 'page-link') %>
<li class="page-item last-page">

View File

@@ -0,0 +1,11 @@
<%# Link to the "Next" page
- available local variables
url: url to the next page
current_page: a page object for the currently displayed page
total_pages: total number of pages
per_page: number of items to fetch per page
remote: data-remote
-%>
<li class="page-item next">
<%= link_to_unless current_page.last?, t('views.pagination.next').html_safe, url, rel: 'next', remote: remote, class: 'page-link' %>
</li>

View File

@@ -0,0 +1,19 @@
<%# Link showing page number
- available local variables
page: a page object for "this" page
url: url to this page
current_page: a page object for the currently displayed page
total_pages: total number of pages
per_page: number of items to fetch per page
remote: data-remote
-%>
<li class="page-item page<%= ' current active' if page.current? %>">
<% if page.current? %>
<%= link_to url, {remote: remote, rel: page.rel, class: 'page-link'} do %>
<%= page %>
<span class="sr-only">(current)</span>
<% end %>
<% else %>
<%= link_to page, url, {remote: remote, rel: page.rel, class: 'page-link'} %>
<% end %>
</li>

View File

@@ -0,0 +1,27 @@
<%# The container tag
- available local variables
current_page: a page object for the currently displayed page
total_pages: total number of pages
per_page: number of items to fetch per page
remote: data-remote
paginator: the paginator that renders the pagination tags inside
-%>
<%= paginator.render do -%>
<nav aria-label="Page navigation">
<ul class="pagination justify-content-center">
<%= first_page_tag unless current_page.first? %>
<%= prev_page_tag unless current_page.first? %>
<% each_page do |page| -%>
<% if page.display_tag? -%>
<%= page_tag page %>
<% elsif !page.was_truncated? -%>
<%= gap_tag %>
<% end -%>
<% end -%>
<% unless current_page.out_of_range? %>
<%= next_page_tag unless current_page.last? %>
<%= last_page_tag unless current_page.last? %>
<% end %>
</ul>
</nav>
<% end -%>

View File

@@ -0,0 +1,11 @@
<%# Link to the "Previous" page
- available local variables
url: url to the previous page
current_page: a page object for the currently displayed page
total_pages: total number of pages
per_page: number of items to fetch per page
remote: data-remote
-%>
<li class="page-item prev">
<%= link_to_unless current_page.first?, t('views.pagination.previous').html_safe, url, rel: 'prev', remote: remote, class: 'page-link' %>
</li>

Some files were not shown because too many files have changed in this diff Show More