Update app.py
Browse files
app.py
CHANGED
|
@@ -573,35 +573,35 @@ assignee_list = load_assignees()
|
|
| 573 |
if st.session_state.using_memory_storage:
|
| 574 |
st.markdown('<div style="background-color: #fff3cd; color: #856404; padding: 8px; border-radius: 4px; font-size: 12px; margin-bottom: 10px;">Using in-memory storage due to file permission issues. Tasks may not persist after refresh.</div>', unsafe_allow_html=True)
|
| 575 |
|
| 576 |
-
with col1:
|
| 577 |
-
|
| 578 |
-
with col2:
|
| 579 |
-
|
| 580 |
|
| 581 |
-
due_date = st.date_input("Due Date")
|
| 582 |
|
| 583 |
-
if st.button("Add Task"):
|
| 584 |
-
|
| 585 |
-
|
| 586 |
-
|
| 587 |
-
|
| 588 |
-
|
| 589 |
-
|
| 590 |
-
|
| 591 |
-
|
| 592 |
-
|
| 593 |
-
|
| 594 |
-
|
| 595 |
-
|
| 596 |
-
|
| 597 |
-
|
| 598 |
-
|
| 599 |
-
|
| 600 |
-
|
| 601 |
-
|
| 602 |
-
|
| 603 |
-
|
| 604 |
-
|
| 605 |
|
| 606 |
# Display tasks in a horizontal grid layout
|
| 607 |
if st.session_state.tasks.empty:
|
|
|
|
| 573 |
if st.session_state.using_memory_storage:
|
| 574 |
st.markdown('<div style="background-color: #fff3cd; color: #856404; padding: 8px; border-radius: 4px; font-size: 12px; margin-bottom: 10px;">Using in-memory storage due to file permission issues. Tasks may not persist after refresh.</div>', unsafe_allow_html=True)
|
| 575 |
|
| 576 |
+
with col1:
|
| 577 |
+
date_started = st.date_input("Date Started", value=datetime.now().date())
|
| 578 |
+
with col2:
|
| 579 |
+
date_to_finish = st.date_input("Date to Finish", value=datetime.now().date())
|
| 580 |
|
| 581 |
+
due_date = st.date_input("Due Date")
|
| 582 |
|
| 583 |
+
if st.button("Add Task"):
|
| 584 |
+
if title: # Basic validation
|
| 585 |
+
task_id = generate_task_id()
|
| 586 |
+
new_task = {
|
| 587 |
+
'ID': task_id,
|
| 588 |
+
'Title': title,
|
| 589 |
+
'Description': description,
|
| 590 |
+
'Assignee': assignee,
|
| 591 |
+
'Status': status,
|
| 592 |
+
'Date Started': date_started,
|
| 593 |
+
'Date to Finish': date_to_finish,
|
| 594 |
+
'Due Date': due_date
|
| 595 |
+
}
|
| 596 |
+
st.session_state.tasks = pd.concat([
|
| 597 |
+
st.session_state.tasks,
|
| 598 |
+
pd.DataFrame([new_task])
|
| 599 |
+
], ignore_index=True)
|
| 600 |
+
save_tasks()
|
| 601 |
+
# Show success but don't mention storage
|
| 602 |
+
st.success("Task added!")
|
| 603 |
+
else:
|
| 604 |
+
st.warning("Please enter a task title")
|
| 605 |
|
| 606 |
# Display tasks in a horizontal grid layout
|
| 607 |
if st.session_state.tasks.empty:
|