nouamanetazi HF staff commited on
Commit
24d64b3
1 Parent(s): 4008992

add mark as resolved

Browse files
Files changed (1) hide show
  1. app.py +6 -2
app.py CHANGED
@@ -92,7 +92,7 @@ def display_interventions(interventions_df, selected_statuses):
92
  details = row[interventions_df.columns[8]]
93
  road_state = row[interventions_df.columns[12]]
94
  # intervention_info = f"<b>Intervention Status:</b> {status}<br><b>Village Status:</b> {village_status}<br><b>Org:</b> {org}<br><b>Intervention:</b> {intervention_type}<br><b>Population:</b> {population}<br><b>📅 Date:</b> {date}"
95
- intervention_info=f"""
96
  <b>Date:</b> {date}<br>
97
  <b>City:</b> {city}<br>
98
  <b>Intervention Status:</b> {status}<br>
@@ -191,6 +191,10 @@ def show_verified_requests(filtered_verified_df):
191
  f'<a href="{maps_url}" target="_blank" rel="noopener noreferrer"><b>Google Maps</b></a><br>'
192
  )
193
 
 
 
 
 
194
  icon_name = ICON_MAPPING.get(request_type, "list")
195
  emergency = row.get("Emergency Degree", "Low")
196
  if long_lat is None:
@@ -417,7 +421,7 @@ show_verified_requests(verified_df)
417
  legend_macro = get_legend_macro(show_unverified)
418
  # delete old legend
419
  for child in m.get_root()._children:
420
- pass #TODO: fix this
421
  # if child.startswith("macro_element"):
422
  # m.get_root()._children.remove(child)
423
  m.get_root().add_child(legend_macro)
 
92
  details = row[interventions_df.columns[8]]
93
  road_state = row[interventions_df.columns[12]]
94
  # intervention_info = f"<b>Intervention Status:</b> {status}<br><b>Village Status:</b> {village_status}<br><b>Org:</b> {org}<br><b>Intervention:</b> {intervention_type}<br><b>Population:</b> {population}<br><b>📅 Date:</b> {date}"
95
+ intervention_info = f"""
96
  <b>Date:</b> {date}<br>
97
  <b>City:</b> {city}<br>
98
  <b>Intervention Status:</b> {status}<br>
 
191
  f'<a href="{maps_url}" target="_blank" rel="noopener noreferrer"><b>Google Maps</b></a><br>'
192
  )
193
 
194
+ # mark as solved button
195
+ id_in_sheet = row["id"]+2
196
+ display_text += f"<a href='https://docs.google.com/forms/d/e/1FAIpQLSdyAcOAULumk4A1DsfrwUsGdZ-9G5xOUuD3vHdQOp3nGNAZXw/viewform?usp=pp_url&entry.1499427789={id_in_sheet}&entry.1666684596={datetime.now().strftime('%Y-%m-%d')}' target='_blank' rel='noopener noreferrer'><b>Mark as solved</b></a><br>"
197
+
198
  icon_name = ICON_MAPPING.get(request_type, "list")
199
  emergency = row.get("Emergency Degree", "Low")
200
  if long_lat is None:
 
421
  legend_macro = get_legend_macro(show_unverified)
422
  # delete old legend
423
  for child in m.get_root()._children:
424
+ pass # TODO: fix this
425
  # if child.startswith("macro_element"):
426
  # m.get_root()._children.remove(child)
427
  m.get_root().add_child(legend_macro)