arif670 commited on
Commit
91d3ac1
Β·
verified Β·
1 Parent(s): ba3a302

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +22 -22
app.py CHANGED
@@ -557,29 +557,29 @@ def main():
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(
 
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(