summaryrefslogtreecommitdiff
path: root/jimbrella/templates/admin/umbrellas_mobile.html
blob: 705722f04ca9fc3740338cfa9ba60ae70572145d (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
54
55
56
57
58
59
60
61
62
{% extends "admin/umbrellas.html" %}
{% block table %}
<div class="data-table-container">
    <table class="data">
        {% for umb in umbrellas %}
        {% if umb.id == edit %}
        <form method="post" action="/admin/umbrellas/edit">
            <input name="id" type="number" value="{{ umb.id }}" hidden />
            <tr id="{{ umb.id }}" class="{{ umb.status }}">
                <th rowspan=5>
                    {{ umb.id }} <br />
                    {{ status_dropdown(umb) }} <br />
                    <input type="submit" value="Submit" />
                </th>
                <td><input name="tenant_name" value="{{ umb.tenant_name }}" /></td>
            </tr>
            <tr class="{{ umb.status }}">
                <td><input name="tenant_id" type="number" value="{{ umb.tenant_id }}" /></td>
            </tr>
            <tr class="{{ umb.status }}">
                <td><input name="tenant_phone" type="tel" value="{{ umb.tenant_phone }}" /></td>
            </tr>
            <tr class="{{ umb.status }}">
                <td><input name="lent_at" type="datetime-local" value="{{ umb.lent_at_str }}" /></td>
            </tr>
            <tr class="{{ umb.status }}"><td>
                {{ umb.lent_time_ago_str }}
                {% if umb.status in ["lent", "overdue"] %} ago {% endif %}
            </td></tr>
        </form>
        {% else %}
        {# not edit mode #}
        {% if umb.status in ["lent", "overdue"] %}
        <tr id="{{ umb.id }}" class="{{ umb.status }}">
                <th rowspan=5>
                    {{ umb.id }} <br />
                    {{ umb.status }} <br />
                    <a href="/admin/umbrellas?edit={{ umb.id }}">Edit</a>
                </th>
                <td>{{ umb.tenant_name }}</td>
            </tr>
            <tr class="{{ umb.status }}"><td>{{ umb.tenant_id }}</td></tr>
            <tr class="{{ umb.status }}"><td>{{ umb.tenant_phone }}</td></tr>
            <tr class="{{ umb.status }}"><td>{{ umb.lent_at_str }}</td></tr>
            <tr class="{{ umb.status }}"><td>
                {{ umb.lent_time_ago_str }}
                {% if umb.status in ["lent", "overdue"] %} ago {% endif %}
            </td></tr>
        {% else %}
        <tr id="{{ umb.id }}" class="{{ umb.status }}">
                <th colspan=2>
                    {{ umb.id }} <br />
                    {{ umb.status }} <br />
                    <a href="/admin/umbrellas?edit={{ umb.id }}#{{ umb.id }}">Edit</a>
                </th>
            </tr>
        {% endif %}
        {% endif %}
        {% endfor %}
    </table>
</div>
{% endblock %}