parent
898c43e782
commit
a1ec31b56c
@ -0,0 +1,60 @@
|
||||
$(document).on('turbolinks:load', function() {
|
||||
if ($('body.cooperative-laboratory-shixuns-index-page').length > 0) {
|
||||
var $searchForm = $('.laboratory-shixun-list-form .search-form');
|
||||
|
||||
$searchForm.find('select#tag_id').select2({
|
||||
placeholder: "请选择",
|
||||
allowClear: true
|
||||
});
|
||||
|
||||
// 上传图片
|
||||
$('.modal.cooperative-upload-file-modal').on('upload:success', function (e, data) {
|
||||
var $imageElement = $('.shixun-image-' + data.source_id);
|
||||
if($imageElement.length === 0) return;
|
||||
$imageElement.attr('src', data.url);
|
||||
$imageElement.show();
|
||||
$imageElement.next().html('重新上传');
|
||||
});
|
||||
|
||||
// 定义状态切换监听事件
|
||||
var defineStatusChangeFunc = function (doElement, undoElement, url, callback) {
|
||||
$('.laboratory-shixun-list-container').on('click', doElement, function () {
|
||||
var $doAction = $(this);
|
||||
var $undoAction = $doAction.siblings(undoElement);
|
||||
|
||||
var laboratoryShixunId = $doAction.data('id');
|
||||
customConfirm({
|
||||
content: '确认进行该操作吗?',
|
||||
ok: function () {
|
||||
$.ajax({
|
||||
url: '/cooperative/laboratory_shixuns/' + laboratoryShixunId + url,
|
||||
method: 'POST',
|
||||
dataType: 'json',
|
||||
success: function () {
|
||||
show_success_flash();
|
||||
$doAction.hide();
|
||||
$undoAction.show();
|
||||
if (callback && typeof callback === "function") {
|
||||
callback(laboratoryShixunId, url);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// 首页展示与取消首页展示
|
||||
var homepageShowCallback = function (laboratoryShixunId, url) {
|
||||
var $laboratoryShixunItem = $('.laboratory-shixun-list-container').find('.laboratory-shixun-item-' + laboratoryShixunId);
|
||||
|
||||
if (url === '/homepage') {
|
||||
$laboratoryShixunItem.find('.homepage-badge').show();
|
||||
} else {
|
||||
$laboratoryShixunItem.find('.homepage-badge').hide();
|
||||
}
|
||||
}
|
||||
defineStatusChangeFunc('.homepage-show-action', '.homepage-hide-action', '/homepage', homepageShowCallback);
|
||||
defineStatusChangeFunc('.homepage-hide-action', '.homepage-show-action', '/cancel_homepage', homepageShowCallback);
|
||||
}
|
||||
})
|
@ -0,0 +1,83 @@
|
||||
$(document).on('turbolinks:load', function() {
|
||||
if ($('body.cooperative-laboratory-subjects-index-page').length > 0) {
|
||||
var $searchForm = $('.laboratory-subject-list-form .search-form');
|
||||
|
||||
// ************** 学校选择 *************
|
||||
$searchForm.find('.school-select').select2({
|
||||
theme: 'bootstrap4',
|
||||
placeholder: '请选择创建者单位',
|
||||
allowClear: true,
|
||||
minimumInputLength: 1,
|
||||
ajax: {
|
||||
delay: 500,
|
||||
url: '/api/schools/search.json',
|
||||
dataType: 'json',
|
||||
data: function (params) {
|
||||
return {keyword: params.term};
|
||||
},
|
||||
processResults: function (data) {
|
||||
return {results: data.schools}
|
||||
}
|
||||
},
|
||||
templateResult: function (item) {
|
||||
if (!item.id || item.id === '') return item.text;
|
||||
return item.name;
|
||||
},
|
||||
templateSelection: function (item) {
|
||||
if (item.id) {
|
||||
}
|
||||
return item.name || item.text;
|
||||
}
|
||||
});
|
||||
|
||||
// 上传图片
|
||||
$('.modal.cooperative-upload-file-modal').on('upload:success', function (e, data) {
|
||||
var $imageElement = $('.subject-image-' + data.source_id);
|
||||
if($imageElement.length === 0) return;
|
||||
$imageElement.attr('src', data.url);
|
||||
$imageElement.show();
|
||||
$imageElement.next().html('重新上传');
|
||||
});
|
||||
|
||||
// 定义状态切换监听事件
|
||||
var defineStatusChangeFunc = function (doElement, undoElement, url, callback) {
|
||||
$('.laboratory-subject-list-container').on('click', doElement, function () {
|
||||
var $doAction = $(this);
|
||||
var $undoAction = $doAction.siblings(undoElement);
|
||||
|
||||
var laboratorySubjectId = $doAction.data('id');
|
||||
customConfirm({
|
||||
content: '确认进行该操作吗?',
|
||||
ok: function () {
|
||||
$.ajax({
|
||||
url: '/cooperative/laboratory_subjects/' + laboratorySubjectId + url,
|
||||
method: 'POST',
|
||||
dataType: 'json',
|
||||
success: function () {
|
||||
show_success_flash();
|
||||
$doAction.hide();
|
||||
$undoAction.show();
|
||||
if (callback && typeof callback === "function") {
|
||||
callback(laboratorySubjectId, url);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// 首页展示与取消首页展示
|
||||
var homepageShowCallback = function (laboratoryShixunId, url) {
|
||||
var $laboratoryShixunItem = $('.laboratory-subject-list-container').find('.laboratory-subject-item-' + laboratoryShixunId);
|
||||
|
||||
if (url === '/homepage') {
|
||||
$laboratoryShixunItem.find('.homepage-badge').show();
|
||||
} else {
|
||||
$laboratoryShixunItem.find('.homepage-badge').hide();
|
||||
}
|
||||
}
|
||||
defineStatusChangeFunc('.homepage-show-action', '.homepage-hide-action', '/homepage', homepageShowCallback);
|
||||
defineStatusChangeFunc('.homepage-hide-action', '.homepage-show-action', '/cancel_homepage', homepageShowCallback);
|
||||
}
|
||||
})
|
@ -0,0 +1,18 @@
|
||||
$(document).on('turbolinks:load', function () {
|
||||
$('.cooperative-modal-container').on('show.bs.modal', '.modal.cooperative-edit-subject-modal', function () {
|
||||
var $modal = $('.modal.cooperative-edit-subject-modal');
|
||||
var $form = $modal.find('form.cooperative-edit-subject-form');
|
||||
|
||||
$modal.on('click', '.submit-btn', function () {
|
||||
$form.find('.error').html('');
|
||||
var url = $form.attr('action');
|
||||
|
||||
$.ajax({
|
||||
method: 'PATCH',
|
||||
dataType: 'script',
|
||||
url: url,
|
||||
data: $form.serialize()
|
||||
});
|
||||
});
|
||||
})
|
||||
});
|
@ -0,0 +1,39 @@
|
||||
class Cooperative::LaboratoryShixunsController < Cooperative::BaseController
|
||||
before_action :check_shixun_ownership!, only: [:edit, :update]
|
||||
|
||||
helper_method :current_laboratory_shixun
|
||||
|
||||
def index
|
||||
laboratory_shixuns = Admins::LaboratoryShixunQuery.call(current_laboratory, params)
|
||||
@laboratory_shixuns = paginate laboratory_shixuns.includes(shixun: %i[tag_repertoires user])
|
||||
end
|
||||
|
||||
def edit
|
||||
end
|
||||
|
||||
def update
|
||||
|
||||
end
|
||||
|
||||
def homepage
|
||||
current_laboratory_shixun.update!(homepage: true)
|
||||
render_ok
|
||||
end
|
||||
|
||||
def cancel_homepage
|
||||
current_laboratory_shixun.update!(homepage: false)
|
||||
render_ok
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def current_laboratory_shixun
|
||||
@_current_laboratory_shixun ||= current_laboratory.laboratory_shixuns.find(params[:id])
|
||||
end
|
||||
|
||||
def check_shixun_ownership!
|
||||
return if current_laboratory_shixun.ownership?
|
||||
|
||||
render_forbidden
|
||||
end
|
||||
end
|
@ -0,0 +1,46 @@
|
||||
class Cooperative::LaboratorySubjectsController < Cooperative::BaseController
|
||||
before_action :check_subject_ownership!, only: [:edit, :update]
|
||||
|
||||
helper_method :current_laboratory_subject
|
||||
|
||||
def index
|
||||
laboratory_subjects = Admins::LaboratorySubjectQuery.call(current_laboratory, params)
|
||||
|
||||
includes_tables = { subject: [:repertoire, :subject_level_system, user: {user_extension: :school}] }
|
||||
@laboratory_subjects = paginate(laboratory_subjects.includes(includes_tables))
|
||||
end
|
||||
|
||||
def edit
|
||||
@laboratory_subject = current_laboratory_subject
|
||||
end
|
||||
|
||||
def update
|
||||
current_laboratory_subject.subject.update!(update_params)
|
||||
end
|
||||
|
||||
def homepage
|
||||
current_laboratory_subject.update!(homepage: true)
|
||||
render_ok
|
||||
end
|
||||
|
||||
def cancel_homepage
|
||||
current_laboratory_subject.update!(homepage: false)
|
||||
render_ok
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def current_laboratory_subject
|
||||
@_current_laboratory_subject ||= current_laboratory.laboratory_subjects.find(params[:id])
|
||||
end
|
||||
|
||||
def check_subject_ownership!
|
||||
return if current_laboratory_subject.ownership?
|
||||
|
||||
render_forbidden
|
||||
end
|
||||
|
||||
def update_params
|
||||
params.require(:laboratory_subject).permit(:repertoire_id, :subject_level_system_id)
|
||||
end
|
||||
end
|
@ -1,4 +1,6 @@
|
||||
class LaboratorySubject < ApplicationRecord
|
||||
belongs_to :laboratory
|
||||
belongs_to :subject
|
||||
|
||||
delegate :repertoire_id, :subject_level_system_id, :student_count, to: :subject
|
||||
end
|
@ -0,0 +1,42 @@
|
||||
<% define_breadcrumbs do %>
|
||||
<% add_breadcrumb('实训项目') %>
|
||||
<% end %>
|
||||
|
||||
|
||||
<div class="box search-form-container laboratory-shixun-list-form">
|
||||
<%= form_tag(cooperative_laboratory_shixuns_path, method: :get, class: 'form-inline search-form', remote: true) do %>
|
||||
<div class="form-group mr-1">
|
||||
<label for="status">状态:</label>
|
||||
<% status_options = [['全部', ''], ['编辑中', 0], ['审核中', 1], ['已发布', 2], ['已关闭', 3]] %>
|
||||
<%= select_tag(:status, options_for_select(status_options), class: 'form-control') %>
|
||||
</div>
|
||||
|
||||
<div class="form-group mr-4">
|
||||
<label for="status">技术平台:</label>
|
||||
<%= select_tag(:tag_id, options_for_select(MirrorRepository.pluck(:type_name,:id).unshift(['']), params[:tag_id]), class: 'form-control') %>
|
||||
</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, false, id:'') %>
|
||||
<%= check_box_tag(:homepage, true, params[:homepage].to_s == 'true', class: 'form-check-input') %>
|
||||
<label class="form-check-label" for="homepage">只看首页展示</label>
|
||||
</div>
|
||||
|
||||
<div class="form-check mr-2">
|
||||
<%= hidden_field_tag(:ownership, false, id:'') %>
|
||||
<%= check_box_tag(:ownership, true, params[:ownership].to_s == 'true', class: 'form-check-input') %>
|
||||
<label class="form-check-label" for="ownership">只看自建</label>
|
||||
</div>
|
||||
|
||||
<%= submit_tag('搜索', class: 'btn btn-primary ml-3', 'data-disable-with': '搜索中...') %>
|
||||
<%= link_to '清空', cooperative_laboratory_shixuns_path, class: 'btn btn-default','data-disable-with': '清空中...' %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="box laboratory-shixun-list-container">
|
||||
<%= render partial: 'cooperative/laboratory_shixuns/shared/list', locals: { laboratory_shixuns: @laboratory_shixuns } %>
|
||||
</div>
|
||||
|
||||
<%= render(partial: 'cooperative/shared/modal/upload_file_modal', locals: { title: '上传封面', accept: 'image/*' }) %>
|
@ -0,0 +1 @@
|
||||
$('.laboratory-shixun-list-container').html("<%= j(render partial: 'cooperative/laboratory_shixuns/shared/list', locals: { laboratory_shixuns: @laboratory_shixuns }) %>");
|
@ -0,0 +1,27 @@
|
||||
<table class="table text-center laboratory-shixun-list-table">
|
||||
<thead class="thead-light">
|
||||
<tr>
|
||||
<th width="28%" class="text-left">实训名称</th>
|
||||
<th width="12%">技术平台</th>
|
||||
<th width="14%" class="text-left">技术体系</th>
|
||||
<th width="10%">封面</th>
|
||||
<th width="8%">创建者</th>
|
||||
<th width="8%">状态</th>
|
||||
<th width="8%">执行时间</th>
|
||||
<th width="16%">操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% if laboratory_shixuns.present? %>
|
||||
<% laboratory_shixuns.each do |laboratory_shixun| %>
|
||||
<tr class="laboratory-shixun-item-<%= laboratory_shixun.id %>">
|
||||
<%= render partial: 'cooperative/laboratory_shixuns/shared/td', locals: { laboratory_shixun: laboratory_shixun } %>
|
||||
</tr>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<%= render 'cooperative/shared/no_data_for_table' %>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<%= render partial: 'cooperative/shared/paginate', locals: { objects: laboratory_shixuns } %>
|
@ -0,0 +1,32 @@
|
||||
<%- shixun = laboratory_shixun.shixun -%>
|
||||
|
||||
<td class="text-left">
|
||||
<%= link_to "/shixuns/#{shixun.identifier}", target: '_blank' do %>
|
||||
<%= shixun.name %>
|
||||
<span class="badge badge-pill badge-success homepage-badge" style="<%= laboratory_shixun.homepage? ? '' : 'display:none' %>">首页</span>
|
||||
<span class="badge badge-pill badge-info ownership-badge" style="<%= laboratory_shixun.ownership ? '' : 'display:none' %>">自建</span>
|
||||
<% end %>
|
||||
</td>
|
||||
<td><%= shixun.shixun_main_name %></td>
|
||||
<td class="text-left">
|
||||
<% shixun.tag_repertoires.each do |tag| %>
|
||||
<span class="badge badge-secondary"><%= tag.name %></span>
|
||||
<% end %>
|
||||
</td>
|
||||
<td class="image-preview-container">
|
||||
<% imageExists = Util::FileManage.exists?(shixun) %>
|
||||
<%= image_tag(imageExists ? Util::FileManage.source_disk_file_url(shixun) : '', height: 40, class: "preview-image shixun-image-#{shixun.id}", data: { toggle: 'tooltip', title: '点击预览' }, style: imageExists ? '' : 'display:none') %>
|
||||
<% if laboratory_shixun.ownership? %>
|
||||
<%= javascript_void_link imageExists ? '重新上传' : '上传图片', class: 'action upload-shixun-image-action', data: { source_id: shixun.id, source_type: 'Shixun', toggle: 'modal', target: '.cooperative-upload-file-modal' } %>
|
||||
<% end %>
|
||||
</td>
|
||||
<td><%= link_to shixun.user&.real_name, "/users/#{shixun.user&.login}", target:'_blank' %></td>
|
||||
<td><span class="<%= shixun_status_class(shixun) %>"><%= t("shixun.status.#{shixun.status}") %></span></td>
|
||||
<td><%= shixun.excute_time %></td>
|
||||
<td class="action-container">
|
||||
<% if laboratory_shixun.ownership? %>
|
||||
<%#= link_to('修改', cooperative_laboratory_subjects_path(laboratory_shixun)) %>
|
||||
<% end %>
|
||||
<%= javascript_void_link('首页展示', class: 'action homepage-show-action', data: { id: laboratory_shixun.id }, style: laboratory_shixun.homepage? ? 'display:none' : '') %>
|
||||
<%= javascript_void_link('取消首页展示', class: 'action homepage-hide-action', data: { id: laboratory_shixun.id }, style: laboratory_shixun.homepage? ? '' : 'display:none') %>
|
||||
</td>
|
@ -0,0 +1,2 @@
|
||||
$('.cooperative-modal-container').html("<%= j( render partial: 'cooperative/laboratory_subjects/shared/edit_subject_modal', locals: { laboratory_subject: @laboratory_subject } ) %>");
|
||||
$('.modal.cooperative-edit-subject-modal').modal('show');
|
@ -0,0 +1,42 @@
|
||||
<% define_breadcrumbs do %>
|
||||
<% add_breadcrumb('实践课程') %>
|
||||
<% end %>
|
||||
|
||||
|
||||
<div class="box search-form-container laboratory-subject-list-form">
|
||||
<%= form_tag(cooperative_laboratory_subjects_path, method: :get, class: 'form-inline search-form', remote: true) do %>
|
||||
<div class="form-group mr-1">
|
||||
<label for="status">状态:</label>
|
||||
<% status_options = [['全部', ''], ['编辑中', 0], ['审核中', 1], ['已发布', 2]] %>
|
||||
<%= 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, false, id:'') %>
|
||||
<%= check_box_tag(:homepage, true, params[:homepage].to_s == 'true', class: 'form-check-input') %>
|
||||
<label class="form-check-label" for="homepage">只看首页展示</label>
|
||||
</div>
|
||||
|
||||
<div class="form-check mr-2">
|
||||
<%= hidden_field_tag(:ownership, false, id:'') %>
|
||||
<%= check_box_tag(:ownership, true, params[:ownership].to_s == 'true', class: 'form-check-input') %>
|
||||
<label class="form-check-label" for="ownership">只看自建</label>
|
||||
</div>
|
||||
|
||||
<%= submit_tag('搜索', class: 'btn btn-primary ml-3', 'data-disable-with': '搜索中...') %>
|
||||
<%= link_to '清空', cooperative_laboratory_subjects_path(current_laboratory), class: 'btn btn-default','data-disable-with': '清空中...' %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="box laboratory-subject-list-container">
|
||||
<%= render partial: 'cooperative/laboratory_subjects/shared/list', locals: { laboratory_subjects: @laboratory_subjects } %>
|
||||
</div>
|
||||
|
||||
<%= render(partial: 'cooperative/shared/modal/upload_file_modal', locals: { title: '上传封面', accept: 'image/*' }) %>
|
@ -0,0 +1 @@
|
||||
$('.laboratory-subject-list-container').html("<%= j(render partial: 'cooperative/laboratory_subjects/shared/list', locals: { laboratory_subjects: @laboratory_subjects }) %>");
|
@ -0,0 +1,31 @@
|
||||
<div class="modal fade cooperative-edit-subject-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">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<%= simple_form_for([:cooperative, laboratory_subject], html: { class: 'cooperative-edit-subject-form' }, defaults: { wrapper_html: { class: 'offset-md-1 col-md-10' } }) do |f| %>
|
||||
<%= f.input :repertoire_id, label: '技术体系:' do %>
|
||||
<% repertoire_options = Repertoire.order('CONVERT(name USING gbk) COLLATE gbk_chinese_ci ASC').map{|r| [r.name, r.id]} %>
|
||||
<%= f.select :repertoire_id, [['请选择', '']] + repertoire_options, {}, class: 'form-control' %>
|
||||
<% end %>
|
||||
|
||||
<%= f.input :subject_level_system_id, label: '等级体系:' do %>
|
||||
<% level_options = SubjectLevelSystem.all.map{|r| [r.name, r.id]} %>
|
||||
<%= f.select :subject_level_system_id, [['请选择', '']] + level_options, {}, class: 'form-control' %>
|
||||
<% end %>
|
||||
|
||||
<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>
|
@ -0,0 +1,27 @@
|
||||
<table class="table text-center laboratory-subject-list-table">
|
||||
<thead class="thead-light">
|
||||
<tr>
|
||||
<th width="28%" class="text-left">课程名称</th>
|
||||
<th width="12%">技术体系</th>
|
||||
<th width="10%">等级体系</th>
|
||||
<th width="10%">封面</th>
|
||||
<th width="8%">创建者</th>
|
||||
<th width="10%">单位</th>
|
||||
<th width="8%">状态</th>
|
||||
<th width="14%">操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% if laboratory_subjects.present? %>
|
||||
<% laboratory_subjects.each do |laboratory_subject| %>
|
||||
<tr class="laboratory-subject-item-<%= laboratory_subject.id %>">
|
||||
<%= render partial: 'cooperative/laboratory_subjects/shared/td', locals: { laboratory_subject: laboratory_subject } %>
|
||||
</tr>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<%= render 'cooperative/shared/no_data_for_table' %>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<%= render partial: 'cooperative/shared/paginate', locals: { objects: laboratory_subjects } %>
|
@ -0,0 +1,28 @@
|
||||
<%- subject = laboratory_subject.subject -%>
|
||||
|
||||
<td class="text-left">
|
||||
<%= link_to(subject.name, "/paths/#{subject.id}", target: '_blank') %>
|
||||
<span class="badge badge-pill badge-success homepage-badge" style="<%= laboratory_subject.homepage? ? '' : 'display:none' %>">首页</span>
|
||||
<span class="badge badge-pill badge-success ownership-badge" style="<%= laboratory_subject.ownership? ? '' : 'display:none' %>">自建</span>
|
||||
</td>
|
||||
<td><%= display_text subject.repertoire&.name %></td>
|
||||
<td><%= display_text subject.subject_level_system&.name %></td>
|
||||
<td class="image-preview-container">
|
||||
<% image_exists = Util::FileManage.exists?(subject) %>
|
||||
<%= image_tag(image_exists ? Util::FileManage.source_disk_file_url(subject) : '', height: 40, class: "w-100 preview-image subject-image-#{subject.id}", style: image_exists ? '' : 'display:none') %>
|
||||
<% if laboratory_subject.ownership? %>
|
||||
<%= javascript_void_link image_exists ? '重新上传' : '上传图片', class: 'action upload-subject-image-action', data: { source_id: subject.id, source_type: 'Subject', toggle: 'modal', target: '.cooperative-upload-file-modal' } %>
|
||||
<% end %>
|
||||
</td>
|
||||
<td><%= link_to subject.user&.real_name, "/users/#{subject.user&.login}", target:'_blank' %></td>
|
||||
<td><%= subject.user.school_name %></td>
|
||||
<td><%= display_subject_status(subject) %></td>
|
||||
|
||||
<td class="action-container">
|
||||
<% if laboratory_subject.ownership? %>
|
||||
<%= link_to('修改', edit_cooperative_laboratory_subject_path(laboratory_subject), remote: true) %>
|
||||
<% end %>
|
||||
|
||||
<%= javascript_void_link('首页展示', class: 'action homepage-show-action', data: { id: laboratory_subject.id }, style: laboratory_subject.homepage? ? 'display:none' : '') %>
|
||||
<%= javascript_void_link('取消首页展示', class: 'action homepage-hide-action', data: { id: laboratory_subject.id }, style: laboratory_subject.homepage? ? '' : 'display:none') %>
|
||||
</td>
|
@ -0,0 +1,3 @@
|
||||
$('.laboratory-subject-list-container .laboratory-subject-item-<%= current_laboratory_subject.id %>').html("<%= j(render partial: 'cooperative/laboratory_subjects/shared/td', locals: { laboratory_subject: current_laboratory_subject }) %>");
|
||||
$('.cooperative-modal-container .modal.cooperative-edit-subject-modal').modal('hide');
|
||||
show_success_flash();
|
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in new issue