diff options
author | Frederick Yin <fkfd@fkfd.me> | 2022-02-02 11:16:44 +0800 |
---|---|---|
committer | Frederick Yin <fkfd@fkfd.me> | 2022-02-02 11:16:44 +0800 |
commit | 2a5c95261c71d9c30d53053e2d0cd1c1282f6b1c (patch) | |
tree | 6f267175715b980f77ba18aa5c741d6478fc2e9a | |
parent | 357cc3d8d9f2b02e60f0763f4701bd614b876436 (diff) |
Adapt jinja templates
-rw-r--r-- | jimbrella/templates/admin/umbrellas_desktop.html | 12 | ||||
-rw-r--r-- | jimbrella/templates/admin/umbrellas_mobile.html | 20 |
2 files changed, 16 insertions, 16 deletions
diff --git a/jimbrella/templates/admin/umbrellas_desktop.html b/jimbrella/templates/admin/umbrellas_desktop.html index c8b0044..8b78e64 100644 --- a/jimbrella/templates/admin/umbrellas_desktop.html +++ b/jimbrella/templates/admin/umbrellas_desktop.html @@ -14,11 +14,11 @@ </thead> <tbody> {% for umb in umbrellas %} - <tr id="{{ umb.serial }}" class="{{ umb.status }}"> - {% if umb.serial == edit %} + <tr id="{{ umb.id }}" class="{{ umb.status }}"> + {% if umb.id == edit %} <form method="post" action="/admin/umbrellas/edit"> - <input name="serial" type="number" value="{{ umb.serial }}" hidden/> - <td>{{ umb.serial }}</td> + <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> @@ -32,7 +32,7 @@ </td> </form> {% else %} - <td>{{ umb.serial }}</td> + <td>{{ umb.id }}</td> <td>{{ umb.status }}</td> <td>{{ umb.tenant_name }}</td> <td>{{ umb.tenant_id }}</td> @@ -42,7 +42,7 @@ {% if umb.status in ["lent", "overdue"] %} ago {% endif %} </td> <td> - <a href="/admin/umbrellas?edit={{ umb.serial }}#{{ umb.serial }}">Edit</a> + <a href="/admin/umbrellas?edit={{ umb.id }}#{{ umb.id }}">Edit</a> </td> {% endif %} </tr> diff --git a/jimbrella/templates/admin/umbrellas_mobile.html b/jimbrella/templates/admin/umbrellas_mobile.html index 3c63418..705722f 100644 --- a/jimbrella/templates/admin/umbrellas_mobile.html +++ b/jimbrella/templates/admin/umbrellas_mobile.html @@ -3,12 +3,12 @@ <div class="data-table-container"> <table class="data"> {% for umb in umbrellas %} - {% if umb.serial == edit %} + {% if umb.id == edit %} <form method="post" action="/admin/umbrellas/edit"> - <input name="serial" type="number" value="{{ umb.serial }}" hidden /> - <tr id="{{ umb.serial }}" class="{{ umb.status }}"> + <input name="id" type="number" value="{{ umb.id }}" hidden /> + <tr id="{{ umb.id }}" class="{{ umb.status }}"> <th rowspan=5> - {{ umb.serial }} <br /> + {{ umb.id }} <br /> {{ status_dropdown(umb) }} <br /> <input type="submit" value="Submit" /> </th> @@ -31,11 +31,11 @@ {% else %} {# not edit mode #} {% if umb.status in ["lent", "overdue"] %} - <tr id="{{ umb.serial }}" class="{{ umb.status }}"> + <tr id="{{ umb.id }}" class="{{ umb.status }}"> <th rowspan=5> - {{ umb.serial }} <br /> + {{ umb.id }} <br /> {{ umb.status }} <br /> - <a href="/admin/umbrellas?edit={{ umb.serial }}">Edit</a> + <a href="/admin/umbrellas?edit={{ umb.id }}">Edit</a> </th> <td>{{ umb.tenant_name }}</td> </tr> @@ -47,11 +47,11 @@ {% if umb.status in ["lent", "overdue"] %} ago {% endif %} </td></tr> {% else %} - <tr id="{{ umb.serial }}" class="{{ umb.status }}"> + <tr id="{{ umb.id }}" class="{{ umb.status }}"> <th colspan=2> - {{ umb.serial }} <br /> + {{ umb.id }} <br /> {{ umb.status }} <br /> - <a href="/admin/umbrellas?edit={{ umb.serial }}#{{ umb.serial }}">Edit</a> + <a href="/admin/umbrellas?edit={{ umb.id }}#{{ umb.id }}">Edit</a> </th> </tr> {% endif %} |