Wajahat698 commited on
Commit
d1c75a3
·
verified ·
1 Parent(s): 97faaae

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +30 -35
app.py CHANGED
@@ -820,23 +820,20 @@ def side():
820
  st.write("Choose the Trust Bucket® by clicking on an image:")
821
  st.markdown('<div class="image-container">', unsafe_allow_html=True)
822
  for bucket, img_path in image_files:
823
- with st.container():
824
- try:
825
- # Display clickable image as a button
826
- if st.button(f"", key=f"filter_{bucket}", help=f"Filter by {bucket}"):
827
- search_query = bucket
828
- st.markdown(
829
- f"""
830
- <div class="image-wrapper">
831
- <button>
832
- <img src="{img_path}" alt="{bucket}">
833
- </button>
834
- </div>
835
- """,
836
- unsafe_allow_html=True,
837
- )
838
- except FileNotFoundError:
839
- st.warning(f"Image not found: {img_path}")
840
  st.markdown("</div>", unsafe_allow_html=True)
841
 
842
  # Save TrustBuilders Section
@@ -848,25 +845,23 @@ def side():
848
  st.write("Choose the Trust Bucket® by clicking on an image to save:")
849
  st.markdown('<div class="image-container">', unsafe_allow_html=True)
850
  for bucket, img_path in image_files:
851
- with st.container():
852
- try:
853
- # Display clickable image for saving
854
- if st.button(f"", key=f"save_{bucket}", help=f"Save to {bucket}"):
855
- save_trustbuilder(user_id, trust_builder_text.strip(), bucket)
856
- st.markdown(
857
- f"""
858
- <div class="image-wrapper">
859
- <button>
860
- <img src="{img_path}" alt="{bucket}">
861
- </button>
862
- </div>
863
- """,
864
- unsafe_allow_html=True,
865
- )
866
- except FileNotFoundError:
867
- st.warning(f"Image not found: {img_path}")
868
  st.markdown("</div>", unsafe_allow_html=True)
869
-
 
870
 
871
 
872
 
 
820
  st.write("Choose the Trust Bucket® by clicking on an image:")
821
  st.markdown('<div class="image-container">', unsafe_allow_html=True)
822
  for bucket, img_path in image_files:
823
+ try:
824
+ # Display clickable image as a button
825
+ if st.button(label="", key=f"filter_{bucket}", help=f"Filter by {bucket}"):
826
+ search_query = bucket
827
+ st.markdown(
828
+ f"""
829
+ <div class="image-wrapper">
830
+ <img src="{img_path}" alt="{bucket}" title="{bucket}">
831
+ </div>
832
+ """,
833
+ unsafe_allow_html=True,
834
+ )
835
+ except FileNotFoundError:
836
+ st.warning(f"Image not found: {img_path}")
 
 
 
837
  st.markdown("</div>", unsafe_allow_html=True)
838
 
839
  # Save TrustBuilders Section
 
845
  st.write("Choose the Trust Bucket® by clicking on an image to save:")
846
  st.markdown('<div class="image-container">', unsafe_allow_html=True)
847
  for bucket, img_path in image_files:
848
+ try:
849
+ # Display clickable image for saving
850
+ if st.button(label="", key=f"save_{bucket}", help=f"Save to {bucket}"):
851
+ save_trustbuilder(user_id, trust_builder_text.strip(), bucket)
852
+ st.markdown(
853
+ f"""
854
+ <div class="image-wrapper">
855
+ <img src="{img_path}" alt="{bucket}" title="{bucket}">
856
+ </div>
857
+ """,
858
+ unsafe_allow_html=True,
859
+ )
860
+ except FileNotFoundError:
861
+ st.warning(f"Image not found: {img_path}")
 
 
 
862
  st.markdown("</div>", unsafe_allow_html=True)
863
+ else:
864
+ st.warning("Please enter a Trust Builder text to save.")
865
 
866
 
867