2020-06-22 13:25:39 +00:00
|
|
|
@extends("admin.layout.base")
|
|
|
|
@extends("admin.layout.header")
|
|
|
|
|
|
|
|
@section("title")
|
2020-06-29 12:48:31 +00:00
|
|
|
Aktivitet - Vis
|
2020-06-22 13:25:39 +00:00
|
|
|
@endsection
|
|
|
|
|
|
|
|
@section("path")
|
2020-06-29 12:48:31 +00:00
|
|
|
<a href="{{ route('events.create') }}" class="text-white">Opret Aktivitet</a> /
|
2020-06-22 13:25:39 +00:00
|
|
|
@endsection
|
|
|
|
|
|
|
|
@section("content")
|
2020-08-07 07:47:23 +00:00
|
|
|
<style>
|
|
|
|
.toggle__label::before, .toggle__label::after {
|
|
|
|
border-color: black;
|
|
|
|
}
|
|
|
|
.toggle__text::before {
|
|
|
|
border-color: black;
|
|
|
|
}
|
2020-08-12 06:42:58 +00:00
|
|
|
|
|
|
|
#editor {
|
|
|
|
margin-bottom: 1rem;
|
|
|
|
}
|
2020-08-07 07:47:23 +00:00
|
|
|
</style>
|
2020-08-19 08:35:44 +00:00
|
|
|
<link href="{{ asset("/css/quill/quill.snow.css") }}" rel="stylesheet">
|
2020-08-13 12:41:10 +00:00
|
|
|
<h1 id="errormesseages" >Opret Aktivitet:</h1>
|
2020-08-12 10:28:05 +00:00
|
|
|
<form method="post" action="{{ route("events.store") }}" enctype="multipart/form-data">
|
2020-06-22 13:25:39 +00:00
|
|
|
@csrf
|
2020-08-18 17:09:40 +00:00
|
|
|
<label for="name">Aktivitet Navn:</label>
|
2020-08-20 12:59:22 +00:00
|
|
|
<label hidden id="error" for="errormesseages">Dette navn findes allerede</label>
|
2020-06-22 13:25:39 +00:00
|
|
|
<input type="text" name="name" id="name" max="60" required>
|
2020-08-18 17:09:40 +00:00
|
|
|
<label for="accountable">Aktivitet Ansvarlig:</label>
|
2020-08-06 12:47:22 +00:00
|
|
|
<input type="text" name="accountable" id="accountable" required>
|
2020-08-18 17:09:40 +00:00
|
|
|
<label for="description">Aktivitet Beskrivelse:</label>
|
2021-04-09 23:43:05 +00:00
|
|
|
<small class="form-text text-muted">For at kunne indsætte et link, skal du markere teksten du vil lave op til et link først.</small>
|
2020-08-10 10:29:38 +00:00
|
|
|
<div id="editor"></div>
|
|
|
|
<textarea name="description" class="d-none" id="hiddenArea"></textarea>
|
2021-04-09 23:43:05 +00:00
|
|
|
<label for="date">Aktivitets dato:</label>
|
2020-08-03 12:47:06 +00:00
|
|
|
<input type="datetime-local" name="date" id="date" required>
|
2020-08-07 07:47:23 +00:00
|
|
|
<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>
|
2021-04-09 23:43:05 +00:00
|
|
|
<label id="fileuploadee"for="fileuploade">Baggrundsbillede til nyheden (Valgfri)</label>
|
2020-08-18 05:49:00 +00:00
|
|
|
<input id="fileuploade" type="file" name="resource" accept="image/*">
|
2020-08-12 10:28:05 +00:00
|
|
|
|
2020-08-13 12:41:10 +00:00
|
|
|
<input id="disable" type="submit" class="btn btn-dark text-white" value="Opret">
|
2020-06-22 13:25:39 +00:00
|
|
|
</form>
|
2020-08-19 08:35:44 +00:00
|
|
|
<script src="{{ asset("/js/quill/quill.js") }}"></script>
|
2020-08-06 12:47:22 +00:00
|
|
|
<script>
|
2020-08-10 10:29:38 +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-10 10:29:38 +00:00
|
|
|
[{ 'script': 'super' }, { 'script': 'sub' }],
|
2020-08-12 13:17:48 +00:00
|
|
|
[{ 'header': '1' }, { 'header': '2' }, 'blockquote' ],
|
2020-08-10 10:29:38 +00:00
|
|
|
[{ 'list': 'ordered' }, { 'list': 'bullet'}, { 'indent': '-1' }, { 'indent': '+1' }],
|
|
|
|
[ {'direction': 'rtl'}, { 'align': [] }],
|
2020-10-07 09:59:58 +00:00
|
|
|
[ 'link', 'image', 'video' ],
|
2020-08-10 10:29:38 +00:00
|
|
|
[ 'clean' ]
|
|
|
|
],
|
|
|
|
},
|
|
|
|
theme: 'snow'
|
2020-08-07 12:11:13 +00:00
|
|
|
});
|
2020-08-06 12:47:22 +00:00
|
|
|
</script>
|
2020-08-10 10:29:38 +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-22 13:25:39 +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-13 12:41:10 +00:00
|
|
|
|
|
|
|
$(document).ready(function () {
|
|
|
|
$value = $('#name').val();
|
|
|
|
$.ajax({
|
|
|
|
type: 'get',
|
|
|
|
url: '{{route('events.nameCheck')}}',
|
|
|
|
data: {'nameCheck':$value},
|
|
|
|
success:function (data) {
|
2020-08-17 06:23:48 +00:00
|
|
|
if(data){
|
2020-08-13 12:41:10 +00:00
|
|
|
$("#error").show(100);
|
|
|
|
$("#error").css('color', 'red');
|
|
|
|
$("#disable").prop('disabled', true);
|
|
|
|
$('#disable').css('cursor','not-allowed');
|
|
|
|
}else{
|
|
|
|
$("#error").hide();
|
|
|
|
$("#disable").prop('disabled', false);
|
|
|
|
$('#disable').css('cursor','pointer');
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
error:function (data) {
|
|
|
|
console.log(data);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
$('#name').on('keyup', function () {
|
|
|
|
$value = $(this).val();
|
|
|
|
$.ajax({
|
|
|
|
type: 'get',
|
|
|
|
url: '{{route('events.nameCheck')}}',
|
|
|
|
data: {'nameCheck':$value},
|
|
|
|
success:function (data) {
|
|
|
|
if(data){
|
|
|
|
$("#error").show(100);
|
|
|
|
$("#error").css('color', 'red');
|
|
|
|
$("#disable").prop('disabled', true);
|
|
|
|
$('#disable').css('cursor','not-allowed');
|
|
|
|
}else{
|
|
|
|
$("#error").hide();
|
|
|
|
$("#disable").prop('disabled', false);
|
|
|
|
$('#disable').css('cursor','pointer');
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
error:function (data) {
|
|
|
|
console.log(data);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
})
|
2020-08-11 08:54:01 +00:00
|
|
|
</script>
|
|
|
|
@endsection
|