From ab7b7f9b24e6bfdf231e142db64e7ae52cbe7fd3 Mon Sep 17 00:00:00 2001 From: Frederick Yin Date: Mon, 25 Oct 2021 00:09:03 +0800 Subject: Mobile view for database edit --- jimbrella/templates/admin/umbrellas.html | 66 ++++++++++++++++++++++++-------- 1 file changed, 49 insertions(+), 17 deletions(-) (limited to 'jimbrella/templates/admin/umbrellas.html') diff --git a/jimbrella/templates/admin/umbrellas.html b/jimbrella/templates/admin/umbrellas.html index 15b6f02..8c92b4d 100644 --- a/jimbrella/templates/admin/umbrellas.html +++ b/jimbrella/templates/admin/umbrellas.html @@ -1,3 +1,17 @@ +{% macro status_dropdown(umb) -%} +{# A dropdown for umbrella status #} + +{%- endmacro %} + @@ -13,6 +27,33 @@
{% for umb in umbrellas %} + {% if umb.serial == edit %} + + + + + + + + + + + + + + + + + + {% else %} + {# not edit mode #} {% if umb.status in ["lent", "overdue"] %} {% else %} - + {% endif %} + {% endif %} {% endfor %}
+ {{ umb.serial }}
+ {{ status_dropdown(umb) }}
+ +
+ {{ umb.lent_time_ago_str }} + {% if umb.status in ["lent", "overdue"] %} ago {% endif %} +
@@ -31,13 +72,19 @@
{{ umb.serial }}
{{ umb.status }}
+ {{ umb.serial }}
+ {{ umb.status }}
+ Edit +
{% else %} + {# not mobile #}
@@ -51,28 +98,13 @@ - {% macro status_opt(umb, status) -%} - - {%- endmacro %} - {% for umb in umbrellas %} {% if umb.serial == edit %} - + -- cgit v1.2.3
{{ umb.serial }} - - {{ status_dropdown(umb) }}