mirror of
https://github.com/netbox-community/netbox.git
synced 2026-01-23 12:08:43 -06:00
* WIP * Misc cleanup * Add warning re: nested quick-adds
This commit is contained in:
28
netbox/templates/htmx/quick_add.html
Normal file
28
netbox/templates/htmx/quick_add.html
Normal file
@@ -0,0 +1,28 @@
|
||||
{% load form_helpers %}
|
||||
{% load helpers %}
|
||||
{% load i18n %}
|
||||
|
||||
<div class="modal-header">
|
||||
<h2 class="modal-title">
|
||||
{% trans "Quick Add" %} {{ model|meta:"verbose_name"|bettertitle }}
|
||||
</h2>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="modal-body row">
|
||||
<form
|
||||
hx-post="{% url model|viewname:"add" %}?_quickadd=True&target={{ request.GET.target }}"
|
||||
hx-target="#htmx-modal-content"
|
||||
enctype="multipart/form-data"
|
||||
>
|
||||
{% csrf_token %}
|
||||
{% include 'htmx/form.html' %}
|
||||
<div class="text-end">
|
||||
<button type="button" class="btn btn-outline-secondary btn-float" data-bs-dismiss="modal" aria-label="Cancel">
|
||||
{% trans "Cancel" %}
|
||||
</button>
|
||||
<button type="submit" name="_quickadd" class="btn btn-primary">
|
||||
{% trans "Create" %}
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
22
netbox/templates/htmx/quick_add_created.html
Normal file
22
netbox/templates/htmx/quick_add_created.html
Normal file
@@ -0,0 +1,22 @@
|
||||
{% load form_helpers %}
|
||||
{% load helpers %}
|
||||
{% load i18n %}
|
||||
|
||||
<div class="modal-header">
|
||||
<h2 class="modal-title">
|
||||
{{ object|meta:"verbose_name"|bettertitle }} {% trans "Created" %}
|
||||
</h2>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="modal-body row">
|
||||
{# This content is intended to be scraped and populated in the targeted selection field. #}
|
||||
<p id="quick-add-object"
|
||||
data-object-repr="{{ object }}"
|
||||
data-object-id="{{ object.pk }}"
|
||||
data-target-id="{{ request.GET.target }}"
|
||||
>
|
||||
{% blocktrans with object=object|linkify object_type=object|meta:"verbose_name" %}
|
||||
Created {{ object_type }} {{ object }}
|
||||
{% endblocktrans %}
|
||||
</p>
|
||||
</div>
|
||||
Reference in New Issue
Block a user