2020-06-15 10:29:03 +00:00
|
|
|
@extends("admin.layout.base")
|
|
|
|
@extends("admin.layout.header")
|
|
|
|
|
|
|
|
@section("title")
|
|
|
|
Menuplan - Opret
|
|
|
|
@endsection
|
|
|
|
|
|
|
|
@section("path")
|
2020-06-25 14:16:08 +00:00
|
|
|
<a href="{{ route('menu-plans.create') }}" class="text-white">Opret Menuplan</a> /
|
2020-06-15 10:29:03 +00:00
|
|
|
@endsection
|
|
|
|
|
|
|
|
@section("content")
|
2020-08-07 08:58:50 +00:00
|
|
|
<style>
|
|
|
|
.toggle__label::before, .toggle__label::after {
|
|
|
|
border-color: black;
|
|
|
|
}
|
|
|
|
.toggle__text::before {
|
|
|
|
border-color: black;
|
|
|
|
}
|
2020-08-07 10:20:15 +00:00
|
|
|
|
2020-08-12 06:42:58 +00:00
|
|
|
#editor {
|
2020-08-07 10:20:15 +00:00
|
|
|
margin-bottom: 1rem;
|
|
|
|
}
|
2020-08-07 08:58:50 +00:00
|
|
|
</style>
|
2020-08-12 06:42:58 +00:00
|
|
|
<link href="https://cdn.quilljs.com/1.3.6/quill.snow.css" rel="stylesheet">
|
2020-06-15 10:29:03 +00:00
|
|
|
<h1>Opret Menuplan:</h1>
|
2020-08-12 10:28:05 +00:00
|
|
|
<form action="{{ action('MenuPlanController@store') }}" method="post" enctype="multipart/form-data">
|
2020-06-25 16:43:46 +00:00
|
|
|
@csrf
|
2020-06-30 10:38:02 +00:00
|
|
|
<label for="week">Uge nr.</label>
|
|
|
|
<input type="number" name="week" id="week" min="1" max="53" placeholder="1" required>
|
2020-08-12 06:42:58 +00:00
|
|
|
<div id="editor">
|
2020-08-12 10:28:05 +00:00
|
|
|
<h2 class="ql-align-center"><strong>Mandag:</strong></h2>
|
2020-08-12 06:42:58 +00:00
|
|
|
<p class="ql-align-center">{Mandag}</p>
|
|
|
|
<p class="ql-align-center"><br></p>
|
2020-08-12 10:28:05 +00:00
|
|
|
<h2 class="ql-align-center"><strong>Tirsdag:</strong></h2>
|
2020-08-12 06:42:58 +00:00
|
|
|
<p class="ql-align-center">{Tirsdag}</p>
|
|
|
|
<p class="ql-align-center"><br></p>
|
2020-08-12 10:28:05 +00:00
|
|
|
<h2 class="ql-align-center"><strong>Onsdag:</strong></h2>
|
2020-08-12 06:42:58 +00:00
|
|
|
<p class="ql-align-center">{Onsdag}</p>
|
|
|
|
<p class="ql-align-center"><br></p>
|
2020-08-12 10:28:05 +00:00
|
|
|
<h2 class="ql-align-center"><strong>Torsdag:</strong></h2>
|
2020-08-12 06:42:58 +00:00
|
|
|
<p class="ql-align-center">{Torsdag}</p>
|
|
|
|
</div>
|
|
|
|
<textarea name="menu" class="d-none" id="hiddenArea"></textarea>
|
2020-08-07 08:58:50 +00:00
|
|
|
<label class="toggle">
|
2020-08-12 09:15:41 +00:00
|
|
|
<input class="toggle__input" id="isNews" type="checkbox" name="newsoption" onclick="change()">
|
2020-08-07 08:58:50 +00:00
|
|
|
<span class="toggle__label">
|
|
|
|
<span class="toggle__text">Opret som nyhed</span>
|
|
|
|
</span>
|
|
|
|
</label>
|
2020-08-12 09:15:41 +00:00
|
|
|
|
2020-08-12 10:28:05 +00:00
|
|
|
<label id="fileuploadee"for="fileuploade">Baggrundsbillede til nyheden (Valgfri):</label>
|
|
|
|
<input id="fileuploade" type="file" name="resource">
|
2020-08-12 09:15:41 +00:00
|
|
|
|
|
|
|
|
2020-06-15 10:29:03 +00:00
|
|
|
<input type="submit" class="btn btn-dark text-white" value="Opret Menuplan">
|
|
|
|
</form>
|
2020-08-05 12:59:41 +00:00
|
|
|
|
2020-08-12 06:42:58 +00:00
|
|
|
<script src="https://cdn.quilljs.com/1.3.6/quill.js"></script>
|
2020-08-05 12:59:41 +00:00
|
|
|
<script>
|
2020-08-12 06:42:58 +00:00
|
|
|
var container = document.getElementById("editor");
|
|
|
|
var fullEditor = new Quill(container, {
|
|
|
|
modules: {
|
|
|
|
'toolbar': [
|
|
|
|
[ 'bold', 'italic', 'underline', 'strike' ],
|
2020-08-12 13:17:48 +00:00
|
|
|
[{ 'color': [] }],
|
2020-08-12 06:42:58 +00:00
|
|
|
[{ 'script': 'super' }, { 'script': 'sub' }],
|
2020-08-12 13:17:48 +00:00
|
|
|
[{ 'header': '1' }, { 'header': '2' }, 'blockquote' ],
|
2020-08-12 06:42:58 +00:00
|
|
|
[{ 'list': 'ordered' }, { 'list': 'bullet'}, { 'indent': '-1' }, { 'indent': '+1' }],
|
|
|
|
[ {'direction': 'rtl'}, { 'align': [] }],
|
|
|
|
[ 'link' ],
|
|
|
|
[ 'clean' ]
|
|
|
|
],
|
|
|
|
},
|
|
|
|
theme: 'snow'
|
2020-08-07 10:20:15 +00:00
|
|
|
});
|
2020-08-05 12:59:41 +00:00
|
|
|
</script>
|
2020-08-12 06:42:58 +00:00
|
|
|
<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>
|
2020-06-15 10:29:03 +00:00
|
|
|
@endsection
|
2020-08-11 08:54:01 +00:00
|
|
|
@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.'
|
|
|
|
}
|
|
|
|
);
|
|
|
|
});
|
2020-08-12 09:15:41 +00:00
|
|
|
|
|
|
|
function change() {
|
|
|
|
if ($('#isNews').is(":checked"))
|
|
|
|
{
|
2020-08-12 10:28:05 +00:00
|
|
|
$('#fileuploade').show(400);
|
|
|
|
$('#fileuploadee').show(200);
|
2020-08-12 09:15:41 +00:00
|
|
|
}else {
|
|
|
|
$('#fileuploade').hide();
|
2020-08-12 10:28:05 +00:00
|
|
|
$('#fileuploadee').hide();
|
2020-08-12 09:15:41 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
change();
|
|
|
|
|
2020-08-11 08:54:01 +00:00
|
|
|
</script>
|
|
|
|
@endsection
|
|
|
|
|