Commit 481b0447 authored by Nicolas Widart's avatar Nicolas Widart

Adding the primary checkbox on create and edit

parent 77df6879
......@@ -9,9 +9,9 @@ class Menu extends Model
protected $fillable = [
'name',
'class',
'title',
'status',
'primary',
];
public $translatedAttributes = ['title', 'status'];
......
......@@ -11,8 +11,8 @@ class EloquentMenuRepository extends EloquentBaseRepository implements MenuRepos
{
$menu = new Menu;
$menu->name = $data['name'];
$menu->primary = $data['primary'];
unset($data['name']);
$translatableData = Helper::separateLanguages($data);
Helper::updateTranslated($menu, $translatableData);
......@@ -21,6 +21,8 @@ class EloquentMenuRepository extends EloquentBaseRepository implements MenuRepos
public function update($menu, $data)
{
$menu->name = $data['name'];
$menu->primary = $data['primary'];
$translatableData = Helper::separateLanguages($data);
Helper::updateTranslated($menu, $translatableData);
......
......@@ -28,5 +28,6 @@ return [
'name' => 'Name',
'status' => 'Online',
'uri' => 'URI',
'primary' => 'Primary menu (used for front-end routing)',
]
];
......@@ -27,6 +27,7 @@ return [
'title' => 'Titre',
'name' => 'Nom',
'status' => 'En ligne',
'uri' => 'URI'
'uri' => 'URI',
'primary' => 'Menu principal (utiliser pour le routage front-end)',
]
];
......@@ -3,3 +3,14 @@
{!! 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="checkbox">
<label for="primary">
<input id="primary"
name="primary"
type="checkbox"
class="flat-blue"
{{ ((bool)$menu->primary) ? 'checked' : '' }}
value="1" />
{{ trans('menu::menu.form.primary') }}
</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