v1.4.4 Made news expiration date, add category to app homepages, made small css things

This commit is contained in:
2020-10-07 15:27:29 +02:00
parent f70d6a7a95
commit 22694bd0fb
15 changed files with 83 additions and 81 deletions
@@ -41,11 +41,13 @@
padding: 10px 10px;
font-size: 22px;
line-height: 30px;
display: flex;
flex-direction: column;
}
.img{
width: 1em;
height: calc(1em + 20px);
width: 2em;
height: calc(2em + 20px);
margin-top: 5px;
margin-bottom: 5px;
margin-left: 5px;
@@ -61,7 +63,7 @@
}
.img > a {
width: 100%;
width: 75%;
height: 100%;
display: flex;
justify-content: center;
@@ -103,12 +105,18 @@
</style>
<main style="justify-content: unset; padding: 0">
<?php
date_default_timezone_set('Europe/Copenhagen');
?>
@foreach($news as $new)
<!--Code to list events-->
@if($new->type == 'News')<!--Code that prints news-->
<div class="card">
<div class="img"><img src="{{URL::asset('/images/icons/news.svg')}}" alt="News:"></div>
<div class="title">{{ $new->subname }}</div>
<div class="title">
{{ $new->subname }}
<span class="createdat">{{__('msg.opret')}}{{ date('Y-m-d H:i:s', strtotime($new->created_at))}}</span>
</div>
@if($new->resource_id !== null)
<div class="header" style="background-size: cover; background-position: center; background-image: url('{{ asset(\App\Resource::query()->where("id", "=", $new->resource_id)->first()->filename) }}');"></div>
@endif
@@ -120,7 +128,10 @@
@elseif($new->type == 'Menu')<!--Code that prints menuplan -->
<div class="card">
<div class="img"><a href="{{ route('menu-plans.index') }}"><img src="{{URL::asset('/images/icons/Menuplan.svg')}}" alt="Menuplan:"></a></div>
<div class="title">{{ $new->subname }}</div>
<div class="title">
{{ $new->subname }}
<span class="createdat">{{__('msg.opret')}}{{ date('Y-m-d H:i:s', strtotime($new->created_at))}}</span>
</div>
@if($new->resource_id !== null)
<div class="header" style="background-size: cover; background-position: center; background-image: url('{{ asset(\App\Resource::query()->where("id", "=", $new->resource_id)->first()->filename) }}');"></div>
@endif
@@ -128,14 +139,16 @@
@if ($new->type_id == 1 || $new->type_id == 2) {{-- If it's a news or menu then display the whole message --}}
{!! $new->content !!}
@else {{-- If it's a menu, guide or event. Then display up to 300 characters of text --}}
{!! \App\Helpers::closetags(substr($new->content, 0, 300) ) !!}
{!! \App\Helpers::closetags(substr($new->content, 0, 500) ) !!}
@endif
</div>
</div>
@elseif($new->type == 'Activity')<!--Code that prints events-->
<div class="card">
<div class="img"><a href="{{ route('events.index') }}"><img src="{{URL::asset('/images/icons/Aktiviteter.svg')}}" alt="Aktiviteter:"></a></div>
<div class="title">{{ $new->subname }}</div>
<div class="title">{{ $new->subname }}
<span class="createdat">{{__('msg.opret')}}{{ date('Y-m-d H:i:s', strtotime($new->created_at))}}</span>
</div>
@if($new->resource_id !== null)
<div class="header" style="background-size: cover; background-position: center; background-image: url('{{ asset(\App\Resource::query()->where("id", "=", $new->resource_id)->first()->filename) }}');"></div>
<div class="information">{{ \Illuminate\Support\Facades\Date::createFromTimeStamp(strtotime(\App\Event::query()->where('id', '=', $new->arrangement_id)->first()->date))->format('d/m/Y \k\l\. H:i') }} | {{\App\Event::query()->where('id', '=', $new->arrangement_id)->first()->accountable}} </div>
@@ -170,9 +183,12 @@
@else<!--Code that prints guides-->
<div class="card">
<div class="img"><a href="{{ route('guides.index') }}"><img src="{{URL::asset('/images/icons/Vejledninger.svg')}}" alt="Vejledninger:"></a></div>
<div class="title">{{ $new->subname }}</div>
<div class="title">{{ $new->subname }}
<span class="createdat">{{__('msg.opret')}}{{ date('Y-m-d H:i:s', strtotime($new->created_at))}}</span>
</div>
@if($new->resource_id !== null)
<div class="header" style="background-size: cover; background-position: center; background-image: url('{{ asset(\App\Resource::query()->where("id", "=", $new->resource_id)->first()->filename) }}');"></div>
<div class="information">{{__('msg.kategori')}}: {{\App\GuidesCategory::query()->where('id', '=', \App\Guide::query()->where('id','=', $new->arrangement_id)->first()->guide_category_id)->first()->guidesCategoryName}}</div>
@endif
<div class="container" style="margin-top: 8px;">