From 11fd5472500a6a818d8fc5eaf962200c600659a1 Mon Sep 17 00:00:00 2001 From: Andrea Carulli Date: Tue, 14 May 2024 18:03:19 +0200 Subject: [PATCH] wip2 - new room assigning wizard --- admin.py | 12 ++++++++++++ tpl/admin.html | 14 ++++++++++---- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/admin.py b/admin.py index 3bbbd96..3ecb138 100644 --- a/admin.py +++ b/admin.py @@ -101,6 +101,18 @@ async def rename_room(request, code, order:Order): await dOrder.send_answers() return redirect(f'/manage/nosecount') +@bp.get('/room/wizard') +async def room_wizard(request, order:Order): + '''Tries to autofill unconfirmed rooms and other matches together''' + # Clear cache first + await clear_cache(request, order) + + #Separate orders which have incomplete rooms and which have no rooms + orders : list[Order] + orders = request.app.ctx.om.cache.items() + # Orders with incomplete rooms + orders_incomplete_rooms = {key:value for key,value in sorted(orders, key=lambda x: x[1].ans('fursona_name')) if value.status not in ['c', 'e'] and value.code == value.room_id and not value.room_confirmed} + @bp.get('/propic/remind') async def propic_remind_missing(request, order:Order): await clear_cache(request, order) diff --git a/tpl/admin.html b/tpl/admin.html index 35627d1..9863810 100644 --- a/tpl/admin.html +++ b/tpl/admin.html @@ -11,14 +11,20 @@

Admin panel

+

Data

Clear cache - Manage rooms - Verify Rooms - Remind badge upload - Auto-confirm Rooms Export CSV Export hotel CSV
+

Rooms

+ Manage rooms + Verify Rooms +
+

Profiles

+ Remind badge upload + Auto-confirm Rooms +
+
{% include 'components/confirm_action_modal.html' %}