@extends("app.layout.base") @section("title") Home @endsection @section("content")
@foreach($news as $new) @if($new->type == 'News')
News:
{{ $new->subname }} {{__('msg.opret')}}{{ date('Y-m-d H:i:s', strtotime($new->created_at))}}
@if($new->resource_id !== null)
@endif
{!! $new->content !!}
@elseif($new->type == 'Menu')
Menuplan:
{{ $new->subname }} {{__('msg.opret')}}{{ date('Y-m-d H:i:s', strtotime($new->created_at))}}
@if($new->resource_id !== null)
@endif
@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, 500) ) !!} @endif
@elseif($new->type == 'Activity')
Aktiviteter:
{{ $new->subname }} {{__('msg.opret')}}{{ date('Y-m-d H:i:s', strtotime($new->created_at))}}
@if($new->resource_id !== null)
{{ \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}}
{!! \App\Helpers::closetags(substr($new->content, 0, 300) ) !!}
@if (count(\App\UserEvent::query()->where('event_id', '=', $new->arrangement_id)->where('user_id', '=', Auth::user()->id)->get()) > 0) {{__('msg.afmeld')}} @else {{-- ^ If you're already participating in the event, then show a ´cancel´ button - v Else show a ´participate´ button --}} {{__('msg.tilmeld')}} @endif $new->arrangement_id ])}}">{{__('msg.læsmere')}} $new->arrangement_id ])}}">{{__('msg.sedeltagere')}}
@else
{!! \App\Helpers::closetags(substr($new->content, 0, 300) ) !!}
{{ \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}}
@if (count(\App\UserEvent::query()->where('event_id', '=', $new->arrangement_id)->where('user_id', '=', Auth::user()->id)->get()) > 0) {{__('msg.afmeld')}} @else {{-- ^ If you're already participating in the event, then show a ´cancel´ button - v Else show a ´participate´ button --}} {{__('msg.tilmeld')}} @endif $new->arrangement_id ])}}">{{__('msg.læsmere')}} $new->arrangement_id ])}}">{{__('msg.sedeltagere')}}
@endif
@else
Vejledninger:
{{ $new->subname }} {{__('msg.opret')}}{{ date('Y-m-d H:i:s', strtotime($new->created_at))}}
@if($new->resource_id !== null)
{{__('msg.kategori')}} {{\App\GuidesCategory::query()->where('id', '=', \App\Guide::query()->where('id','=', $new->arrangement_id)->first()->guide_category_id)->first()->guidesCategoryName}}
@endif @endif @endforeach @if(count(\App\News::query()->orderBy("created_at", "desc")->get()) == 0)

{{__('msg.ingennyheder')}}

@endif
@endsection @section("scripts") @endsection