Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Commit
•
96da45a
1
Parent(s):
471adbe
update title, make checkboxes True, add row index as IF (#3)
Browse files- update title, make checkboxes True, add row index as IF (aec2192bb9e5130ad31f5f012f748b2466bc6581)
Co-authored-by: Loubna Ben Allal <loubnabnl@users.noreply.huggingface.co>
app.py
CHANGED
@@ -28,7 +28,7 @@ st.markdown(
|
|
28 |
unsafe_allow_html=True,
|
29 |
)
|
30 |
|
31 |
-
st.title("Nt3awnu
|
32 |
|
33 |
st.markdown("Help us report more people in need by filling this form: https://forms.gle/nZNCUVog9ka2Vdqu6 : ساعدونا نبلغو الناس ليمحتاجين فهاد الاستمارة")
|
34 |
|
@@ -58,7 +58,7 @@ headers_mapping = {
|
|
58 |
"مساعدة طبية": "Medical Assistance/مساعدة طبية",
|
59 |
"مأوى": "Shelter/مأوى",
|
60 |
"طعام وماء": "Food & Water/طعام وماء",
|
61 |
-
"مخاطر (تسرب الغاز، تلف في الخدمات العامة...)": "Danger/مخاطر",
|
62 |
}
|
63 |
colors_mapping = {
|
64 |
"إغاثة": "red",
|
@@ -74,16 +74,16 @@ st.markdown("👉 **Choose request type / اختر نوع الطلب**")
|
|
74 |
cols = st.columns(len(options))
|
75 |
|
76 |
for i, option in enumerate(options):
|
77 |
-
|
78 |
-
checked = cols[i].checkbox(option, value=default_value)
|
79 |
|
80 |
if checked:
|
81 |
-
selected_options.append(option)
|
82 |
|
|
|
83 |
df['id'] = df.index
|
84 |
-
filtered_df = df[df[' What are your needs? / ما هي احتياجاتك؟ (أضفها إذا لم يتم ذكرها)'].isin(
|
85 |
-
selected_headers = [headers_mapping[request] for request in
|
86 |
-
st.subheader(", ".join(selected_headers))
|
87 |
|
88 |
m = folium.Map(
|
89 |
location=[31.628674, -7.992047],
|
@@ -100,7 +100,7 @@ m = folium.Map(
|
|
100 |
for index, row in filtered_df.iterrows():
|
101 |
request_type = row[' What are your needs? / ما هي احتياجاتك؟ (أضفها إذا لم يتم ذكرها)']
|
102 |
phone = row["رقم الهاتف (اختياري)"] if not pd.isna(row["رقم الهاتف (اختياري)"]) else ""
|
103 |
-
display_text = f"{request_type} {phone}"
|
104 |
if row["latlng"] is None:
|
105 |
continue
|
106 |
folium.Marker(
|
|
|
28 |
unsafe_allow_html=True,
|
29 |
)
|
30 |
|
31 |
+
st.title("Nt3awnu 🤝 نتعاونو")
|
32 |
|
33 |
st.markdown("Help us report more people in need by filling this form: https://forms.gle/nZNCUVog9ka2Vdqu6 : ساعدونا نبلغو الناس ليمحتاجين فهاد الاستمارة")
|
34 |
|
|
|
58 |
"مساعدة طبية": "Medical Assistance/مساعدة طبية",
|
59 |
"مأوى": "Shelter/مأوى",
|
60 |
"طعام وماء": "Food & Water/طعام وماء",
|
61 |
+
"مخاطر (تسرب الغاز، تلف في الخدمات العامة...)": "Danger/مخاطر (تسرب الغاز، تلف في الخدمات العامة...)",
|
62 |
}
|
63 |
colors_mapping = {
|
64 |
"إغاثة": "red",
|
|
|
74 |
cols = st.columns(len(options))
|
75 |
|
76 |
for i, option in enumerate(options):
|
77 |
+
checked = cols[i].checkbox(headers_mapping[option], value=True)
|
|
|
78 |
|
79 |
if checked:
|
80 |
+
selected_options.append(headers_mapping[option])
|
81 |
|
82 |
+
arabic_options = [e.split("/")[1] for e in selected_options]
|
83 |
df['id'] = df.index
|
84 |
+
filtered_df = df[df[' What are your needs? / ما هي احتياجاتك؟ (أضفها إذا لم يتم ذكرها)'].isin(arabic_options)]
|
85 |
+
selected_headers = [headers_mapping[request] for request in arabic_options]
|
86 |
+
#st.subheader(", ".join(selected_headers))
|
87 |
|
88 |
m = folium.Map(
|
89 |
location=[31.628674, -7.992047],
|
|
|
100 |
for index, row in filtered_df.iterrows():
|
101 |
request_type = row[' What are your needs? / ما هي احتياجاتك؟ (أضفها إذا لم يتم ذكرها)']
|
102 |
phone = row["رقم الهاتف (اختياري)"] if not pd.isna(row["رقم الهاتف (اختياري)"]) else ""
|
103 |
+
display_text = f"{request_type} {phone} Id: {row['id']}"
|
104 |
if row["latlng"] is None:
|
105 |
continue
|
106 |
folium.Marker(
|