Herc commited on
Commit
3226f49
·
verified ·
1 Parent(s): 89bd924

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +34 -0
app.py CHANGED
@@ -69,6 +69,40 @@ catalog = load_catalog()
69
  st.title("Enterprise Software Product Catalog")
70
  st.write("This is the source of truth for app approval statuses within the enterprise.")
71
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
72
  # Sidebar for Advanced Search and Filtering
73
  with st.sidebar.expander("Advanced Search Options"):
74
  search_query = st.text_input("Search by Any Attribute", key='search_query')
 
69
  st.title("Enterprise Software Product Catalog")
70
  st.write("This is the source of truth for app approval statuses within the enterprise.")
71
 
72
+ # Custom CSS for styling product details
73
+ st.markdown("""
74
+ <style>
75
+ .detail-box {
76
+ border-radius: 10px;
77
+ padding: 10px;
78
+ margin: 5px 0;
79
+ background-color: #f0f2f6;
80
+ }
81
+ .detail-header {
82
+ color: #4f8bf9;
83
+ font-weight: bold;
84
+ }
85
+ .detail-text {
86
+ color: #333;
87
+ }
88
+ </style>
89
+ """, unsafe_allow_html=True)
90
+
91
+ # Display product names as clickable items
92
+ for index, row in catalog.iterrows():
93
+ if st.button(row['Product Name'], key=str(index)):
94
+ with st.expander("Product Details", expanded=True):
95
+ st.markdown(f"<div class='detail-box'>"
96
+ f"<p class='detail-header'>Product Name:</p> <p class='detail-text'>{row['Product Name']}</p>"
97
+ f"<p class='detail-header'>Category:</p> <p class='detail-text'>{row['Category']}</p>"
98
+ f"<p class='detail-header'>Cyber Approved:</p> <p class='detail-text'>{'Yes' if row['Cyber Approved'] else 'No'}</p>"
99
+ f"<p class='detail-header'>Accessibility Approved:</p> <p class='detail-text'>{'Yes' if row['Accessibility Approved'] else 'No'}</p>"
100
+ f"<p class='detail-header'>Privacy Approved:</p> <p class='detail-text'>{'Yes' if row['Privacy Approved'] else 'No'}</p>"
101
+ f"<p class='detail-header'>Review Date:</p> <p class='detail-text'>{row['Review Date']}</p>"
102
+ "</div>", unsafe_allow_html=True)
103
+
104
+ # Note: Streamlit's layout is linear and stateless; this approach recreates the UI on each interaction.
105
+
106
  # Sidebar for Advanced Search and Filtering
107
  with st.sidebar.expander("Advanced Search Options"):
108
  search_query = st.text_input("Search by Any Attribute", key='search_query')