mirror of
https://github.com/DMOJ/online-judge.git
synced 2024-11-25 16:32:37 +08:00
Use a better default for timezone map
This commit is contained in:
parent
31f2ded7a0
commit
6655dfd18d
@ -128,8 +128,7 @@ BAD_MAIL_PROVIDERS = ()
|
||||
BAD_MAIL_PROVIDER_REGEX = ()
|
||||
NOFOLLOW_EXCLUDED = set()
|
||||
|
||||
TIMEZONE_BG = None
|
||||
TIMEZONE_MAP = None
|
||||
TIMEZONE_MAP = 'https://static.dmoj.ca/assets/earth.jpg'
|
||||
|
||||
TERMS_OF_SERVICE_URL = None
|
||||
DEFAULT_USER_LANGUAGE = 'PY3'
|
||||
|
@ -69,9 +69,7 @@ class RegistrationView(OldRegistrationView):
|
||||
def get_context_data(self, **kwargs):
|
||||
if 'title' not in kwargs:
|
||||
kwargs['title'] = self.title
|
||||
tzmap = settings.TIMEZONE_MAP
|
||||
kwargs['TIMEZONE_MAP'] = tzmap or 'http://momentjs.com/static/img/world.png'
|
||||
kwargs['TIMEZONE_BG'] = settings.TIMEZONE_BG if tzmap else '#4E7CAD'
|
||||
kwargs['TIMEZONE_MAP'] = settings.TIMEZONE_MAP
|
||||
kwargs['password_validators'] = get_default_password_validators()
|
||||
kwargs['tos_url'] = settings.TERMS_OF_SERVICE_URL
|
||||
return super(RegistrationView, self).get_context_data(**kwargs)
|
||||
|
@ -381,15 +381,13 @@ def edit_profile(request):
|
||||
form.fields['newsletter'].initial = subscription.subscribed
|
||||
form.fields['test_site'].initial = request.user.has_perm('judge.test_site')
|
||||
|
||||
tzmap = settings.TIMEZONE_MAP
|
||||
return render(request, 'user/edit-profile.html', {
|
||||
'require_staff_2fa': settings.DMOJ_REQUIRE_STAFF_2FA,
|
||||
'form': form, 'title': _('Edit profile'), 'profile': request.profile,
|
||||
'can_download_data': bool(settings.DMOJ_USER_DATA_DOWNLOAD),
|
||||
'has_math_config': bool(settings.MATHOID_URL),
|
||||
'ignore_user_script': True,
|
||||
'TIMEZONE_MAP': tzmap or 'http://momentjs.com/static/img/world.png',
|
||||
'TIMEZONE_BG': settings.TIMEZONE_BG if tzmap else '#4E7CAD',
|
||||
'TIMEZONE_MAP': settings.TIMEZONE_MAP,
|
||||
})
|
||||
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
{{ form.media.css }}
|
||||
<style>
|
||||
.map-inset {
|
||||
background: url('{{TIMEZONE_MAP}}') 50% 50%
|
||||
background: url('{{ TIMEZONE_MAP }}') 50% 50%
|
||||
}
|
||||
|
||||
.map-wrap {
|
||||
@ -14,12 +14,6 @@
|
||||
.featherlight .featherlight-content {
|
||||
min-width: 80%
|
||||
}
|
||||
|
||||
{% if TIMEZONE_BG %}
|
||||
.map-wrap {
|
||||
background: {{TIMEZONE_BG}}
|
||||
}
|
||||
{% endif %}
|
||||
</style>
|
||||
{% endblock %}
|
||||
|
||||
|
@ -1,15 +1,8 @@
|
||||
{% compress css %}
|
||||
{% if TIMEZONE_BG %}
|
||||
<style>
|
||||
.map-wrap {
|
||||
background: url('{{TIMEZONE_BG}}')
|
||||
}
|
||||
</style>
|
||||
{% endif %}
|
||||
<link rel="stylesheet" href="{{ static('libs/timezone-map/timezone-map.css') }}">
|
||||
<style>
|
||||
.map-inset {
|
||||
background: url('{{TIMEZONE_MAP}}') 50% 50%
|
||||
background: url('{{ TIMEZONE_MAP }}') 50% 50%
|
||||
}
|
||||
|
||||
.map-wrap {
|
||||
|
Loading…
Reference in New Issue
Block a user