v1.5.15a - Changes by Anders

This commit is contained in:
2021-04-27 12:27:46 +02:00
parent e5126ae5ae
commit cb690a470d
8 changed files with 180 additions and 35 deletions
@@ -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()">&times;</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>