From 1ec9c3ca12b490cb98465a45e79ad03c649a077b Mon Sep 17 00:00:00 2001 From: Norm Rasmussen Date: Tue, 8 Oct 2024 17:35:04 -0400 Subject: [PATCH] Started functionality around editing a verse. Added the ability to add a new child as well as a force popup if you load the page and there are no people in the db. Need to add another field for when you add a person to add their club too. --- __pycache__/dashboard.cpython-312.pyc | Bin 2497 -> 2455 bytes __pycache__/main.cpython-312.pyc | Bin 14104 -> 16579 bytes __pycache__/theme.cpython-312.pyc | Bin 2211 -> 2223 bytes __pycache__/utils.cpython-312.pyc | Bin 2487 -> 3364 bytes dashboard.py | 1 - main.py | 238 ++++++++++++++++++-------- memorization_tasks.db | Bin 8192 -> 8192 bytes theme.py | 2 +- utils.py | 14 +- 9 files changed, 184 insertions(+), 71 deletions(-) diff --git a/__pycache__/dashboard.cpython-312.pyc b/__pycache__/dashboard.cpython-312.pyc index 9681cb39df4598ee4c71f896d0eed99f430ed5cb..e4faaa3905b627eb1cc1f25d55da02443a46a1cb 100644 GIT binary patch delta 304 zcmX>oJYAUgG%qg~0}wpuXH93F$SbM81jw1rkiw9{n8OeSqM33SbD5%;7$IWJQOrOw z<{Xw>)+km+hSbRy7)3=>8M635hM<6n@!~uwEOVHnIGGqynX*JCUu2SzOJQqaSPfMc z#a+p$$^H_=^V4L!#Z;QP@dwaMmdU|vZ&+1 zC>AiAF^4sZ6)47%!vb;!mt{`WQgLeWYpw%3F7%_GTve;%>$r-81*{Lb7Z6c@1q zMT*!!1Urb}01;9^;ucFmVtQ&3$k>$(pMfMpkt&e*#bJ}1pHiBWYFDHOIi*3sOj@ diff --git a/__pycache__/main.cpython-312.pyc b/__pycache__/main.cpython-312.pyc index d59814ddfdf4a4738f14c9dbeb94cf5edf55c77c..13d02068c7ee2dedec8d416b9d8b65bf0f1f9956 100644 GIT binary patch delta 4316 zcma)9du$ZP8K2p^z1zK)efIgqo$WQYF^69mY#`wcArJ^YClJERG3UFredZo!cF%xi zV_UUqLs7w*R3vH|rHT}ZfErR-B~{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u?sOGvxw6+a(-_yh*9Q95p(jcx0G~$xi zq-Nw_p^*xCZLb3Sj~fm}+Qs`uQKU_|zsCUnCmr?O9`UEfu|3_g{GdpI#m`0BT`8`+ zY_n_H&g&e6<*Q;#4L5}QkuD8ixyxuN%3(o5gWx3m}KGd9G{LmwJ`<)Lf{M#t;1tpIt848!OBb;AC4muOZoW69WbES|70g^|mqYjDIGylk0K6teGw?RVjq z!2fg74>%~aev!ae{Kj3bfc$By+8=*zg|yEqTrM^j|>uRF(h$ diff --git a/__pycache__/theme.cpython-312.pyc b/__pycache__/theme.cpython-312.pyc index 3ed00754ab00809e608e702c16f840d2fc9151e5..151c72888e18c8de49cb97e1b5656ee69d289665 100644 GIT binary patch delta 194 zcmZ21xL%O&G%qg~0}xm)WKF-vJdv+bvP!HdJtC@=X5BYRAYr*@(@PQEqY# zn~_)m(+38ID5hi(mBUoZ^p$~uwTx-=5w=W5174v0MSLKFA4uF{E-oo5k^{0PO4pz%H&uMCl+O(AOMHpFC+i} delta 182 zcmZ24xLA7#mOCPMq=?y9~c-inVgt` zls9t{^H&B2)@0_*7uYfx4Fo`%1wn)mkhsNMTvAk|2xP5f_zWZ&iWGpvFAkgB{FKt1 QRJ$Ve$(bBZENVbO0LCsV;{X5v diff --git a/__pycache__/utils.cpython-312.pyc b/__pycache__/utils.cpython-312.pyc index ba935ff352948a9c42144b212c586e3287dd6b56..60ada26ec284d6fbacbde72714a61f986051cf49 100644 GIT binary patch delta 1084 zcmaJ=O-vI}5Z>SJwxv+|14L|DAkvl+3dV$kLL~gC2`L)j!a>-&3$&89?$!cLv6x^| z6OE~R=z(xB;bOc%G~rrKn0R@Jfu!N+NiU|oc`(k~S|}G^vfs>`o%ijVZ)W%HJ6Gzz zSS%(2){h-_@r2FQza?+w-t}80Zj+cbN<5%x&FC}jo&2Gje>ZppF)9g3Sy5$SQ1B>r zIQjnLPv#n>85w8aci85M1c?dplE^d_p(=hYZV?idCL)v;WSU(h?3iut!@pA`kzlI1 z5l-u4nnwReQBA$DK*y#rso{cjoz`A(ev;GnxbBeB3d#D_Q}vhYNl~7gK0}d>E8%ED zap1H%3>FM73~m4)qd2kO22kYUqN<9Ea*<8SQaGXFy9-)?_h+7iw?Ulo7G%A?JFq{v zH@F)>!&7K__H=swXnGz^iAap2CrK1vK`X1Me(f8dIFRQ&cGFu6CLW&vy&~?l% zyt16xoOyrFkA#uJ_~FFCL}3U$m_qL9W7|xYgR0*cUm9PV6%NikI@WAJ~GNxVDZs<^DA{3B>jI- zF}+Z&tFA&Yr@u6~$hYQNQQL5#>#*mbr{MmaL30v%C?k0RwYV0K z8<(<%%f$tKX6+My!`T50N*4w{hF%Q)TA6Pj?*@01C{ZM9DH&+iUNX^aQ^`cJjuNkX rG%$ic7n143GobhOyhyNjgddfS&pny!8c~ delta 348 zcmZ1?wOyF+G%qg~0}!Z0v!wH}OyrxyXfSc1AxkB@CdbA{|Ckx8CO>2mWz^jKokf*N zj0vO?3OIo@GZ24no2<>E%2&bylbFqr!Zdjur{v@^c0s0ErpfQwwHa9_OLJ(2RPiY! z=A|fOU2V^ub+z}9-&OMR)f}Fz None: - with theme.frame('Homepage'): - with ui.dialog().props('persistent') as addverse: - pass - with ui.dialog().props('persistent') as editverse: + with theme.frame("Homepage"): + firstload = Utils.get_unique_people() + if firstload is None: + with ui.dialog() as first_dialog, ui.card().classes("items-center"): + first_dialog.open() + ui.label( + "Looks like this is your first time! \n\n Please click the button below to add your first Awana club member." + ).classes("text-center font-bold text-xl") + ui.button().props("push glossy icon=person_add color=secondary").on( + "click", lambda: addchild.open() + ) + else: pass - with ui.grid(columns=1).classes('self-center justify-items-center content-center p-2 m-2 rounded-xl'): + with ui.dialog().props("persistent") as addverse: + pass + + with ui.dialog().props("persistent") as editverse: + pass + + with ui.dialog() as addchild, ui.card().classes("items-center"): + result = ui.input(label="Clubber's Name") + ui.button().props("push glossy icon=add_circle color=secondary").on( + "click", lambda: add_child(result) + ) + + with ui.grid(columns=1).classes( + "self-center justify-items-center content-center p-2 m-2 rounded-xl" + ): users = Utils.get_unique_people() for ppl in users: pers = str(ppl)[2:-3].title() - users = [pers if x==ppl else x for x in users] + users = [pers if x == ppl else x for x in users] toggle = ui.toggle(users, clearable=True, on_change=lambda: show_person(toggle)) - with ui.row().classes('fixed bottom-0 left-0 p-2 m-2'): - with ui.element('q-fab').props('icon=navigation color=accent'): - ui.element('q-fab-action').props('icon=add color=secondary').on('click', lambda: add_verse(toggle)) - ui.element('q-fab-action').props('icon=remove color=negative').on('click', lambda: remove_verse(toggle)) + with ui.row().classes("fixed bottom-0 left-0 p-2 m-2"): + with ui.element("q-fab").props("icon=navigation color=accent"): + ui.element("q-fab-action").props("icon=add color=secondary").on( + "click", lambda: add_verse(toggle) + ) + ui.element("q-fab-action").props("icon=remove color=negative").on( + "click", lambda: remove_verse(toggle) + ) + ui.element("q-fab-action").props("icon=person_add color=positive").on( + "click", lambda: addchild.open() + ) + ui.element("q-fab-action").props("icon=person_remove color=accent").on( + "click", lambda: ui.notify("Removing person is not set up yet") + ) - with ui.row().style('justify-content: center') as showperson: + with ui.row().style("justify-content: center") as showperson: pass showperson.set_visibility(False) # FEAT: Allow editing of the verse. Awana will sometimes only give the student part of a verse (i.e 1 John 4:14 is actually 14b). - # FEAT: Find how to pin/bind a verse to a second page @ui.refreshable def show_person(person): showperson.clear() + showperson.set_visibility(False) if person.value is not None: dbinfo = Utils.get_specific_person(person) if dbinfo == []: showperson.clear() - ui.notify(f"{person.value} doesn't have any verses saved under her name! Start adding some by clicking the green arrow in the bottom left.") + ui.notify( + f"{person.value} doesn't have any verses saved under their name! Start adding some by clicking the arrow in the bottom left." + ) + elif dbinfo[0][1] == None: + pass else: showperson.set_visibility(True) if person.value == "Hannah": @@ -55,30 +92,63 @@ def index_page() -> None: setcolor = "rgba(255, 0, 0, .5)" else: setcolor = "rgba(0, 0, 255, .5)" - with showperson.classes(f'border-8').style(f'border: {setcolor} 1px solid;'): - with ui.grid(columns=5).classes('items-center w-full'): - ui.separator().classes('col-span-5 h-2') + with showperson.classes(f"border-8").style( + f"border: {setcolor} 1px solid;" + ): + with ui.grid(columns=5).classes( + "items-center w-full" + ) as persontoggle: + ui.separator().classes("col-span-5 h-2") for item in dbinfo: - label_verse = ui.label(text=item[0]).classes('hidden') - label_passage = ui.label(text=item[1]).classes('hidden') - label_status = ui.label(text=item[2]).classes('hidden') - ui.label(label_verse.text).classes('font-bold text-center') + label_verse = ui.label(text=item[0]).classes("hidden") + label_passage = ui.label(text=item[1]).classes("hidden") + label_status = ui.label(text=item[2]).classes("hidden") + ui.label(label_verse.text).classes("font-bold text-center") with ui.row(): - ui.label(label_passage.text).classes('text-wrap') - ui.chip("Edit Verse", selectable=True, icon="edit", color="white", on_selection_change=lambda label_verse=label_verse: edit_verse(label_verse.text, person, label_passage.text)) - if label_status.text == '1': - ui.chip('Complete', - selectable=True, icon="add", color="positive", - on_selection_change=lambda label_verse=label_verse: Utils.toggle_completion(label_verse.text, person, status=0), - on_click=lambda: show_person(person)) + ui.label(label_passage.text).classes("text-wrap") + # ui.chip("Edit Verse", selectable=True, icon="edit", color="white", on_selection_change=lambda label_verse=label_verse: edit_verse(label_verse.text, person, label_passage.text)) + if label_status.text == "1": + ui.chip( + "Complete", + selectable=True, + icon="add", + color="tnt", + on_selection_change=lambda label_verse=label_verse: Utils.toggle_completion( + label_verse.text, person, status=0 + ), + on_click=lambda: show_person(person), + ).classes("text-white") else: - ui.chip('Incomplete', - selectable=True, icon="add", color="negative", - on_selection_change=lambda label_verse=label_verse: Utils.toggle_completion(label_verse.text, person, status=1), - on_click=lambda: show_person(person)) - ui.checkbox('Pin Verse')#.bind_visibility_from(card, 'value') - ui.checkbox('Mark as Completed')#.bind_value(item[2]) - ui.separator().classes('col-span-5 h-2') + ui.chip( + "Incomplete", + selectable=True, + icon="add", + color="sparks", + on_selection_change=lambda label_verse=label_verse: Utils.toggle_completion( + label_verse.text, person, status=1 + ), + on_click=lambda: show_person(person), + ).classes("text-white") + ui.chip( + "Edit Verse", + selectable=True, + icon="edit", + color="cubbies", + on_selection_change=lambda label_passage=label_passage: edit_verse( + label_verse.text, person, label_passage.text + ), + ).classes("text-white") + ui.chip( + "Delete Verse", + selectable=True, + color="red", + icon="delete", + on_selection_change=lambda label_verse=label_verse: Utils.delete_verse( + label_verse.text, person + ), + on_click=lambda: show_person(person), + ).classes("text-white").style('color: white;') + ui.separator().classes("col-span-5 h-2") else: showperson.clear() addverse.close() @@ -86,10 +156,14 @@ def index_page() -> None: def edit_verse(verse, person, passage): editverse.open() with editverse: - with ui.card().classes('flex-wrap items-center'): - editing = ui.textarea(label="Edit Below", placeholder=passage) - with ui.row().classes('justify-content-center'): - ui.button().props('push glossy icon=add_circle color=secondary').on('click', lambda: submit_verse(result, person)) + with ui.card().classes("flex-wrap items-center"): + ui.label("Here's the verse for easier copy & paste:") + ui.label(passage) + editing = ui.textarea(label="Edit below") + with ui.row().classes("justify-content-center"): + ui.button().props("push glossy icon=add_circle color=secondary").on( + "click", lambda: edit_submit_verse(person, editing, verse) + ) def add_verse(person): if person.value is None: @@ -97,31 +171,51 @@ def index_page() -> None: else: addverse.open() with addverse: - with ui.card().classes('flex-wrap items-center'): + with ui.card().classes("flex-wrap items-center"): result = ui.input(label="Add Verse Here") - with ui.row().classes('justify-content-center'): - ui.button().props('push glossy icon=add_circle color=secondary').on('click', lambda: submit_verse(result, person)) - ui.button().props('push glossy icon=cancel color=negative').on('click', lambda: addverse.close()) + with ui.row().classes("justify-content-center"): + ui.button().props( + "push glossy icon=add_circle color=secondary" + ).on("click", lambda: submit_verse(result, person)) + ui.button().props("push glossy icon=cancel color=negative").on( + "click", lambda: addverse.close() + ) + + def edit_submit_verse(person, passage, verse): + print(passage) + print(passage.value) + Utils.edit_verse(person, verse, passage) + editverse.close() + show_person(person) + + def submit_verse(result, person): # Check if Verse is already in db - dbcheck = cur.execute(f"select * from tasks where person = '{person.value.lower()}' and verse = '{result.value}';") + dbcheck = cur.execute( + f"select * from tasks where person = '{person.value}' and verse = '{result.value}';" + ) check_for_verse = dbcheck.fetchone() if check_for_verse is not None: - ui.notify(f"{result.value} already exists for {person.value}! You can't have duplicates") + ui.notify( + f"{result.value} already exists for {person.value}! You can't have duplicates" + ) else: # Verify the format of a Bible Verse - if not re.match(r'((^\d\s\w{1,}\s|^\w{1,}\s)(\d{1,2}:)(\d{1,2}-\d{1,2}|\d{1,2}))', result.value): + if not re.match( + r"((^\d\s\w{1,}\s|^\w{1,}\s)(\d{1,2}:)(\d{1,2}-\d{1,2}|\d{1,2}))", + result.value, + ): ui.notify("Verse was input incorrectly.") addverse.close() else: # Split up the string for later - colon = result.value.split(':') - precolon = colon[0].split(' ')[1].strip() + colon = result.value.split(":") + precolon = colon[0].split(" ")[1].strip() postcolon = colon[1].strip() - if '-' in postcolon: - start = postcolon.split('-')[0] - end = postcolon.split('-')[1] + if "-" in postcolon: + start = postcolon.split("-")[0] + end = postcolon.split("-")[1] else: start = postcolon @@ -132,31 +226,41 @@ def index_page() -> None: vpass = response.json() passage = str(vpass["passages"]) # npassage gets rid of any carriage return characters - npassage = passage.replace('\\n', '').strip() + npassage = passage.replace("\\n", "").strip() # xpassage removes Footnotes section, if it exists - if 'Footnotes' in npassage: - xpassage = re.sub(r'Footnotes.*', '', npassage) + if "Footnotes" in npassage: + xpassage = re.sub(r"Footnotes.*", "", npassage) else: - xpassage = npassage.replace("(ESV)']", '') + xpassage = npassage.replace("(ESV)']", "") # vpassage grabs the actual verses, dropping the title (starting from first verse in result) - print(xpassage) - vpassage = re.search(fr'\[{start}\].*', xpassage).group(0) + vpassage = re.search(rf"\[{start}\].*", xpassage).group(0) # zpassage - remove any parenthesis or brackets references - zpassage = re.sub(r'\[\d+\]|\(\d+\)|\s{2,}', '', vpassage).strip() - if re.match(r'^\“', zpassage): - zpassage = f'{zpassage}”' + zpassage = re.sub(r"\[\d+\]|\(\d+\)|\s{2,}", "", vpassage).strip() + if re.match(r"^\“", zpassage): + zpassage = f"{zpassage}”" else: pass - print(zpassage) else: - print(response.text) ui.notify("Uh oh. Something went wrong.") - ins = cur.execute(f"replace into tasks values('{person.value.lower()}', '{result.value}', '{zpassage}', 0, 0, 'none');") + ins = cur.execute( + f"replace into tasks values('{person.value.lower()}', '{result.value}', '{zpassage}', 0, 0, 'none');" + ) db.commit() show_person(person) -def checked_data() -> None: - datavals = [] + def add_child(person): + check_person = Utils.get_specific_person(person) + print(check_person) + if check_person == []: + Utils.add_person(person) + # persontoggle.set_visibility(False) + show_person(person) + addchild.close() + else: + ui.notify( + f"The name {person.value} already exists. Please add someone else" + ) -ui.run(storage_secret='b601785a-855c-41d1-adeb-68f0330d8186') + +ui.run(storage_secret="b601785a-855c-41d1-adeb-68f0330d8186") diff --git a/memorization_tasks.db b/memorization_tasks.db index f7496bd8fdd36341798375fb9300c71d1bf411ae..06207fc6634bc5f0eff1dda179375da84addccec 100644 GIT binary patch delta 105 zcmZp0XmFSy%{YIej5Ggy2EDvpybKHsjQsTs{Pi0P`S>T-@OQ|t@^mrteCPM)d(XR* zr;DeH-x3IQ`4##8^Znmgn8mZXONO6`F>+#IC|ev0hq!k23VVx|0UZy!Nomowz{16lj!^l{%Va2mx+nPRF zFQtv#GMoRh8e4C