blob: 8b78e64327305fda2dffb84b0923d34deeb798c1 (
plain)
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
51
52
53
|
{% extends "admin/umbrellas.html" %}
{% block table %}
<div class="data-table-container">
<table class="data">
<thead>
<tr>
<th>#</th>
<th>Status</th>
<th>Tenant</th>
<th>ID</th>
<th>Phone</th>
<th colspan=2>Lent at</th>
</tr>
</thead>
<tbody>
{% for umb in umbrellas %}
<tr id="{{ umb.id }}" class="{{ umb.status }}">
{% if umb.id == edit %}
<form method="post" action="/admin/umbrellas/edit">
<input name="id" type="number" value="{{ umb.id }}" hidden/>
<td>{{ umb.id }}</td>
<td>{{ status_dropdown(umb) }}</td>
<td><input name="tenant_name" value="{{ umb.tenant_name }}" class="db-edit" /></td>
<td><input name="tenant_id" type="number" value="{{ umb.tenant_id }}" class="db-edit" /></td>
<td><input name="tenant_phone" type="tel" value="{{ umb.tenant_phone }}" class="db-edit" /></td>
<td><input name="lent_at" type="datetime-local" value="{{ umb.lent_at_str }}"/></td>
<td>{{ umb.lent_time_ago_str }}
{% if umb.status in ["lent", "overdue"] %} ago {% endif %}
</td>
<td>
<input type="submit" value="Submit" />
</td>
</form>
{% else %}
<td>{{ umb.id }}</td>
<td>{{ umb.status }}</td>
<td>{{ umb.tenant_name }}</td>
<td>{{ umb.tenant_id }}</td>
<td>{{ umb.tenant_phone }}</td>
<td>{{ umb.lent_at_str }}</td>
<td>{{ umb.lent_time_ago_str }}
{% if umb.status in ["lent", "overdue"] %} ago {% endif %}
</td>
<td>
<a href="/admin/umbrellas?edit={{ umb.id }}#{{ umb.id }}">Edit</a>
</td>
{% endif %}
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% endblock %}
|