-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathobjects.html
50 lines (44 loc) · 1.48 KB
/
objects.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
{% if not request.headers.get("Hx-Request") %}
{% extends "base.html" %}
{% endif %}
{% block breadcrumb %}
<nav aria-label="breadcrumb" id="nav-breadcrumb" hx-swap-oob="true">
<ul>
<li>Objects</li>
<li><a href="#" hx-target="#body-main" hx-get="{{ request.path }}">{{ request.view_args.get("object_type")|capitalize }}</a></li>
</ul>
</nav>
{% endblock breadcrumb %}
{% block body %}
<h4>Manage {{ request.view_args.get("object_type") }}</h4>
<div class="grid split-grid">
<article>
<hgroup>
<h5>New object</h5>
<p>Create an object by defining a unique name.</p>
</hgroup>
<form
hx-trigger="submit throttle:200ms"
_="on htmx:afterRequest[event.detail.successful==true]
trigger submit on #{{ request.view_args.get("object_type") }}-table-search
end
"
hx-post="/objects/{{ request.view_args.get("object_type") }}"
id="{{ request.view_args.get("object_type") }}-form">
<fieldset>
<label for="name">Name
<input type="text" name="name" id="name"
autocomplete="off"
autocorrect="off"
autocapitalize="off"
spellcheck="false">
</label>
</fieldset>
<button data-loading-disable type="submit" _="install buttonCheckHtmxResponse">Create</button>
</form>
</article>
<article id="{{ request.view_args.get("object_type") }}-full-table">
{% include "objects/includes/table.html" %}
</article>
</div>
{% endblock body %}