2016-07-12 14:24:19 +00:00
|
|
|
import pycountry
|
|
|
|
|
|
|
|
TShirts = [
|
|
|
|
"XS",
|
|
|
|
"S",
|
|
|
|
"M",
|
|
|
|
"L",
|
|
|
|
"XL",
|
|
|
|
"XXL"
|
|
|
|
]
|
|
|
|
|
|
|
|
Backgrounds = [
|
|
|
|
("elementary", "Elementary School Student"),
|
|
|
|
("high", "High School Student"),
|
|
|
|
("university", "University Student"),
|
|
|
|
("teacher", "Teacher"),
|
|
|
|
("professional", "Security Professional"),
|
|
|
|
("hobbyist", "CTF Hobbyist(non-student)"),
|
|
|
|
("other", "Other")
|
|
|
|
]
|
|
|
|
|
|
|
|
BackgroundKeys = [x[0] for x in Backgrounds]
|
|
|
|
|
2017-04-27 10:39:59 +00:00
|
|
|
Countries = [(country.alpha_3, country.name) for country in pycountry.countries]
|
2016-07-12 14:24:19 +00:00
|
|
|
Countries = (sorted(Countries, key=lambda x: "0" if x[1] == "Iceland" else x[1]))
|
|
|
|
CountryKeys = [x[0] for x in Countries]
|
|
|
|
|
|
|
|
|
|
|
|
def genoption(arr, selected=None, header=None):
|
|
|
|
s = ""
|
|
|
|
if header is not None:
|
|
|
|
s += header
|
|
|
|
for val in arr:
|
|
|
|
if isinstance(val, tuple):
|
|
|
|
val, name = val
|
|
|
|
else:
|
|
|
|
name = val
|
|
|
|
if selected is not None and val == selected:
|
|
|
|
s += ('<option value="%s" selected>%s</option>' % (val, name))
|
|
|
|
else:
|
|
|
|
s += ('<option value="%s">%s</option>' % (val, name))
|
|
|
|
return s
|