2018-02-12 05:47:26 +10:00
|
|
|
{{> partials/menu}}
|
2018-01-07 04:55:48 +10:00
|
|
|
<script src="https://code.jquery.com/ui/1.11.3/jquery-ui.min.js"></script>
|
|
|
|
<div class="col-lg-9">
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-md-10">
|
|
|
|
<h2>Menu</h2>
|
|
|
|
<table class="table table-condensed">
|
|
|
|
<th></th>
|
|
|
|
<th>Menu</th>
|
|
|
|
<th>Link</th>
|
|
|
|
<th></th>
|
|
|
|
<tbody id="draggable_list">
|
2018-01-15 03:02:10 +10:00
|
|
|
{{#each menu.items}}
|
2019-12-07 09:41:18 +10:00
|
|
|
<tr class="drag-row" id="menuId-{{@key}}">
|
|
|
|
<input type="hidden" class="navId" value="{{title}}">
|
2018-01-07 04:55:48 +10:00
|
|
|
<td class="dragable_item col-md-1 td-pad"><i class="fa fa-arrows"></i></td>
|
|
|
|
<td class="dragable_item col-md-2">
|
2019-12-07 09:41:18 +10:00
|
|
|
<input type="text" class="form-control input-sm navMenu" value="{{title}}">
|
2018-01-07 04:55:48 +10:00
|
|
|
</td>
|
|
|
|
<td class="dragable_item col-md-6">
|
2019-12-07 09:41:18 +10:00
|
|
|
<input type="text" class="form-control input-sm navLink" value="{{link}}">
|
2018-01-07 04:55:48 +10:00
|
|
|
</td>
|
|
|
|
<td class="col-md-2">
|
2019-12-07 09:41:18 +10:00
|
|
|
<a class="btn btn-danger btn-sm settings-menu-delete" data-id="{{@key}}">
|
2018-01-07 04:55:48 +10:00
|
|
|
<i class="fa fa-trash-o"></i>
|
2018-01-15 03:02:10 +10:00
|
|
|
</a>
|
2019-12-07 09:41:18 +10:00
|
|
|
<button type="submit" class="btn btn-success btn-sm" id="settings-menu-update" >
|
2018-01-07 04:55:48 +10:00
|
|
|
<i class="fa fa-floppy-o"></i>
|
|
|
|
</button>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
{{/each}}
|
|
|
|
<tr>
|
|
|
|
<td class="dragable_item col-md-1"></td>
|
|
|
|
<td class="dragable_item col-md-2">
|
2019-12-07 09:41:18 +10:00
|
|
|
<input type="text" class="form-control input-sm" id="newNavMenu">
|
2018-01-07 04:55:48 +10:00
|
|
|
</td>
|
|
|
|
<td class="dragable_item col-md-6">
|
2019-12-07 09:41:18 +10:00
|
|
|
<input type="text" class="form-control input-sm" id="newNavLink">
|
2018-01-07 04:55:48 +10:00
|
|
|
</td>
|
|
|
|
<td class="col-md-2">
|
2019-12-07 09:41:18 +10:00
|
|
|
<button type="submit" id="settings-menu-new" class="btn btn-success btn-sm">
|
2018-01-07 04:55:48 +10:00
|
|
|
<i class="fa fa-plus"></i>
|
|
|
|
</button>
|
|
|
|
</td>
|
2018-01-15 03:02:10 +10:00
|
|
|
</tr>
|
2018-01-07 04:55:48 +10:00
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
<p class="text-muted">
|
2019-11-06 18:31:25 +10:00
|
|
|
|
|
|
|
{{ @root.__ "Setting_menu_explain" }}
|
2018-01-15 03:02:10 +10:00
|
|
|
</p>
|
2018-01-07 04:55:48 +10:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
$(document).ready(function() {
|
|
|
|
$('#draggable_list').sortable({
|
|
|
|
update: function (event, ui) {
|
|
|
|
var sorted = $( ".navId" ).serialize();
|
|
|
|
$.ajax({
|
|
|
|
data: sorted,
|
|
|
|
type: 'POST',
|
|
|
|
url: '/admin/settings/menu/save_order'
|
|
|
|
})
|
|
|
|
.fail(function(msg){
|
|
|
|
showNotification(msg.responseJSON.message, 'danger', true);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
</script>
|