parent
48e701fea4
commit
a0735aba07
@ -1,3 +1,8 @@
|
||||
tbody input {
|
||||
max-width: 80px;
|
||||
}
|
||||
|
||||
.drag-handle {
|
||||
cursor: move;
|
||||
}
|
||||
|
||||
|
@ -1,9 +1,14 @@
|
||||
{% if title %}
|
||||
<span data-bs-toggle="tooltip"
|
||||
title="{{ title }}"
|
||||
style="border-bottom: 1px dotted">
|
||||
{{ content }}
|
||||
</span>
|
||||
style="border-bottom: 1px dotted"
|
||||
needstooltip
|
||||
>{{ content }}</span>
|
||||
<script>
|
||||
var tt = document.querySelector('[needstooltip]');
|
||||
new bootstrap.Tooltip(tt);
|
||||
tt.removeAttribute('needstooltip');
|
||||
</script>
|
||||
{% else %}
|
||||
{{ content }}
|
||||
{% endif %}
|
||||
|
@ -0,0 +1,72 @@
|
||||
<table class="table table-striped table-bordered table-hover mb-4">
|
||||
<thead class="table-secondary">
|
||||
<tr>
|
||||
<th colspan="100">
|
||||
{{ sub.label }}
|
||||
{% if user.is_staff %}
|
||||
<a href="/admin/jobs/submittal/{{ sub.pk }}/change"
|
||||
class="edit-link">Edit</a>
|
||||
<div class="btn-group float-end">
|
||||
<button class="btn btn-primary btn-sm"
|
||||
hx-get="{% url 'jobs:stair_scope_row_add' %}?submittal={{ sub.pk }}"
|
||||
hx-target="#{{ bodyid }}"
|
||||
hx-swap="beforeend"
|
||||
>Add stair</button>
|
||||
<button class="btn btn-danger btn-sm"
|
||||
hx-delete="{% url 'jobs:sub_scope' pk=sub.pk %}"
|
||||
hx-target="closest table"
|
||||
hx-swap="outerHTML"
|
||||
hx-confirm="Are you sure you want to delete {{ sub.job.number }} sub {{ sub.number }} and all its stairs?"
|
||||
>Delete sub</button>
|
||||
</div>
|
||||
{% endif %}
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
{% if user.is_staff %}<th></th>{% endif %}
|
||||
<th>Stair</th>
|
||||
<th>Grid</th>
|
||||
<th>Levels</th>
|
||||
<th>Flights</th>
|
||||
<th>Stringer Type</th>
|
||||
<th>Stair Construction</th>
|
||||
<th>Landings</th>
|
||||
<th>Landing Construction</th>
|
||||
<th>Rail Type</th>
|
||||
<th>Finish</th>
|
||||
<th>STN</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody id="{{ bodyid }}" class="collapse show">
|
||||
<tr class="mh-1 py-0"><td class="py-0" colspan="100"></td></tr>
|
||||
{% for stair in sub.get_stairs %}
|
||||
{% include 'jobs/stair_scope_row.html' %}
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
|
||||
<script>
|
||||
new Sortable(document.getElementById("{{ bodyid }}"), {
|
||||
group: {
|
||||
name: 'subs',
|
||||
},
|
||||
handle: '.drag-handle',
|
||||
draggable: '.draggable',
|
||||
animation: 200,
|
||||
});
|
||||
</script>
|
||||
|
||||
<tfoot class="table-secondary table-bordered">
|
||||
<tr class="mh-1 py-0"><td class="py-0" colspan="100"></td></tr>
|
||||
<tr hx-target="closest tr" hx-swap="outerHTML">
|
||||
<td colspan="{% if user.is_staff %}4{% else %}3{% endif %}">
|
||||
{% if user.is_staff %}
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>{{ sub.total_flights }}</td>
|
||||
<td colspan="2"></td>
|
||||
<td>{{ sub.total_landings }}</td>
|
||||
<td colspan="11"></td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
Loading…
Reference in new issue