103 lines
3.1 KiB
Plaintext
103 lines
3.1 KiB
Plaintext
<% content_for :page_specific_javascript do %>
|
|
<%= javascript_include_tag "lib/jquery-ui-sortable.min" %>
|
|
<% end %>
|
|
<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">
|
|
<a class="btn btn-small btn-primary pull-right" href="<%= new_admin_course_semester_path %>#course_semester_modal" data-toggle="modal" data-remote="true"><i class="icon-plus"></i> <%= t('add')%></a>
|
|
<span><%= t("personal_course.course_semester") %></span>
|
|
</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">
|
|
<table id="course_semesters" class="table table-striped">
|
|
<tbody>
|
|
<%= render :partial => 'course_semester', :collection => @course_semesters %>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="element span4">
|
|
<div class="detail w-a h-a">
|
|
<p class="totle">
|
|
<a class="btn btn-small btn-primary pull-right" href="<%= new_admin_course_category_path %>#course_category_modal" data-toggle="modal" data-remote="true"><i class="icon-plus"></i> <%= t('add')%></a>
|
|
<span><%= t("personal_course.course_category") %></span>
|
|
</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">
|
|
<table id="course_categories" class="table table-striped">
|
|
<tbody>
|
|
<%= render :partial => 'course_category', :collection => @course_categories %>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="paper_type_qe">
|
|
<div style="display:none;" class="modal" id="course_semester_modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
|
|
</div>
|
|
</div>
|
|
|
|
<div id="paper_level_qe">
|
|
<div style="display:none;" class="modal" id="course_category_modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
|
|
</div>
|
|
</div>
|
|
|
|
<script type="text/javascript">
|
|
$("#course_categories tbody").sortable({
|
|
update : function(){
|
|
var data = {};
|
|
$("#course_categories tbody tr").each(function(i){
|
|
data[$(this).data("type-id")] = i;
|
|
})
|
|
$.ajax({
|
|
url : "/admin/course_categories/update_order",
|
|
type : "post",
|
|
data : {"order" : data}
|
|
})
|
|
}
|
|
});
|
|
</script> |