From: Agnibho Mondal Date: Thu, 14 Mar 2024 17:37:38 +0000 (+0530) Subject: Grey out unavailable vaccines X-Git-Url: https://code.agnibho.com/repo?a=commitdiff_plain;h=0c9dd5093e72fde62dd26e537c76affb972c2fd8;p=librevax.git Grey out unavailable vaccines --- diff --git a/inventory.py b/inventory.py index 0d4b0d3..a4ce7dc 100644 --- a/inventory.py +++ b/inventory.py @@ -49,7 +49,7 @@ def delete(cursor, iid): def list(cursor, mid, all=False): try: if(all): - result=cursor.execute("SELECT * FROM inventory WHERE mid=?", (mid,)) + result=cursor.execute("SELECT * FROM inventory WHERE mid=? ORDER BY available DESC", (mid,)) else: result=cursor.execute("SELECT * FROM inventory WHERE mid=? AND available=?", (mid, True)) if(cursor.rowcount==0): diff --git a/templates/inventory-view.html b/templates/inventory-view.html index 3741dce..5192513 100644 --- a/templates/inventory-view.html +++ b/templates/inventory-view.html @@ -20,7 +20,7 @@ You should have received a copy of the GNU General Public License along with Lib {% for rec in data %} - + {% endfor %}
VaccineBatchDate of Expiry
{{rec["vaccine"]}}{{rec["batch"]}}{{rec["doe"]}}
{{rec["vaccine"]}}{{rec["batch"]}}{{rec["doe"]}}
Add Inventory