Update app.py
Browse files
app.py
CHANGED
|
@@ -557,29 +557,29 @@ def main():
|
|
| 557 |
|
| 558 |
# Attachment Management
|
| 559 |
st.subheader("π Attachments")
|
| 560 |
-
|
| 561 |
-
|
| 562 |
-
|
| 563 |
-
|
| 564 |
-
|
| 565 |
-
|
| 566 |
-
|
| 567 |
-
|
| 568 |
-
|
| 569 |
-
|
| 570 |
-
|
| 571 |
-
</div>
|
| 572 |
-
<small style="color:#666;">{att['type']} | {att['size'] // 1024} KB</small>
|
| 573 |
</div>
|
| 574 |
-
""
|
| 575 |
-
|
| 576 |
-
|
| 577 |
-
|
| 578 |
-
|
| 579 |
-
|
| 580 |
-
|
| 581 |
-
|
| 582 |
-
|
|
|
|
|
|
|
| 583 |
|
| 584 |
# New Attachments
|
| 585 |
new_attachments = st.file_uploader(
|
|
|
|
| 557 |
|
| 558 |
# Attachment Management
|
| 559 |
st.subheader("π Attachments")
|
| 560 |
+
if task['attachments']:
|
| 561 |
+
for att in task['attachments']:
|
| 562 |
+
col1, col2 = st.columns([4,1])
|
| 563 |
+
with col1:
|
| 564 |
+
st.markdown(f"""
|
| 565 |
+
<div style="margin:0.5rem 0; padding:0.5rem; border-radius:5px; background:#f0f2f6;">
|
| 566 |
+
<div style="display:flex; align-items:center; gap:1rem;">
|
| 567 |
+
<span style="flex:1;">π {att['name']}</span>
|
| 568 |
+
<a href="{att['url']}" target="_blank" style="text-decoration:none;">
|
| 569 |
+
π View
|
| 570 |
+
</a>
|
|
|
|
|
|
|
| 571 |
</div>
|
| 572 |
+
<small style="color:#666;">{att['type']} | {att['size'] // 1024} KB</small>
|
| 573 |
+
</div>
|
| 574 |
+
""", unsafe_allow_html=True)
|
| 575 |
+
with col2:
|
| 576 |
+
if st.button("ποΈ", key=f"del_att_{att['name']}"):
|
| 577 |
+
# Remove attachment from task
|
| 578 |
+
updated_attachments = [a for a in task['attachments'] if a['name'] != att['name']]
|
| 579 |
+
db.collection("tasks").document(task['id']).update({
|
| 580 |
+
"attachments": updated_attachments
|
| 581 |
+
})
|
| 582 |
+
st.rerun()
|
| 583 |
|
| 584 |
# New Attachments
|
| 585 |
new_attachments = st.file_uploader(
|