feat: Sprint 1 final — delete host, Alpine modal events, grid/list toggle, transfers panel
This commit is contained in:
@@ -1,18 +1,19 @@
|
||||
{{define "host_modal"}}
|
||||
<div id="host-modal" class="fixed inset-0 z-50 hidden" x-data="{ open: false }" x-init="open = true">
|
||||
<div class="absolute inset-0 bg-black/30 backdrop-blur-sm" @click="open = false; $el.parentElement.classList.add('hidden')"></div>
|
||||
<div id="host-modal" class="fixed inset-0 z-50" x-data="{ open: false }" x-show="open" x-cloak
|
||||
@open-modal.window="open = true" @keydown.escape.window="open = false">
|
||||
<div class="absolute inset-0 bg-black/30 backdrop-blur-sm" @click="open = false"></div>
|
||||
<div class="absolute inset-0 flex items-center justify-center p-4" x-show="open" x-transition>
|
||||
<div class="bg-white rounded-xl shadow-xl w-full max-w-md p-6" @click.outside="open = false">
|
||||
<div class="flex items-center justify-between mb-6">
|
||||
<h2 class="text-lg font-semibold text-on-surface">Add New Host</h2>
|
||||
<button @click="open = false; $el.closest('#host-modal').classList.add('hidden')"
|
||||
<button @click="open = false"
|
||||
class="p-1 rounded-lg hover:bg-surface-container-low text-on-surface-variant">
|
||||
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"/></svg>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<form hx-post="/hosts" hx-target="#host-list" hx-swap="outerHTML"
|
||||
@submit="open = false; setTimeout(() => document.getElementById('host-modal').classList.add('hidden'), 100)"
|
||||
@submit="open = false"
|
||||
class="space-y-4">
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-on-surface mb-1">Host Name</label>
|
||||
@@ -60,7 +61,7 @@
|
||||
</select>
|
||||
</div>
|
||||
<div class="flex justify-end gap-3 pt-2">
|
||||
<button type="button" @click="open = false; $el.closest('#host-modal').classList.add('hidden')"
|
||||
<button type="button" @click="open = false"
|
||||
class="px-4 py-2 rounded-lg text-sm font-medium text-on-surface-variant hover:bg-surface-container-low transition-colors">
|
||||
Cancel
|
||||
</button>
|
||||
|
||||
Reference in New Issue
Block a user