@extends("app.layout.base") @section("title") Aktiviteter @endsection @section("content")

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

@if(count(\App\Notification::query()->where("user_id", "=", auth()->user()->id)->get()) > 0)
× Event Canceled @foreach(\App\Notification::query()->where("user_id", "=", auth()->user()->id)->get() as $notification)

{{ $notification->message }}{{ __("msg.canceled") }}

@endforeach
@endif @if(!$events->isEmpty()) @foreach($events as $event)
@if($event->resource_id !== null)

{{ $event->name }}

{{__('msg.af')}}: {{ $event->accountable }}

{{ \Illuminate\Support\Facades\Date::createFromTimeStamp(strtotime($event->date))->format('d/m/Y \k\l\. H:i') }}

@else

{{ $event->name }}

Af: {{ $event->accountable }}

{{ \Illuminate\Support\Facades\Date::createFromTimeStamp(strtotime($event->date))->format('d/m/Y \k\l\. H:i') }}

@endif
{!! \App\Helpers::closetags(substr($event->description, 0, 300) )!!} {!! session()->get('error#' . $event->id) !!} {!! session()->get('signup#' . $event->id) !!}
@if (count(\App\UserEvent::query()->where('event_id', '=', $event->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 $event->id ])}}">{{__('msg.læsmere')}} $event->id ])}}">{{__('msg.sedeltagere')}}
@endforeach {{ $events->links() }} @else

{{__('msg.dereringenaktiviteter')}}!

@endif {{__('msg.setilmeldteaktiviteter')}}
@endsection @section("scripts") @endsection