REFACTORING #1880 @4h30m: another ugly refactoring commit

This commit is contained in:
Michal Kváček
2016-10-25 16:50:04 +02:00
parent 28f67ffe3c
commit cc999dd24e
71 changed files with 827 additions and 608 deletions
@@ -1,9 +1,9 @@
@if($page->title_photo)
@if($page->titlePhoto)
<div class="row">
<div id="titlePhotoContainer"
class="col-lg-4 col-lg-offset-4 col-md-6 col-md-offset-3 col-sm-12 title-photo text-center">
<input type="hidden" id="existingTitlePhoto" value="{{$page->title_photo}}" name="existingTitlePhoto">
<p><img src="@thumbnail($page->title_photo)" alt="" /></p>
<input type="hidden" id="existingTitlePhoto" value="{{$page->titlePhoto}}" name="existingTitlePhoto">
<p><img src="@thumbnail($page->titlePhoto)" alt="" /></p>
<p>
<a href="javascript:void(0)" id="removeTitlePhoto" class="btn btn-warning" data-toggle="tooltip"
title="@lang('admin/contents.deleteTitlePhoto')"><i
@@ -39,12 +39,12 @@
@include('admin.snippets.hasError', ['field' => 'status'])
</div>
<div class="col-lg-6">
<select class="form-control" name="parentPage">
<select class="form-control" name="parentId">
<option value="">@lang('admin/contents.noParentPage')</option>
@foreach($rootPages as $rootPage)
<option value="{{$rootPage->id}}"
@if(old('parent_page', $page->parent_id) == $rootPage->id) selected @endif>
@if(old('parentId', $page->parentId) == $rootPage->id) selected @endif>
{{$rootPage->title}}
</option>
@endforeach
@@ -55,11 +55,11 @@
@if($module->support_categories && count($categories))
<div class="col-lg-12">
<select class="form-control" name="category">
<select class="form-control" name="categoryId">
<option value="">@lang('admin/contents.noCategory')</option>
@foreach($categories as $category)
<option value="{{$category->id}}"
@if($category->id == old('category', $page->category_id)) selected @endif>
@if($category->id == old('categoryId', $page->categoryId)) selected @endif>
{{str_repeat(' - ', $category->real_depth)}} {{$category->name}}
</option>
@endforeach
@@ -71,7 +71,7 @@
<div class="row">
<div class="col-lg-12">
<textarea name="pageContent" id="pageContent" rows="15" class="wysiwyg-editor">
{{old('pageContent', $page->content)}}
{{old('pageContent', $page->pageContent)}}
</textarea>
</div>
</div>
@@ -4,7 +4,7 @@
@lang('admin/contents.field_meta_keywords')
</label>
<input type="text" name="metaKeywords" class="form-control" value="{{old('meta_keywords', $page->meta_keywords)}}" placeholder="@lang('admin/contents.field_meta_keywords')" />
<input type="text" name="metaKeywords" class="form-control" value="{{old('metaKeywords', $page->metaKeywords)}}" placeholder="@lang('admin/contents.field_meta_keywords')" />
</div>
</div>
<div class="row">
@@ -14,6 +14,6 @@
</label>
<textarea class="form-control" name="metaDescription" placeholder="@lang('admin/contents.field_meta_description')" rows="5">{{old('meta_description', $page->meta_description)}}</textarea>
<textarea class="form-control" name="metaDescription" placeholder="@lang('admin/contents.field_meta_description')" rows="5">{{old('metaDescription', $page->metaDescription)}}</textarea>
</div>
</div>
@@ -1,22 +1,22 @@
<div class="row">
<div class="col-lg-6">
<label class="control-label">
@lang('admin/contents.field_published_from')
@lang('admin/contents.field_publishedFrom')
</label>
<input type="datetime" class="form-control" name="publishedFrom" value="{{old('published_from', $page->published_from)}}"
placeholder="@lang('admin/contents.field_published_from')" />
<input type="datetime" class="form-control" name="publishedFrom" value="{{old('publishedFrom', $page->publishedFrom)}}"
placeholder="@lang('admin/contents.field_publishedFrom')" />
@include('admin.snippets.hasError', ['field' => 'published_from'])
@include('admin.snippets.hasError', ['field' => 'publishedFrom'])
</div>
<div class="col-lg-6">
<label class="control-label">
@lang('admin/contents.field_published_to')
@lang('admin/contents.field_publishedTo')
</label>
<input type="datetime" class="form-control" name="publishedTo" value="{{old('published_to', $page->published_to)}}"
placeholder="@lang('admin/contents.field_published_to')" />
@include('admin.snippets.hasError', ['field' => 'published_to'])
<input type="datetime" class="form-control" name="publishedTo" value="{{old('publishedTo', $page->publishedTo)}}"
placeholder="@lang('admin/contents.field_publishedTo')" />
@include('admin.snippets.hasError', ['field' => 'publishedTo'])
</div>
</div>
@@ -1,6 +1,6 @@
@extends('admin.layoutWithNavigation')
@section('pageHeading', @trans(isset($pageHeading) ? $pageHeading : 'admin/contents.overview'))
@section('pageHeading', @trans($pageHeading))
@section('headerButtons')
@if($module->exists === true)
@@ -34,13 +34,13 @@
@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', ['url' => $page->url])}}">
@if(!view()->exists(\App\CMS\Helpers\Template::name($page->template, false)))
<a href="{{route('content.edit', ['id' => $page->id])}}">
@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>
@else
@if(!empty($page->title_photo))
<img src="@thumbnail($page->title_photo)" class="placeholder"
@if(!empty($page->titlePhoto))
<img src="@thumbnail($page->titlePhoto)" class="placeholder"
alt="{{$page->title}}" />
@else
<img src="{{asset('resources/assets/admin/img/placeholder.png')}}"
@@ -51,11 +51,11 @@
</a>
</div>
<div class="col-xs-10 col-md-3 col-lg-4">
<a href="{{route('content.edit', ['url' => $page->url])}}">
<a href="{{route('content.edit', ['id' => $page->id])}}">
{{$page->title}}
</a>
@if($page->is_homepage) <span class="m-l-10 tag tag-primary">@lang('admin/contents.homepage')</span> @endif
@if($page->isHomepage) <span class="m-l-10 tag tag-primary">@lang('admin/contents.homepage')</span> @endif
</div>
<div class="col-lg-2 col-md-3 hidden-sm-down">
<span class="tag @if($page->isPublic()) tag-success
@@ -81,7 +81,7 @@
<div class="item-actions-block">
<ul class="item-actions-list">
@if(!$page->is_homepage)
@if(!$page->isHomepage)
<li>
<a href="{{route('content.setHomepage', ['id' => $page->id])}}"
@@ -92,7 +92,7 @@
@endif
<li>
<a class="edit" href="{{route('content.edit', ['url' => $page->url])}}"
<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>
@@ -115,7 +115,7 @@
</li>
@else
<li>
<a href="{{route('page.content', ['url' => $page->url])}}" target="_blank"
<a href="{{route('page.content', ['id' => $page->id])}}" target="_blank"
data-toggle="tooltip" title="@lang('admin/contents.viewPage')"
class="button tiny secondary"><i class="fa fa-globe"></i>
</a>
@@ -11,8 +11,8 @@
<tr>
<td class="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(!empty($page->titlePhoto))
<img src="@upload($page->titlePhoto)" class="placeholder" alt="{{$page->title}}" />
@else
<img src="{{asset('resources/assets/admin/img/placeholder.png')}}" class="placeholder"
alt="{{$page->title}}" />