diff --git a/mamweb/context_processors.py b/mamweb/context_processors.py new file mode 100644 index 00000000..ec6481df --- /dev/null +++ b/mamweb/context_processors.py @@ -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} + diff --git a/mamweb/middleware.py b/mamweb/middleware.py new file mode 100644 index 00000000..1bc0b4fa --- /dev/null +++ b/mamweb/middleware.py @@ -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 diff --git a/mamweb/settings_common.py b/mamweb/settings_common.py index a46085cf..345bbc3b 100644 --- a/mamweb/settings_common.py +++ b/mamweb/settings_common.py @@ -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 = ( diff --git a/mamweb/static/css/mamweb.css b/mamweb/static/css/mamweb.css index 73adcb29..84c613f8 100644 --- a/mamweb/static/css/mamweb.css +++ b/mamweb/static/css/mamweb.css @@ -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; diff --git a/mamweb/static/images/header-bg-archiv-NOC.png b/mamweb/static/images/header-bg-archiv-NOC.png new file mode 100755 index 00000000..69f43cde Binary files /dev/null and b/mamweb/static/images/header-bg-archiv-NOC.png differ diff --git a/mamweb/static/images/header-bg-clanek-NOC.png b/mamweb/static/images/header-bg-clanek-NOC.png new file mode 100755 index 00000000..2856cb23 Binary files /dev/null and b/mamweb/static/images/header-bg-clanek-NOC.png differ diff --git a/mamweb/static/images/header-bg-odevzdat-NOC.png b/mamweb/static/images/header-bg-odevzdat-NOC.png new file mode 100755 index 00000000..cd58658e Binary files /dev/null and b/mamweb/static/images/header-bg-odevzdat-NOC.png differ diff --git a/mamweb/static/images/header-bg-soustredeni-NOC.png b/mamweb/static/images/header-bg-soustredeni-NOC.png new file mode 100755 index 00000000..b60604dc Binary files /dev/null and b/mamweb/static/images/header-bg-soustredeni-NOC.png differ diff --git a/mamweb/static/images/header-bg-uvod-NOC.png b/mamweb/static/images/header-bg-uvod-NOC.png new file mode 100755 index 00000000..0ecb9e11 Binary files /dev/null and b/mamweb/static/images/header-bg-uvod-NOC.png differ diff --git a/mamweb/static/images/header-bg-zadani-NOC.png b/mamweb/static/images/header-bg-zadani-NOC.png new file mode 100755 index 00000000..7c0d1d6f Binary files /dev/null and b/mamweb/static/images/header-bg-zadani-NOC.png differ diff --git a/mamweb/templates/base.html b/mamweb/templates/base.html index 6073ac99..a97d5168 100644 --- a/mamweb/templates/base.html +++ b/mamweb/templates/base.html @@ -48,7 +48,7 @@
-