Spaces:
Sleeping
Sleeping
Commit ·
45b6d4e
1
Parent(s): 8f12a98
Update app.py
Browse files
app.py
CHANGED
|
@@ -94,21 +94,21 @@ options = ["إغاثة", "مساعدة طبية", "مأوى", "طعام وماء
|
|
| 94 |
selected_options = []
|
| 95 |
|
| 96 |
st.markdown("👉 **Choose request type / اختر نوع الطلب**")
|
| 97 |
-
col1, col2, col3, col4, col5 = st.columns([2, 3, 2, 3, 4])
|
| 98 |
-
cols = [col1, col2, col3, col4, col5]
|
| 99 |
|
| 100 |
-
for i, option in enumerate(options):
|
| 101 |
#checked = cols[i].checkbox(headers_mapping[option], value=True)
|
| 102 |
#if checked:
|
| 103 |
-
selected_options.append(headers_mapping[option])
|
| 104 |
|
| 105 |
-
arabic_options = [e.split("/")[1] for e in
|
| 106 |
df['id'] = df.index
|
| 107 |
filtered_df = df[df['ما هي احتياجاتك؟ (أضفها إذا لم يتم ذكرها)'].isin(arabic_options)]
|
| 108 |
selected_headers = [headers_mapping[request] for request in arabic_options]
|
| 109 |
|
| 110 |
# select interventions
|
| 111 |
-
st.markdown("👇 **View past or planned interventions / عرض عمليات المساعدة السابقة أو المخطط لها**")
|
| 112 |
show_interventions = st.checkbox("Display Interventions عرض التدخلات", value=True)
|
| 113 |
|
| 114 |
m = folium.Map(
|
|
@@ -122,23 +122,23 @@ m = folium.Map(
|
|
| 122 |
max_bounds=True,
|
| 123 |
)
|
| 124 |
|
| 125 |
-
if show_interventions:
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
|
| 142 |
|
| 143 |
for index, row in filtered_df.iterrows():
|
| 144 |
request_type = row['ما هي احتياجاتك؟ (أضفها إذا لم يتم ذكرها)']
|
|
|
|
| 94 |
selected_options = []
|
| 95 |
|
| 96 |
st.markdown("👉 **Choose request type / اختر نوع الطلب**")
|
| 97 |
+
#col1, col2, col3, col4, col5 = st.columns([2, 3, 2, 3, 4])
|
| 98 |
+
#cols = [col1, col2, col3, col4, col5]
|
| 99 |
|
| 100 |
+
#for i, option in enumerate(options):
|
| 101 |
#checked = cols[i].checkbox(headers_mapping[option], value=True)
|
| 102 |
#if checked:
|
| 103 |
+
#selected_options.append(headers_mapping[option])
|
| 104 |
|
| 105 |
+
arabic_options = [e.split("/")[1] for e in options]
|
| 106 |
df['id'] = df.index
|
| 107 |
filtered_df = df[df['ما هي احتياجاتك؟ (أضفها إذا لم يتم ذكرها)'].isin(arabic_options)]
|
| 108 |
selected_headers = [headers_mapping[request] for request in arabic_options]
|
| 109 |
|
| 110 |
# select interventions
|
| 111 |
+
#st.markdown("👇 **View past or planned interventions / عرض عمليات المساعدة السابقة أو المخطط لها**")
|
| 112 |
show_interventions = st.checkbox("Display Interventions عرض التدخلات", value=True)
|
| 113 |
|
| 114 |
m = folium.Map(
|
|
|
|
| 122 |
max_bounds=True,
|
| 123 |
)
|
| 124 |
|
| 125 |
+
#if show_interventions:
|
| 126 |
+
for index, row in interventions_df.iterrows():
|
| 127 |
+
status = "Done ✅" if row[interventions_df.columns[5]]!="Intervention prévue dans le futur / Planned future intervention" else "Planned ⌛"
|
| 128 |
+
color_mk = "green" if row[interventions_df.columns[5]]!="Intervention prévue dans le futur / Planned future intervention" else "pink"
|
| 129 |
+
intervention_type = row[interventions_df.columns[6]].split("/")[0].strip()
|
| 130 |
+
org = row[interventions_df.columns[1]]
|
| 131 |
+
city = row[interventions_df.columns[9]]
|
| 132 |
+
date = row[interventions_df.columns[4]]
|
| 133 |
+
intervention_info = f"<b>Status:</b> {status}<br><b>Org:</b> {org}<br><b>Intervention:</b> {intervention_type}<br><b>📅 Date:</b> {date}"
|
| 134 |
+
if row["latlng"] is None:
|
| 135 |
+
continue
|
| 136 |
+
folium.Marker(
|
| 137 |
+
location=row["latlng"],
|
| 138 |
+
tooltip=city,
|
| 139 |
+
popup=folium.Popup(intervention_info, max_width=300),
|
| 140 |
+
icon=folium.Icon(color=color_mk)
|
| 141 |
+
).add_to(m)
|
| 142 |
|
| 143 |
for index, row in filtered_df.iterrows():
|
| 144 |
request_type = row['ما هي احتياجاتك؟ (أضفها إذا لم يتم ذكرها)']
|