Some good progresspython main.py Started the edit verse functionality. The cards on dashboard now pull dynamically based on the users in the db. Will need to add 'start up' functions that allow you to input your children so everything is scalable. Need to look into auth too.

This commit is contained in:
Norm Rasmussen
2024-10-07 18:14:27 -04:00
parent a05d842a5a
commit 61094c1aac
13 changed files with 73 additions and 42 deletions

View File

@ -2,36 +2,26 @@ import theme
from nicegui import ui
from main import checked_data
import data
from utils import Utils
db = data.CON
cur = db.cursor()
color = {'tnt': theme.tnt, 'cubbies': theme.cubbies, 'sparks': theme.sparks}
@ui.page('/dashboard')
def dashboard():
with theme.frame('Dashboard'):
pass
with ui.grid().style('grid-template-columns: repeat(2, minmax(1px, 1fr));'): #(columns='auto 99px 1fr 2fr').classes('w-full gap-3'):
res = cur.execute(f"select person,verse,verse_passage,status from tasks where status = '0'")
information = res.fetchall()
for info in information:
if info[0] == 'hannah':
hvc = ui.label(info[1]).classes('hidden')
hpc = ui.label(info[2]).classes('hidden')
with ui.card().classes('grid justify-items-center').style('border: 2px solid rgba(0, 255, 0, .25)'):
ui.label('Hannah').classes('absolute top-0 left-0 font-thin text-sm')
ui.label(hvc.text).classes('text-center')
ui.label(hpc.text).classes('font-bold')
elif info[0] == 'fiona':
fvc = ui.label(info[1]).classes('hidden')
fpc = ui.label(info[2]).classes('hidden')
with ui.card().classes('grid justify-items-center').style('border: 2px solid rgba(255, 55, 0, .25)'):
ui.label(fvc.text).classes('text-center')
ui.label(fpc.text).classes('font-bold')
else:
lvc = ui.label(info[1]).classes('hidden')
lpc = ui.label(info[2]).classes('hidden')
with ui.card().classes('grid justify-items-center').style('border: 2px solid rgba(0, 0, 255, .25)'):
ui.label(lvc.text).classes('text-center')
ui.label(lpc.text).classes('font-bold')
with ui.grid().style('grid-template-columns: repeat(2, minmax(1px, 1fr));'):
peoples = Utils.get_unique_people()
for ppl in peoples:
pl = ''.join(ppl)
card_info = Utils.get_persons_incomplete(pl)
for item in card_info:
vcard = ui.label(item[1]).classes('hidden')
pcard = ui.label(item[2]).classes('hidden')
club = ui.label(item[3]).classes('hidden')
with ui.card().classes('grid justify-items-center').style(f'border: 2px solid {color[club.text.lower()]}'):
ui.label(pl).classes('absolute top-0 left-0 font-thin text-sm')
ui.label(vcard.text).classes('text-center')
ui.label(pcard.text).classes('font-bold')