v1.5.9 Added and fixed preview, the only problem is that images on event, guide category and guide resource id is not display on the different pages
This commit is contained in:
@@ -32,10 +32,10 @@
|
||||
<label for="accountable">Aktivitet Ansvarlig:</label>
|
||||
<input type="text" name="accountable" id="accountable" required>
|
||||
<label for="description">Aktivitet Beskrivelse:</label>
|
||||
<small class="form-text text-muted">For at kunne indsætte et link, skal du markere den text du vil lave som et link først.</small>
|
||||
<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>
|
||||
<div id="editor"></div>
|
||||
<textarea name="description" class="d-none" id="hiddenArea"></textarea>
|
||||
<label for="date">Aktivitet dato:</label>
|
||||
<label for="date">Aktivitets dato:</label>
|
||||
<input type="datetime-local" name="date" id="date" required>
|
||||
<label class="toggle">
|
||||
<input class="toggle__input" type="checkbox" name="newsoption">
|
||||
@@ -43,7 +43,7 @@
|
||||
<span class="toggle__text">Opret som nyhed</span>
|
||||
</span>
|
||||
</label>
|
||||
<label id="fileuploadee"for="fileuploade">Baggrundsbillede til nyheden (Valgfri):</label>
|
||||
<label id="fileuploadee"for="fileuploade">Baggrundsbillede til nyheden (Valgfri)</label>
|
||||
<input id="fileuploade" type="file" name="resource" accept="image/*">
|
||||
|
||||
<input id="disable" type="submit" class="btn btn-dark text-white" value="Opret">
|
||||
|
||||
@@ -26,10 +26,11 @@
|
||||
</div>
|
||||
<table class="tbl mt-2 letterSpaceTable fixOverflow" id="table_id">
|
||||
<thead>
|
||||
<th>Aktivitet Navn</th>
|
||||
<th>Aktivitet Ansvarlig</th>
|
||||
<th>Aktivitet Dato</th>
|
||||
<th>Aktivitets Navn</th>
|
||||
<th>Aktivitets Ansvarlig</th>
|
||||
<th>Aktivitets Dato</th>
|
||||
<th class="w-1em"><img class="w-100" src="{{ asset('/images/icons/eye.svg') }}" alt="Show"></th>
|
||||
<th class="w-1em"><img class="w-100" src="{{ asset('/images/icons/preview.svg') }}" alt="preview"></th>
|
||||
@if(auth()->user()->can('event.edit'))
|
||||
<th class="w-1em"><img class="w-100" src="{{ asset('/images/icons/pencil.svg') }}" alt="Update"></th>
|
||||
@endif
|
||||
@@ -45,6 +46,7 @@
|
||||
<td>{{ $event->accountable }}</td>
|
||||
<td>{{ \Illuminate\Support\Facades\Date::createFromTimeStamp(strtotime($event->date))->format('d/m/Y \k\l\. H:i') }}</td>
|
||||
<td><a href="{{ route("events.signups", [ "event" => $event ]) }}"><img class="w-100" src="{{ asset('/images/icons/eye-dark.svg') }}" alt="Show"></a></td>
|
||||
<td><a id="preview" onclick="modalNewsContent({{$event->id}})" style="cursor: pointer" ><img class="w-100" src="{{ asset('/images/icons/preview-dark.svg') }}" alt="preview"></a></td>
|
||||
@if(auth()->user()->can('event.edit'))
|
||||
<td><a href="{{ route("events.edit", [ "event" => $event ]) }}"><img class="w-100" src="{{ asset('/images/icons/pencil-dark.svg') }}" alt="Update"></a></td>
|
||||
@endif
|
||||
@@ -59,13 +61,64 @@
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div id="newsModal" class="modal zindex-100">
|
||||
<div id="modal-content" class="modal-content text-black d-block w-50">
|
||||
<span class="close" onclick="closeModal()">×</span>
|
||||
<center>
|
||||
<h1 id="name"></h1>
|
||||
<hr>
|
||||
<strong><label for="date">Aktivitets dato</label></strong>
|
||||
<p id="date"></p>
|
||||
<strong><label for="accountable">Aktivitets ansvarlig</label></strong>
|
||||
<p id="accountable"></p>
|
||||
<hr>
|
||||
<img src="{{ asset(\App\Resource::query()->where($event->id, "=", $event->resource_id)->first()->filename) }}">
|
||||
<p id="description"></p>
|
||||
</center>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@section('scripts')
|
||||
<script>
|
||||
var modalNews = document.getElementById("newsModal");
|
||||
|
||||
function modalNewsContent(id) {
|
||||
$.ajax({
|
||||
type: 'get',
|
||||
url: '{{route('events.preview')}}',
|
||||
data: {'preview':id},
|
||||
success:function (data) {
|
||||
modalNews.style.display = "block";
|
||||
var l = JSON.parse(data);
|
||||
console.log(l);
|
||||
$("#name").html(l.name);
|
||||
$("#date").html(l.date);
|
||||
$("#accountable").html(l.accountable);
|
||||
$("#description").html(l.description);
|
||||
$("#f").html(l.resource_id);
|
||||
},
|
||||
error:function (data) {
|
||||
console.log(data);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function closeModal() {
|
||||
modalNews.style.display = "none";
|
||||
}
|
||||
|
||||
window.onmousedown = function(event) {
|
||||
if (event.target == modalNews) {
|
||||
modalNews.style.display = "none";
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<script>
|
||||
$(document).ready( function () {
|
||||
$('#table_id').DataTable({
|
||||
columnDefs: [
|
||||
{ orderable: false, targets: [-1, -2, -3] }
|
||||
{ orderable: false, targets: [-1, -2, -3, -4] }
|
||||
]
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user