Browse Source

Merge branch 'noc'

remotes/origin/Float_novinky
Bc. Petr Pecha 9 years ago
parent
commit
0e6d95615e
  1. 12
      mamweb/context_processors.py
  2. 36
      mamweb/middleware.py
  3. 1
      mamweb/settings_common.py
  4. 8
      mamweb/static/css/mamweb.css
  5. BIN
      mamweb/static/images/header-bg-archiv-NOC.png
  6. BIN
      mamweb/static/images/header-bg-clanek-NOC.png
  7. BIN
      mamweb/static/images/header-bg-odevzdat-NOC.png
  8. BIN
      mamweb/static/images/header-bg-soustredeni-NOC.png
  9. BIN
      mamweb/static/images/header-bg-uvod-NOC.png
  10. BIN
      mamweb/static/images/header-bg-zadani-NOC.png
  11. 2
      mamweb/templates/base.html
  12. 1
      mamweb/templates/flatpages/default.html

12
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}

36
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

1
mamweb/settings_common.py

@ -78,6 +78,7 @@ TEMPLATE_CONTEXT_PROCESSORS = (
'django.core.context_processors.tz', 'django.core.context_processors.tz',
'sekizai.context_processors.sekizai', 'sekizai.context_processors.sekizai',
'django.core.context_processors.static', 'django.core.context_processors.static',
'mamweb.context_processors.vzhled',
) )
INSTALLED_APPS = ( INSTALLED_APPS = (

8
mamweb/static/css/mamweb.css

@ -63,12 +63,20 @@ h2 {
top: -1px; top: -1px;
} }
#header.cojemam { background-image: url("../images/header-bg-uvod.png"); } #header.cojemam { background-image: url("../images/header-bg-uvod.png"); }
#header.soustredeni { background-image: url("../images/header-bg-soustredeni.png"); } #header.soustredeni { background-image: url("../images/header-bg-soustredeni.png"); }
#header.zadani { background-image: url("../images/header-bg-zadani.png"); } #header.zadani { background-image: url("../images/header-bg-zadani.png"); }
#header.clanky { background-image: url("../images/header-bg-clanek.png"); } #header.clanky { background-image: url("../images/header-bg-clanek.png"); }
#header.archiv { background-image: url("../images/header-bg-archiv.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 { #header img.logo {
position: absolute; position: absolute;
top: 40px; top: 40px;

BIN
mamweb/static/images/header-bg-archiv-NOC.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 251 KiB

BIN
mamweb/static/images/header-bg-clanek-NOC.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

BIN
mamweb/static/images/header-bg-odevzdat-NOC.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 388 KiB

BIN
mamweb/static/images/header-bg-soustredeni-NOC.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 316 KiB

BIN
mamweb/static/images/header-bg-uvod-NOC.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 256 KiB

BIN
mamweb/static/images/header-bg-zadani-NOC.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 204 KiB

2
mamweb/templates/base.html

@ -48,7 +48,7 @@
<div class='row'> <div class='row'>
<div class='col-md-12'> <div class='col-md-12'>
<a href='/'> <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' %}" /> <img class="logo" src="{% static 'images/logo.png' %}" />
<!--<h1>{% block nadpis1b %}Nadpis 1. úrovně{% endblock %}</h1>--> <!--<h1>{% block nadpis1b %}Nadpis 1. úrovně{% endblock %}</h1>-->
</div> </div>

1
mamweb/templates/flatpages/default.html

@ -5,7 +5,6 @@
{% endblock %}{% endblock %} {% endblock %}{% endblock %}
{% block content %} {% block content %}
<div> <div>
{{ flatpage.content }} {{ flatpage.content }}
</div> </div>

Loading…
Cancel
Save