48 lines
1.7 KiB
PHP
48 lines
1.7 KiB
PHP
<x-app-layout>
|
|
<x-slot name="header">
|
|
{{ __('Polls') }}
|
|
</x-slot>
|
|
|
|
<div class="py-6">
|
|
<div class="max-w-7xl mx-auto sm:px-6 lg:px-8">
|
|
<div class="bg-theme-background overflow-x-visible shadow-xl sm:rounded-lg">
|
|
|
|
<div class="p-12 px-6 sm:px-20 bg-theme-background">
|
|
|
|
@livewire('side-post', [
|
|
'type' => 'SiteContents\Manage\Polls',
|
|
'random' => false,
|
|
'fallbackTitle' => __('Manage polls'),
|
|
'fallbackDescription' => __('Create polls, set their questions, settings and target audience, and follow the results.') ])
|
|
|
|
@livewire('polls.manage')
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
@push('scripts')
|
|
<script>
|
|
// Date pickers live in modals that appear after page load: initialize new ones after each Livewire update
|
|
function initPollDatePickers() {
|
|
if (!window.LaravelFlatpickr) {
|
|
return;
|
|
}
|
|
document.querySelectorAll('input.flatpickr-input[data-selector-id]').forEach(input => {
|
|
if (!input._flatpickr) {
|
|
window.LaravelFlatpickr.initializeFlatpickr(input);
|
|
}
|
|
});
|
|
}
|
|
|
|
document.addEventListener('DOMContentLoaded', function () {
|
|
setTimeout(initPollDatePickers, 100);
|
|
Livewire.hook('morph.updated', () => {
|
|
setTimeout(initPollDatePickers, 200);
|
|
setTimeout(initPollDatePickers, 500);
|
|
});
|
|
});
|
|
</script>
|
|
@endpush
|
|
</x-app-layout>
|