Fixes in scripts edit

This commit is contained in:
Antonio de la Rosa 2022-04-01 17:38:30 +02:00
parent 6220d8a4f0
commit fbab7917ef
3 changed files with 44 additions and 14 deletions

View file

@ -4,7 +4,7 @@
<div id="scripts_list" class="form">
% for script in scripts:
<p><label>${script['name']}</label>: <span class="position" id="position_${script['id']}">${script['position']}</span></p>
<p>${script['name']}<input type="hidden" class="position" id="position_${script['id']}" value="${script['position']}"></p>
% endfor
</div>
@ -29,7 +29,7 @@ $('#change_order').click(function () {
$('.position').each(function () {
var item_id=$(this).attr('id').replace('postion_', '');
var item_id=$(this).attr('id').replace('position_', '');
order_id.push(item_id);
@ -37,7 +37,7 @@ $('#change_order').click(function () {
$.ajax({
type: 'POST',
url:"",
url:"${url_for('admin_app.pastafari2_save_positions', server_id=server_data['id'])}",
data: {order_id: JSON.stringify(order_id)},
success: function (data) {
@ -46,7 +46,7 @@ $('#change_order').click(function () {
if(!data.error) {
alert("${lang('pastafari2', 'positions_updated', 'Positions updated')}");
}
else {

View file

@ -10,11 +10,6 @@ ${edit_update|n}
<%block name="jscript_block">
<script type="text/javascript" src="${make_media_url('js/Sortable.min.js', 'pastafari2')}"></script>
<script>
sortable_list=document.getElementById('updateserverscripts_table_rows');
sortable_var=new Sortable(sortable_list, {
animation: 150,
/*ghostClass: 'blue-background-class'*/
});
</script>
</%block>