Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Commit
•
e386ae4
1
Parent(s):
6efa259
hide col 3
Browse files- src/components.py +31 -19
src/components.py
CHANGED
@@ -48,11 +48,14 @@ def show_embed_code():
|
|
48 |
)
|
49 |
|
50 |
|
51 |
-
def show_dataframes_metrics(len_requests, len_interventions, len_solved_verified_requests, lang):
|
52 |
if lang == "en":
|
53 |
# with st.expander("📝 Nt3awnou Platform Description"):
|
54 |
st.markdown(INTRO_TEXT_EN, unsafe_allow_html=True)
|
55 |
-
|
|
|
|
|
|
|
56 |
with col1:
|
57 |
st.metric(
|
58 |
"# Number of help requests",
|
@@ -63,15 +66,19 @@ def show_dataframes_metrics(len_requests, len_interventions, len_solved_verified
|
|
63 |
"# Number of interventions",
|
64 |
len_interventions + len_solved_verified_requests,
|
65 |
)
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
|
|
71 |
elif lang == "ar":
|
72 |
# with st.expander("📝 شرح منصة نتعاونو"):
|
73 |
st.markdown(INTRO_TEXT_AR, unsafe_allow_html=True)
|
74 |
-
|
|
|
|
|
|
|
75 |
with col1:
|
76 |
st.metric(
|
77 |
"# عدد طلبات المساعدة",
|
@@ -82,15 +89,19 @@ def show_dataframes_metrics(len_requests, len_interventions, len_solved_verified
|
|
82 |
"# عدد التدخلات",
|
83 |
len_interventions + len_solved_verified_requests,
|
84 |
)
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
|
|
90 |
elif lang == "fr":
|
91 |
# with st.expander("📝 Description de la plateforme Nt3awnou"):
|
92 |
st.markdown(INTRO_TEXT_FR, unsafe_allow_html=True)
|
93 |
-
|
|
|
|
|
|
|
94 |
with col1:
|
95 |
st.metric(
|
96 |
"# Nombre de demandes d'aide",
|
@@ -101,11 +112,12 @@ def show_dataframes_metrics(len_requests, len_interventions, len_solved_verified
|
|
101 |
"# Nombre d'interventions",
|
102 |
len_interventions + len_solved_verified_requests,
|
103 |
)
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
|
|
109 |
|
110 |
def show_donations(lang):
|
111 |
st.subheader(_("📝 **Donations**"))
|
|
|
48 |
)
|
49 |
|
50 |
|
51 |
+
def show_dataframes_metrics(len_requests, len_interventions, len_solved_verified_requests, lang, show_col_3=False):
|
52 |
if lang == "en":
|
53 |
# with st.expander("📝 Nt3awnou Platform Description"):
|
54 |
st.markdown(INTRO_TEXT_EN, unsafe_allow_html=True)
|
55 |
+
if show_col_3:
|
56 |
+
col1, col2, col3 = st.columns([1, 1, 1])
|
57 |
+
else:
|
58 |
+
col1, col2 = st.columns([1, 1])
|
59 |
with col1:
|
60 |
st.metric(
|
61 |
"# Number of help requests",
|
|
|
66 |
"# Number of interventions",
|
67 |
len_interventions + len_solved_verified_requests,
|
68 |
)
|
69 |
+
if show_col_3:
|
70 |
+
with col3:
|
71 |
+
st.metric(
|
72 |
+
"# Number of solved requests",
|
73 |
+
len_solved_verified_requests,
|
74 |
+
)
|
75 |
elif lang == "ar":
|
76 |
# with st.expander("📝 شرح منصة نتعاونو"):
|
77 |
st.markdown(INTRO_TEXT_AR, unsafe_allow_html=True)
|
78 |
+
if show_col_3:
|
79 |
+
col1, col2, col3 = st.columns([1, 1, 1])
|
80 |
+
else:
|
81 |
+
col1, col2 = st.columns([1, 1])
|
82 |
with col1:
|
83 |
st.metric(
|
84 |
"# عدد طلبات المساعدة",
|
|
|
89 |
"# عدد التدخلات",
|
90 |
len_interventions + len_solved_verified_requests,
|
91 |
)
|
92 |
+
if show_col_3:
|
93 |
+
with col3:
|
94 |
+
st.metric(
|
95 |
+
"# عدد الطلبات المستجاب لها",
|
96 |
+
len_solved_verified_requests,
|
97 |
+
)
|
98 |
elif lang == "fr":
|
99 |
# with st.expander("📝 Description de la plateforme Nt3awnou"):
|
100 |
st.markdown(INTRO_TEXT_FR, unsafe_allow_html=True)
|
101 |
+
if show_col_3:
|
102 |
+
col1, col2, col3 = st.columns([1, 1, 1])
|
103 |
+
else:
|
104 |
+
col1, col2 = st.columns([1, 1])
|
105 |
with col1:
|
106 |
st.metric(
|
107 |
"# Nombre de demandes d'aide",
|
|
|
112 |
"# Nombre d'interventions",
|
113 |
len_interventions + len_solved_verified_requests,
|
114 |
)
|
115 |
+
if show_col_3:
|
116 |
+
with col3:
|
117 |
+
st.metric(
|
118 |
+
"# Nombre de demandes résolues",
|
119 |
+
len_solved_verified_requests,
|
120 |
+
)
|
121 |
|
122 |
def show_donations(lang):
|
123 |
st.subheader(_("📝 **Donations**"))
|