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
24b1adc7
Commit
24b1adc7
authored
Nov 14, 2014
by
Nicolas Widart
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Preparing edit menuitems fields
parent
370e1929
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
135 additions
and
3 deletions
+135
-3
MenuItemController.php
Http/Controllers/Admin/MenuItemController.php
+3
-3
edit.blade.php
Resources/views/admin/menuitems/edit.blade.php
+84
-0
edit-fields.blade.php
...rces/views/admin/menuitems/partials/edit-fields.blade.php
+24
-0
edit-trans-fields.blade.php
...iews/admin/menuitems/partials/edit-trans-fields.blade.php
+24
-0
No files found.
Http/Controllers/Admin/MenuItemController.php
View file @
24b1adc7
...
...
@@ -37,12 +37,12 @@ class MenuItemController
return
$this
->
redirector
->
route
(
'dashboard.menu.edit'
,
[
$menu
->
id
]);
}
public
function
edit
(
Menu
$menu
,
Menuitem
$menu
i
tem
)
public
function
edit
(
Menu
$menu
,
Menuitem
$menu
I
tem
)
{
dd
(
'edit form'
);
return
view
(
'menu::admin.menuitems.edit'
,
compact
(
'menu'
,
'menuItem'
)
);
}
public
function
update
(
Menu
$menu
)
public
function
update
(
Menu
$menu
,
Menuitem
$menuItem
)
{
}
}
Resources/views/admin/menuitems/edit.blade.php
0 → 100644
View file @
24b1adc7
@
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('styles')
<link href="
{
!!
Module
::
asset
(
'core'
,
'css/vendor/iCheck/flat/blue.css'
)
!!
}
" rel="
stylesheet
" type="
text
/
css
" />
@stop
@section('content')
{!! Form::open(['route' => ['dashboard.menuitem.store',
$menu->id
], '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.menuitems.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.menuitems.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.edit', [$menu->id])}}"
><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
Resources/views/admin/menuitems/partials/edit-fields.blade.php
0 → 100644
View file @
24b1adc7
<div
class=
"form-group"
>
<label
for=
"page"
>
{{ trans('menu::menu-items.form.page') }}
</label>
<select
class=
"form-control"
name=
"page_id"
id=
"page"
>
<option
value=
""
></option>
</select>
</div>
<div
class=
"form-group"
>
<label
for=
"module"
>
{{ trans('menu::menu-items.form.module') }}
</label>
<select
class=
"form-control"
name=
"module"
id=
"module"
>
<option
value=
""
></option>
<?php
foreach
(
Module
::
enabled
()
as
$module
)
:
?>
<option
value=
"{{ strtolower($module) }}"
{{
$
menuItem-
>
module_name == strtolower($module) ? 'selected' : '' }}>{{ $module }}
</option>
<?php
endforeach
;
?>
</select>
</div>
<div
class=
"form-group"
>
<label
for=
"target"
>
{{ trans('menu::menu-items.form.target') }}
</label>
<select
class=
"form-control"
name=
"target"
id=
"target"
>
<option
value=
"_self"
{{
$
menuItem-
>
target == '_self' ? 'selected' : '' }}>{{ trans('menu::menu-items.form.same tab') }}
</option>
<option
value=
"_blank"
{{
$
menuItem-
>
target == '_blank' ? 'selected' : '' }}>{{ trans('menu::menu-items.form.new tab') }}
</option>
</select>
</div>
Resources/views/admin/menuitems/partials/edit-trans-fields.blade.php
0 → 100644
View file @
24b1adc7
<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}]", $menuItem->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=
"form-group"
>
{!! Form::label("uri[{$lang}]", trans('menu::menu.form.uri')) !!}
<div
class=
'input-group{{ $errors->has("uri[{$lang}]") ? '
has-error
'
:
''
}}'
>
<span
class=
"input-group-addon"
>
/{{ $lang }}/
</span>
{!! Form::text("uri[{$lang}]", Input::old("uri[{$lang}]", $menuItem->translate($lang)->uri), ['class' => 'form-control', 'placeholder' => trans('menu::menu.form.uri')]) !!}
{!! $errors->first("uri[{$lang}]", '
<span
class=
"help-block"
>
:message
</span>
') !!}
</div>
</div>
<div
class=
"checkbox"
>
<label
for=
"status[{{$lang}}]"
>
<input
id=
"status[{{$lang}}]"
name=
"status[{{$lang}}]"
type=
"checkbox"
class=
"flat-blue"
{{
(
bool
)$
menuItem-
>
translate($lang)->status ? 'checked' : '' }}
value="1" />
{{ trans('menu::menu.form.status') }}
</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