v1.5.15a - Changes by Anders
This commit is contained in:
@@ -48,7 +48,7 @@
|
||||
<td>{{ $event->accountable }}</td>
|
||||
<td>{{ \Illuminate\Support\Facades\Date::createFromTimeStamp(strtotime($event->date))->format('d/m/Y \k\l\. H:i') }}</td>
|
||||
<td><a href="{{ route("events.signups", [ "event" => $event ]) }}"><img class="w-100" src="{{ asset('/images/icons/eye-dark.svg') }}" alt="Show"></a></td>
|
||||
<td><a id="preview" onclick="modalNewsContent({{$event->id}})" style="cursor: pointer" ><img class="w-100" src="{{ asset('/images/icons/preview-dark.svg') }}" alt="preview"></a></td>
|
||||
<td><a id="preview" onclick="modalEventContent({{$event->id}})" style="cursor: pointer" ><img class="w-100" src="{{ asset('/images/icons/preview-dark.svg') }}" alt="preview"></a></td>
|
||||
@if(auth()->user()->can('event.edit'))
|
||||
<td><a href="{{ route("events.edit", [ "event" => $event ]) }}"><img class="w-100" src="{{ asset('/images/icons/pencil-dark.svg') }}" alt="Update"></a></td>
|
||||
@endif
|
||||
@@ -64,7 +64,7 @@
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div id="newsModal" class="modal zindex-100">
|
||||
<div id="eventModal" class="modal zindex-100">
|
||||
<div id="modal-content" class="modal-content text-black d-block w-50">
|
||||
<span class="close" onclick="closeModal()">×</span>
|
||||
<center>
|
||||
@@ -83,9 +83,9 @@
|
||||
@endsection
|
||||
@section('scripts')
|
||||
<script>
|
||||
var modalNews = document.getElementById("newsModal");
|
||||
var modalEvent = document.getElementById("eventModal");
|
||||
|
||||
function modalNewsContent(id) {
|
||||
function modalEventContent(id) {
|
||||
$.ajax({
|
||||
type: 'get',
|
||||
url: '{{route('events.preview')}}',
|
||||
@@ -93,7 +93,6 @@
|
||||
success:function (data) {
|
||||
modalNews.style.display = "flex";
|
||||
var l = JSON.parse(data);
|
||||
console.log(l);
|
||||
$("#name").html(l.name);
|
||||
$("#date").html(l.date);
|
||||
$("#accountable").html(l.accountable);
|
||||
@@ -101,8 +100,6 @@
|
||||
|
||||
if (l.filename)
|
||||
$("#eventimg").attr('src', l.filename);
|
||||
|
||||
|
||||
},
|
||||
error:function (data) {
|
||||
console.log(data);
|
||||
@@ -111,7 +108,7 @@
|
||||
}
|
||||
|
||||
function closeModal() {
|
||||
modalNews.style.display = "none";
|
||||
modalEvent.style.display = "none";
|
||||
|
||||
$("#name").html('');
|
||||
$("#date").html('');
|
||||
@@ -121,8 +118,8 @@
|
||||
}
|
||||
|
||||
window.onmousedown = function(event) {
|
||||
if (event.target == modalNews) {
|
||||
modalNews.style.display = "none";
|
||||
if (event.target == modalEvent) {
|
||||
modalEvent.style.display = "none";
|
||||
|
||||
$("#name").html('');
|
||||
$("#date").html('');
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
<tr id="guide_row_{{ $guide->id }}" data-id="guide_category_row{{ \App\GuidesCategory::query()->where('id', '=', $guide->guide_category_id)->first()->id }}">
|
||||
<td>{{$guide->name}}</td>
|
||||
<td>{{ \App\GuidesCategory::query()->where('id', '=', $guide->guide_category_id)->first()->guidesCategoryName }}</td>
|
||||
<td><a id="preview" onclick="modalNewsContent({{$guide->id}})" style="cursor: pointer" ><img class="w-100" src="{{ asset('/images/icons/preview-dark.svg') }}" alt="preview"></a></td>
|
||||
<td><a id="preview" onclick="modalGuidesContent({{$guide->id}})" style="cursor: pointer" ><img class="w-100" src="{{ asset('/images/icons/preview-dark.svg') }}" alt="preview"></a></td>
|
||||
@if(auth()->user()->can('guides.edit'))
|
||||
<td><a href="{{ route("guides.edit", [ "guide" => $guide ]) }}"><img class="w-100" src="{{ asset('/images/icons/pencil-dark.svg') }}" alt="Update"></a></td>
|
||||
@endif
|
||||
@@ -89,7 +89,7 @@
|
||||
</div>
|
||||
|
||||
|
||||
<div id="newsModal" class="modal zindex-100">
|
||||
<div id="guidesModal" class="modal zindex-100">
|
||||
<div id="modal-content" class="modal-content text-black d-block w-50">
|
||||
<span class="close" onclick="closeModal()">×</span>
|
||||
<center>
|
||||
@@ -104,9 +104,9 @@
|
||||
@endsection
|
||||
@section('scripts')
|
||||
<script>
|
||||
var modalNews = document.getElementById("newsModal");
|
||||
var modalGuides = document.getElementById("guidesModal");
|
||||
|
||||
function modalNewsContent(id) {
|
||||
function modalGuidesContent(id) {
|
||||
$.ajax({
|
||||
type: 'get',
|
||||
url: '{{route('guides.preview')}}',
|
||||
@@ -128,15 +128,15 @@
|
||||
}
|
||||
|
||||
function closeModal() {
|
||||
modalNews.style.display = "none";
|
||||
modalGuides.style.display = "none";
|
||||
$("#name").html('');
|
||||
$("#guide_articles").html('');
|
||||
$("#eventimg").attr('src', '');
|
||||
}
|
||||
|
||||
window.onmousedown = function(event) {
|
||||
if (event.target == modalNews) {
|
||||
modalNews.style.display = "none";
|
||||
if (event.target == modalGuides) {
|
||||
modalGuides.style.display = "none";
|
||||
$("#name").html('');
|
||||
$("#guide_articles").html('');
|
||||
$("#eventimg").attr('src', '');
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
@foreach($menuPlans as $menuplan)
|
||||
<tr id="row_{{ $menuplan->id }}">
|
||||
<td>{{$menuplan->week}}</td>
|
||||
<td><a id="preview" onclick="modalNewsContent({{$menuplan->id}})" style="cursor: pointer" ><img class="w-100" src="{{ asset('/images/icons/preview-dark.svg') }}" alt="preview"></a></td>
|
||||
<td><a id="preview" onclick="modalMenuContent({{$menuplan->id}})" style="cursor: pointer" ><img class="w-100" src="{{ asset('/images/icons/preview-dark.svg') }}" alt="preview"></a></td>
|
||||
<td><a href="{{ route("pdf.genPDF", [ "menuPlan" => $menuplan ]) }}" target="_blank"><img class="w-100" src="{{ asset('/images/icons/print.svg') }}" alt="Print"></a></td>
|
||||
@if(auth()->user()->can('menuplan.edit'))
|
||||
<td><a href="{{ route("menu-plans.edit", [ "menu_plan" => $menuplan ]) }}"><img class="w-100" src="{{ asset('/images/icons/pencil-dark.svg') }}" alt="Update"></a></td>
|
||||
@@ -54,7 +54,7 @@
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div id="newsModal" class="modal zindex-100">
|
||||
<div id="menuModal" class="modal zindex-100">
|
||||
<div id="modal-content" class="modal-content text-black d-block w-50">
|
||||
<span class="close" onclick="closeModal()">×</span>
|
||||
<center>
|
||||
@@ -74,9 +74,9 @@
|
||||
@endsection
|
||||
@section('scripts')
|
||||
<script>
|
||||
var modalNews = document.getElementById("newsModal");
|
||||
var modalMenu = document.getElementById("menuModal");
|
||||
|
||||
function modalNewsContent(id) {
|
||||
function modalMenuContent(id) {
|
||||
$.ajax({
|
||||
type: 'get',
|
||||
url: '{{route('menuplans.preview')}}',
|
||||
@@ -97,7 +97,7 @@
|
||||
}
|
||||
|
||||
function closeModal() {
|
||||
modalNews.style.display = "none";
|
||||
modalMenu.style.display = "none";
|
||||
$("#week").html('');
|
||||
$("#monday").html('');
|
||||
$("#tuesday").html('');
|
||||
@@ -106,8 +106,13 @@
|
||||
}
|
||||
|
||||
window.onmousedown = function(event) {
|
||||
if (event.target == modalNews) {
|
||||
modalNews.style.display = "none";
|
||||
if (event.target == modalMenu) {
|
||||
modalMenu.style.display = "none";
|
||||
$("#week").html('');
|
||||
$("#monday").html('');
|
||||
$("#tuesday").html('');
|
||||
$("#wednesday").html('');
|
||||
$("#thursday").html('');
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
<td>{{ $event->week}}</td>
|
||||
<td><a id="preview" onclick="modalEventContent({{$event->id}})" style="cursor: pointer"><img class="w-100" src="{{ asset('/images/icons/preview-dark.svg') }}" alt="preview"></a></td>
|
||||
@if(auth()->user()->can('event.edit'))
|
||||
<td><a href="{{ route("events.edit", [ "event" => $event ]) }}"><img class="w-100" src="{{ asset('/images/icons/pencil-dark.svg') }}" alt="Update"></a></td>
|
||||
<td><a href="#"><img class="w-100" src="{{ asset('/images/icons/pencil-dark.svg') }}" alt="Update"></a></td>
|
||||
@endif
|
||||
@if(auth()->user()->can('event.delete'))
|
||||
<td>
|
||||
@@ -38,8 +38,109 @@
|
||||
</td>
|
||||
@endif
|
||||
</tr>
|
||||
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div id="eventModal" class="modal zindex-100">
|
||||
<div id="modal-content" class="modal-content text-black d-block w-50">
|
||||
<span class="close" onclick="closeModal()">×</span>
|
||||
<center>
|
||||
<h1 id="week"></h1>
|
||||
<hr>
|
||||
<strong><label>Aktiviteter</label></strong>
|
||||
<hr>
|
||||
<img id="eventimg">
|
||||
<p id="description"></p>
|
||||
</center>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@section('scripts')
|
||||
<script>
|
||||
var modalEvent = document.getElementById("eventModal");
|
||||
|
||||
function modalEventContent(id) {
|
||||
$.ajax({
|
||||
type: 'get',
|
||||
url: '{{route('multiple-events.preview')}}',
|
||||
data: {'preview':id},
|
||||
dataType: 'JSON',
|
||||
success:function (data) {
|
||||
modalEvent.style.display = "flex";
|
||||
$("#week").html(data[0].week);
|
||||
if (data[0].resource_id != null)
|
||||
$("#eventimg").attr('src', data[0].filename);
|
||||
/*var l = JSON.parse(data);
|
||||
$("#name").html(l.name);
|
||||
$("#date").html(l.date);
|
||||
$("#accountable").html(l.accountable);
|
||||
$("#description").html(l.description);
|
||||
|
||||
if (l.filename)
|
||||
$("#eventimg").attr('src', l.filename);*/
|
||||
},
|
||||
error:function (data) {
|
||||
console.log(data);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function closeModal() {
|
||||
modalEvent.style.display = "none";
|
||||
|
||||
$("#name").html('');
|
||||
$("#date").html('');
|
||||
$("#accountable").html('');
|
||||
$("#description").html('');
|
||||
$("#eventimg").attr('src', '');
|
||||
}
|
||||
|
||||
window.onmousedown = function(event) {
|
||||
if (event.target == modalEvent) {
|
||||
modalEvent.style.display = "none";
|
||||
|
||||
$("#name").html('');
|
||||
$("#date").html('');
|
||||
$("#accountable").html('');
|
||||
$("#description").html('');
|
||||
$("#eventimg").attr('src', '');
|
||||
}
|
||||
}
|
||||
|
||||
function delete_event(id) {
|
||||
var token = $("input[name='_token']").val();
|
||||
|
||||
Swal.fire({
|
||||
title: 'Er du sikker?',
|
||||
text: "Dette kan ikke blive ændret tilbage!",
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Slet Aktiviteten',
|
||||
cancelButtonText: 'Annuller'
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "multiple-events/"+id,
|
||||
data:{'_token':token, _method: 'DELETE'},
|
||||
success: function () {
|
||||
$('#table_id').DataTable().row($('#row_'+id)[0]).remove().draw();
|
||||
|
||||
Swal.fire(
|
||||
'Aktiviteten er slettet!',
|
||||
'',
|
||||
'success'
|
||||
)
|
||||
},
|
||||
error:function (data) {
|
||||
console.log(data);
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
@endsection
|
||||
|
||||
Reference in New Issue
Block a user