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