diff options
Diffstat (limited to 'templates/domains')
| -rw-r--r-- | templates/domains/editdomain.django | 5 | ||||
| -rw-r--r-- | templates/domains/edittld.django | 5 | ||||
| -rw-r--r-- | templates/domains/htmx/domains.htmx.django | 29 | ||||
| -rw-r--r-- | templates/domains/htmx/editdomain.htmx.django | 49 | ||||
| -rw-r--r-- | templates/domains/htmx/edittld.htmx.django | 22 | ||||
| -rw-r--r-- | templates/domains/htmx/tlds.htmx.django | 8 |
6 files changed, 115 insertions, 3 deletions
diff --git a/templates/domains/editdomain.django b/templates/domains/editdomain.django new file mode 100644 index 0000000..7b10b37 --- /dev/null +++ b/templates/domains/editdomain.django @@ -0,0 +1,5 @@ +{% extends "layouts/dashboard.django" %} + +{% block dashboard %} +{% include "domains/htmx/editdomain.htmx.django" %} +{% endblock %} diff --git a/templates/domains/edittld.django b/templates/domains/edittld.django new file mode 100644 index 0000000..a466b56 --- /dev/null +++ b/templates/domains/edittld.django @@ -0,0 +1,5 @@ +{% extends "layouts/dashboard.django" %} + +{% block dashboard %} +{% include "domains/htmx/edittld.htmx.django" %} +{% endblock %} diff --git a/templates/domains/htmx/domains.htmx.django b/templates/domains/htmx/domains.htmx.django index 82a4820..11843f6 100644 --- a/templates/domains/htmx/domains.htmx.django +++ b/templates/domains/htmx/domains.htmx.django @@ -21,6 +21,12 @@ </div> <p class="text-sm text-zinc-200">{{ domain.Name }}.{{ domain.TLD.Name }}</p> </div> + <div class="flex items-center gap-4"> + {% url "domains.manage.edit" id=domain.ID as edit_domain_path %} + <a href="{{ edit_domain_path }}" hx-get="{{ edit_domain_path }}" hx-target="#content" hx-swap="innerHTML" hx-push-url="true" class="text-xs text-zinc-600 hover:text-zinc-300 transition-colors duration-150">Edit</a> + {% url "domains.manage.delete" id=domain.ID as delete_domain_path %} + <button data-confirm-trigger data-confirm-title="Delete {{ domain.Name }}.{{ domain.TLD.Name }}" data-confirm-message="This domain and all associated data will be permanently removed. This action cannot be undone." data-confirm-action="{{ delete_domain_path }}" class="text-xs text-zinc-600 hover:text-red-400 transition-colors duration-150">Delete</button> + </div> </div> {% endfor %} </div> @@ -36,4 +42,25 @@ </div> {% endif %} </div> -</div>
\ No newline at end of file + + <div id="confirm-modal" class="fixed inset-0 z-50 hidden"> + <div class="absolute inset-0 bg-black/60 backdrop-blur-sm" data-confirm-backdrop></div> + <div class="flex items-center justify-center min-h-screen p-4"> + <div class="relative glass rounded-xl glow-border w-full max-w-sm p-6 space-y-4"> + <div class="flex items-center gap-3"> + <div class="flex items-center justify-center w-10 h-10 rounded-xl bg-red-500/10"> + <svg class="w-5 h-5 text-red-400" fill="none" stroke="currentColor" viewBox="0 0 24 24" stroke-width="1.5"> + <path stroke-linecap="round" stroke-linejoin="round" d="M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126ZM12 15.75h.007v.008H12v-.008Z" /> + </svg> + </div> + <h3 id="confirm-title" class="text-sm font-medium text-zinc-100"></h3> + </div> + <p id="confirm-message" class="text-xs text-zinc-400 leading-relaxed"></p> + <div class="flex items-center justify-end gap-3 pt-2"> + <button data-confirm-cancel class="px-4 py-2 text-xs text-zinc-400 hover:text-zinc-200 rounded-lg bg-surface-800 border border-white/[0.06] hover:border-white/[0.1] transition-all duration-150">Cancel</button> + <button id="confirm-action" class="px-4 py-2 text-xs text-white rounded-lg bg-red-500/80 hover:bg-red-500 border border-red-400/20 transition-all duration-150">Delete</button> + </div> + </div> + </div> + </div> +</div> diff --git a/templates/domains/htmx/editdomain.htmx.django b/templates/domains/htmx/editdomain.htmx.django new file mode 100644 index 0000000..f26dbce --- /dev/null +++ b/templates/domains/htmx/editdomain.htmx.django @@ -0,0 +1,49 @@ +<h1 id="page-title" class="text-sm font-medium text-zinc-100" hx-swap-oob="true">{{ PageTitle }}</h1> +<div class="slide-up flex items-start justify-center pt-12"> + <div class="glass rounded-xl glow-border w-full max-w-lg"> + <div class="px-5 py-4 border-b border-white/[0.04]"> + <h2 class="text-sm font-medium text-zinc-200">Edit Domain</h2> + </div> + <div class="p-5"> + {% url "domains.manage.update" id=domain.ID as update_path %} + <form hx-put="{{ update_path }}" hx-swap="none" class="space-y-4"> + <div> + <label class="block text-xs font-medium text-zinc-400 mb-1.5 ml-1">Domain Name</label> + <input type="text" name="name" value="{{ domain.Name }}" required autocomplete="off" class="input-field"> + </div> + <div> + <label class="block text-xs font-medium text-zinc-400 mb-1.5 ml-1">TLD</label> + <div class="dropdown" data-dropdown> + <input type="hidden" name="tld_name" value="{{ domain.TLD.Name }}" data-dropdown-value> + <button type="button" data-dropdown-trigger class="input-field text-left flex items-center justify-between"> + <span class="truncate" data-dropdown-label>.{{ domain.TLD.Name }}</span> + <svg class="w-4 h-4 text-zinc-500 shrink-0 ml-2 transition-transform duration-150" data-dropdown-chevron fill="none" stroke="currentColor" viewBox="0 0 24 24" stroke-width="1.5"> + <path stroke-linecap="round" stroke-linejoin="round" d="m19.5 8.25-7.5 7.5-7.5-7.5" /> + </svg> + </button> + <div class="dropdown-menu" data-dropdown-menu> + <div class="p-2 border-b border-white/[0.04]"> + <input type="text" placeholder="Search TLDs..." class="dropdown-search" data-dropdown-search> + </div> + <div class="dropdown-options" data-dropdown-options> + {% for tld in tlds %} + <button type="button" class="dropdown-option" data-dropdown-option data-value="{{ tld.Name }}" data-label=".{{ tld.Name }}"> + <p class="text-sm text-zinc-200">.{{ tld.Name }}</p> + </button> + {% endfor %} + </div> + <div class="dropdown-empty hidden" data-dropdown-empty> + <p class="text-xs text-zinc-500 text-center py-3">No TLDs found</p> + </div> + </div> + </div> + </div> + <div class="flex items-center gap-3 pt-2"> + <button type="submit" class="btn-primary">Save Changes</button> + {% url "domains.manage" as domains_path %} + <a href="{{ domains_path }}" hx-get="{{ domains_path }}" hx-target="#content" hx-swap="innerHTML" hx-push-url="true" class="text-xs text-zinc-500 hover:text-zinc-300 transition-colors duration-150">Cancel</a> + </div> + </form> + </div> + </div> +</div>
\ No newline at end of file diff --git a/templates/domains/htmx/edittld.htmx.django b/templates/domains/htmx/edittld.htmx.django new file mode 100644 index 0000000..773578b --- /dev/null +++ b/templates/domains/htmx/edittld.htmx.django @@ -0,0 +1,22 @@ +<h1 id="page-title" class="text-sm font-medium text-zinc-100" hx-swap-oob="true">{{ PageTitle }}</h1> +<div class="slide-up flex items-start justify-center pt-12"> + <div class="glass rounded-xl glow-border w-full max-w-lg"> + <div class="px-5 py-4 border-b border-white/[0.04]"> + <h2 class="text-sm font-medium text-zinc-200">Edit TLD</h2> + </div> + <div class="p-5"> + {% url "domains.tlds.update" id=tld.ID as update_path %} + <form hx-put="{{ update_path }}" hx-swap="none" class="space-y-4"> + <div> + <label class="block text-xs font-medium text-zinc-400 mb-1.5 ml-1">TLD Name</label> + <input type="text" name="name" value="{{ tld.Name }}" required autocomplete="off" class="input-field"> + </div> + <div class="flex items-center gap-3 pt-2"> + <button type="submit" class="btn-primary">Save Changes</button> + {% url "domains.tlds" as tlds_path %} + <a href="{{ tlds_path }}" hx-get="{{ tlds_path }}" hx-target="#content" hx-swap="innerHTML" hx-push-url="true" class="text-xs text-zinc-500 hover:text-zinc-300 transition-colors duration-150">Cancel</a> + </div> + </form> + </div> + </div> +</div>
\ No newline at end of file diff --git a/templates/domains/htmx/tlds.htmx.django b/templates/domains/htmx/tlds.htmx.django index 0f4972d..13705d8 100644 --- a/templates/domains/htmx/tlds.htmx.django +++ b/templates/domains/htmx/tlds.htmx.django @@ -29,8 +29,12 @@ </div> </div> {% if not tld.IsDefault %} - {% url "domains.tlds.delete" name=tld.Name as delete_tld_path %} - <button data-confirm-trigger data-confirm-title="Delete .{{ tld.Name }}" data-confirm-message="This TLD and all associated data will be permanently removed. This action cannot be undone." data-confirm-action="{{ delete_tld_path }}" class="text-xs text-zinc-600 hover:text-red-400 transition-colors duration-150">Delete</button> + <div class="flex items-center gap-4"> + {% url "domains.tlds.edit" id=tld.ID as edit_tld_path %} + <a href="{{ edit_tld_path }}" hx-get="{{ edit_tld_path }}" hx-target="#content" hx-swap="innerHTML" hx-push-url="true" class="text-xs text-zinc-600 hover:text-zinc-300 transition-colors duration-150">Edit</a> + {% url "domains.tlds.delete" name=tld.Name as delete_tld_path %} + <button data-confirm-trigger data-confirm-title="Delete .{{ tld.Name }}" data-confirm-message="This TLD and all associated data will be permanently removed. This action cannot be undone." data-confirm-action="{{ delete_tld_path }}" class="text-xs text-zinc-600 hover:text-red-400 transition-colors duration-150">Delete</button> + </div> {% endif %} </div> {% endfor %} |
