Commit 0ba6e088 authored by Nicolas Widart's avatar Nicolas Widart Committed by GitHub

Merge pull request #411 from JulienTant/fix/blade-markup-in-menu

Use blade directive in Menu module
parents 13d5416d 85778546
...@@ -23,21 +23,23 @@ ...@@ -23,21 +23,23 @@
<div class="nav-tabs-custom"> <div class="nav-tabs-custom">
<ul class="nav nav-tabs"> <ul class="nav nav-tabs">
<?php $i = 0; ?> <?php $i = 0; ?>
<?php foreach (LaravelLocalization::getSupportedLocales() as $locale => $language): ?> @foreach (LaravelLocalization::getSupportedLocales() as $locale => $language)
<?php $i++; ?> <?php $i++; ?>
<li class="{{ App::getLocale() == $locale ? 'active' : '' }}"> <li class="{{ App::getLocale() == $locale ? 'active' : '' }}">
<a href="#tab_{{ $i }}" data-toggle="tab">{{ trans('core::core.tab.'. strtolower($language['name'])) }}</a> <a href="#tab_{{ $i }}" data-toggle="tab">
{{ trans('core::core.tab.'. strtolower($language['name'])) }}
</a>
</li> </li>
<?php endforeach; ?> @endforeach
</ul> </ul>
<div class="tab-content"> <div class="tab-content">
<?php $i = 0; ?> <?php $i = 0; ?>
<?php foreach (LaravelLocalization::getSupportedLocales() as $locale => $language): ?> @foreach (LaravelLocalization::getSupportedLocales() as $locale => $language): ?>
<?php $i++; ?> <?php $i++; ?>
<div class="tab-pane {{ App::getLocale() == $locale ? 'active' : '' }}" id="tab_{{ $i }}"> <div class="tab-pane {{ App::getLocale() == $locale ? 'active' : '' }}" id="tab_{{ $i }}">
@include('menu::admin.menuitems.partials.create-trans-fields', ['lang' => $locale]) @include('menu::admin.menuitems.partials.create-trans-fields', ['lang' => $locale])
</div> </div>
<?php endforeach; ?> @endforeach
</div> </div>
</div> </div>
</div> </div>
......
...@@ -23,21 +23,23 @@ ...@@ -23,21 +23,23 @@
<div class="nav-tabs-custom"> <div class="nav-tabs-custom">
<ul class="nav nav-tabs"> <ul class="nav nav-tabs">
<?php $i = 0; ?> <?php $i = 0; ?>
<?php foreach (LaravelLocalization::getSupportedLocales() as $locale => $language): ?> @foreach (LaravelLocalization::getSupportedLocales() as $locale => $language)
<?php $i++; ?> <?php $i++; ?>
<li class="{{ App::getLocale() == $locale ? 'active' : '' }}"> <li class="{{ App::getLocale() == $locale ? 'active' : '' }}">
<a href="#tab_{{ $i }}" data-toggle="tab">{{ trans('core::core.tab.'. strtolower($language['name'])) }}</a> <a href="#tab_{{ $i }}" data-toggle="tab">
{{ trans('core::core.tab.'. strtolower($language['name'])) }}
</a>
</li> </li>
<?php endforeach; ?> @endforeach
</ul> </ul>
<div class="tab-content"> <div class="tab-content">
<?php $i = 0; ?> <?php $i = 0; ?>
<?php foreach (LaravelLocalization::getSupportedLocales() as $locale => $language): ?> @foreach (LaravelLocalization::getSupportedLocales() as $locale => $language)
<?php $i++; ?> <?php $i++; ?>
<div class="tab-pane {{ App::getLocale() == $locale ? 'active' : '' }}" id="tab_{{ $i }}"> <div class="tab-pane {{ App::getLocale() == $locale ? 'active' : '' }}" id="tab_{{ $i }}">
@include('menu::admin.menuitems.partials.edit-trans-fields', ['lang' => $locale]) @include('menu::admin.menuitems.partials.edit-trans-fields', ['lang' => $locale])
</div> </div>
<?php endforeach; ?> @endforeach
</div> </div>
</div> </div>
</div> </div>
......
...@@ -12,18 +12,18 @@ ...@@ -12,18 +12,18 @@
<label for="page">{{ trans('menu::menu-items.form.page') }}</label> <label for="page">{{ trans('menu::menu-items.form.page') }}</label>
<select class="form-control" name="page_id" id="page"> <select class="form-control" name="page_id" id="page">
<option value=""></option> <option value=""></option>
<?php foreach ($pages as $page): ?> @foreach ($pages as $page)
<option value="{{ $page->id }}">{{ $page->title }}</option> <option value="{{ $page->id }}">{{ $page->title }}</option>
<?php endforeach; ?> @endforeach
</select> </select>
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="parent_id">{{ trans('menu::menu-items.form.parent menu item') }}</label> <label for="parent_id">{{ trans('menu::menu-items.form.parent menu item') }}</label>
<select class="form-control" name="parent_id" id="parent_id"> <select class="form-control" name="parent_id" id="parent_id">
<option value=""></option> <option value=""></option>
<?php foreach ($menuSelect as $parentMenuItemId => $parentMenuItemName): ?> @foreach ($menuSelect as $parentMenuItemId => $parentMenuItemName)
<option value="{{ $parentMenuItemId }}">{{ $parentMenuItemName }}</option> <option value="{{ $parentMenuItemId }}">{{ $parentMenuItemName }}</option>
<?php endforeach; ?> @endforeach
</select> </select>
</div> </div>
......
...@@ -13,22 +13,22 @@ ...@@ -13,22 +13,22 @@
<label for="page">{{ trans('menu::menu-items.form.page') }}</label> <label for="page">{{ trans('menu::menu-items.form.page') }}</label>
<select class="form-control" name="page_id" id="page"> <select class="form-control" name="page_id" id="page">
<option value=""></option> <option value=""></option>
<?php foreach ($pages as $page): ?> @foreach ($pages as $page)
<option value="{{ $page->id }}" {{ $menuItem->page_id == $page->id ? 'selected' : '' }}> <option value="{{ $page->id }}" {{ $menuItem->page_id == $page->id ? 'selected' : '' }}>
{{ $page->title }} {{ $page->title }}
</option> </option>
<?php endforeach; ?> @endforeach
</select> </select>
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="parent_id">{{ trans('menu::menu-items.form.parent menu item') }}</label> <label for="parent_id">{{ trans('menu::menu-items.form.parent menu item') }}</label>
<select class="form-control" name="parent_id" id="parent_id"> <select class="form-control" name="parent_id" id="parent_id">
<option value=""></option> <option value=""></option>
<?php foreach ($menuSelect as $parentMenuItemId => $parentMenuItemName): ?> @foreach ($menuSelect as $parentMenuItemId => $parentMenuItemName)
<?php if ($menuItem->id != $parentMenuItemId): ?> @if ($menuItem->id != $parentMenuItemId)
<option value="{{ $parentMenuItemId }}" {{ $menuItem->parent_id == $parentMenuItemId ? ' selected' : '' }}>{{ $parentMenuItemName }}</option> <option value="{{ $parentMenuItemId }}" {{ $menuItem->parent_id == $parentMenuItemId ? ' selected' : '' }}>{{ $parentMenuItemName }}</option>
<?php endif; ?> @endif
<?php endforeach; ?> @endforeach
</select> </select>
</div> </div>
<div class="form-group"> <div class="form-group">
......
...@@ -23,21 +23,23 @@ ...@@ -23,21 +23,23 @@
<div class="nav-tabs-custom"> <div class="nav-tabs-custom">
<ul class="nav nav-tabs"> <ul class="nav nav-tabs">
<?php $i = 0; ?> <?php $i = 0; ?>
<?php foreach (LaravelLocalization::getSupportedLocales() as $locale => $language): ?> @foreach (LaravelLocalization::getSupportedLocales() as $locale => $language)
<?php $i++; ?> <?php $i++; ?>
<li class="{{ App::getLocale() == $locale ? 'active' : '' }}"> <li class="{{ App::getLocale() == $locale ? 'active' : '' }}">
<a href="#tab_{{ $i }}" data-toggle="tab">{{ trans('core::core.tab.'. strtolower($language['name'])) }}</a> <a href="#tab_{{ $i }}" data-toggle="tab">
{{ trans('core::core.tab.'. strtolower($language['name'])) }}
</a>
</li> </li>
<?php endforeach; ?> @endforeach
</ul> </ul>
<div class="tab-content"> <div class="tab-content">
<?php $i = 0; ?> <?php $i = 0; ?>
<?php foreach (LaravelLocalization::getSupportedLocales() as $locale => $language): ?> @foreach (LaravelLocalization::getSupportedLocales() as $locale => $language)
<?php $i++; ?> <?php $i++; ?>
<div class="tab-pane {{ App::getLocale() == $locale ? 'active' : '' }}" id="tab_{{ $i }}"> <div class="tab-pane {{ App::getLocale() == $locale ? 'active' : '' }}" id="tab_{{ $i }}">
@include('menu::admin.menus.partials.create-trans-fields', ['lang' => $locale]) @include('menu::admin.menus.partials.create-trans-fields', ['lang' => $locale])
</div> </div>
<?php endforeach; ?> @endforeach
</div> </div>
</div> </div>
</div> </div>
......
...@@ -41,21 +41,23 @@ ...@@ -41,21 +41,23 @@
<div class="nav-tabs-custom"> <div class="nav-tabs-custom">
<ul class="nav nav-tabs"> <ul class="nav nav-tabs">
<?php $i = 0; ?> <?php $i = 0; ?>
<?php foreach (LaravelLocalization::getSupportedLocales() as $locale => $language): ?> @foreach (LaravelLocalization::getSupportedLocales() as $locale => $language)
<?php $i++; ?> <?php $i++; ?>
<li class="{{ App::getLocale() == $locale ? 'active' : '' }}"> <li class="{{ App::getLocale() == $locale ? 'active' : '' }}">
<a href="#tab_{{ $i }}" data-toggle="tab">{{ trans('core::core.tab.'. strtolower($language['name'])) }}</a> <a href="#tab_{{ $i }}" data-toggle="tab">
{{ trans('core::core.tab.'. strtolower($language['name'])) }}
</a>
</li> </li>
<?php endforeach; ?> @endforeach
</ul> </ul>
<div class="tab-content"> <div class="tab-content">
<?php $i = 0; ?> <?php $i = 0; ?>
<?php foreach (LaravelLocalization::getSupportedLocales() as $locale => $language): ?> @foreach (LaravelLocalization::getSupportedLocales() as $locale => $language)
<?php $i++; ?> <?php $i++; ?>
<div class="tab-pane {{ App::getLocale() == $locale ? 'active' : '' }}" id="tab_{{ $i }}"> <div class="tab-pane {{ App::getLocale() == $locale ? 'active' : '' }}" id="tab_{{ $i }}">
@include('menu::admin.menus.partials.edit-trans-fields', ['lang' => $locale]) @include('menu::admin.menus.partials.edit-trans-fields', ['lang' => $locale])
</div> </div>
<?php endforeach; ?> @endforeach
</div> </div>
</div> </div>
</div> </div>
......
...@@ -34,8 +34,8 @@ ...@@ -34,8 +34,8 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<?php if (isset($menus)): ?> @isset($menus)
<?php foreach ($menus as $menu): ?> @foreach ($menus as $menu)
<tr> <tr>
<td> <td>
<a href="{{ route('admin.menu.menu.edit', [$menu->id]) }}"> <a href="{{ route('admin.menu.menu.edit', [$menu->id]) }}">
...@@ -49,13 +49,17 @@ ...@@ -49,13 +49,17 @@
</td> </td>
<td> <td>
<div class="btn-group"> <div class="btn-group">
<a href="{{ route('admin.menu.menu.edit', [$menu->id]) }}" class="btn btn-default btn-flat"><i class="glyphicon glyphicon-pencil"></i></a> <a href="{{ route('admin.menu.menu.edit', [$menu->id]) }}"
<button class="btn btn-danger btn-flat" data-toggle="modal" data-target="#confirmation-{{ $menu->id }}"><i class="glyphicon glyphicon-trash"></i></button> class="btn btn-default btn-flat"><i
class="glyphicon glyphicon-pencil"></i></a>
<button class="btn btn-danger btn-flat" data-toggle="modal"
data-target="#confirmation-{{ $menu->id }}"><i
class="glyphicon glyphicon-trash"></i></button>
</div> </div>
</td> </td>
</tr> </tr>
<?php endforeach; ?> @endforeach
<?php endif; ?> @endisset
</tbody> </tbody>
<tfoot> <tfoot>
<tr> <tr>
...@@ -71,8 +75,8 @@ ...@@ -71,8 +75,8 @@
</div> </div>
</div> </div>
</div> </div>
<?php if (isset($menus)): ?> @isset($menus)
<?php foreach ($menus as $menu): ?> @foreach ($menus as $menu)
<!-- Modal --> <!-- Modal -->
<div class="modal fade modal-danger" id="confirmation-{{ $menu->id }}" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> <div class="modal fade modal-danger" id="confirmation-{{ $menu->id }}" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog"> <div class="modal-dialog">
...@@ -93,8 +97,8 @@ ...@@ -93,8 +97,8 @@
</div> </div>
</div> </div>
</div> </div>
<?php endforeach; ?> @endforeach
<?php endif; ?> @endisset
@stop @stop
@section('footer') @section('footer')
......
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