Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use blade directive in Menu module #411

Merged
merged 1 commit into from
Oct 11, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions Modules/Menu/Resources/views/admin/menuitems/create.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
12 changes: 7 additions & 5 deletions Modules/Menu/Resources/views/admin/menuitems/edit.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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">
Expand Down
12 changes: 7 additions & 5 deletions Modules/Menu/Resources/views/admin/menus/create.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
12 changes: 7 additions & 5 deletions Modules/Menu/Resources/views/admin/menus/edit.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
24 changes: 14 additions & 10 deletions Modules/Menu/Resources/views/admin/menus/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -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]) }}">
Expand All @@ -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>
Expand All @@ -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">
Expand All @@ -93,8 +97,8 @@
</div>
</div>
</div>
<?php endforeach; ?>
<?php endif; ?>
@endforeach
@endisset
@stop

@section('footer')
Expand Down