Update app.py
Browse files
app.py
CHANGED
@@ -17,16 +17,28 @@ PAGE_SIZE = 14
|
|
17 |
|
18 |
LANGUAGES = ["English", "French", "Spanish", "German", "Portuguese", "Chinese", "Arabic", "Hindi"]
|
19 |
ALL_COUNTRIES = sorted(set([
|
20 |
-
"
|
21 |
-
"
|
22 |
-
"
|
23 |
-
"
|
24 |
-
"
|
25 |
-
"
|
26 |
-
"
|
27 |
-
"
|
28 |
-
"
|
29 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
]))
|
31 |
|
32 |
def init_db():
|
@@ -280,17 +292,17 @@ def interface():
|
|
280 |
admin_code = gr.Text(label="Admin Code", type="password")
|
281 |
del_status = gr.Textbox(label="Status", interactive=False)
|
282 |
del_btn.click(
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
).then(
|
287 |
-
|
288 |
-
|
289 |
-
).then(
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
)
|
294 |
|
295 |
|
296 |
gr.Markdown("---\n### 📅 Admin Export CSV")
|
|
|
17 |
|
18 |
LANGUAGES = ["English", "French", "Spanish", "German", "Portuguese", "Chinese", "Arabic", "Hindi"]
|
19 |
ALL_COUNTRIES = sorted(set([
|
20 |
+
"Afghanistan", "Albania", "Algeria", "Andorra", "Angola", "Antigua and Barbuda", "Argentina", "Armenia", "Australia", "Austria",
|
21 |
+
"Azerbaijan", "Bahamas", "Bahrain", "Bangladesh", "Barbados", "Belarus", "Belgium", "Belize", "Benin", "Bhutan",
|
22 |
+
"Bolivia", "Bosnia and Herzegovina", "Botswana", "Brazil", "Brunei", "Bulgaria", "Burkina Faso", "Burundi",
|
23 |
+
"Cabo Verde", "Cambodia", "Cameroon", "Canada", "Central African Republic", "Chad", "Chile", "China", "Colombia",
|
24 |
+
"Comoros", "Congo (Congo-Brazzaville)", "Costa Rica", "Croatia", "Cuba", "Cyprus", "Czech Republic (Czechia)",
|
25 |
+
"Democratic Republic of the Congo", "Denmark", "Djibouti", "Dominica", "Dominican Republic", "Ecuador", "Egypt",
|
26 |
+
"El Salvador", "Equatorial Guinea", "Eritrea", "Estonia", "Eswatini", "Ethiopia", "Fiji", "Finland",
|
27 |
+
"France", "Gabon", "Gambia", "Georgia", "Germany", "Ghana", "Greece", "Grenada", "Guatemala", "Guinea", "Guinea-Bissau",
|
28 |
+
"Guyana", "Haiti", "Honduras", "Hungary", "Iceland", "India", "Indonesia", "Iran", "Iraq", "Ireland", "Israel", "Italy",
|
29 |
+
"Jamaica", "Japan", "Jordan", "Kazakhstan", "Kenya", "Kiribati", "Kuwait", "Kyrgyzstan", "Laos", "Latvia", "Lebanon",
|
30 |
+
"Lesotho", "Liberia", "Libya", "Liechtenstein", "Lithuania", "Luxembourg", "Madagascar", "Malawi", "Malaysia", "Maldives",
|
31 |
+
"Mali", "Malta", "Marshall Islands", "Mauritania", "Mauritius", "Mexico", "Micronesia", "Moldova", "Monaco", "Mongolia",
|
32 |
+
"Montenegro", "Morocco", "Mozambique", "Myanmar (formerly Burma)", "Namibia", "Nauru", "Nepal", "Netherlands",
|
33 |
+
"New Zealand", "Nicaragua", "Niger", "Nigeria", "North Korea", "North Macedonia", "Norway", "Oman", "Pakistan",
|
34 |
+
"Palau", "Palestine State", "Panama", "Papua New Guinea", "Paraguay", "Peru", "Philippines", "Poland", "Portugal",
|
35 |
+
"Qatar", "Romania", "Russia", "Rwanda", "Saint Kitts and Nevis", "Saint Lucia", "Saint Vincent and the Grenadines",
|
36 |
+
"Samoa", "San Marino", "Sao Tome and Principe", "Saudi Arabia", "Senegal", "Serbia", "Seychelles", "Sierra Leone",
|
37 |
+
"Singapore", "Slovakia", "Slovenia", "Solomon Islands", "Somalia", "South Africa", "South Korea", "South Sudan",
|
38 |
+
"Spain", "Sri Lanka", "Sudan", "Suriname", "Sweden", "Switzerland", "Syria", "Taiwan", "Tajikistan", "Tanzania",
|
39 |
+
"Thailand", "Timor-Leste", "Togo", "Tonga", "Trinidad and Tobago", "Tunisia", "Turkey", "Turkmenistan",
|
40 |
+
"Tuvalu", "Uganda", "Ukraine", "United Arab Emirates", "United Kingdom", "United States of America", "Uruguay",
|
41 |
+
"Uzbekistan", "Vanuatu", "Vatican City", "Venezuela", "Vietnam", "Yemen", "Zambia", "Zimbabwe"
|
42 |
]))
|
43 |
|
44 |
def init_db():
|
|
|
292 |
admin_code = gr.Text(label="Admin Code", type="password")
|
293 |
del_status = gr.Textbox(label="Status", interactive=False)
|
294 |
del_btn.click(
|
295 |
+
fn=delete_by_discord,
|
296 |
+
inputs=[admin_discord, admin_code],
|
297 |
+
outputs=[del_status]
|
298 |
+
).then(
|
299 |
+
fn=lambda: 1,
|
300 |
+
outputs=[page_state]
|
301 |
+
).then(
|
302 |
+
fn=filter_by_fields,
|
303 |
+
inputs=[country_filter, city_filter, language_filter, gr.State(1)],
|
304 |
+
outputs=[table_html, page_state, gr.Number(visible=False)]
|
305 |
+
)
|
306 |
|
307 |
|
308 |
gr.Markdown("---\n### 📅 Admin Export CSV")
|