Spaces:
Sleeping
Sleeping
ok
Browse files
app.py
CHANGED
@@ -143,7 +143,7 @@ def program():
|
|
143 |
item = [item for item in filtered_data_by_group if item['risk'] == risk][0]
|
144 |
|
145 |
st.header(risk)
|
146 |
-
st.write(
|
147 |
|
148 |
# Define the number of columns
|
149 |
num_columns = 3
|
@@ -181,11 +181,9 @@ def program():
|
|
181 |
# Display the filtered news as a grid of cards
|
182 |
if len(filtered_data_by_group) > 0:
|
183 |
for risk in set([item['risk'] for item in filtered_data_by_group]):
|
|
|
184 |
st.header(risk)
|
185 |
-
|
186 |
-
filtered_data_by_risk = [item for item in filtered_data_by_group if item['risk'] == risk]
|
187 |
-
|
188 |
-
# Define the number of columns
|
189 |
num_columns = 3
|
190 |
col_index = 0
|
191 |
|
@@ -195,26 +193,25 @@ def program():
|
|
195 |
# Initialize an empty row
|
196 |
row = grid.columns(num_columns)
|
197 |
|
198 |
-
for
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
<div class="
|
204 |
-
<
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
<a href="{news['link']}" target="_blank">Read more</a>
|
209 |
-
</div>
|
210 |
</div>
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
|
|
218 |
|
219 |
if len(filtered_data_by_group) == 0:
|
220 |
st.write("No news found for the selected task and group.")
|
|
|
143 |
item = [item for item in filtered_data_by_group if item['risk'] == risk][0]
|
144 |
|
145 |
st.header(risk)
|
146 |
+
st.write(item['description'])
|
147 |
|
148 |
# Define the number of columns
|
149 |
num_columns = 3
|
|
|
181 |
# Display the filtered news as a grid of cards
|
182 |
if len(filtered_data_by_group) > 0:
|
183 |
for risk in set([item['risk'] for item in filtered_data_by_group]):
|
184 |
+
item = [item for item in filtered_data_by_group if item['risk'] == risk][0]
|
185 |
st.header(risk)
|
186 |
+
st.write(item['description'])
|
|
|
|
|
|
|
187 |
num_columns = 3
|
188 |
col_index = 0
|
189 |
|
|
|
193 |
# Initialize an empty row
|
194 |
row = grid.columns(num_columns)
|
195 |
|
196 |
+
for news in item['mitigators']:
|
197 |
+
with row[col_index]:
|
198 |
+
st.markdown(
|
199 |
+
f"""
|
200 |
+
<div class="grid-item">
|
201 |
+
<div class="card">
|
202 |
+
<h3>{news['title']}</h3>
|
203 |
+
<p>{news['recommendation']}</p>
|
204 |
+
<p><b>Year:</b> {news['year']}</p>
|
205 |
+
<a href="{news['link']}" target="_blank">Read more</a>
|
|
|
|
|
206 |
</div>
|
207 |
+
</div>
|
208 |
+
""",
|
209 |
+
unsafe_allow_html=True
|
210 |
+
)
|
211 |
+
col_index = (col_index + 1) % num_columns
|
212 |
+
# Start a new row after the last column
|
213 |
+
if col_index == 0:
|
214 |
+
row = grid.columns(num_columns)
|
215 |
|
216 |
if len(filtered_data_by_group) == 0:
|
217 |
st.write("No news found for the selected task and group.")
|