Commit bbb1e626 authored by Nicolas Widart's avatar Nicolas Widart

Preparing menu index view

parent 58aed91f
...@@ -10,6 +10,11 @@ return [ ...@@ -10,6 +10,11 @@ return [
'create menu item' => 'Create a menu item', 'create menu item' => 'Create a menu item',
], ],
'button' => [ 'button' => [
'create menu item' => 'Create a menu item' 'create menu item' => 'Create a menu item',
'create menu' => 'Create a menu'
],
'table' => [
'name' => 'Name',
'title' => 'Title',
] ]
]; ];
...@@ -8,6 +8,11 @@ return [ ...@@ -8,6 +8,11 @@ return [
'menu' => 'Gestionnaire de menu' 'menu' => 'Gestionnaire de menu'
], ],
'button' => [ 'button' => [
'create menu item' => 'Créer un élément de menu' 'create menu item' => 'Créer un élément de menu',
'create menu' => 'Créer un menu'
],
'table' => [
'name' => 'Nom',
'title' => 'Titre',
] ]
]; ];
...@@ -10,52 +10,113 @@ ...@@ -10,52 +10,113 @@
</ol> </ol>
@stop @stop
@section('styles')
<link href="{!! Module::asset('menu', 'css/nestable.css') !!}" rel="stylesheet" type="text/css" />
@stop
@section('content') @section('content')
<div class="row"> <div class="row">
<div class="col-md-6"> <div class="col-md-12">
<div class="btn-group pull-right"> <div class="row">
<a href="{{ URL::route('dashboard.menu.create') }}" class="btn btn-primary btn-flat"> <div class="btn-group pull-right" style="margin: 0 15px 15px 0;">
<i class="fa fa-pencil"></i> {{ trans('menu::menu.button.create menu item') }} <a href="{{ URL::route('dashboard.menu.create') }}" class="btn btn-primary btn-flat">
</a> <i class="fa fa-pencil"></i> {{ trans('menu::menu.button.create menu') }}
</a>
</div>
</div> </div>
<div class="dd"> <div class="box">
<ol class="dd-list"> <div class="box-header">
<li class="dd-item" data-id="1"> </div>
<div class="dd-handle">Item 1</div> <!-- /.box-header -->
</li> <div class="box-body table-responsive">
<li class="dd-item" data-id="2"> <table class="data-table table table-bordered table-hover">
<div class="dd-handle">Item 2</div> <thead>
</li> <tr>
<li class="dd-item" data-id="3"> <th>{{ trans('menu::menu.table.name') }}</th>
<div class="dd-handle">Item 3</div> <th>{{ trans('menu::menu.table.title') }}</th>
<ol class="dd-list"> <th>{{ trans('core::core.table.actions') }}</th>
<li class="dd-item" data-id="4"> </tr>
<div class="dd-handle">Item 4</div> </thead>
</li> <tbody>
<li class="dd-item" data-id="5"> <?php if (isset($menus)): ?>
<div class="dd-handle">Item 5</div> <?php foreach($menus as $menu): ?>
</li> <tr>
</ol> <td>
</li> <a href="{{ URL::route('dashboard.post.edit', [$menu->id]) }}">
</ol> {{ $menu->title }}
</a>
</td>
<td>
<a href="{{ URL::route('dashboard.post.edit', [$menu->id]) }}">
{{ $menu->slug }}
</a>
</td>
<td>
<div class="btn-group">
<a href="{{ URL::route('dashboard.post.edit', [$menu->id]) }}" class="btn btn-default btn-flat"><i class="glyphicon glyphicon-pencil"></i></a>
<button class="btn btn-danger btn-flat" data-toggle="modal" data-target="#confirmation-{{ $menu->id }}"><i class="glyphicon glyphicon-trash"></i></button>
</div>
</td>
</tr>
<?php endforeach; ?>
<?php endif; ?>
</tbody>
<tfoot>
<tr>
<th>{{ trans('menu::menu.table.name') }}</th>
<th>{{ trans('menu::menu.table.title') }}</th>
<th>{{ trans('core::core.table.actions') }}</th>
</tr>
</tfoot>
</table>
<!-- /.box-body -->
</div>
<!-- /.box -->
</div> </div>
</div> </div>
</div> </div>
<?php if (isset($menus)): ?>
<?php foreach($menus as $menu): ?>
<!-- Modal -->
<div class="modal fade" id="confirmation-{{ $menu->id }}" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
<h4 class="modal-title" id="myModalLabel">{{ trans('core::core.modal.title') }}</h4>
</div>
<div class="modal-body">
{{ trans('core::core.modal.confirmation-message') }}
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">{{ trans('core::core.button.cancel') }}</button>
{!! Form::open(['route' => ['dashboard.post.destroy', $menu->id], 'method' => 'delete', 'class' => 'pull-left']) !!}
<button type="submit" class="btn btn-danger btn-flat"><i class="glyphicon glyphicon-trash"></i> {{ trans('core::core.button.delete') }}</button>
{!! Form::close() !!}
</div>
</div>
</div>
</div>
<?php endforeach; ?>
<?php endif; ?>
@stop @stop
@section('scripts') @section('scripts')
<script src="{!! Module::asset('menu', 'js/jquery.nestable.js') !!}"></script> <?php $locale = App::getLocale(); ?>
<script> <script type="text/javascript">
$( document ).ready(function() { $(function () {
$('.dd').nestable(); $('.data-table').dataTable({
$('.dd').on('change', function() { "bPaginate": true,
var data = $('.dd').nestable('serialize'); "bLengthChange": true,
console.log(data); "bFilter": true,
"bSort": true,
"bInfo": true,
"bAutoWidth": true,
"oLanguage": {
"sUrl": '<?php echo Module::asset('core', "js/vendor/datatables/{$locale}.json") ?>'
},
"aoColumns": [
null,
null,
{ "bSortable": false }
]
});
}); });
});
</script> </script>
@stop @stop
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment