2021-04-22 13:31:08 +00:00
|
|
|
@extends("admin.layout.base")
|
|
|
|
@extends("admin.layout.header")
|
|
|
|
|
|
|
|
@section("title")
|
2021-04-29 07:16:08 +00:00
|
|
|
Rediger ugentligt aktivitet - Vis
|
2021-04-22 13:31:08 +00:00
|
|
|
@endsection
|
|
|
|
|
|
|
|
@section("path")
|
2021-04-29 07:16:08 +00:00
|
|
|
<a href="{{ route('multiple-events.create') }}" class="text-white">Opret ugentligt aktivitet</a> /
|
2021-04-22 13:31:08 +00:00
|
|
|
@endsection
|
|
|
|
|
|
|
|
@section("content")
|
|
|
|
<style>
|
|
|
|
.toggle__label::before, .toggle__label::after {
|
|
|
|
border-color: black;
|
|
|
|
}
|
|
|
|
.toggle__text::before {
|
|
|
|
border-color: black;
|
|
|
|
}
|
|
|
|
|
2021-04-29 07:16:08 +00:00
|
|
|
table {
|
|
|
|
font-family: arial, sans-serif;
|
|
|
|
border-collapse: collapse;
|
|
|
|
width: 100%;
|
2021-04-22 13:31:08 +00:00
|
|
|
}
|
2021-04-29 07:16:08 +00:00
|
|
|
|
|
|
|
td, th {
|
|
|
|
|
|
|
|
text-align: left;
|
|
|
|
padding: 8px;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2021-04-22 13:31:08 +00:00
|
|
|
</style>
|
|
|
|
<link href="{{ asset("/css/quill/quill.snow.css") }}" rel="stylesheet">
|
2021-04-29 07:16:08 +00:00
|
|
|
<h1 id="errormesseages" >Opret ugentligt aktivitet: [Vi er i uge <?php echo date('W'); ?>]</h1>
|
2021-05-04 10:32:24 +00:00
|
|
|
<form method="post" action="{{ route("multiple-events.update", $parentEvent) }}" enctype="multipart/form-data">
|
2021-04-22 13:31:08 +00:00
|
|
|
@csrf
|
2021-05-04 10:32:24 +00:00
|
|
|
@method("PUT")
|
2021-04-29 07:16:08 +00:00
|
|
|
<input type="text" name="week" placeholder="Uge">
|
|
|
|
<label id="fileuploadee"for="fileuploade">Baggrundsbillede til nyheden (Valgfri)</label>
|
|
|
|
<input id="fileuploade" type="file" name="resource" accept="image/*">
|
|
|
|
<table>
|
|
|
|
<tr>
|
|
|
|
<th>Aktivitets navn</th>
|
|
|
|
<th>Aktivitets beskrivelse</th>
|
|
|
|
<th>Tovholder</th>
|
|
|
|
<th>Tidsrum (Start)</th>
|
|
|
|
</tr>
|
2021-05-04 10:32:24 +00:00
|
|
|
@foreach($multiEvents as $multiEvent)
|
|
|
|
<tr>
|
|
|
|
<td><input type="text" name="name[][]" max="255" value="{{ $multiEvent->name }}"></td>
|
|
|
|
<td><input type="text" name="description[][]" max="255" value="{{ $multiEvent->description }}"></td>
|
|
|
|
<td><input type="text" name="accountable[][]" value="{{ $multiEvent->accountable }}"></td>
|
|
|
|
<td><input type="datetime-local" name="date[][]" value="{{ $multiEvent->date }}"></td>
|
|
|
|
</tr>
|
|
|
|
@endforeach
|
2021-04-29 07:16:08 +00:00
|
|
|
</table>
|
|
|
|
|
2021-04-22 13:31:08 +00:00
|
|
|
<label class="toggle">
|
2021-04-29 07:16:08 +00:00
|
|
|
<input id="isNews" class="toggle__input" type="checkbox" name="newsoption" onclick="change()">
|
2021-04-22 13:31:08 +00:00
|
|
|
<span class="toggle__label">
|
2021-04-29 07:16:08 +00:00
|
|
|
<span class="toggle__text">Opret som nyhed</span>
|
2021-04-22 13:31:08 +00:00
|
|
|
</span>
|
|
|
|
</label>
|
|
|
|
|
2021-04-29 07:16:08 +00:00
|
|
|
<input id="disable" type="submit" class="btn btn-dark text-white" value="Opret">
|
|
|
|
</form>
|
2021-04-22 13:31:08 +00:00
|
|
|
@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.'
|
|
|
|
}
|
|
|
|
);
|
|
|
|
});
|
|
|
|
|
|
|
|
$(document).ready(function () {
|
|
|
|
$value = $('#name').val();
|
|
|
|
$.ajax({
|
|
|
|
type: 'get',
|
2021-04-29 07:16:08 +00:00
|
|
|
url: '{{route('events.nameCheck')}}',
|
|
|
|
data: {'nameCheck':$value},
|
2021-04-22 13:31:08 +00:00
|
|
|
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);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
$('#name').on('keyup', function () {
|
|
|
|
$value = $(this).val();
|
|
|
|
$.ajax({
|
|
|
|
type: 'get',
|
2021-04-29 07:16:08 +00:00
|
|
|
url: '{{route('events.nameCheck')}}',
|
|
|
|
data: {'nameCheck':$value},
|
2021-04-22 13:31:08 +00:00
|
|
|
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);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
})
|
|
|
|
</script>
|
|
|
|
@endsection
|