diff options
author | Frederick Yin <fkfd@fkfd.me> | 2022-02-04 20:44:07 +0800 |
---|---|---|
committer | Frederick Yin <fkfd@fkfd.me> | 2022-02-04 20:44:07 +0800 |
commit | 87c661557186a4975fa94977ac1ac1be9bd87d2e (patch) | |
tree | 394f718b68c83a992fffe61b8b29e3497a25e9aa /jimbrella/templates/admin | |
parent | 15dd33f6b1db117716e16f1dfee281efd9b43a2a (diff) |
Supply Jinja with full umbrella data sorted by status
Diffstat (limited to 'jimbrella/templates/admin')
-rw-r--r-- | jimbrella/templates/admin/index.html | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/jimbrella/templates/admin/index.html b/jimbrella/templates/admin/index.html index 73ae5f6..50b88ae 100644 --- a/jimbrella/templates/admin/index.html +++ b/jimbrella/templates/admin/index.html @@ -15,22 +15,19 @@ <div class="banner overdue"> <h2 class="banner-heading">Overdue</h2> <span class="proportion"> - <strong class="big">{{ overdue }}</strong> / {{ umbrellas }} + <strong class="big">{{ overdue|length }}</strong> / {{ umbrellas|length }} </span> <div class="table-container"> {% if mobile %} <table class="data"> {% for umb in overdue %} <tr class="{{ umb.status }}"> - <th class="big far" rowspan=4>#{{ umb.serial }}</th> + <th class="big far" rowspan=4>#{{ umb.id }}</th> <td>{{ umb.tenant_name }}</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> + <tr class="{{ umb.status }}"><td>{{ umb.lent_at }}</td></tr> + <tr class="{{ umb.status }}"><td>{{ umb.lent_time_ago }}</td></tr> {% endfor %} </table> {% else %} @@ -46,10 +43,10 @@ <tbody> {% for umb in overdue %} <tr> - <td>{{ umb.serial }}</td> + <td>{{ umb.id }}</td> <td>{{ umb.tenant_name }}</td> <td>{{ umb.tenant_phone }}</td> - <td>{{ umb.lent_time_ago_str }} ago</td> + <td>{{ umb.lent_time_ago }}</td> </tr> {% endfor %} </tbody> @@ -64,13 +61,13 @@ <div class="tile lent"> <h2 class="tile-heading">Lent</h2> <span class="proportion"> - <strong class="big">{{ lent }}</strong> / {{ umbrellas }} + <strong class="big">{{ lent|length }}</strong> / {{ umbrellas|length }} </span> </div> <div class="tile available"> <h2 class="tile-heading">Available</h2> <span class="proportion"> - <strong class="big">{{ available }}</strong> / {{ umbrellas }} + <strong class="big">{{ available|length }}</strong> / {{ umbrellas|length }} </span> </div> </div> |