2020-08-11 11:44:18 +00:00
|
|
|
|
@extends("app.layout.base")
|
|
|
|
|
@section("content")
|
|
|
|
|
<style>
|
2020-08-26 08:49:11 +00:00
|
|
|
|
iframe, .ql-video {
|
|
|
|
|
width: 100%;
|
|
|
|
|
}
|
|
|
|
|
|
2020-08-11 11:44:18 +00:00
|
|
|
|
div.card {
|
2020-08-31 12:28:15 +00:00
|
|
|
|
margin-top: .5rem;
|
|
|
|
|
margin-bottom: 7px;
|
2020-08-11 11:44:18 +00:00
|
|
|
|
width: auto;
|
2020-08-31 12:41:44 +00:00
|
|
|
|
@if(request()->cookie("mode") == "dark")
|
2020-09-07 06:28:49 +00:00
|
|
|
|
background-color: #36393F;
|
2020-08-31 12:41:44 +00:00
|
|
|
|
@else
|
|
|
|
|
background-color: white;
|
|
|
|
|
@endif
|
2020-08-11 11:44:18 +00:00
|
|
|
|
}
|
2020-08-10 07:05:53 +00:00
|
|
|
|
|
2020-08-11 11:44:18 +00:00
|
|
|
|
div.header {
|
|
|
|
|
background-color: #00788a;
|
|
|
|
|
color: white;
|
|
|
|
|
padding: 8px;
|
|
|
|
|
font-size: 10px;
|
|
|
|
|
text-align: center;
|
2020-08-31 12:28:15 +00:00
|
|
|
|
height: 200px;
|
|
|
|
|
width: auto;
|
2020-08-11 11:44:18 +00:00
|
|
|
|
}
|
2020-08-10 08:21:09 +00:00
|
|
|
|
|
2020-08-11 11:44:18 +00:00
|
|
|
|
div.container {
|
2020-08-31 12:28:15 +00:00
|
|
|
|
padding: 3px 13px 13px 13px;
|
2020-08-11 11:44:18 +00:00
|
|
|
|
text-align: justify;
|
|
|
|
|
line-height: 1.5;
|
|
|
|
|
}
|
2020-08-10 07:05:53 +00:00
|
|
|
|
|
2020-08-11 11:44:18 +00:00
|
|
|
|
ol {
|
|
|
|
|
padding-right: 8px;
|
|
|
|
|
}
|
2020-08-31 12:28:15 +00:00
|
|
|
|
|
|
|
|
|
.title{
|
|
|
|
|
margin-left: 50px;
|
|
|
|
|
padding: 10px 10px;
|
|
|
|
|
font-size: 22px;
|
|
|
|
|
line-height: 30px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.img{
|
|
|
|
|
width: 1em;
|
2020-09-02 09:40:36 +00:00
|
|
|
|
height: calc(1em + 20px);
|
2020-08-31 12:28:15 +00:00
|
|
|
|
margin-top: 5px;
|
|
|
|
|
margin-bottom: 5px;
|
|
|
|
|
margin-left: 5px;
|
|
|
|
|
font-size: 20px;
|
2020-09-02 09:40:36 +00:00
|
|
|
|
padding: 0 10px;
|
|
|
|
|
border-color: #00788a;
|
2020-08-31 12:28:15 +00:00
|
|
|
|
border-radius: 100%;
|
2020-09-02 09:40:36 +00:00
|
|
|
|
background-color: #00788a;
|
2020-08-31 12:28:15 +00:00
|
|
|
|
line-height: 30px;
|
|
|
|
|
float: left;
|
2020-09-02 09:40:36 +00:00
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.img > a {
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: 100%;
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: center;
|
2020-08-31 12:28:15 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.information{
|
|
|
|
|
text-align: center;
|
2020-09-07 06:28:49 +00:00
|
|
|
|
@if(request()->cookie("mode") == "dark")
|
|
|
|
|
background-color: #202225;
|
|
|
|
|
@else
|
2020-09-03 06:31:31 +00:00
|
|
|
|
background-color: rgba(240,240,240,0.8);
|
2020-09-07 06:28:49 +00:00
|
|
|
|
@endif
|
2020-09-03 06:31:31 +00:00
|
|
|
|
border-bottom: 1px solid rgba(0, 0, 0, .1);
|
2020-08-31 12:28:15 +00:00
|
|
|
|
width: 100%;
|
|
|
|
|
height: 25px;
|
|
|
|
|
}
|
|
|
|
|
|
2020-09-07 06:28:49 +00:00
|
|
|
|
.information2{
|
|
|
|
|
text-align: center;
|
|
|
|
|
@if(request()->cookie("mode") == "dark")
|
|
|
|
|
background-color: #202225;
|
|
|
|
|
@else
|
|
|
|
|
background-color: rgba(240,240,240,0.8);
|
|
|
|
|
@endif
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: 25px;
|
|
|
|
|
}
|
|
|
|
|
|
2020-08-31 12:28:15 +00:00
|
|
|
|
.card > .img > a > img, .card > .img > img {
|
|
|
|
|
width: 100%;
|
|
|
|
|
}
|
|
|
|
|
|
2020-09-02 13:10:58 +00:00
|
|
|
|
html,main{
|
2020-08-31 12:41:44 +00:00
|
|
|
|
@if(request()->cookie("mode") == "dark")
|
|
|
|
|
|
|
|
|
|
@else
|
|
|
|
|
background-color: rgb(200,200,200);
|
|
|
|
|
@endif
|
2020-08-31 12:28:15 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2020-08-11 11:44:18 +00:00
|
|
|
|
</style>
|
2020-08-31 12:28:15 +00:00
|
|
|
|
<main style="justify-content: unset; padding: 0">
|
2020-08-19 08:43:59 +00:00
|
|
|
|
@foreach($news as $new)
|
2020-08-31 12:28:15 +00:00
|
|
|
|
<!--Code to list events-->
|
2020-08-31 12:54:25 +00:00
|
|
|
|
@if($new->type == 'News')<!--Code that prints news-->
|
2020-08-31 12:28:15 +00:00
|
|
|
|
<div class="card">
|
|
|
|
|
<div class="img"><img src="{{URL::asset('/images/icons/news.svg')}}" alt="News:"></div>
|
|
|
|
|
<div class="title">{{ $new->subname }}</div>
|
|
|
|
|
@if($new->resource_id !== null)
|
2020-09-07 11:10:20 +00:00
|
|
|
|
<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>
|
2020-08-31 12:28:15 +00:00
|
|
|
|
@endif
|
2020-08-12 13:17:48 +00:00
|
|
|
|
|
2020-08-31 12:28:15 +00:00
|
|
|
|
<div class="container" style="margin-top: 8px;">
|
|
|
|
|
{!! $new->content !!}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2020-08-31 12:54:25 +00:00
|
|
|
|
@elseif($new->type == 'Menu')<!--Code that prints menuplan -->
|
2020-08-31 12:28:15 +00:00
|
|
|
|
<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>
|
|
|
|
|
@if($new->resource_id !== null)
|
2020-09-07 11:10:20 +00:00
|
|
|
|
<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>
|
2020-08-31 12:28:15 +00:00
|
|
|
|
@endif
|
|
|
|
|
<div class="container" style="margin-top: 8px;">
|
|
|
|
|
@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) ) !!}
|
|
|
|
|
@endif
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2020-08-31 12:54:25 +00:00
|
|
|
|
@elseif($new->type == 'Activity')<!--Code that prints events-->
|
2020-08-31 12:28:15 +00:00
|
|
|
|
<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>
|
|
|
|
|
@if($new->resource_id !== null)
|
2020-09-07 11:10:20 +00:00
|
|
|
|
<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>
|
2020-09-07 06:28:49 +00:00
|
|
|
|
<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>
|
|
|
|
|
<div class="container">
|
|
|
|
|
{!! \App\Helpers::closetags(substr($new->content, 0, 300) ) !!}
|
|
|
|
|
<div class="row" style="justify-content: space-between; padding-top: 12px; border-top: 1px solid rgba(0, 0, 0, .2);">
|
|
|
|
|
@if (count(\App\UserEvent::query()->where('event_id', '=', $new->arrangement_id)->where('user_id', '=', Auth::user()->id)->get()) > 0)
|
|
|
|
|
<a style="margin: 0; padding: 0; font-weight: 700;" class="sde-blue text-center" href="javascript:void(0);" onclick="ajaxCall({{ $new->arrangement_id }}, this)" >{{__('msg.afmeld')}}</a>
|
|
|
|
|
@else {{-- ^ If you're already participating in the event, then show a ´cancel´ button - v Else show a ´participate´ button --}}
|
|
|
|
|
<a style="margin: 0; padding: 0; font-weight: 700;" class="sde-blue text-center" href="javascript:void(0);" onclick="ajaxCall({{ $new->arrangement_id }}, this)" >{{__('msg.tilmeld')}}</a>
|
|
|
|
|
@endif
|
|
|
|
|
<a style="margin: 0; padding: 0; font-weight: 700;" class="sde-blue text-center" href="{{route("events.show", ["event" => $new->arrangement_id ])}}">{{__('msg.læsmere')}}</a>
|
|
|
|
|
<a style="margin: 0; padding: 0; font-weight: 700;" class="sde-blue text-center" href="{{route("events.accountsignups", ["event" => $new->arrangement_id ])}}">{{__('msg.sedeltagere')}}</a>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
@else
|
|
|
|
|
<div class="container">
|
|
|
|
|
{!! \App\Helpers::closetags(substr($new->content, 0, 300) ) !!}
|
|
|
|
|
<div class="information2">{{ \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>
|
|
|
|
|
<div class="row" style="justify-content: space-between; padding-top: 12px; border-top: 1px solid rgba(0, 0, 0, .2);">
|
|
|
|
|
@if (count(\App\UserEvent::query()->where('event_id', '=', $new->arrangement_id)->where('user_id', '=', Auth::user()->id)->get()) > 0)
|
|
|
|
|
<a style="margin: 0; padding: 0; font-weight: 700;" class="sde-blue text-center" href="javascript:void(0);" onclick="ajaxCall({{ $new->arrangement_id }}, this)" >{{__('msg.afmeld')}}</a>
|
|
|
|
|
@else {{-- ^ If you're already participating in the event, then show a ´cancel´ button - v Else show a ´participate´ button --}}
|
|
|
|
|
<a style="margin: 0; padding: 0; font-weight: 700;" class="sde-blue text-center" href="javascript:void(0);" onclick="ajaxCall({{ $new->arrangement_id }}, this)" >{{__('msg.tilmeld')}}</a>
|
|
|
|
|
@endif
|
|
|
|
|
<a style="margin: 0; padding: 0; font-weight: 700;" class="sde-blue text-center" href="{{route("events.show", ["event" => $new->arrangement_id ])}}">{{__('msg.læsmere')}}</a>
|
|
|
|
|
<a style="margin: 0; padding: 0; font-weight: 700;" class="sde-blue text-center" href="{{route("events.accountsignups", ["event" => $new->arrangement_id ])}}">{{__('msg.sedeltagere')}}</a>
|
|
|
|
|
</div>
|
2020-08-12 13:17:48 +00:00
|
|
|
|
</div>
|
2020-09-07 06:28:49 +00:00
|
|
|
|
@endif
|
2020-08-12 10:28:05 +00:00
|
|
|
|
</div>
|
2020-08-31 12:28:15 +00:00
|
|
|
|
@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>
|
|
|
|
|
@if($new->resource_id !== null)
|
2020-09-07 11:10:20 +00:00
|
|
|
|
<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>
|
2020-08-31 12:28:15 +00:00
|
|
|
|
@endif
|
|
|
|
|
|
|
|
|
|
<div class="container" style="margin-top: 8px;">
|
|
|
|
|
{!! \App\Helpers::closetags(substr($new->content, 0, 300) ) !!}
|
2020-08-31 12:54:25 +00:00
|
|
|
|
@if ($new->type == 'Guide') {{-- Else if's displaying guides, then show `Læs mere` --}}
|
2020-09-07 06:28:49 +00:00
|
|
|
|
<div class="row" style="justify-content: center; padding-top: 12px; border-top: 1px solid rgba(0, 0, 0, .2);">
|
2020-08-31 12:28:15 +00:00
|
|
|
|
<a style="font-weight: 700;" href="{{route("guides.show", ["guide" => $new->arrangement_id])}}" class="sde-blue">{{__('msg.læsmere')}}</a>
|
|
|
|
|
</div>
|
|
|
|
|
@endif {{-- Else if it's a menu or news, then don't show a button at bottom --}}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
@endif
|
2020-08-11 11:44:18 +00:00
|
|
|
|
@endforeach
|
|
|
|
|
@if(count(\App\News::query()->orderBy("created_at", "desc")->get()) == 0)
|
|
|
|
|
<p class="text-center">{{__('msg.ingennyheder')}}</p>
|
|
|
|
|
@endif
|
2020-08-12 10:28:05 +00:00
|
|
|
|
<div id="snackbar"></div>
|
2020-08-19 07:54:26 +00:00
|
|
|
|
|
2020-08-11 11:44:18 +00:00
|
|
|
|
</main>
|
|
|
|
|
@endsection
|
2020-08-11 13:08:09 +00:00
|
|
|
|
@section("scripts")
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
|
function snackbar(data) {
|
|
|
|
|
var x = document.getElementById("snackbar");
|
|
|
|
|
x.innerHTML = data;
|
|
|
|
|
x.className = "show";
|
2020-08-12 13:17:48 +00:00
|
|
|
|
|
2020-08-11 13:08:09 +00:00
|
|
|
|
setTimeout(function(){ x.className = x.className.replace("show", ""); }, 3000);
|
|
|
|
|
}
|
|
|
|
|
|
2020-08-13 09:39:10 +00:00
|
|
|
|
function ajaxCall(event_id, el) {
|
|
|
|
|
if(el.innerHTML === "{{__("msg.tilmeld")}}") {
|
|
|
|
|
axios.post("{{ route("userevents.createajax") }}",
|
|
|
|
|
{
|
|
|
|
|
event_id: event_id
|
|
|
|
|
}
|
|
|
|
|
).then(function (response) {
|
|
|
|
|
var data = response.data;
|
2020-08-12 13:17:48 +00:00
|
|
|
|
|
2020-08-13 09:39:10 +00:00
|
|
|
|
snackbar(data);
|
2020-08-11 13:08:09 +00:00
|
|
|
|
|
2020-08-13 09:39:10 +00:00
|
|
|
|
el.innerHTML = "{{__("msg.afmeld")}}";
|
|
|
|
|
}).catch(function (error) {
|
|
|
|
|
console.log(error);
|
|
|
|
|
});
|
|
|
|
|
} else if(el.innerHTML === "{{__("msg.afmeld")}}"){
|
|
|
|
|
axios.post("{{ route("userevents.createajaxcancel") }}",
|
|
|
|
|
{
|
|
|
|
|
event_id: event_id
|
|
|
|
|
}
|
|
|
|
|
).then(function (response) {
|
|
|
|
|
var data = response.data;
|
2020-08-12 13:17:48 +00:00
|
|
|
|
|
2020-08-13 09:39:10 +00:00
|
|
|
|
snackbar(data);
|
2020-08-12 13:17:48 +00:00
|
|
|
|
|
2020-08-13 09:39:10 +00:00
|
|
|
|
el.innerHTML = "{{__("msg.tilmeld")}}";
|
|
|
|
|
}).catch(function (error) {
|
|
|
|
|
console.log(error);
|
|
|
|
|
});
|
|
|
|
|
}
|
2020-08-12 13:17:48 +00:00
|
|
|
|
}
|
2020-08-11 13:08:09 +00:00
|
|
|
|
</script>
|
|
|
|
|
@endsection
|