Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -772,11 +772,81 @@ def side():
|
|
| 772 |
|
| 773 |
|
| 774 |
# Show Trust Builders Section
|
| 775 |
-
trust_buckets = [
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 776 |
|
| 777 |
st.subheader("Show My TrustBuilders®")
|
| 778 |
search_query = st.text_input("Search by keyword", key="search_query")
|
| 779 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 780 |
|
| 781 |
if st.button("Show TrustBuilders", key="show_trustbuilders"):
|
| 782 |
trustbuilders = fetch_trustbuilders(st.session_state.get("wix_user_id"))
|
|
|
|
| 772 |
|
| 773 |
|
| 774 |
# Show Trust Builders Section
|
| 775 |
+
trust_buckets = [
|
| 776 |
+
{"label": "Stability", "icon": "Bucket_STABILITY.png"},
|
| 777 |
+
{"label": "Development", "icon": "Bucket_DEVELOPMENT.png"},
|
| 778 |
+
{"label": "Relationship", "icon": "Bucket_RELATIONSHIP.png"},
|
| 779 |
+
{"label": "Benefit", "icon": "Bucket_BENEFIT.png"},
|
| 780 |
+
{"label": "Vision", "icon": "Bucket_VISION.png"},
|
| 781 |
+
{"label": "Competence", "icon": "Bucket_COMPETENCE.png"}
|
| 782 |
+
]
|
| 783 |
+
def get_base64(file_path):
|
| 784 |
+
with open(file_path, "rb") as f:
|
| 785 |
+
return base64.b64encode(f.read()).decode()
|
| 786 |
+
|
| 787 |
+
|
| 788 |
+
|
| 789 |
+
|
| 790 |
+
dropdown_html = """
|
| 791 |
+
<style>
|
| 792 |
+
.custom-dropdown {
|
| 793 |
+
width: 100%;
|
| 794 |
+
max-width: 400px;
|
| 795 |
+
margin: 10px auto;
|
| 796 |
+
font-family: Arial, sans-serif;
|
| 797 |
+
}
|
| 798 |
+
.custom-dropdown select {
|
| 799 |
+
width: 100%;
|
| 800 |
+
padding: 10px;
|
| 801 |
+
font-size: 16px;
|
| 802 |
+
border: 1px solid #ccc;
|
| 803 |
+
border-radius: 5px;
|
| 804 |
+
background-color: white;
|
| 805 |
+
appearance: none;
|
| 806 |
+
-webkit-appearance: none;
|
| 807 |
+
-moz-appearance: none;
|
| 808 |
+
cursor: pointer;
|
| 809 |
+
}
|
| 810 |
+
.custom-dropdown option {
|
| 811 |
+
display: flex;
|
| 812 |
+
align-items: center;
|
| 813 |
+
padding: 10px;
|
| 814 |
+
background-color: #f9f9f9;
|
| 815 |
+
}
|
| 816 |
+
</style>
|
| 817 |
+
<div class="custom-dropdown">
|
| 818 |
+
<select>
|
| 819 |
+
"""
|
| 820 |
+
for bucket in trust_buckets:
|
| 821 |
+
icon_path = os.path.join(".", bucket["icon"]) # Adjust the path if your icons are in a subdirectory
|
| 822 |
+
encoded_img = get_base64(icon_path)
|
| 823 |
+
dropdown_html += f"""
|
| 824 |
+
<option style="background-image: url('data:image/png;base64,{encoded_img}');
|
| 825 |
+
background-repeat: no-repeat;
|
| 826 |
+
background-position: left center;
|
| 827 |
+
padding-left: 40px;">
|
| 828 |
+
{bucket['label']}
|
| 829 |
+
</option>
|
| 830 |
+
"""
|
| 831 |
+
|
| 832 |
+
dropdown_html += """
|
| 833 |
+
</select>
|
| 834 |
+
</div>
|
| 835 |
+
"""
|
| 836 |
+
|
| 837 |
|
| 838 |
st.subheader("Show My TrustBuilders®")
|
| 839 |
search_query = st.text_input("Search by keyword", key="search_query")
|
| 840 |
+
st.markdown(dropdown_html, unsafe_allow_html=True)
|
| 841 |
+
|
| 842 |
+
|
| 843 |
+
|
| 844 |
+
|
| 845 |
+
|
| 846 |
+
|
| 847 |
+
|
| 848 |
+
|
| 849 |
+
|
| 850 |
|
| 851 |
if st.button("Show TrustBuilders", key="show_trustbuilders"):
|
| 852 |
trustbuilders = fetch_trustbuilders(st.session_state.get("wix_user_id"))
|