2020-08-06 10:21:19 +00:00
|
|
|
@extends("admin.layout.base")
|
|
|
|
@extends("admin.layout.header")
|
|
|
|
|
|
|
|
@section("title")
|
|
|
|
Opret Nyheder
|
|
|
|
@endsection
|
|
|
|
|
|
|
|
@section("path")
|
|
|
|
<a href="{{ route('news.create') }}" class="text-white">Opret Nyheder</a> /
|
|
|
|
@endsection
|
|
|
|
|
|
|
|
@section("content")
|
|
|
|
<style>
|
2020-08-12 06:42:58 +00:00
|
|
|
#editor {
|
2020-08-06 10:21:19 +00:00
|
|
|
margin-bottom: 1rem;
|
|
|
|
}
|
|
|
|
</style>
|
2020-08-12 06:42:58 +00:00
|
|
|
<link href="https://cdn.quilljs.com/1.3.6/quill.snow.css" rel="stylesheet">
|
2020-08-06 10:21:19 +00:00
|
|
|
<h1>Opret Nyhed</h1>
|
|
|
|
<form method="post" action="{{ route("news.store") }}">
|
|
|
|
@csrf
|
|
|
|
<label for="title">Titel på nyheden:</label>
|
2020-08-12 06:42:58 +00:00
|
|
|
<input type="text" name="subname" id="title" placeholder="OBS: Menuplanen er ændret" required>
|
|
|
|
<div id="editor"></div>
|
|
|
|
<textarea name="content" class="d-none" id="hiddenArea"></textarea>
|
2020-08-06 10:21:19 +00:00
|
|
|
<input type="submit" class="btn btn-dark text-white" value="Opret">
|
|
|
|
</form>
|
|
|
|
|
2020-08-12 06:42:58 +00:00
|
|
|
<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' ],
|
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'
|
|
|
|
});
|
|
|
|
</script>
|
2020-08-06 10:21:19 +00:00
|
|
|
<script>
|
2020-08-12 06:42:58 +00:00
|
|
|
var form = document.querySelector('form');
|
|
|
|
form.onsubmit = function() {
|
|
|
|
var myEditor = document.getElementById('editor');
|
|
|
|
var html = myEditor.children[0].innerHTML;
|
|
|
|
document.getElementById('hiddenArea').innerText = html;
|
|
|
|
}
|
2020-08-06 10:21:19 +00:00
|
|
|
</script>
|
|
|
|
|
|
|
|
@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.'
|
|
|
|
}
|
|
|
|
);
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
@endsection
|