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
481b0447
Commit
481b0447
authored
Nov 18, 2014
by
Nicolas Widart
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding the primary checkbox on create and edit
parent
77df6879
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
18 additions
and
3 deletions
+18
-3
Menu.php
Entities/Menu.php
+1
-1
EloquentMenuRepository.php
Repositories/Eloquent/EloquentMenuRepository.php
+3
-1
menu.php
Resources/lang/en/menu.php
+1
-0
menu.php
Resources/lang/fr/menu.php
+2
-1
edit-fields.blade.php
Resources/views/admin/menus/partials/edit-fields.blade.php
+11
-0
No files found.
Entities/Menu.php
View file @
481b0447
...
...
@@ -9,9 +9,9 @@ class Menu extends Model
protected
$fillable
=
[
'name'
,
'class'
,
'title'
,
'status'
,
'primary'
,
];
public
$translatedAttributes
=
[
'title'
,
'status'
];
...
...
Repositories/Eloquent/EloquentMenuRepository.php
View file @
481b0447
...
...
@@ -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
);
...
...
Resources/lang/en/menu.php
View file @
481b0447
...
...
@@ -28,5 +28,6 @@ return [
'name'
=>
'Name'
,
'status'
=>
'Online'
,
'uri'
=>
'URI'
,
'primary'
=>
'Primary menu (used for front-end routing)'
,
]
];
Resources/lang/fr/menu.php
View file @
481b0447
...
...
@@ -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)'
,
]
];
Resources/views/admin/menus/partials/edit-fields.blade.php
View file @
481b0447
...
...
@@ -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>
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