Converted all inline onclick/onsubmit handlers to Alpine.js @click/@submit directives and added x-data attributes to template body tags. Templates updated: - admin.templ: Added x-data="admin", converted scan/hide buttons - analytics.templ: Added x-data, converted loadAnalytics button - api_explorer.templ: Added x-data for API explorer page - bookshelf.templ: Added x-data, converted library/pagination handlers - collection_modal.templ: Added x-data for modal components - collection_rules.templ: Added x-data, converted all rule handlers - collections.templ: Added x-data, converted navigation/book handlers - conflicts.templ: Added x-data, converted resolve/dismiss handlers - header.templ: Converted theme dropdown and user menu handlers - index.templ: Added x-data for theme/auth - login.templ: Added x-data for theme switching - profile.templ: Added x-data, converted delete account - profile_form.templ: Converted modal close handler - profile_modal.templ: Added x-data for modal - progress.templ: Removed script (uses header.logout) - queue.templ: Added x-data, converted queue handlers - register.templ: Added x-data for theme - restore_system_collection_modal.templ: Added x-data - toast.templ: Converted to x-init with Alpine - unlinked_books.templ: Added x-data for bulk operations Dynamic content in devices.templ uses event delegation via data attributes.
32 lines
1.6 KiB
Templ
32 lines
1.6 KiB
Templ
package templates
|
|
|
|
templ RestoreSystemCollectionModal() {
|
|
<div x-data="collections" class="fixed inset-0 z-50 flex items-center justify-center bg-black/70">
|
|
<div class="card rounded-lg p-6 w-full max-w-md mx-4" style="background-color: var(--bg-secondary); border-color: var(--border);">
|
|
<div class="flex justify-between items-center mb-6">
|
|
<h2 class="text-xl font-bold" style="color: var(--text-primary)">Restore System Collection</h2>
|
|
<button type="button" @click="closeCollectionModal()" class="p-2 hover:opacity-80 rounded" style="color: var(--text-primary)">✕</button>
|
|
</div>
|
|
<div class="mb-4">
|
|
<p class="mb-4" style="color: var(--text-secondary)">Select a system collection to restore:</p>
|
|
<form
|
|
hx-post="/api/dashboard/restore-system-collection"
|
|
hx-redirect="/collections"
|
|
>
|
|
<select name="collection_name" class="w-full px-4 py-2 border rounded-lg" style="background-color: var(--bg-primary); color: var(--text-primary); border-color: var(--border);">
|
|
<option value="">Select collection...</option>
|
|
<option value="continue-reading">Continue Reading</option>
|
|
<option value="recently-added">Recently Added</option>
|
|
<option value="recently-read">Recently Read</option>
|
|
<option value="not-started">Not Started</option>
|
|
</select>
|
|
<div class="flex justify-end space-x-3 mt-6">
|
|
<button type="button" @click="closeCollectionModal()" class="btn-secondary px-4 py-2 rounded-lg">Cancel</button>
|
|
<button type="submit" class="btn-primary px-4 py-2 rounded-lg">Restore</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
}
|