2020-08-11 11:44:18 +00:00
|
|
|
@extends("app.layout.base")
|
|
|
|
@section("content")
|
|
|
|
<style>
|
|
|
|
div.card {
|
|
|
|
margin-top: 1rem;
|
|
|
|
margin-bottom: 30px;
|
|
|
|
width: auto;
|
|
|
|
heigt: auto;
|
|
|
|
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
|
|
|
|
}
|
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-10 08:21:09 +00:00
|
|
|
|
2020-08-11 11:44:18 +00:00
|
|
|
div.container {
|
|
|
|
padding: 8px;
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
</style>
|
2020-08-11 13:08:09 +00:00
|
|
|
<main style="justify-content: unset;">
|
2020-08-11 11:44:18 +00:00
|
|
|
@foreach(\App\News::query()->orderBy("created_at", "desc")->get() as $new)
|
|
|
|
<div class="card">
|
2020-08-12 10:28:05 +00:00
|
|
|
@if($new->resource_id !== null)
|
|
|
|
<div class="header" style="background-size: cover; background-image: url('{{ asset(\App\Resource::query()->where("id", "=", $new->resource_id)->first()->filename) }}');">
|
|
|
|
<p style="text-shadow: 2px 2px 2px #00078A;"><b>{{ $new->name }}</b></p>
|
|
|
|
<h3 style="text-shadow: 2px 2px 2px #00078A;">{{ $new->subname }}</h3>
|
|
|
|
</div>
|
|
|
|
@else
|
|
|
|
<div class="header">
|
|
|
|
<p><b>{{ $new->name }}</b></p>
|
|
|
|
<h3>{{ $new->subname }}</h3>
|
|
|
|
</div>
|
|
|
|
@endif
|
2020-08-11 11:44:18 +00:00
|
|
|
<div class="container">
|
|
|
|
{!! $new->content !!}
|
|
|
|
</div>
|
2020-08-10 07:05:53 +00:00
|
|
|
</div>
|
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-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";
|
|
|
|
setTimeout(function(){ x.className = x.className.replace("show", ""); }, 3000);
|
|
|
|
}
|
|
|
|
|
|
|
|
function ajaxCall(event_id) {
|
|
|
|
axios.post("{{ route("userevents.createajax") }}",
|
|
|
|
{
|
|
|
|
event_id: event_id
|
|
|
|
}
|
|
|
|
).then(function (response) {
|
|
|
|
var data = response.data;
|
|
|
|
|
|
|
|
snackbar(data);
|
|
|
|
}).catch(function (error) {
|
|
|
|
console.log(error);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
</script>
|
|
|
|
@endsection
|