academic_advising/app/views/admin/academic_advisings/setting.html.erb

70 lines
2.0 KiB
Plaintext
Raw Normal View History

2015-12-02 10:29:00 +00:00
<% content_for :page_specific_javascript do %>
<%= javascript_include_tag "lib/jquery-ui-sortable.min" %>
<% end %>
2014-07-02 09:37:34 +00:00
<style type="text/css">
.element{
background: #FFF;
margin-bottom: 10px;
border-radius: 5px;
border: 1px solid #DDD;
}
.detail{
padding: 10px;
min-height: 250px;
}
.totle{
margin-bottom: 25px;
}
.totle span{
font-size: 18px;
}
</style>
<div class="row">
<div class="element span4">
<div class="detail w-a h-a">
<p class="totle">
2021-02-07 14:56:22 +00:00
<a class="btn btn-small btn-primary pull-right" href="<%= new_admin_academic_advising_type_path %>#academic_advising_type_modal" data-toggle="modal" data-remote="true"><i class="icon-plus"></i> <%= t('add')%></a>
<span><%= t("academic_advising.academic_advising_category") %></span>
2014-07-02 09:37:34 +00:00
</p>
<div class="detal-list my_scroll">
<div class="scrollbar">
<div class="track">
<div class="thumb">
<div class="end"></div>
</div>
</div>
</div>
<div class="viewport">
<div class="overview">
2021-02-07 14:56:22 +00:00
<table id="academic_advising_types" class="table table-striped">
2014-07-02 09:37:34 +00:00
<tbody>
2021-02-07 14:56:22 +00:00
<%= render :partial => 'list_academic_advising_type', :collection => @academic_advising_types.asc(:sort_position) %>
2014-07-02 09:37:34 +00:00
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
2021-02-07 14:56:22 +00:00
<div id="academic_advising_type_qe">
<div style="display:none;" class="modal" id="academic_advising_type_modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
2014-07-02 09:37:34 +00:00
</div>
2015-12-02 10:29:00 +00:00
</div>
<script type="text/javascript">
2021-02-07 14:56:22 +00:00
$("#academic_advising_types tbody").sortable({
2015-12-02 10:29:00 +00:00
update : function(){
var data = {};
2021-02-07 14:56:22 +00:00
$("#academic_advising_types tbody tr").each(function(i){
2015-12-02 10:29:00 +00:00
data[$(this).data("type-id")] = i;
})
$.ajax({
2021-02-07 14:56:22 +00:00
url : "/admin/academic_advising_types/update_order",
2015-12-02 10:29:00 +00:00
type : "post",
data : {"order" : data}
})
}
});
</script>