summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrederick Yin <fkfd@fkfd.me>2022-02-02 23:23:45 +0800
committerFrederick Yin <fkfd@fkfd.me>2022-02-02 23:23:45 +0800
commitbad6b0a8d24392f1a8c4b45e2dd06ec84719f456 (patch)
treed9fac99b677215d154f41d269d335809feb7d23c
parent272eba3bc1217d339cb1b0e23fd5aad2bee752a4 (diff)
Frontend lent_at UX enhancements
-rw-r--r--jimbrella/templates/admin/umbrellas_desktop.html12
-rw-r--r--jimbrella/templates/admin/umbrellas_mobile.html13
2 files changed, 8 insertions, 17 deletions
diff --git a/jimbrella/templates/admin/umbrellas_desktop.html b/jimbrella/templates/admin/umbrellas_desktop.html
index 8b78e64..315f427 100644
--- a/jimbrella/templates/admin/umbrellas_desktop.html
+++ b/jimbrella/templates/admin/umbrellas_desktop.html
@@ -23,10 +23,8 @@
<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 name="lent_at" type="datetime-local" value="{{ umb.lent_at }}"/></td>
+ <td></td>
<td>
<input type="submit" value="Submit" />
</td>
@@ -37,10 +35,8 @@
<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>{{ umb.lent_at }}</td>
+ <td>{{ umb.lent_time_ago }}</td>
<td>
<a href="/admin/umbrellas?edit={{ umb.id }}#{{ umb.id }}">Edit</a>
</td>
diff --git a/jimbrella/templates/admin/umbrellas_mobile.html b/jimbrella/templates/admin/umbrellas_mobile.html
index 705722f..441ce17 100644
--- a/jimbrella/templates/admin/umbrellas_mobile.html
+++ b/jimbrella/templates/admin/umbrellas_mobile.html
@@ -7,7 +7,7 @@
<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>
+ <th rowspan=4>
{{ umb.id }} <br />
{{ status_dropdown(umb) }} <br />
<input type="submit" value="Submit" />
@@ -21,12 +21,8 @@
<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>
+ <td><input name="lent_at" type="datetime-local" value="{{ umb.lent_at }}" /></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 #}
@@ -41,10 +37,9 @@
</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_at }}</td></tr>
<tr class="{{ umb.status }}"><td>
- {{ umb.lent_time_ago_str }}
- {% if umb.status in ["lent", "overdue"] %} ago {% endif %}
+ {{ umb.lent_time_ago }}
</td></tr>
{% else %}
<tr id="{{ umb.id }}" class="{{ umb.status }}">