83 lines
2.9 KiB
PHP
83 lines
2.9 KiB
PHP
@extends("admin.layout.base")
|
|
@extends("admin.layout.header")
|
|
|
|
@section("title")
|
|
Menuplan - Rediger
|
|
@endsection
|
|
|
|
@section("path")
|
|
<a href="{{ route('menu-plans.edit', [ "menu_plan" => $menuplan ]) }}" class="text-white">Rediger Menuplan</a> /
|
|
@endsection
|
|
|
|
@section("content")
|
|
<style>
|
|
.toggle__label::before, .toggle__label::after {
|
|
border-color: black;
|
|
}
|
|
.toggle__text::before {
|
|
border-color: black;
|
|
}
|
|
|
|
#editor {
|
|
margin-bottom: 1rem;
|
|
}
|
|
</style>
|
|
<link href="https://cdn.quilljs.com/1.3.6/quill.snow.css" rel="stylesheet">
|
|
<h1>Rediger Menuplan:</h1>
|
|
<form method="post" action="{{ route("menu-plans.update", [ "menu_plan" => $menuplan ]) }}">
|
|
@csrf
|
|
@method("PUT")
|
|
<label for="mandag">Uge:</label>
|
|
<input type="number" name="week" id="week" min="1" max="53" value="{{ $menuplan->week }}" required>
|
|
<div id="editor">{!! $menuplan->menu !!}</div>
|
|
<textarea name="menu" class="d-none" id="hiddenArea"></textarea>
|
|
<label class="toggle">
|
|
<input class="toggle__input" type="checkbox" name="newsoption">
|
|
<span class="toggle__label">
|
|
<span class="toggle__text">Opret som nyhed</span>
|
|
</span>
|
|
</label>
|
|
<input type="submit" class="btn btn-dark text-white" value="Rediger Menuplan">
|
|
</form>
|
|
|
|
<script src="https://cdn.quilljs.com/1.3.6/quill.js"></script>
|
|
<script>
|
|
var container = document.getElementById("editor");
|
|
var fullEditor = new Quill(container, {
|
|
modules: {
|
|
'toolbar': [
|
|
[ 'bold', 'italic', 'underline', 'strike' ],
|
|
[{ 'color': [] }, { 'background': [] }],
|
|
[{ 'script': 'super' }, { 'script': 'sub' }],
|
|
[{ 'header': '1' }, { 'header': '2' }, 'blockquote', 'code-block' ],
|
|
[{ 'list': 'ordered' }, { 'list': 'bullet'}, { 'indent': '-1' }, { 'indent': '+1' }],
|
|
[ {'direction': 'rtl'}, { 'align': [] }],
|
|
[ 'link' ],
|
|
[ 'clean' ]
|
|
],
|
|
},
|
|
theme: 'snow'
|
|
});
|
|
</script>
|
|
<script>
|
|
var form = document.querySelector('form');
|
|
form.onsubmit = function() {
|
|
var myEditor = document.getElementById('editor');
|
|
var html = myEditor.children[0].innerHTML;
|
|
document.getElementById('hiddenArea').innerText = html;
|
|
}
|
|
</script>
|
|
@endsection
|
|
@section("scripts")
|
|
<script>
|
|
$(function() {
|
|
$('form').areYouSure(
|
|
{
|
|
message: 'It looks like you have been editing something. '
|
|
+ 'If you leave before saving, your changes will be lost.'
|
|
}
|
|
);
|
|
});
|
|
</script>
|
|
@endsection
|