parent
1a66348dcf
commit
3f9e7f5916
@ -0,0 +1,32 @@
|
||||
$(document).on('turbolinks:load', function() {
|
||||
$(".tags-selected_multi").each(function () {
|
||||
$(this).select2({
|
||||
multiple: true,
|
||||
maximumSelectionLength: 3,
|
||||
// // width: 300,
|
||||
placeholder: '请选择技术平台',
|
||||
allowClear: true
|
||||
})
|
||||
})
|
||||
|
||||
});
|
||||
|
||||
|
||||
function update_change(target) {
|
||||
var s_id = $(target).attr("data-id");
|
||||
var s_value = $(target).val();
|
||||
var s_name = $(target).attr("name");
|
||||
var json = {};
|
||||
var s_index = $(target).parent("td").siblings(".shixun-line-no").text();
|
||||
json[s_name] = s_value;
|
||||
json["page_no"] = s_index;
|
||||
$.ajax({
|
||||
url: "/admins/shixun_settings/" + s_id,
|
||||
type: "PUT",
|
||||
dataType:'script',
|
||||
data: json,
|
||||
success: function (data) {
|
||||
|
||||
}
|
||||
})
|
||||
}
|
@ -1 +1 @@
|
||||
$(".shixun-settings-list-container").html(<%= j render "admins/shixun_settings/shared/list",locals:{shixuns:@shixuns} %>)
|
||||
$(".shixun-settings-list-container").html(<%= j render "admins/shixun_settings/shared/list",locals:{shixuns:@shixuns} %>)
|
||||
|
@ -0,0 +1,24 @@
|
||||
<table class="table text-center shixun-settings-list-table">
|
||||
<thead>
|
||||
<th width="4%">序号</th>
|
||||
<th width="8%">ID</th>
|
||||
<th width="12%" class="text-left">实训名称</th>
|
||||
<th width="8%">技术平台</th>
|
||||
<th width="8%">权限</th>
|
||||
<th width="18%">技术体系</th>
|
||||
<th width="12%">上传图片</th>
|
||||
<th width="5%">创建者</th>
|
||||
<th width="4%">关闭</th>
|
||||
<th width="4%">复制</th>
|
||||
<th width="6%">代码执行时间</th>
|
||||
<th>操作</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% shixuns.each_with_index do |shixun,index| %>
|
||||
<tr id="setting-item-<%= shixun.id %>">
|
||||
<% page_no = (@params_page.to_i - 1) * 20 + index + 1 %>
|
||||
<%= render partial: "admins/shixun_settings/shared/td",locals: {shixun: shixun,page_no:page_no} %>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
@ -0,0 +1,85 @@
|
||||
<td class="shixun-line-no"><%= page_no %></td>
|
||||
<td><%= shixun.identifier %></td>
|
||||
<td class="text-left">
|
||||
<span>
|
||||
<%= link_to overflow_hidden_span(shixun.name,width:230), "/shixuns/#{shixun.identifier}", :target => "_blank", :title => shixun.name %>
|
||||
</span>
|
||||
</td>
|
||||
<td>
|
||||
<%= shixun.shixun_main_name.nil? ? "--" : shixun.shixun_main_name %>
|
||||
</td>
|
||||
<td>
|
||||
<% status_options = [['超级管理员', '0'], ["合作团队", "1"]] %>
|
||||
<%= select_tag(:use_scope, options_for_select(status_options,shixun.use_scope),class:"form-control shixun-setting-form",data:{id:shixun.id},onchange:"update_change(this)") %>
|
||||
</td>
|
||||
<td>
|
||||
<%= select_tag(:tag_repertoires, options_for_select(@shixun_tags,shixun.is_tag_used?(tag.id)),multiple:true,class:"form-control tags-selected_multi",onchange: "update_change(this)") %>
|
||||
<!-- 新版技术标签-->
|
||||
<!-- <div class="fl pr ml30">-->
|
||||
<!-- <input type="hidden" name="small_type" class="shixun_language" value="">-->
|
||||
<!-- <input type="text" class="input-100-40 pr20 color-grey-3 font-14 pointer techInput" readonly value="<%#= shixun.shixun_tag_name.join(";") %>" placeholder="请选择技术体系"/>-->
|
||||
<!-- <input class="search" contenteditable="true" style=" display: none; max-width: 70px;-->
|
||||
<!-- position: absolute;-->
|
||||
<!-- min-width: 40px;-->
|
||||
<!-- height: 96%;-->
|
||||
<!-- left: 180px;-->
|
||||
<!-- top: 0px;-->
|
||||
<!-- padding: 0 4px;-->
|
||||
<!-- width: fit-content;-->
|
||||
<!-- background: #fff;-->
|
||||
<!-- line-height: 40px;-->
|
||||
<!-- border: 1px solid rgb(234, 234, 234);"></input>-->
|
||||
<!-- <div class="down-select shixun_small_language_option" style="padding: 2px 0px">-->
|
||||
<%# @shixun_tags.each do |tag| %>
|
||||
<!-- <p data-shixun-value="<%#= index + 1 %><%= tag.name %>_<%#= tag.id %>">-->
|
||||
<!-- <input name="select<%#= index %>" data-value="<%#= tag.id %>" <%#= shixun.is_tag_used?(tag.id) ? "checked" : "" %> data-shixun="<%#= shixun.id %>" type="checkbox" class="select<%#= count %> magic-checkbox" id="<%#= count %>_<%#= tag.name %>_<%#= tag.id %>" value="<%#= tag.name %>"/>-->
|
||||
<!-- <label style="top:0px" for="<%#= index %>_<%#= tag.name %>_<%#= tag.id %>" class="task-hide"><%#= tag.name %></label>-->
|
||||
<!-- </p>-->
|
||||
<%# end %>
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
</td>
|
||||
<td>
|
||||
<!-- 图片上传,稍后添加-->
|
||||
|
||||
</td>
|
||||
<td><%= link_to shixun.owner.try(:show_real_name),user_path(shixun.user_id),target:'_blank' %></td>
|
||||
<td>
|
||||
<% if shixun.status == 2 %>
|
||||
<%= link_to "关闭", "###", :class => "", :remote => true %>
|
||||
<% else %>
|
||||
<a href="javascript:void(0)">关闭</a>
|
||||
<% end %>
|
||||
</td>
|
||||
<td class="operate">
|
||||
<input type="checkbox" <%= shixun.can_copy ? 'checked' : "" %> name="can_copy" value="<%= shixun.id %>" id="can_copy_<%= shixun.id %>" class="ml5 mr5 magic-checkbox" >
|
||||
<label style="top:-15px;" class="color-grey" for="can_copy_<%= shixun.id %>"></label>
|
||||
</td>
|
||||
<td class="operate">
|
||||
<input name="excute_time" value="<%= shixun.excute_time %>" class="input-100-35 ml5 mr5 excute_time">
|
||||
<div class="undis"><%= shixun.id %></div>
|
||||
</td>
|
||||
<td class="operate">
|
||||
<span class="fl ml5 shixun_webssh">
|
||||
<input type="checkbox" <%= shixun.webssh == 1 ? 'checked' : "" %> value="0" id="join_course_role_<%= shixun.id %>" class="ml-3 mr5 magic-checkbox">
|
||||
<label style="top:0px;padding-left: 19px;" for="join_course_role_<%= shixun.id %>">ssh</label>
|
||||
<div class="undis"><%= shixun.id %></div>
|
||||
</span>
|
||||
<span class="fl ml5 shixun_hidden">
|
||||
<input type="checkbox" <%= shixun.hidden ? 'checked' : "" %> value="0" id="shixun_hidden_<%= shixun.id %>" name="hidden" class="ml-3 mr5 magic-checkbox">
|
||||
<label style="top:0px;padding-left: 19px;" for="shixun_hidden_<%= shixun.id %>">隐藏</label>
|
||||
<div class="undis"><%= shixun.id %></div>
|
||||
</span>
|
||||
<span class="fl ml5 homepage_show">
|
||||
<input type="checkbox" name="homepage_show_cell" <%= shixun.status == 2 ? "" : "disabled" %> value="<%= shixun.id %>" <%= shixun.homepage_show ? "checked" : "" %> class="ml-3 mr5 magic-checkbox" id="homepage_show_<%= shixun.id %>">
|
||||
<label style="top:0px;padding-left: 19px;" for="homepage_show_<%= shixun.id %>">首页</label>
|
||||
</span>
|
||||
<span class="fl ml5 shixun_pass">
|
||||
<input type="checkbox" name="shixun_pass_cell" value="<%= shixun.id %>" <%= shixun.task_pass ? "checked" : "" %> class="ml-3 mr5 magic-checkbox" id="shixun_pass_<%= shixun.id %>">
|
||||
<label style="top:0px;padding-left: 19px;" for="shixun_pass_<%= shixun.id %>">跳关</label>
|
||||
</span>
|
||||
<span class="fl ml5 shixun_file">
|
||||
<input type="checkbox" name="shixun_file_cell" value="<%= shixun.id %>" <%= shixun.code_hidden ? "checked" : "" %> class="ml-3 mr5 magic-checkbox" id="shixun_file_<%= shixun.id %>">
|
||||
<label style="top:0px;padding-left: 19px;" for="shixun_file_<%= shixun.id %>">隐藏文件目录</label>
|
||||
</span>
|
||||
</td>
|
@ -0,0 +1 @@
|
||||
$("#setting-item-<%= @shixun.id %>").html("<%= j render partial: "admins/shixun_settings/shared/td",locals: {shixun: @shixun,page_no:@page_no} %>")
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Loading…
Reference in new issue