Merge branch 'noc'
This commit is contained in:
commit
0e6d95615e
12 changed files with 58 additions and 2 deletions
12
mamweb/context_processors.py
Normal file
12
mamweb/context_processors.py
Normal file
|
@ -0,0 +1,12 @@
|
|||
|
||||
from datetime import datetime, date
|
||||
|
||||
def vzhled(request):
|
||||
''' Podle casu prida do templatu, zdali je nebo neni noc '''
|
||||
hodin = datetime.now().hour
|
||||
if (hodin <= 6) or (hodin >= 20):
|
||||
noc = True
|
||||
else:
|
||||
noc = False
|
||||
return {'noc' : noc}
|
||||
|
36
mamweb/middleware.py
Normal file
36
mamweb/middleware.py
Normal file
|
@ -0,0 +1,36 @@
|
|||
|
||||
from django.http import HttpResponse
|
||||
from datetime import datetime, date
|
||||
|
||||
class vzhled:
|
||||
|
||||
def process_request(self, request):
|
||||
return None
|
||||
|
||||
def process_view(self, request, view_func, view_args, view_kwargs):
|
||||
#print "====== process_request ======"
|
||||
#print view_func
|
||||
#print view_args
|
||||
#print view_kwargs
|
||||
#print "============================="
|
||||
return None
|
||||
|
||||
def process_template_response(self, request, response):
|
||||
hodin = datetime.now().hour
|
||||
if (hodin <= 6) or (hodin >= 14): # TODO 20
|
||||
response.context_data['noc'] = True
|
||||
else:
|
||||
response.context_data['noc'] = False
|
||||
return response
|
||||
|
||||
def process_response(self, request, response):
|
||||
#hodin = datetime.now().hour
|
||||
#if (hodin <= 6) or (hodin >= 14): # TODO 20
|
||||
#response.context_data['noc'] = True
|
||||
#else:
|
||||
#response.context_data['noc'] = False
|
||||
return response
|
||||
|
||||
|
||||
##def process_exception(request, exception):
|
||||
#pass
|
|
@ -78,6 +78,7 @@ TEMPLATE_CONTEXT_PROCESSORS = (
|
|||
'django.core.context_processors.tz',
|
||||
'sekizai.context_processors.sekizai',
|
||||
'django.core.context_processors.static',
|
||||
'mamweb.context_processors.vzhled',
|
||||
)
|
||||
|
||||
INSTALLED_APPS = (
|
||||
|
|
|
@ -63,12 +63,20 @@ h2 {
|
|||
top: -1px;
|
||||
}
|
||||
|
||||
|
||||
#header.cojemam { background-image: url("../images/header-bg-uvod.png"); }
|
||||
#header.soustredeni { background-image: url("../images/header-bg-soustredeni.png"); }
|
||||
#header.zadani { background-image: url("../images/header-bg-zadani.png"); }
|
||||
#header.clanky { background-image: url("../images/header-bg-clanek.png"); }
|
||||
#header.archiv { background-image: url("../images/header-bg-archiv.png"); }
|
||||
|
||||
#header.NOC {background-image: url("../images/header-bg-uvod-NOC.png"); }
|
||||
#header.NOCcojemam { background-image: url("../images/header-bg-uvod-NOC.png"); }
|
||||
#header.NOCsoustredeni { background-image: url("../images/header-bg-soustredeni-NOC.png"); }
|
||||
#header.NOCzadani { background-image: url("../images/header-bg-zadani-NOC.png"); }
|
||||
#header.NOCclanky { background-image: url("../images/header-bg-clanek-NOC.png"); }
|
||||
#header.NOCarchiv { background-image: url("../images/header-bg-archiv-NOC.png"); }
|
||||
|
||||
#header img.logo {
|
||||
position: absolute;
|
||||
top: 40px;
|
||||
|
|
BIN
mamweb/static/images/header-bg-archiv-NOC.png
Executable file
BIN
mamweb/static/images/header-bg-archiv-NOC.png
Executable file
Binary file not shown.
After Width: | Height: | Size: 251 KiB |
BIN
mamweb/static/images/header-bg-clanek-NOC.png
Executable file
BIN
mamweb/static/images/header-bg-clanek-NOC.png
Executable file
Binary file not shown.
After Width: | Height: | Size: 61 KiB |
BIN
mamweb/static/images/header-bg-odevzdat-NOC.png
Executable file
BIN
mamweb/static/images/header-bg-odevzdat-NOC.png
Executable file
Binary file not shown.
After Width: | Height: | Size: 388 KiB |
BIN
mamweb/static/images/header-bg-soustredeni-NOC.png
Executable file
BIN
mamweb/static/images/header-bg-soustredeni-NOC.png
Executable file
Binary file not shown.
After Width: | Height: | Size: 316 KiB |
BIN
mamweb/static/images/header-bg-uvod-NOC.png
Executable file
BIN
mamweb/static/images/header-bg-uvod-NOC.png
Executable file
Binary file not shown.
After Width: | Height: | Size: 256 KiB |
BIN
mamweb/static/images/header-bg-zadani-NOC.png
Executable file
BIN
mamweb/static/images/header-bg-zadani-NOC.png
Executable file
Binary file not shown.
After Width: | Height: | Size: 204 KiB |
|
@ -48,7 +48,7 @@
|
|||
<div class='row'>
|
||||
<div class='col-md-12'>
|
||||
<a href='/'>
|
||||
<div id="header" class="{% block header %}{% endblock %}">
|
||||
<div id="header" class="{% if noc %}NOC{% endif %}{% block header %}{% endblock %}">
|
||||
<img class="logo" src="{% static 'images/logo.png' %}" />
|
||||
<!--<h1>{% block nadpis1b %}Nadpis 1. úrovně{% endblock %}</h1>-->
|
||||
</div>
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
{% endblock %}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<div>
|
||||
{{ flatpage.content }}
|
||||
</div>
|
||||
|
|
Loading…
Reference in a new issue