Browse Source

Odlišení webů: takhle to určitě jde, ale možná to jde lépe (a v hezčích barvách)

export_seznamu_prednasek
Jonas Havelka 3 years ago
parent
commit
3e63e1c768
  1. 1
      mamweb/settings_common.py
  2. 1
      mamweb/settings_local.py
  3. 1
      mamweb/settings_prod.py
  4. 1
      mamweb/settings_test.py
  5. 18
      mamweb/static/css/mamweb.css
  6. 2
      mamweb/templates/base.html
  7. 7
      various/context_processors.py

1
mamweb/settings_common.py

@ -79,6 +79,7 @@ TEMPLATES = [
'django.contrib.messages.context_processors.messages',
'sekizai.context_processors.sekizai',
'header_fotky.context_processors.vzhled',
'various.context_processors.rozliseni',
'various.context_processors.april',
)
},

1
mamweb/settings_local.py

@ -97,3 +97,4 @@ LOGGING = {
# E-maily posílat chceme, ale do terminálu :-)
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
SEND_EMAIL_NOTIFICATIONS = True
LOCAL_TEST_PROD = "local"

1
mamweb/settings_prod.py

@ -67,3 +67,4 @@ LOGGING['handlers']['registration_error_log']['filename'] = '/home/mam-web/logs/
# E-MAIL NOTIFICATIONS
POSLI_MAILOVOU_NOTIFIKACI = True
LOCAL_TEST_PROD = "prod"

1
mamweb/settings_test.py

@ -76,3 +76,4 @@ EMAIL_BACKEND = 'various.mail_prefixer.PrefixingMailBackend'
# TODO Pouze na otestování testu… Zvolit konferu!
# XXX: Je to pole, protože implementační detail backendu.
TESTOVACI_EMAILOVA_KONFERENCE = ['betatest@mam.mff.cuni.cz']
LOCAL_TEST_PROD = "test"

18
mamweb/static/css/mamweb.css

@ -1182,3 +1182,21 @@ div.gdpr {
label[for=id_skola] {
font-weight: bold;
}
.localweb {
border-left: 20px solid greenyellow;
border-right: 20px solid greenyellow;
}
.localweb .login-bar {
margin-left: -20px;
}
.testweb {
border-left: 20px solid darkorange;
border-right: 20px solid darkorange;
}
.testweb .login-bar {
margin-left: -20px;
}

2
mamweb/templates/base.html

@ -36,7 +36,7 @@
{% block script %}{% endblock %}
</head>
<body class='{% if user.is_staff %}org-logged-in{% endif %}'>
<body class='{{ LOCAL_TEST_PROD }}web{% if user.is_staff %} org-logged-in{% endif %}'>
{% if user.is_staff %}
<div class="login-bar" >

7
various/context_processors.py

@ -1,3 +1,6 @@
from django.conf import settings
def april(req):
if 'X-April' in req.headers:
try:
@ -12,3 +15,7 @@ def april(req):
return {'april': today.year}
return {}
def rozliseni(request):
return {"LOCAL_TEST_PROD": settings.LOCAL_TEST_PROD}

Loading…
Cancel
Save