v1.4.4 Made news expiration date, add category to app homepages, made small css things
This commit is contained in:
@@ -41,11 +41,15 @@
|
||||
<div id="editor"></div>
|
||||
<textarea name="guide_articles" class="d-none" id="hiddenArea"></textarea>
|
||||
<label class="toggle">
|
||||
<input class="toggle__input" type="checkbox" name="newsoption">
|
||||
<input id="isNews" class="toggle__input" type="checkbox" name="newsoption" onclick="change()">
|
||||
<span class="toggle__label">
|
||||
<span class="toggle__text">Opret som nyhed</span>
|
||||
</span>
|
||||
</label>
|
||||
<div class="form-group" style="display: flex; flex-direction: column" id="delete_event">
|
||||
<label for="date">Dato til når nyheden skal slettes (valgfri):</label>
|
||||
<input type="datetime-local" name="news_expiration_date" id="date">
|
||||
</div>
|
||||
<label id="fileuploadee"for="fileuploade">Baggrundsbillede til nyheden (Valgfri):</label>
|
||||
<input id="fileuploade" type="file" name="resource" accept="image/*">
|
||||
<input type="submit" id="disable" class="btn btn-dark text-white" value="Opret">
|
||||
@@ -144,5 +148,16 @@
|
||||
})
|
||||
|
||||
|
||||
function change() {
|
||||
if ($('#isNews').is(":checked"))
|
||||
{
|
||||
$('#delete_event').show(400);
|
||||
}else {
|
||||
$('#delete_event').hide(400);
|
||||
}
|
||||
}
|
||||
change();
|
||||
|
||||
|
||||
</script>
|
||||
@endsection
|
||||
|
||||
@@ -22,6 +22,8 @@
|
||||
<label for="title">Titel på nyheden:</label>
|
||||
<label hidden id="error" for="errormesseages">Dette navn findes allerede</label>
|
||||
<input type="text" name="subname" id="title" placeholder="OBS: Menuplanen er ændret" required>
|
||||
<label for="date">Dato til når nyheden skal slettes (valgfri)</label>
|
||||
<input type="datetime-local" name="news_expiration_date" id="date">
|
||||
<div id="editor"></div>
|
||||
<textarea name="content" class="d-none" id="hiddenArea"></textarea>
|
||||
<input type="submit" id="disable" class="btn btn-dark text-white" value="Opret">
|
||||
|
||||
@@ -23,6 +23,8 @@
|
||||
<label for="title">Navn</label>
|
||||
<label hidden id="error" for="errormesseages">Dette navn findes allerede</label>
|
||||
<input value="{{$news->subname}}" type="text" name="subname" id="title" required>
|
||||
<label for="date">Rediger datoen til når nyheden skal slettes (Hvis nyheden ikke skal slettes efter en bestemt dato, slet ALT i dato felete, så det er tomt!)</label>
|
||||
<input type="datetime-local" value="{{$news->news_expiration_date}}" name="news_expiration_date" id="date">
|
||||
<div id="editor">{!! $news->content !!}</div>
|
||||
<textarea name="content" class="d-none" id="hiddenArea"></textarea>
|
||||
<input id="disable" type="submit" class="btn btn-dark text-white" value="Rediger">
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
<table class="tbl" id="table_id">
|
||||
<thead>
|
||||
<th>Navn</th>
|
||||
<th>Udløbsdato</th>
|
||||
@if(auth()->user()->can('news.edit'))
|
||||
<th style="width: 1em;"><img class="w-100" src="{{ asset('/images/icons/pencil.svg') }}" alt="Update"></th>
|
||||
@endif
|
||||
@@ -29,6 +30,11 @@
|
||||
@foreach($news as $new)
|
||||
<tr>
|
||||
<td>{{$new->subname}}</td>
|
||||
@if($new->news_expiration_date !== null)
|
||||
<td>{{ \Illuminate\Support\Facades\Date::createFromTimeStamp(strtotime($new->news_expiration_date))->format('d/m/Y \k\l\. H:i') }}</td>
|
||||
@else
|
||||
<td>Ingen udløbsdato</td>
|
||||
@endif
|
||||
@if(auth()->user()->can('news.edit'))
|
||||
<td><a href="{{ route("news.edit", [ "news" => $new ]) }}"><img class="w-100" src="{{ asset('/images/icons/pencil-dark.svg') }}" alt="Update"></a></td>
|
||||
@endif
|
||||
|
||||
@@ -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;">
|
||||
|
||||
Reference in New Issue
Block a user