Wajahat698 commited on
Commit
4040a8d
·
verified ·
1 Parent(s): ad645f9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -21
app.py CHANGED
@@ -776,7 +776,7 @@ def side():
776
  "Competence",
777
  ]
778
 
779
- # Icon filenames (ensure these icons are in the same directory as your script)
780
  icon_files = {
781
  "Stability": "Bucket_STABILITY.png",
782
  "Development": "Bucket_DEVELOPMENT.png",
@@ -795,7 +795,7 @@ def side():
795
  st.error(f"File not found: {file_path}")
796
  return ""
797
 
798
- # Generate HTML for the dropdown
799
  dropdown_html = """
800
  <style>
801
  .custom-dropdown {
@@ -816,9 +816,8 @@ def side():
816
  """
817
 
818
  for bucket in trust_buckets:
819
- icon_path = icon_files.get(bucket, "")
820
- if icon_path:
821
- icon_path = os.path.join(".", icon_path)
822
  encoded_img = get_base64(icon_path)
823
  dropdown_html += f"""
824
  <option style="background-image: url('data:image/png;base64,{encoded_img}');
@@ -836,22 +835,7 @@ def side():
836
  </select>
837
  </div>
838
  """
839
- for bucket in trust_buckets:
840
- icon_path = os.path.join(".", bucket["icon"]) # Adjust the path if your icons are in a subdirectory
841
- encoded_img = get_base64(icon_path)
842
- dropdown_html += f"""
843
- <option style="background-image: url('data:image/png;base64,{encoded_img}');
844
- background-repeat: no-repeat;
845
- background-position: left center;
846
- padding-left: 40px;">
847
- {bucket['label']}
848
- </option>
849
- """
850
-
851
- dropdown_html += """
852
- </select>
853
- </div>
854
- """
855
 
856
 
857
  st.subheader("Show My TrustBuilders®")
 
776
  "Competence",
777
  ]
778
 
779
+ # Map bucket names to icon filenames
780
  icon_files = {
781
  "Stability": "Bucket_STABILITY.png",
782
  "Development": "Bucket_DEVELOPMENT.png",
 
795
  st.error(f"File not found: {file_path}")
796
  return ""
797
 
798
+ # Generate HTML for dropdown
799
  dropdown_html = """
800
  <style>
801
  .custom-dropdown {
 
816
  """
817
 
818
  for bucket in trust_buckets:
819
+ if bucket in icon_files:
820
+ icon_path = os.path.join(".", icon_files[bucket]) # Adjust path if icons are in a subdirectory
 
821
  encoded_img = get_base64(icon_path)
822
  dropdown_html += f"""
823
  <option style="background-image: url('data:image/png;base64,{encoded_img}');
 
835
  </select>
836
  </div>
837
  """
838
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
839
 
840
 
841
  st.subheader("Show My TrustBuilders®")