Feat: Reusable download Proof Button
This commit is contained in:
@@ -52,7 +52,7 @@
|
||||
<!-- Column Selector -->
|
||||
<div class="flex justify-between col-md-12 mt-3 mb-4">
|
||||
<!-- Include the reusable download-proofs component -->
|
||||
<x-download-proofs :route="route('activitiesAttended.downloadProofs')" />
|
||||
<x-download-proofs :route="route('admin.downloadProofs')" :model="'ActivitiesAttended'" />
|
||||
<div class="dropdown">
|
||||
<button class="btn btn-danger dropdown-toggle" type="button" id="columnSelectorDropdown" data-bs-toggle="dropdown" aria-expanded="false">
|
||||
<i class="fas fa-columns me-1"></i> Customize Columns
|
||||
@@ -268,7 +268,8 @@
|
||||
@section('scripts')
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/js/all.min.js" integrity="sha512-Tn2m0TIpgVyTzzvmxLNuqbSJH3JP8jm+Cy3hvHrW7ndTDcJ1w5mBiksqDBb8GpE2ksktFvDB/ykZ0mDpsZj20w==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
||||
<script>
|
||||
const downloadProofsRoute = "{{ route('activitiesAttended.downloadProofs') }}";
|
||||
const downloadProofsRoute = "{{ route('admin.downloadProofs') }}";
|
||||
const currentModel = "{{ isset($model) ? $model : 'ActivitiesAttended' }}";
|
||||
const csrf_token = "{{ csrf_token() }}";
|
||||
$(document).ready(function() {
|
||||
// Handle "Select All" checkbox
|
||||
@@ -582,6 +583,13 @@
|
||||
.attr('name', 'ids')
|
||||
.attr('value', JSON.stringify(selectedIds))
|
||||
.appendTo(form);
|
||||
|
||||
// Add model name
|
||||
$('<input>')
|
||||
.attr('type', 'hidden')
|
||||
.attr('name', 'model')
|
||||
.attr('value', currentModel)
|
||||
.appendTo(form);
|
||||
|
||||
$('body').append(form);
|
||||
form.submit();
|
||||
|
||||
Reference in New Issue
Block a user