Adding delete option for scopes
This commit is contained in:
1 parent
f4771e33d4
commit
14aa2ac5d6
4 files changed
+118
-7
No files matched your search
@@ -30,13 +30,16 @@
|
||||
{% for ct in column_types %}
|
||||
<th data-sort-off>{{ ct.name }}</th>
|
||||
{% endfor %}
|
||||
{% if can_write_scopes %}
|
||||
<th data-sort-off></th>
|
||||
{% endif %}
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for row in rows %}
|
||||
{% set scope = row.scope %}
|
||||
{% set info = row.info %}
|
||||
<tr>
|
||||
<tr id="scope-row-{{ scope.id }}">
|
||||
<td>
|
||||
<strong><a href="/admin/augmented-parts/{{ scope.id }}">{{ scope.description }}</a></strong>
|
||||
{% if scope.sku %}<br><span class="muted">{{ scope.sku }}</span>{% endif %}
|
||||
@@ -67,10 +70,19 @@
|
||||
{% endif %}
|
||||
</td>
|
||||
{% endfor %}
|
||||
{% if can_write_scopes %}
|
||||
<td class="row-actions">
|
||||
<button class="btn btn-danger"
|
||||
hx-delete="/scopes/{{ scope.id }}"
|
||||
hx-target="#scope-row-{{ scope.id }}"
|
||||
hx-swap="outerHTML"
|
||||
hx-confirm="Delete {{ scope.sku or scope.description }}?">Delete</button>
|
||||
</td>
|
||||
{% endif %}
|
||||
</tr>
|
||||
{% else %}
|
||||
<tr>
|
||||
<td colspan="{{ 6 + column_types | length }}" class="muted">
|
||||
<td colspan="{{ 6 + column_types | length + (1 if can_write_scopes else 0) }}" class="muted">
|
||||
No scopes match your search.
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
Reference in new issue
Block a user