adding static connection
This commit is contained in:
1 parent
eba7896893
commit
422e217180
14 files changed
+405
-2
No files matched your search
@@ -0,0 +1,16 @@
|
||||
<tr id="static-connection-{{ sc.id }}">
|
||||
<td>{{ sc.id }}</td>
|
||||
<td>{{ sc.od_mm }}</td>
|
||||
<td>{{ sc.od_in }}</td>
|
||||
<td class="row-actions">
|
||||
<button class="btn btn-ghost"
|
||||
hx-get="/admin/static-connections/{{ sc.id }}/edit"
|
||||
hx-target="#static-connection-{{ sc.id }}"
|
||||
hx-swap="outerHTML">Edit</button>
|
||||
<button class="btn btn-danger"
|
||||
hx-delete="/admin/static-connections/{{ sc.id }}"
|
||||
hx-target="#static-connection-{{ sc.id }}"
|
||||
hx-swap="outerHTML"
|
||||
hx-confirm="Delete {{ sc.od_mm }} mm?">Delete</button>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -0,0 +1,19 @@
|
||||
<tr id="static-connection-{{ sc.id }}">
|
||||
<td colspan="4">
|
||||
<form hx-post="/admin/static-connections/{{ sc.id }}"
|
||||
hx-target="#static-connection-{{ sc.id }}"
|
||||
hx-swap="outerHTML"
|
||||
class="inline-edit">
|
||||
<span class="muted">#{{ sc.id }}</span>
|
||||
<label>OD (mm) <input type="number" name="od_mm" step="0.001" min="0" value="{{ sc.od_mm }}" required></label>
|
||||
<label>OD (in) <input type="number" name="od_in" step="0.0001" min="0" value="{{ sc.od_in }}" required></label>
|
||||
<div class="row-actions">
|
||||
<button type="submit" class="btn btn-primary">Save</button>
|
||||
<button type="button" class="btn btn-ghost"
|
||||
hx-get="/admin/static-connections/{{ sc.id }}/row"
|
||||
hx-target="#static-connection-{{ sc.id }}"
|
||||
hx-swap="outerHTML">Cancel</button>
|
||||
</div>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -0,0 +1,19 @@
|
||||
<div id="static-connection-list" class="card">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>OD (mm)</th>
|
||||
<th>OD (in)</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for sc in static_connections %}
|
||||
{% include "admin/_static_connection_row.html" %}
|
||||
{% else %}
|
||||
<tr><td colspan="4" class="muted">No static connections recorded.</td></tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@@ -0,0 +1,19 @@
|
||||
{% extends "base.html" %}
|
||||
{% block title %}Static Connections · {{ app_name }}{% endblock %}
|
||||
{% block body %}
|
||||
{% include "_nav.html" %}
|
||||
<main class="container">
|
||||
<h1>Static Connections</h1>
|
||||
|
||||
<div class="card">
|
||||
<h2>Add connection</h2>
|
||||
<form hx-post="/admin/static-connections" hx-target="#static-connection-list" hx-swap="outerHTML" class="form-grid">
|
||||
<label>OD (mm) <input type="number" name="od_mm" step="0.001" min="0" placeholder="e.g. 30.0" required></label>
|
||||
<label>OD (in) <input type="number" name="od_in" step="0.0001" min="0" placeholder="e.g. 1.1811" required></label>
|
||||
<button type="submit" class="btn btn-primary">Add</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
{% include "admin/_static_connections_table.html" %}
|
||||
</main>
|
||||
{% endblock %}
|
||||
Reference in new issue
Block a user