FEATURE: use more route model binding

This commit is contained in:
Michal Kváček
2017-08-01 19:10:55 +02:00
parent a7e91ef499
commit 3275e5aeed
22 changed files with 163 additions and 159 deletions
@@ -4,7 +4,7 @@
@section('headerButtons')
@if($module->exists === true)
<a href="{{route('content.new', ['moduleId' => $module->id])}}" class="btn btn-primary btn-sm rounded">
<a href="{{route('content.new', ['module' => $module])}}" class="btn btn-primary btn-sm rounded">
<i class="fa fa-plus"></i>
</a>
@endif
@@ -36,7 +36,7 @@
@foreach($pages as $page)
<div class="row p-tb-15">
<div class="col-md-1 hidden-sm-down text-center with-placeholder">
<a href="{{route('content.edit', ['id' => $page->id])}}">
<a href="{{route('content.edit', ['page' => $page])}}">
@if(!view()->exists(template_name($page->template, false)))
<i class="fa fa-2x text-warning fa-warning" data-toggle="tooltip"
title="@lang('admin/contents.invalidTemplateSelected')"></i>
@@ -53,7 +53,7 @@
</a>
</div>
<div class="col-xs-10 col-md-3 col-lg-4">
<a href="{{route('content.edit', ['id' => $page->id])}}">
<a href="{{route('content.edit', ['page' => $page])}}">
{{$page->title}}
</a>
@@ -66,7 +66,7 @@
@else tag-warning @endif">{{$statuses[$page->status]}}</span>
</div>
<div class="col-lg-2 col-md-3 hidden-sm-down">
<a href="{{route('content.overview', ['moduleId' => $page->module_id])}}">
<a href="{{route('content.overview', ['module' => $page->module->alias])}}">
{{trans($page->module_name)}}
</a>
</div>
@@ -87,7 +87,7 @@
@if(!$page->isHomepage)
<li>
<a href="{{route('content.setHomepage', ['id' => $page->id])}}"
<a href="{{route('content.setHomepage', ['page' => $page])}}"
data-toggle="tooltip"
title="@lang('admin/contents.setHomepage')">
<i class="fa fa-home"></i>
@@ -96,7 +96,7 @@
@endif
<li>
<a class="edit" href="{{route('content.edit', ['id' => $page->id])}}"
<a class="edit" href="{{route('content.edit', ['page' => $page])}}"
data-toggle="tooltip" title="@lang('admin/contents.editPlain')">
<i class="fa fa-pencil"></i>
</a>
@@ -104,14 +104,14 @@
@if($page->isDraft())
<li>
<a href="{{route('content.changeStatus', ['id' => $page->id, 'status' => 'public'])}}"
<a href="{{route('content.changeStatus', ['page' => $page, 'status' => 'public'])}}"
class="confirm" data-toggle="tooltip"
title="@lang('admin/contents.makePublic')">
<i class="fa fa-eye"></i>
</a>
</li>
<li>
<a href="{{route('content.changeStatus', ['id' => $page->id, 'status' => 'protected'])}}"
<a href="{{route('content.changeStatus', ['page' => $page, 'status' => 'protected'])}}"
class="confirm" data-toggle="tooltip"
title="@lang('admin/contents.makeProtected')">
<i class="fa fa-lock"></i>
@@ -126,7 +126,7 @@
</a>
</li>
<li>
<a href="{{route('content.changeStatus', ['id' => $page->id, 'status' => 'draft'])}}"
<a href="{{route('content.changeStatus', ['page' => $page, 'status' => 'draft'])}}"
class="button tiny warning confirm" data-toggle="tooltip"
title="@lang('admin/contents.makeDraft')">
<i class="fa fa-eye-slash"></i>
@@ -135,7 +135,7 @@
@endif
<li>
<a href="{{route('content.delete', ['id' => $page->id])}}"
<a href="{{route('content.delete', ['page' => $page])}}"
class="button tiny alert remove confirm" data-toggle="tooltip"
title="@lang('admin/contents.deletePage')"><i
class="fa fa-trash-o"></i>