Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Platform
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Platform
Commits
bbb1e626
Commit
bbb1e626
authored
Nov 04, 2014
by
Nicolas Widart
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Preparing menu index view
parent
58aed91f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
110 additions
and
39 deletions
+110
-39
menu.php
Resources/lang/en/menu.php
+6
-1
menu.php
Resources/lang/fr/menu.php
+6
-1
index.blade.php
Resources/views/admin/menus/index.blade.php
+98
-37
No files found.
Resources/lang/en/menu.php
View file @
bbb1e626
...
...
@@ -10,6 +10,11 @@ return [
'create menu item'
=>
'Create a menu item'
,
],
'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'
,
]
];
Resources/lang/fr/menu.php
View file @
bbb1e626
...
...
@@ -8,6 +8,11 @@ return [
'menu'
=>
'Gestionnaire de menu'
],
'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'
,
]
];
Resources/views/admin/menus/index.blade.php
View file @
bbb1e626
...
...
@@ -10,52 +10,113 @@
</ol>
@stop
@section('styles')
<link href="
{
!!
Module
::
asset
(
'menu'
,
'css/nestable.css'
)
!!
}
" rel="
stylesheet
" type="
text
/
css
" />
@stop
@section('content')
<div
class=
"row"
>
<div class="
col
-
md
-
6
">
<div class="
btn
-
group
pull
-
right
">
<a href="
{{
URL
::
route
(
'dashboard.menu.create'
)
}}
" class="
btn
btn
-
primary
btn
-
flat
">
<i class="
fa
fa
-
pencil
"></i> {{ trans('menu::menu.button.create menu item') }}
</a>
<div
class=
"col-md-12"
>
<div
class=
"row"
>
<div
class=
"btn-group pull-right"
style=
"margin: 0 15px 15px 0;"
>
<a
href=
"{{ URL::route('dashboard.menu.create') }}"
class=
"btn btn-primary btn-flat"
>
<i
class=
"fa fa-pencil"
></i>
{{ trans('menu::menu.button.create menu') }}
</a>
</div>
</div>
<div class="
dd
">
<ol class="
dd
-
list
">
<li class="
dd
-
item
" data-id="
1
">
<div class="
dd
-
handle
">Item 1</div>
</li>
<li class="
dd
-
item
" data-id="
2
">
<div class="
dd
-
handle
">Item 2</div>
</li>
<li class="
dd
-
item
" data-id="
3
">
<div class="
dd
-
handle
">Item 3</div>
<ol class="
dd
-
list
">
<li class="
dd
-
item
" data-id="
4
">
<div class="
dd
-
handle
">Item 4</div>
</li>
<li class="
dd
-
item
" data-id="
5
">
<div class="
dd
-
handle
">Item 5</div>
</li>
</ol>
</li>
</ol>
<div
class=
"box"
>
<div
class=
"box-header"
>
</div>
<!-- /.box-header -->
<div
class=
"box-body table-responsive"
>
<table
class=
"data-table table table-bordered table-hover"
>
<thead>
<tr>
<th>
{{ trans('menu::menu.table.name') }}
</th>
<th>
{{ trans('menu::menu.table.title') }}
</th>
<th>
{{ trans('core::core.table.actions') }}
</th>
</tr>
</thead>
<tbody>
<?php
if
(
isset
(
$menus
))
:
?>
<?php
foreach
(
$menus
as
$menu
)
:
?>
<tr>
<td>
<a
href=
"{{ URL::route('dashboard.post.edit', [$menu->id]) }}"
>
{{ $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>
<?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"
>
×
</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
@section('scripts')
<script src="
{
!!
Module
::
asset
(
'menu'
,
'js/jquery.nestable.js'
)
!!
}
"></script>
<script>
$( document ).ready(function() {
$('.dd').nestable();
$('.dd').on('change', function() {
var data = $('.dd').nestable('serialize');
console.log(data);
<?php
$locale
=
App
::
getLocale
();
?>
<script
type=
"text/javascript"
>
$
(
function
()
{
$
(
'
.data-table
'
).
dataTable
({
"
bPaginate
"
:
true
,
"
bLengthChange
"
:
true
,
"
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>
@stop
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment