Commit 58aed91f authored by Nicolas Widart's avatar Nicolas Widart

Preparing for the menulink subresource

parent f3cdb2ed
......@@ -7,12 +7,12 @@ class MenuController extends AdminBaseController
{
public function index()
{
return View::make('menu::admin.index');
return View::make('menu::admin.menus.index');
}
public function create()
{
return View::make('menu::admin.create');
return View::make('menu::admin.menus.create');
}
public function store()
......
<?php namespace Modules\Menu\Http\Controllers\Admin;
class MenuLinkController
{
}
......@@ -14,6 +14,15 @@ $router->group(['prefix' => LaravelLocalization::setLocale(), 'before' => 'Larav
'update' => 'dashboard.menu.update',
'destroy' => 'dashboard.menu.destroy',
]]);
$router->resource('menus.menulinks', 'Admin\MenuLinkController', ['except' => ['show'], 'names' => [
'index' => 'dashboard.menulink.index',
'create' => 'dashboard.menulink.create',
'store' => 'dashboard.menulink.store',
'edit' => 'dashboard.menulink.edit',
'update' => 'dashboard.menulink.update',
'destroy' => 'dashboard.menulink.destroy',
]]);
});
});
......
@extends('core::layouts.master')
@section('content-header')
<h1>
{{ trans('menu::menu.titles.create menu item') }}
</h1>
<ol class="breadcrumb">
<li><a href="{{ URL::route('dashboard.index') }}"><i class="fa fa-dashboard"></i> {{ trans('core::core.breadcrumb.home') }}</a></li>
<li><a href="{{ URL::route('dashboard.menu.index') }}">{{ trans('menu::menu.breadcrumb.menu') }}</a></li>
<li>{{ trans('menu::menu.breadcrumb.create menu item') }}</li>
</ol>
@stop
@section('content')
{!! Form::open(['route' => ['dashboard.menu.store'], 'method' => 'post']) !!}
<div class="row">
<div class="col-md-12">
</div>
</div>
{!! Form::close() !!}
@stop
@extends('core::layouts.master')
@section('content-header')
<h1>
{{ trans('menu::menu.titles.menu') }}
</h1>
<ol class="breadcrumb">
<li><a href="{{ URL::route('dashboard.index') }}"><i class="fa fa-dashboard"></i> {{ trans('core::core.breadcrumb.home') }}</a></li>
<li class="active">{{ trans('menu::menu.breadcrumb.menu') }}</li>
</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>
<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>
</div>
</div>
@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);
});
});
</script>
@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