FEATURE: prepare hotels template
This commit is contained in:
@@ -0,0 +1,26 @@
|
|||||||
|
<?php
|
||||||
|
namespace Templates\PragueTennisCamp\Pipeline;
|
||||||
|
|
||||||
|
use App\CMS\Contracts\Content\DisplayPipeline\Process;
|
||||||
|
use App\Models\Content\Content;
|
||||||
|
use Modules\Categories\Entities\Category;
|
||||||
|
|
||||||
|
class AddHotelsCategory implements Process
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Process and modify given page
|
||||||
|
*
|
||||||
|
* @param Content $page
|
||||||
|
*
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
|
function handle(Content & $page)
|
||||||
|
{
|
||||||
|
if ($page->template == 'staticpages::pageWithHotels') {
|
||||||
|
$category = Category::where('url', 'hotels')
|
||||||
|
->first();
|
||||||
|
|
||||||
|
$page->hotelsCategory = $category;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -5,7 +5,8 @@ use App\CMS\Contracts\Content\DisplayPipeline\Process;
|
|||||||
use App\Models\Content\Content;
|
use App\Models\Content\Content;
|
||||||
use Modules\Categories\Entities\Category;
|
use Modules\Categories\Entities\Category;
|
||||||
|
|
||||||
class AddTraineeTeamCategory implements Process {
|
class AddTraineeTeamCategory implements Process
|
||||||
|
{
|
||||||
/**
|
/**
|
||||||
* Process and modify given page
|
* Process and modify given page
|
||||||
*
|
*
|
||||||
@@ -15,9 +16,11 @@ class AddTraineeTeamCategory implements Process {
|
|||||||
*/
|
*/
|
||||||
function handle(Content & $page)
|
function handle(Content & $page)
|
||||||
{
|
{
|
||||||
$category = Category::where('url', 'trenersky-tym')
|
if ($page->template == 'staticpages::traineeTeam' || $page->isHomepage == true) {
|
||||||
->first();
|
$category = Category::where('url', 'trenersky-tym')
|
||||||
|
->first();
|
||||||
|
|
||||||
$page->traineeTeamCategory = $category;
|
$page->traineeTeamCategory = $category;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3,6 +3,7 @@ namespace Templates\PragueTennisCamp\Providers;
|
|||||||
|
|
||||||
use App\CMS\Helpers\Template;
|
use App\CMS\Helpers\Template;
|
||||||
use Modules\ContactForm\Widgets\Form\Presenter;
|
use Modules\ContactForm\Widgets\Form\Presenter;
|
||||||
|
use Templates\PragueTennisCamp\Pipeline\AddHotelsCategory;
|
||||||
use Templates\PragueTennisCamp\Pipeline\AddTraineeTeamCategory;
|
use Templates\PragueTennisCamp\Pipeline\AddTraineeTeamCategory;
|
||||||
|
|
||||||
class ServiceProvider extends \Illuminate\Support\ServiceProvider {
|
class ServiceProvider extends \Illuminate\Support\ServiceProvider {
|
||||||
@@ -24,5 +25,6 @@ class ServiceProvider extends \Illuminate\Support\ServiceProvider {
|
|||||||
|
|
||||||
$pipeline = app('displayPipeline');
|
$pipeline = app('displayPipeline');
|
||||||
$pipeline->add(AddTraineeTeamCategory::class);
|
$pipeline->add(AddTraineeTeamCategory::class);
|
||||||
|
$pipeline->add(AddHotelsCategory::class);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+17
@@ -0,0 +1,17 @@
|
|||||||
|
@if (isset($page->hotelsCategory))
|
||||||
|
<div class="hotels">
|
||||||
|
<h2>{{$page->hotelsCategory->name}}</h2>
|
||||||
|
|
||||||
|
@foreach($page->hotelsCategory->content as $i => $subpage)
|
||||||
|
<div class="column"
|
||||||
|
data-equalizer-watch>
|
||||||
|
@if(!empty($subpage->titlePhoto))
|
||||||
|
<img class="thumbnail" src="@upload($subpage->titlePhoto)" alt="{{$subpage->title}}">
|
||||||
|
@endif
|
||||||
|
<h4>{{$subpage->title}}</h4>
|
||||||
|
|
||||||
|
{!! $subpage->pageContent !!}
|
||||||
|
</div>
|
||||||
|
@endforeach
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
+19
@@ -0,0 +1,19 @@
|
|||||||
|
@php $images = $page->files()->where('mime_type', 'like', 'image%')->get(); @endphp
|
||||||
|
@if(count($images) > 0)
|
||||||
|
<div class="orbit" role="region" data-orbit
|
||||||
|
data-options="animationDuration:3000; animInFromLeft:fade-in; animInFromRight:fade-in; animOutToLeft:fade-out; animOutToRight:fade-out;">
|
||||||
|
<ul class="orbit-container">
|
||||||
|
@foreach($images as $i => $image)
|
||||||
|
<li class="orbit-slide slow @if($i == 0) is-active @endif">
|
||||||
|
<img class="orbit-image" src="@upload($image->filename)" alt="" />
|
||||||
|
</li>
|
||||||
|
@endforeach
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<nav class="orbit-bullets">
|
||||||
|
@foreach($images as $i => $image)
|
||||||
|
<button @if($i == 0) class="is-active" @endif data-slide="{{$i}}"></button>
|
||||||
|
@endforeach
|
||||||
|
</nav>
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
+8
-8
@@ -5,14 +5,14 @@
|
|||||||
@foreach($page->traineeTeamCategory->content as $i => $subpage)
|
@foreach($page->traineeTeamCategory->content as $i => $subpage)
|
||||||
<div class="column text-center small-12 medium-{{ceil(12/count($page->traineeTeamCategory->content))}}"
|
<div class="column text-center small-12 medium-{{ceil(12/count($page->traineeTeamCategory->content))}}"
|
||||||
data-equalizer-watch>
|
data-equalizer-watch>
|
||||||
<a href="{{route('page.content', ['url' => $subpage->url])}}">
|
@if(empty($subpage->titlePhoto))
|
||||||
@if(empty($subpage->titlePhoto))
|
<img class="thumbnail" src="@asset('visitor/images/avatar.png')" alt="{{$subpage->title}}">
|
||||||
<img class="thumbnail" src="@asset('visitor/images/avatar.png')" alt="{{$subpage->title}}">
|
@else
|
||||||
@else
|
<img class="thumbnail" src="@upload($subpage->titlePhoto)" alt="{{$subpage->title}}">
|
||||||
<img class="thumbnail" src="@upload($subpage->titlePhoto)" alt="{{$subpage->title}}">
|
@endif
|
||||||
@endif
|
<h4>{{$subpage->title}}</h4>
|
||||||
<h4>{{$subpage->title}}</h4>
|
|
||||||
</a>
|
{!! $subpage->pageContent !!}
|
||||||
</div>
|
</div>
|
||||||
@endforeach
|
@endforeach
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
+4
-22
@@ -23,29 +23,11 @@
|
|||||||
@endsection
|
@endsection
|
||||||
|
|
||||||
@section('content')
|
@section('content')
|
||||||
@php $images = $page->files()->where('mime_type', 'like', 'image%')->get(); @endphp
|
@include('modules.staticpages.visitor._partials.slider')
|
||||||
@if(count($images) > 0)
|
<header class="hide-for-small-only top-bar centered text-center">
|
||||||
<div class="orbit" role="region" data-orbit
|
@widgetArea('mainMenu')
|
||||||
data-options="animationDuration:3000; animInFromLeft:fade-in; animInFromRight:fade-in; animOutToLeft:fade-out; animOutToRight:fade-out;">
|
</header>
|
||||||
<ul class="orbit-container">
|
|
||||||
@foreach($images as $i => $image)
|
|
||||||
<li class="orbit-slide slow @if($i == 0) is-active @endif">
|
|
||||||
<img class="orbit-image" src="@upload($image->filename)" alt="" />
|
|
||||||
</li>
|
|
||||||
@endforeach
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<nav class="orbit-bullets">
|
|
||||||
@foreach($images as $i => $image)
|
|
||||||
<button @if($i == 0) class="is-active" @endif data-slide="{{$i}}"></button>
|
|
||||||
@endforeach
|
|
||||||
</nav>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<header class="hide-for-small-only top-bar centered text-center">
|
|
||||||
@widgetArea('mainMenu')
|
|
||||||
</header>
|
|
||||||
@endif
|
|
||||||
|
|
||||||
<div class="row content-container">
|
<div class="row content-container">
|
||||||
{!! $page->pageContent !!}
|
{!! $page->pageContent !!}
|
||||||
|
|||||||
+23
@@ -0,0 +1,23 @@
|
|||||||
|
@extendVisitor('defaultLayout')
|
||||||
|
|
||||||
|
@section('bodyClass', 'photo-bg')
|
||||||
|
|
||||||
|
@section('topMenu')
|
||||||
|
@include(\App\CMS\Helpers\Template::name('commonHeader'))
|
||||||
|
@endsection
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
|
||||||
|
@if (!empty($page->titlePhoto))
|
||||||
|
<div class="row title-photo">
|
||||||
|
<img src="@upload($page->titlePhoto)" alt="">
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
<div class="row content-container">
|
||||||
|
<h1>{{$page->title}}</h1>
|
||||||
|
|
||||||
|
{!! $page->pageContent !!}
|
||||||
|
|
||||||
|
@include('modules.staticpages.visitor._partials.hotelList')
|
||||||
|
</div>
|
||||||
|
@endsection
|
||||||
Reference in New Issue
Block a user