themen verwalten add

This commit is contained in:
Andreas Stephanides
2014-02-09 21:23:09 +01:00
parent f504077f55
commit ab959f8b86
7 changed files with 129 additions and 4 deletions

View File

@@ -0,0 +1,56 @@
<style>
#themen { list-style-type: none; margin: 0; padding: 0; margin-bottom: 15px;zoom: 1; }
#themen li { margin: 0 5px 5px 5px; padding: 5px; font-size: 1.2em; width: 95%; }
</style>
<ul id="themen" class="sort" >
<% @themen.each do |thema| %>
<li id="themen_<%= thema.id %>" class="sort" style="background:white;display:block;" ><%= thema.title %>-<%= thema.priority %></li>
<% end %>
</ul>
<script>
$( document ).ready(function(){
$("#themen").sortable({
cursor: 'crosshair',
drag:true,
update: function(){
$.ajax({
url: '<%= themengruppe_sort_themen_path(@themengruppe) %>',
type: 'post',
data: $('#themen').sortable('serialize'),
dataType: 'script',
complete: function(request){
alert("complete");
}
})
}
});
});
</script>
<!--
$( document ).ready(function(){
$("#themen").sortable({
axis: 'y',
drag:true,
dropOnEmpty: false,
handle: '.handle',
cursor: 'crosshair',
items: 'li',
opacity: 0.4,
scroll: true,
update: function(){
$.ajax({
url: '/books/sort',
type: 'post',
data: $('#themen').sortable('serialize'),
dataType: 'script',
complete: function(request){
$('#themen').effect('highlight');
}
});
}
});
});
-->