Commit af2f4aea authored by Nicolas Widart's avatar Nicolas Widart

Adding edition view

parent d544f14e
......@@ -48,6 +48,6 @@ class MenuController extends AdminBaseController
public function edit(Menu $menu)
{
dd('editing menu');
return View::make('menu::admin.menus.edit', compact('menu'));
}
}
......@@ -4,11 +4,13 @@ return [
'titles' => [
'menu' => 'Menu management',
'create menu' => 'Create a menu',
'edit menu' => 'Edit a menu',
'create menu item' => 'Create a menu item',
],
'breadcrumb' => [
'menu' => 'Menu management',
'create menu' => 'Create a menu',
'edit menu' => 'Edit a menu',
'create menu item' => 'Create a menu item',
],
'button' => [
......
@extends('core::layouts.master')
@section('content-header')
<h1>
{{ trans('menu::menu.titles.edit 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><a href="{{ URL::route('dashboard.menu.index') }}">{{ trans('menu::menu.breadcrumb.menu') }}</a></li>
<li>{{ trans('menu::menu.breadcrumb.edit menu') }}</li>
</ol>
@stop
@section('styles')
<link href="{!! Module::asset('core', 'css/vendor/iCheck/flat/blue.css') !!}" rel="stylesheet" type="text/css" />
@stop
@section('content')
{!! Form::open(['route' => ['dashboard.menu.update'], 'method' => 'post']) !!}
<div class="row">
<div class="col-md-12">
<div class="box box-info">
<div class="box-header">
<h3 class="box-title">{{ trans('core::core.title.translatable fields') }}</h3>
</div>
<div class="box-body">
<div class="nav-tabs-custom">
<ul class="nav nav-tabs">
<?php $i = 0; ?>
<?php foreach(LaravelLocalization::getSupportedLocales() as $locale => $language): ?>
<?php $i++; ?>
<li class="{{ App::getLocale() == $locale ? 'active' : '' }}">
<a href="#tab_{{ $i }}" data-toggle="tab">{{ trans('core::core.tab.'. strtolower($language['name'])) }}</a>
</li>
<?php endforeach; ?>
</ul>
<div class="tab-content">
<?php $i = 0; ?>
<?php foreach(LaravelLocalization::getSupportedLocales() as $locale => $language): ?>
<?php $i++; ?>
<div class="tab-pane {{ App::getLocale() == $locale ? 'active' : '' }}" id="tab_{{ $i }}">
@include('menu::admin.menus.partials.edit-trans-fields', ['lang' => $locale])
</div>
<?php endforeach; ?>
</div>
</div>
</div>
</div>
<div class="box box-info">
<div class="box-header">
<h3 class="box-title">{{ trans('core::core.title.non translatable fields') }}</h3>
</div>
<div class="box-body">
@include('menu::admin.menus.partials.edit-fields')
</div>
</div>
<div class="box-footer">
<button type="submit" class="btn btn-primary btn-flat">{{ trans('core::core.button.update') }}</button>
<a class="btn btn-danger pull-right btn-flat" href="{{ URL::route('dashboard.menu.index')}}"><i class="fa fa-times"></i> {{ trans('core::core.button.cancel') }}</a>
</div>
</div>
</div>
{!! Form::close() !!}
@stop
@section('scripts')
<script>
$( document ).ready(function() {
$('input[type="checkbox"].flat-blue, input[type="radio"].flat-blue').iCheck({
checkboxClass: 'icheckbox_flat-blue',
radioClass: 'iradio_flat-blue'
});
$('input[type="checkbox"]').on('ifChecked', function(){
$(this).parent().find('input[type=hidden]').remove();
});
$('input[type="checkbox"]').on('ifUnchecked', function(){
var name = $(this).attr('name'),
input = '<input type="hidden" name="' + name + '" value="0" />';
$(this).parent().append(input);
});
});
</script>
@stop
<div class='form-group{{ $errors->has('name') ? ' has-error' : '' }}'>
{!! Form::label('name', trans('menu::menu.form.name')) !!}
{!! Form::text('name', Input::old('name', $menu->name), ['class' => 'form-control', 'placeholder' => trans('menu::menu.form.name')]) !!}
{!! $errors->first('Name', '<span class="help-block">:message</span>') !!}
</div>
<div class='form-group{{ $errors->has("title[{$lang}]") ? ' has-error' : '' }}'>
{!! Form::label("title[{$lang}]", trans('menu::menu.form.title')) !!}
{!! Form::text("title[{$lang}]", Input::old("title[{$lang}]", $menu->translate($lang)->title), ['class' => 'form-control', 'placeholder' => trans('menu::menu.form.title')]) !!}
{!! $errors->first("title[{$lang}]", '<span class="help-block">:message</span>') !!}
</div>
<div class="checkbox">
<label for="status[{{$lang}}]">
<input id="status[{{$lang}}]"
name="status[{{$lang}}]"
type="checkbox"
class="flat-blue"
{{ ((bool)$menu->translate($lang)->status) ? 'checked' : '' }}
value="1" />
{{ trans('menu::menu.form.status') }}
</label>
</div>
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