FEATURE: add template check on content overview

This commit is contained in:
Michal Kváček
2016-09-20 14:47:38 +02:00
parent df9ff7b259
commit e8b91db6f2
4 changed files with 85 additions and 64 deletions
@@ -4,6 +4,12 @@
@section('content')
@if(!count($templates))
<div class="alert alert-warning">
@lang('admin/contents.noTemplates')
</div>
@endif
<form method="POST" enctype="multipart/form-data" action="{{route('content.editPost', ['pageId' => $page->id])}}">
{!! csrf_field() !!}
@@ -35,11 +35,17 @@
<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])}}">
@if(!empty($page->title_photo))
<img src="@upload($page->title_photo)" class="placeholder" alt="{{$page->title}}" />
@if(!view()->exists(\App\Helpers\Template::name($page->template, false)))
<i class="fa fa-2x text-warning fa-warning" data-toggle="tooltip"
title="@lang('admin/contents.invalidTemplateSelected')"></i>
@else
<img src="{{asset('resources/assets/admin/img/placeholder.png')}}" class="placeholder"
alt="{{$page->title}}" />
@if(!empty($page->title_photo))
<img src="@upload($page->title_photo)" class="placeholder" alt="{{$page->title}}" />
@else
<img src="{{asset('resources/assets/admin/img/placeholder.png')}}"
class="placeholder"
alt="{{$page->title}}" />
@endif
@endif
</a>
</div>
@@ -71,14 +77,16 @@
@if(!$page->is_homepage)
<li>
<a href="{{route('content.setHomepage', ['id' => $page->id])}}" data-toggle="tooltip" title="@lang('admin/contents.setHomepage')">
<a href="{{route('content.setHomepage', ['id' => $page->id])}}"
data-toggle="tooltip" title="@lang('admin/contents.setHomepage')">
<i class="fa fa-home"></i>
</a>
</li>
@endif
<li>
<a class="edit" href="{{route('content.edit', ['id' => $page->id])}}" data-toggle="tooltip" title="@lang('admin/contents.editPlain')">
<a class="edit" href="{{route('content.edit', ['id' => $page->id])}}"
data-toggle="tooltip" title="@lang('admin/contents.editPlain')">
<i class="fa fa-pencil"></i>
</a>
</li>
@@ -86,7 +94,8 @@
@if($page->status == \App\Models\Content::STATUS_DRAFT)
<li>
<a href="{{route('content.changeStatus', ['id' => $page->id, 'status' => \App\Models\Content::STATUS_PUBLIC])}}"
class="confirm" data-toggle="tooltip" title="@lang('admin/contents.makePublic')">
class="confirm" data-toggle="tooltip"
title="@lang('admin/contents.makePublic')">
<i class="fa fa-eye"></i>
</a>
</li>
@@ -115,7 +124,8 @@
<li>
<a href="{{route('content.delete', ['id' => $page->id])}}"
class="button tiny alert remove confirm" data-toggle="tooltip" title="@lang('admin/contents.deletePage')"><i
class="button tiny alert remove confirm" data-toggle="tooltip"
title="@lang('admin/contents.deletePage')"><i
class="fa fa-trash-o"></i>
</a>
</li>