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
Show 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
...
@@ -9,9 +9,9 @@ class Menu extends Model
protected
$fillable
=
[
protected
$fillable
=
[
'name'
,
'name'
,
'class'
,
'title'
,
'title'
,
'status'
,
'status'
,
'primary'
,
];
];
public
$translatedAttributes
=
[
'title'
,
'status'
];
public
$translatedAttributes
=
[
'title'
,
'status'
];
...
...
Repositories/Eloquent/EloquentMenuRepository.php
View file @
481b0447
...
@@ -11,8 +11,8 @@ class EloquentMenuRepository extends EloquentBaseRepository implements MenuRepos
...
@@ -11,8 +11,8 @@ class EloquentMenuRepository extends EloquentBaseRepository implements MenuRepos
{
{
$menu
=
new
Menu
;
$menu
=
new
Menu
;
$menu
->
name
=
$data
[
'name'
];
$menu
->
name
=
$data
[
'name'
];
$menu
->
primary
=
$data
[
'primary'
];
unset
(
$data
[
'name'
]);
$translatableData
=
Helper
::
separateLanguages
(
$data
);
$translatableData
=
Helper
::
separateLanguages
(
$data
);
Helper
::
updateTranslated
(
$menu
,
$translatableData
);
Helper
::
updateTranslated
(
$menu
,
$translatableData
);
...
@@ -21,6 +21,8 @@ class EloquentMenuRepository extends EloquentBaseRepository implements MenuRepos
...
@@ -21,6 +21,8 @@ class EloquentMenuRepository extends EloquentBaseRepository implements MenuRepos
public
function
update
(
$menu
,
$data
)
public
function
update
(
$menu
,
$data
)
{
{
$menu
->
name
=
$data
[
'name'
];
$menu
->
primary
=
$data
[
'primary'
];
$translatableData
=
Helper
::
separateLanguages
(
$data
);
$translatableData
=
Helper
::
separateLanguages
(
$data
);
Helper
::
updateTranslated
(
$menu
,
$translatableData
);
Helper
::
updateTranslated
(
$menu
,
$translatableData
);
...
...
Resources/lang/en/menu.php
View file @
481b0447
...
@@ -28,5 +28,6 @@ return [
...
@@ -28,5 +28,6 @@ return [
'name'
=>
'Name'
,
'name'
=>
'Name'
,
'status'
=>
'Online'
,
'status'
=>
'Online'
,
'uri'
=>
'URI'
,
'uri'
=>
'URI'
,
'primary'
=>
'Primary menu (used for front-end routing)'
,
]
]
];
];
Resources/lang/fr/menu.php
View file @
481b0447
...
@@ -27,6 +27,7 @@ return [
...
@@ -27,6 +27,7 @@ return [
'title'
=>
'Titre'
,
'title'
=>
'Titre'
,
'name'
=>
'Nom'
,
'name'
=>
'Nom'
,
'status'
=>
'En ligne'
,
'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 @@
...
@@ -3,3 +3,14 @@
{!! Form::text('name', Input::old('name', $menu->name), ['class' => 'form-control', 'placeholder' => 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>
') !!}
{!! $errors->first('Name', '
<span
class=
"help-block"
>
:message
</span>
') !!}
</div>
</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