REFACTORING #1880 @4h30m: another ugly refactoring commit
This commit is contained in:
@@ -40,7 +40,7 @@ abstract class OnePage implements TemplateHandler, InstallableModule
|
||||
public static function registerAdminMenu(User $user)
|
||||
{
|
||||
$menu = \Menu::instance('mainMenu');
|
||||
$menu->route('template.setHomepage', trans('template::admin/mainMenu.setHomepage'), [], 1, ['icon' => 'fa fa-fw fa-home']);
|
||||
// $menu->route('template.setHomepage', trans('template::admin/mainMenu.setHomepage'), [], 1, ['icon' => 'fa fa-fw fa-home']);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -92,7 +92,7 @@ abstract class OnePage implements TemplateHandler, InstallableModule
|
||||
*/
|
||||
public static function beforeRender(Content & $content)
|
||||
{
|
||||
if ($content->is_homepage) {
|
||||
if ($content->isHomepage) {
|
||||
$pages = self::getPagesOnHomepage();
|
||||
|
||||
// create real content from pages
|
||||
|
||||
@@ -48,7 +48,7 @@ class SetHomepage extends Controller
|
||||
$homepage = null;
|
||||
foreach ($allPages as $page) {
|
||||
|
||||
if ($page->is_homepage) {
|
||||
if ($page->isHomepage) {
|
||||
$homepage = $page;
|
||||
continue;
|
||||
}
|
||||
@@ -82,7 +82,7 @@ class SetHomepage extends Controller
|
||||
{
|
||||
$page = $this->content->getOne($id);
|
||||
|
||||
if ($page->is_homepage) {
|
||||
if ($page->isHomepage) {
|
||||
return redirect()
|
||||
->back()
|
||||
->with('error', trans('template::admin/setHomepage.cannotSetHomepageAsPartOfHomepage'));
|
||||
|
||||
@@ -66,7 +66,7 @@ Improvement: http://www.html5rocks.com/en/tutorials/dnd/basics/
|
||||
<a href="{{route('content.edit', ['id' => $page->id])}}"
|
||||
class="btn btn-secondary btn-sm"><i
|
||||
class="fa fa-fw fa-pencil"></i></a>
|
||||
@if(!$page->is_homepage)
|
||||
@if(!$page->isHomepage)
|
||||
<a href="{{route('content.setHomepage', ['id' => $page->id])}}"
|
||||
class="btn btn-secondary confirm btn-sm"
|
||||
data-toggle="tooltip" title="@lang('admin/contents.setHomepage')">
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
<div class="row article-list-item">
|
||||
<aside class="column text-right large-1">
|
||||
<div class="date">
|
||||
<span class="date day big">@customDate('j', $page->published_from ?: $page->created_at)</span>
|
||||
<span class="date uppercase month">@monthName($page->published_from ?: $page->created_at)</span>
|
||||
<span class="date day big">@customDate('j', $page->publishedFrom ?: $page->created_at)</span>
|
||||
<span class="date uppercase month">@monthName($page->publishedFrom ?: $page->created_at)</span>
|
||||
</div>
|
||||
<div class="m-t-25 author">
|
||||
<img class="gravatar" src="@gravatar($page->author->email, 50)" alt="">
|
||||
@@ -22,7 +22,7 @@
|
||||
@endif
|
||||
|
||||
|
||||
@if(isset($page->module_settings->allowComments) && $page->module_settings->allowComments != 0)
|
||||
@if(isset($page->moduleSettings->allowComments) && $page->moduleSettings->allowComments != 0)
|
||||
<div class="m-t-35">
|
||||
<a href="#comments">{{$page->comments->count()}} <i class="fa fa-comments"></i></a>
|
||||
</div>
|
||||
@@ -36,7 +36,7 @@
|
||||
</article>
|
||||
</div>
|
||||
</div>
|
||||
@if(isset($page->module_settings->allowComments) && $page->module_settings->allowComments != 0)
|
||||
@if(isset($page->moduleSettings->allowComments) && $page->moduleSettings->allowComments != 0)
|
||||
<div class="row m-t-50">
|
||||
<a name="comments"></a>
|
||||
|
||||
|
||||
@@ -14,9 +14,9 @@
|
||||
<div class="row">
|
||||
<aside class="column text-right large-3">
|
||||
<div class="date">
|
||||
<span class="date day big">@customDate('j', $article->published_from ?: $article->created_at)</span>
|
||||
<span class="date day big">@customDate('j', $article->publishedFrom ?: $article->created_at)</span>
|
||||
<br>
|
||||
<span class="date uppercase month">@monthName($article->published_from ?: $article->created_at)</span>
|
||||
<span class="date uppercase month">@monthName($article->publishedFrom ?: $article->created_at)</span>
|
||||
</div>
|
||||
<div class="m-t-15 author">
|
||||
{{--<small>{{str_limit($article->author->name, 15)}}</small>--}}
|
||||
@@ -37,7 +37,7 @@
|
||||
<a href="{{route('page.content', ['url' => $article->url])}}">více</a>
|
||||
</article>
|
||||
|
||||
@if(isset($article->module_settings->allowComments) && $article->module_settings->allowComments != 0 || $article->category)
|
||||
@if(isset($article->moduleSettings->allowComments) && $article->moduleSettings->allowComments != 0 || $article->category)
|
||||
<footer class="text-right">
|
||||
|
||||
@if($article->category)
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
@if(session('error'))
|
||||
<div class="callout alert">
|
||||
Zprávu bohužel nebylo možné odeslat, zkuste nám napsat na {{$page->module_settings->contactEmail}}.
|
||||
Zprávu bohužel nebylo možné odeslat, zkuste nám napsat na {{$page->moduleSettings->contactEmail}}.
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@@ -45,15 +45,15 @@
|
||||
</div>
|
||||
|
||||
<div class="small-8 column">
|
||||
<p><strong>{{$page->module_settings->companyName}}</strong></p>
|
||||
<p><strong>{{$page->moduleSettings->companyName}}</strong></p>
|
||||
<p>
|
||||
{!! nl2br($page->module_settings->address) !!}
|
||||
{!! nl2br($page->moduleSettings->address) !!}
|
||||
</p>
|
||||
<p><br></p>
|
||||
<p><a class="underline"
|
||||
href="mailto:{{$page->module_settings->email}}">{{$page->module_settings->email}}</a></p>
|
||||
href="mailto:{{$page->moduleSettings->email}}">{{$page->moduleSettings->email}}</a></p>
|
||||
<p><a class="thin"
|
||||
href="tel:{{str_replace(' ', '', $page->module_settings->phone)}}">{{$page->module_settings->phone}}</a>
|
||||
href="tel:{{str_replace(' ', '', $page->moduleSettings->phone)}}">{{$page->moduleSettings->phone}}</a>
|
||||
</p>
|
||||
</div>
|
||||
<div class="clearfix m-0"></div>
|
||||
|
||||
+2
-2
@@ -7,14 +7,14 @@
|
||||
<div class="row small-11 medium-11 large-11 xlarge-11 m-t-25 reference-gallery">
|
||||
<div class="row">
|
||||
<div class="ref-scr column xlarge-8 large-8 medium-4 m-b-25 p-lr-0 b-invo" data-img="" data-label="">
|
||||
<img class="thumbnail pointer" src="@upload($page->title_photo)" alt="{{$page->title}}">
|
||||
<img class="thumbnail pointer" src="@upload($page->titlePhoto)" alt="{{$page->title}}">
|
||||
</div>
|
||||
@foreach($page->files as $file)
|
||||
@if(!\Illuminate\Support\Str::startsWith($file->mime_type, 'image'))
|
||||
@continue;
|
||||
@endif
|
||||
<div class="ref-scr b-invo column xlarge-4 large-4 medium-4 small-6"
|
||||
data-img="@upload($page->title_photo)"
|
||||
data-img="@upload($page->titlePhoto)"
|
||||
data-label="{{$file->description}}">
|
||||
<img class="thumbnail pointer m-b-26" src="@upload($file->filename)"
|
||||
alt="{{$file->name}}">
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
<?php $counter++; ?>
|
||||
<div class="column reference-item @if($counter > 8) more-references @endif">
|
||||
<div class="holder">
|
||||
<img class="thumbnail" data-equalizer-watch src="@thumbnail($reference->title_photo)">
|
||||
<img class="thumbnail" data-equalizer-watch src="@thumbnail($reference->titlePhoto)">
|
||||
<div class="item-data">
|
||||
<h4>{{$reference->title}}</h4>
|
||||
<p>{{$reference->meta_description}}</p>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
@section('pageDescription', $page->meta_description)
|
||||
@section('pageKeywords', $page->meta_keywords)
|
||||
@section('pageTitleImage')
|
||||
@if (!empty($page->title_photo) && \App\CMS\Helpers\Template::upload($page->title_photo))@upload($page->title_photo)
|
||||
@if (!empty($page->titlePhoto) && \App\CMS\Helpers\Template::upload($page->titlePhoto))@upload($page->titlePhoto)
|
||||
@else{{asset_path('visitor/images/social-cover.png')}}@endif
|
||||
@endsection
|
||||
@endif
|
||||
@@ -28,7 +28,7 @@ class Handler extends OnePage
|
||||
* @param Content $content
|
||||
* @param Request $request
|
||||
*/
|
||||
public static function beforeSave(Content & $content, Request $request)
|
||||
public static function beforeSave(Content & $content, $request)
|
||||
{
|
||||
// nothing to do
|
||||
}
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="parallax"><img src="@upload($page->title_photo)" alt=""></div>
|
||||
<div class="parallax"><img src="@upload($page->titlePhoto)" alt=""></div>
|
||||
</div>
|
||||
|
||||
<div class="container">
|
||||
|
||||
@@ -28,7 +28,7 @@ class Handler extends OnePage
|
||||
* @param Content $content
|
||||
* @param Request $request
|
||||
*/
|
||||
public static function beforeSave(Content & $content, Request $request)
|
||||
public static function beforeSave(Content & $content, $request)
|
||||
{
|
||||
// nothing to do
|
||||
}
|
||||
|
||||
+5
-5
@@ -6,7 +6,7 @@
|
||||
|
||||
@if(session('error'))
|
||||
<div class="notification alert">
|
||||
Bohužel nebylo možné odeslat zprávu. Pošlete mi to prosím ručně na {{$page->module_settings->contactEmail}}.
|
||||
Bohužel nebylo možné odeslat zprávu. Pošlete mi to prosím ručně na {{$page->moduleSettings->contactEmail}}.
|
||||
Děkuji!
|
||||
</div>
|
||||
@endif
|
||||
@@ -23,12 +23,12 @@
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-5 text-right" style="font-size: 150%">
|
||||
@if (isset($page->module_settings->phone))
|
||||
<p><i class="fa fa-fw fa-mobile-phone"></i> {{$page->module_settings->phone}}</p>
|
||||
@if (isset($page->moduleSettings->phone))
|
||||
<p><i class="fa fa-fw fa-mobile-phone"></i> {{$page->moduleSettings->phone}}</p>
|
||||
@endif
|
||||
|
||||
@if (isset($page->module_settings->contactEmail))
|
||||
<p><i class="fa fa-fw fa-envelope-o"></i> {{$page->module_settings->contactEmail}}</p>
|
||||
@if (isset($page->moduleSettings->contactEmail))
|
||||
<p><i class="fa fa-fw fa-envelope-o"></i> {{$page->moduleSettings->contactEmail}}</p>
|
||||
@endif
|
||||
</div>
|
||||
<div class="col-lg-7">
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
@extendVisitor('layout')
|
||||
|
||||
@section('content')
|
||||
<header class="intro" style="background-image: url('@upload($page->title_photo)')">
|
||||
<header class="intro" style="background-image: url('@upload($page->titlePhoto)')">
|
||||
<div class="intro-body">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
|
||||
Reference in New Issue
Block a user