Update pages/devoirs.py
Browse files- pages/devoirs.py +3 -3
pages/devoirs.py
CHANGED
@@ -33,9 +33,9 @@ def app(client):
|
|
33 |
|
34 |
def display_homework_list(homeworks, client):
|
35 |
for homework in homeworks:
|
36 |
-
with st.expander(f"{"
|
37 |
st.markdown(f"""
|
38 |
-
- **Statut :** {"
|
39 |
- **Description :** {homework.description}
|
40 |
""", unsafe_allow_html=True)
|
41 |
|
@@ -43,7 +43,7 @@ def display_homework_list(homeworks, client):
|
|
43 |
unique_key = str(uuid.uuid4()) # Generate a unique key
|
44 |
|
45 |
# Use the unique key for the button to avoid DuplicateWidgetID error
|
46 |
-
st.button("
|
47 |
|
48 |
def update_homework_status(homework, client):
|
49 |
new_status = not homework.done
|
|
|
33 |
|
34 |
def display_homework_list(homeworks, client):
|
35 |
for homework in homeworks:
|
36 |
+
with st.expander(f"{"\u2705" if homework.done else "β"} | {homework.subject.name} - *pour le {homework.date.strftime('%d/%m/%Y')}*"):
|
37 |
st.markdown(f"""
|
38 |
+
- **Statut :** {"\u2705 Fait" if homework.done else "β Γ faire"}
|
39 |
- **Description :** {homework.description}
|
40 |
""", unsafe_allow_html=True)
|
41 |
|
|
|
43 |
unique_key = str(uuid.uuid4()) # Generate a unique key
|
44 |
|
45 |
# Use the unique key for the button to avoid DuplicateWidgetID error
|
46 |
+
st.button("\u2705 Marquer comme fait" if not homework.done else "β Marquer comme Γ faire", key=unique_key, on_click=update_homework_status, args=(homework, client))
|
47 |
|
48 |
def update_homework_status(homework, client):
|
49 |
new_status = not homework.done
|