Files
nhgooi.nl/resources/views/calendarlist.blade.php
2024-05-14 15:05:39 +02:00

113 lines
5.3 KiB
PHP

@extends('layouts/sidebar')
@section('title')
Regioagenda
@endsection
@section('page_class')
news_post post_container breadcrumb_no_border
@endsection
@section('page_container_class')
grey_background
@endsection
@section('site_container_class')
grey_background
@endsection
@section('content_class')
@endsection
@section('breadcrumb')
<ul class="bread_crumb">
<li><a title="Home" href="/">Home</a></li>
<li class="separator"><i class="fa-solid fa-chevron-right"></i></li>
<li>Regio-agenda</li>
</ul>
@endsection
@if(!count($events))
@section('content')
<div class="page_body margin_bottom">
<p>Er zijn geen items in de regioagenda. Iets te melden? Mail het naar {{Html::mailto("info@nhgooi.nl")}}
.</p>
</div>
@endsection
@else
@section('content')
@parent
<div data-tabs class="page_body">
<div class="tabs">
<h4 data-tab-content-id="tab_previous" class="box_header small flex-grow-1"><span>Eerder</span></h4>
<h4 data-tab-content-id="tab_current_week" class="box_header small flex-grow-1 active"><span>Komende week</span></h4>
<h4 data-tab-content-id="tab_everything" class="box_header small flex-grow-1"><span>Toon alles</span></h4>
<h4 data-tab-content-id="tab_next" class="box_header small"><span>Later</span></h4>
</div>
@php($tabs = [
[
'id' => 'tab_previous',
'start' => new DateTime('1-1-1990'),
'end' => new DateTime('sunday previous week'),
],
[
'id' => 'tab_current_week',
'start' => new DateTime('monday this week'),
'end' => new DateTime('sunday this week'),
],
[
'id' => 'tab_everything',
'start' => new DateTime('1-1-1990'),
'end' => new DateTime('31-12-3000'),
],
[
'id' => 'tab_next',
'start' => new DateTime('monday next week'),
'end' => new DateTime('31-12-3000'),
]
])
@foreach($tabs as $tab)
<div style="padding: 0" class="tab_content{{$tab['id'] == 'tab_current_week' ? ' active' : ''}}" id="{{$tab['id']}}">
@php($count = 0)
@foreach($events as $event)
@if($event->starts >= $tab['start'] && $event->ends <= $tab['end'])
@php($count++)
<?php $url = route('agenda.details', ['id' => $event->id, 'title' => $event->title]); ?>
<div class="box featured">
<div class="row">
<div class="col-12 col-md-6">
<a href="{{$url}}" title="{{$event->title}}">
<img src="{{$event->images && $event->images[0] && $event->images[0]->url ? $imgBase . $event->images[0]->url : '/images/noimage.png'}}"/>
</a>
</div>
<div class="col-12 col-md-6">
<h2 class="post_title"><a href="{{$url}}" title="{{$event->title}}">{!!$event->title!!}</a></h2>
<div class="sub_title" style="flex-wrap: wrap">
<ul class="post_tags" style="width: 100%; margin: 0 0 8px 0;height: 25px;">
<li><a style="padding: 3px 8px 3px" title="{{$event->region}}">{{$event->region}}</a></li>
</ul>
<span class="post_date" style="line-height: 1.17; height: 14px;" title="{{Formatter::relativeDate($event->starts, 'W d m y?')}}">
<i class="fa-regular fa-clock"></i> {{Formatter::relativeDate($event->starts, 'W d m y?')}}
@if($event->ends && $event->starts != $event->ends)
t/m {{strtolower(Formatter::relativeDate($event->ends, 'W d m y?'))}}
@endif
</span>
</div>
<p class="clipText clipText-7" title="{{Formatter::excerpt($event->content, 150)}}">
{!!Formatter::excerpt($event->content, 150)!!}
</p>
<a class="btn fit_content" href="{{$url}}">Lees verder</a>
</div>
</div>
</div>
@endif
@endforeach
@if($count == 0)
<p>Er zijn geen items gevonden. Iets te melden? Mail het naar <a href="mailto:info@nhgooi.nl">info@nhgooi.nl</a>.</p>
@endif
</div>
@endforeach
</div>
@endsection
@endif