File size: 1,983 Bytes
597fb2d
 
c1f3539
597fb2d
9a17e6b
c1f3539
9a17e6b
 
 
 
 
 
597fb2d
 
 
 
 
 
 
 
 
 
 
 
9a17e6b
597fb2d
 
 
 
9a17e6b
597fb2d
 
 
9a17e6b
 
 
 
 
 
 
 
c1f3539
597fb2d
 
c1f3539
597fb2d
 
9a17e6b
597fb2d
 
 
9a17e6b
 
 
597fb2d
 
9a17e6b
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
import streamlit as st


def show_requests_filters():
    HEADERS_MAPPING = {
        "إغاثة": _("Rescue"),
        "مساعدة طبية": _("Medical Assistance"),
        "مأوى": _("Shelter"),
        "طعام وماء": _("Food & Water"),
        "مخاطر (تسرب الغاز، تلف في الخدمات العامة...)": _("Danger"),
    }

    options = [
        "إغاثة",
        "مساعدة طبية",
        "مأوى",
        "طعام وماء",
        "مخاطر (تسرب الغاز، تلف في الخدمات العامة...)",
    ]
    selected_options = []

    col1, col2 = st.columns([1, 1])
    with col1:
        show_unverified = st.checkbox(
            _("Display unverified requests"),
            value=False,
        )
    with col2:
        show_interventions = st.checkbox(
            _("Display Interventions"),
            value=True,
        )

    st.markdown(_("👉 **Choose request type**"))
    selected_options = st.multiselect(
        "Choose request type",
        options=options,
        default=options,
        format_func=lambda x: HEADERS_MAPPING[x],
        label_visibility="collapsed",
    )

    return selected_options, options, show_unverified, show_interventions


def show_interventions_filters():
    st.markdown(
        _("👉 **State of villages visited by NGOs**"),
        unsafe_allow_html=True,
    )
    status_mapping = {
        "Critique, Besoin d'aide en urgence / Critical, in urgent need of help": _("🚨 Critical"),
        "Partiellement satisfait / Partially Served": _("⚠️ Partially served"),
        "Entièrement satisfait / Fully served": _("✅ Fully served"),
    }

    # Let's use multiselect instead
    selected_statuses = st.multiselect(
        "Choose status",
        options=status_mapping.keys(),
        default=status_mapping.keys(),
        format_func=lambda x: status_mapping[x],
        label_visibility="collapsed",
    )
    return selected_statuses