Jan Mühlnikel commited on
Commit
5a0ec90
·
1 Parent(s): 4f10561

added filter options to single matching tab

Browse files
Files changed (1) hide show
  1. similarity_page.py +55 -19
similarity_page.py CHANGED
@@ -149,7 +149,7 @@ def show_multi_matching_page():
149
 
150
  col1, col2, col3 = st.columns([10, 1, 10])
151
  with col1:
152
- st.subheader("Sector Filter (required)")
153
  st.caption("""
154
  Sector filters must be applied to see results. The CRS5 and CRS3 classifications organise development aid into categories,
155
  with the 5-digit level providing more specific detail within the broader 3-digit categories.
@@ -273,27 +273,63 @@ def show_multi_matching_page():
273
 
274
  def show_single_matching_page():
275
 
276
- search_option = st.selectbox(
277
- label = 'Select how you want to search',
278
- index = 0,
279
- placeholder = " ",
280
- options = ["Search with IATI ID", "Search with project title"],
281
- )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
282
 
283
- if search_option == "Search with IATI ID":
284
- search_list = iati_search_list
285
- else:
286
- search_list = title_search_list
 
 
 
 
 
 
 
 
287
 
288
- project_option = st.selectbox(
289
- label = 'Search for a project with the IATI ID or teh project title',
290
- index = None,
291
- placeholder = " ",
292
- options = search_list,
293
  )
294
-
295
- #different_orga_checkbox_ = st.checkbox("Only matches for organisations other than the selected project")
296
- #filterd_country_only_checkbox_ = st.checkbox("Only matches in the same countries as project selection")
 
 
297
 
298
  #selected_index = None
299
  if project_option:
 
149
 
150
  col1, col2, col3 = st.columns([10, 1, 10])
151
  with col1:
152
+ st.subheader("Sector Filters (required)")
153
  st.caption("""
154
  Sector filters must be applied to see results. The CRS5 and CRS3 classifications organise development aid into categories,
155
  with the 5-digit level providing more specific detail within the broader 3-digit categories.
 
273
 
274
  def show_single_matching_page():
275
 
276
+ col1, col2, col3 = st.columns([1, 1, 1])
277
+ with col1:
278
+ st.subheader("Select a reference project")
279
+ st.caption("""
280
+ ...
281
+ """)
282
+ with col2:
283
+ st.subheader("Filters for similar projects")
284
+ st.caption("""
285
+ The filters are applied to find the similar projects and are independend of the selected reference project.
286
+ """)
287
+
288
+ col1, col2, col3 = st.columns([1, 1, 1])
289
+ with col1:
290
+
291
+ search_option = st.selectbox(
292
+ label = 'Search with project title or IATI ID',
293
+ index = 0,
294
+ placeholder = " ",
295
+ options = ["Search with IATI ID", "Search with project title"],
296
+ )
297
+
298
+ if search_option == "Search with IATI ID":
299
+ search_list = iati_search_list
300
+ else:
301
+ search_list = title_search_list
302
+
303
+ project_option = st.selectbox(
304
+ label = 'Search for a project',
305
+ index = None,
306
+ placeholder = " ",
307
+ options = search_list,
308
+ )
309
 
310
+ with col2:
311
+ # COUNTRY SELECTION
312
+ country_option = st.multiselect(
313
+ 'Country / Countries',
314
+ COUNTRY_OPTION_LIST,
315
+ placeholder="All countries selected"
316
+ )
317
+
318
+ # ORGA SELECTION
319
+ orga_abbreviation = projects_df["orga_abbreviation"].unique()
320
+ orga_full_names = projects_df["orga_full_name"].unique()
321
+ orga_list = [f"{orga_full_names[i]} ({orga_abbreviation[i].upper()})"for i in range(len(orga_abbreviation))]
322
 
323
+ orga_option = st.multiselect(
324
+ 'Development Bank / Organization',
325
+ orga_list,
326
+ placeholder="All organizations selected"
 
327
  )
328
+
329
+ with col3:
330
+ different_orga_checkbox = st.checkbox("Only matches between different organizations", value=True)
331
+ filterd_country_only_checkbox = st.checkbox("Only matches between filtered countries", value=True)
332
+
333
 
334
  #selected_index = None
335
  if project_option: