|
|
|
@ -1,8 +1,28 @@
|
|
|
|
|
<%= stylesheet_link_tag 'css/public','css/common'%>
|
|
|
|
|
<div class="edu-back-white ml20 clearfix">
|
|
|
|
|
<p class="font-16 edu-line padding30-20">合作伙伴</p>
|
|
|
|
|
<div class="clearfix">
|
|
|
|
|
<p class="font-16 ml20 mb15 mt15"> 产学联盟 </p>
|
|
|
|
|
<ul class='edu-cooperation clearfix cooperation-item' id="sortable2">
|
|
|
|
|
<% @alliance_img.each do |alliance_img| %>
|
|
|
|
|
<li class="bor-grey-e pr" data-id="<%= alliance_img.id %>" data-position="<%= alliance_img.position %>">
|
|
|
|
|
<% if User.current.admin? %>
|
|
|
|
|
<a href="javascript:void(0)" onclick="delete_confirm_box('<%= delete_coop_path(:id => alliance_img.id) %>', '确定要删除该图片吗?')"><i data-tip-down="删除" class="fa fa-times-circle mr10 color-orange05 font-16" style="position:absolute;right:0px;top:8px"></i></a>
|
|
|
|
|
<% end %>
|
|
|
|
|
<a href="<%= alliance_img.src_states == '' ? 'javascript:void(0)' : alliance_img.src_states %>" target="_blank">
|
|
|
|
|
<img src="<%= alliance_img.url_states %>" alt=""/>
|
|
|
|
|
</a>
|
|
|
|
|
</li>
|
|
|
|
|
<% end %>
|
|
|
|
|
<% if User.current.admin? %>
|
|
|
|
|
<li style="border: 1px dashed #FF7500" class="font-16"><a href="<%= update_help_path(:tab => 3,:resubmit => @resubmit)%>" data-remote="true">+ 新建</a></li>
|
|
|
|
|
<% end %>
|
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="clearfix">
|
|
|
|
|
<p class="font-16 ml20 mb15 mt15"> 企业合作 </p>
|
|
|
|
|
<p class="font-16 ml20 mb15 mt15"> 知名企业 </p>
|
|
|
|
|
<ul class='edu-cooperation clearfix cooperation-item' id="sortable">
|
|
|
|
|
<% @com_coop_img.each do |coop_img| %>
|
|
|
|
|
<li class="bor-grey-e pr" data-id="<%= coop_img.id %>" data-position="<%= coop_img.position %>">
|
|
|
|
@ -21,7 +41,7 @@
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
<div class="clearfix">
|
|
|
|
|
<p class="font-16 ml20 mb15">高校合作 </p>
|
|
|
|
|
<p class="font-16 ml20 mb15">各类院校 </p>
|
|
|
|
|
<ul class='edu-cooperation cooperation-school clearfix' id="sortable1">
|
|
|
|
|
<% @edu_coop_img.each do |coop_img| %>
|
|
|
|
|
<li class="bor-grey-e pr" data-id="<%= coop_img.id %>" data-position="<%= coop_img.position %>">
|
|
|
|
@ -51,6 +71,8 @@
|
|
|
|
|
var id = 0;
|
|
|
|
|
var pos_1 = 0;
|
|
|
|
|
var id_1 = 0;
|
|
|
|
|
var pos_2 = 0;
|
|
|
|
|
var id_2 = 0;
|
|
|
|
|
$( "#sortable" ).sortable({
|
|
|
|
|
containment:".cooperation-item",
|
|
|
|
|
sort:function(e, ui){
|
|
|
|
@ -121,7 +143,40 @@
|
|
|
|
|
});
|
|
|
|
|
$( "#sortable1" ).disableSelection();
|
|
|
|
|
|
|
|
|
|
$( "#sortable2" ).sortable({
|
|
|
|
|
containment:".cooperation-school",
|
|
|
|
|
sort:function(e, ui){
|
|
|
|
|
select_item = ui.item; //当前拖动的元素
|
|
|
|
|
pos_2 = $(select_item[0]).prev().attr("data-position");
|
|
|
|
|
id_2 = $(select_item[0]).attr("data-id");
|
|
|
|
|
if(pos == undefined || id == undefined){
|
|
|
|
|
pos_2 = 0;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
stop:function(e, ui){
|
|
|
|
|
select_item = ui.item; //当前拖动的元素
|
|
|
|
|
console.log(ui.item);
|
|
|
|
|
pos_2 = $(select_item[0]).prev().attr("data-position");
|
|
|
|
|
id_2 = $(select_item[0]).attr("data-id");
|
|
|
|
|
if(pos_2 == undefined || id_2 == undefined){
|
|
|
|
|
pos_2 = 0;
|
|
|
|
|
}
|
|
|
|
|
console.log("pos: " + pos_2);
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: "<%= change_coop_position_path %>",
|
|
|
|
|
data: {id: id_2, position: pos_2, type: "alliance_coop"},
|
|
|
|
|
success: function(data) {
|
|
|
|
|
if(data.status == 1){
|
|
|
|
|
console.log("更新成功!");
|
|
|
|
|
$(select_item[0]).attr("data-position", pos_2+1)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
$( "#sortable2" ).disableSelection();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|