From: Jan Szejko
Date: Wed, 15 Jun 2016 15:04:52 +0000 (+0200)
Subject: non-teasing teaser (digital olympiad stub)
X-Git-Url: https://git.mdrn.pl/edumed.git/commitdiff_plain/5b62a88ffbb4e529be32e3f552c32497ab4666e5?ds=sidebyside
non-teasing teaser (digital olympiad stub)
---
diff --git a/edumed/static/css/base.css b/edumed/static/css/base.css
index 2d17d6e..99182a2 100644
--- a/edumed/static/css/base.css
+++ b/edumed/static/css/base.css
@@ -116,6 +116,42 @@ header.main {
header.main nav .menu-kontakt:hover:before {
background: url(../img/menu/kontakt_active.png) no-repeat 0 0;
background-size: 100%; }
+ header.main nav .menu-oc-program:before {
+ background: url(../img/menu/olimpiada/program.png) no-repeat 0 0;
+ background-size: 100%; }
+ header.main nav .menu-oc-harmonogram:before {
+ background: url(../img/menu/olimpiada/harmonogram.png) no-repeat 0 0;
+ background-size: 100%; }
+ header.main nav .menu-oc-regulamin:before {
+ background: url(../img/menu/olimpiada/regulamin.png) no-repeat 0 0;
+ background-size: 100%; }
+ header.main nav .menu-oc-literatura:before {
+ background: url(../img/menu/olimpiada/literatura.png) no-repeat 0 0;
+ background-size: 100%; }
+ header.main nav .menu-oc-komitet:before {
+ background: url(../img/menu/olimpiada/komitet.png) no-repeat 0 0;
+ background-size: 100%; }
+ header.main nav .menu-oc-kontakt:before {
+ background: url(../img/menu/olimpiada/kontakt.png) no-repeat 0 0;
+ background-size: 100%; }
+ header.main nav .menu-oc-program:hover:before {
+ background: url(../img/menu/olimpiada/program_active.png) no-repeat 0 0;
+ background-size: 100%; }
+ header.main nav .menu-oc-harmonogram:hover:before {
+ background: url(../img/menu/olimpiada/harmonogram_active.png) no-repeat 0 0;
+ background-size: 100%; }
+ header.main nav .menu-oc-regulamin:hover:before {
+ background: url(../img/menu/olimpiada/regulamin_active.png) no-repeat 0 0;
+ background-size: 100%; }
+ header.main nav .menu-oc-literatura:hover:before {
+ background: url(../img/menu/olimpiada/literatura_active.png) no-repeat 0 0;
+ background-size: 100%; }
+ header.main nav .menu-oc-komitet:hover:before {
+ background: url(../img/menu/olimpiada/komitet_active.png) no-repeat 0 0;
+ background-size: 100%; }
+ header.main nav .menu-oc-kontakt:hover:before {
+ background: url(../img/menu/olimpiada/kontakt_active.png) no-repeat 0 0;
+ background-size: 100%; }
header.main #tagline {
clear: both;
float: left;
diff --git a/edumed/static/css/base.scss b/edumed/static/css/base.scss
index b422a2d..88d2033 100644
--- a/edumed/static/css/base.scss
+++ b/edumed/static/css/base.scss
@@ -117,6 +117,24 @@ header.main {
.menu-o-nas:hover:before { background: url(../img/menu/o-nas_active.png) no-repeat 0 0; background-size: 100%;}
.menu-kontakt:hover:before { background: url(../img/menu/kontakt_active.png) no-repeat 0 0; background-size: 100%;}
+ .menu-oc-program:before { background: url(../img/menu/olimpiada/program.png) no-repeat 0 0; background-size: 100%;}
+ .menu-oc-harmonogram:before { background: url(../img/menu/olimpiada/harmonogram.png) no-repeat 0 0; background-size: 100%;}
+ .menu-oc-regulamin:before { background: url(../img/menu/olimpiada/regulamin.png) no-repeat 0 0; background-size: 100%;}
+ .menu-oc-literatura:before { background: url(../img/menu/olimpiada/literatura.png) no-repeat 0 0; background-size: 100%;}
+ .menu-oc-komitet:before { background: url(../img/menu/olimpiada/komitet.png) no-repeat 0 0; background-size: 100%;}
+ .menu-oc-kontakt:before { background: url(../img/menu/olimpiada/kontakt.png) no-repeat 0 0; background-size: 100%;}
+ .menu-oc-program:hover:before {
+ background: url(../img/menu/olimpiada/program_active.png) no-repeat 0 0; background-size: 100%;}
+ .menu-oc-harmonogram:hover:before {
+ background: url(../img/menu/olimpiada/harmonogram_active.png) no-repeat 0 0; background-size: 100%;}
+ .menu-oc-regulamin:hover:before {
+ background: url(../img/menu/olimpiada/regulamin_active.png) no-repeat 0 0; background-size: 100%;}
+ .menu-oc-literatura:hover:before {
+ background: url(../img/menu/olimpiada/literatura_active.png) no-repeat 0 0; background-size: 100%;}
+ .menu-oc-komitet:hover:before {
+ background: url(../img/menu/olimpiada/komitet_active.png) no-repeat 0 0; background-size: 100%;}
+ .menu-oc-kontakt:hover:before {
+ background: url(../img/menu/olimpiada/kontakt_active.png) no-repeat 0 0; background-size: 100%;}
}
#tagline {
diff --git a/edumed/static/img/menu/olimpiada/harmonogram.png b/edumed/static/img/menu/olimpiada/harmonogram.png
new file mode 100644
index 0000000..06e9c92
Binary files /dev/null and b/edumed/static/img/menu/olimpiada/harmonogram.png differ
diff --git a/edumed/static/img/menu/olimpiada/harmonogram_active.png b/edumed/static/img/menu/olimpiada/harmonogram_active.png
new file mode 100644
index 0000000..68c9721
Binary files /dev/null and b/edumed/static/img/menu/olimpiada/harmonogram_active.png differ
diff --git a/edumed/static/img/menu/olimpiada/komitet.png b/edumed/static/img/menu/olimpiada/komitet.png
new file mode 100644
index 0000000..2837890
Binary files /dev/null and b/edumed/static/img/menu/olimpiada/komitet.png differ
diff --git a/edumed/static/img/menu/olimpiada/komitet_active.png b/edumed/static/img/menu/olimpiada/komitet_active.png
new file mode 100644
index 0000000..b70ad4c
Binary files /dev/null and b/edumed/static/img/menu/olimpiada/komitet_active.png differ
diff --git a/edumed/static/img/menu/olimpiada/kontakt.png b/edumed/static/img/menu/olimpiada/kontakt.png
new file mode 100644
index 0000000..e94d178
Binary files /dev/null and b/edumed/static/img/menu/olimpiada/kontakt.png differ
diff --git a/edumed/static/img/menu/olimpiada/kontakt_active.png b/edumed/static/img/menu/olimpiada/kontakt_active.png
new file mode 100644
index 0000000..58e597a
Binary files /dev/null and b/edumed/static/img/menu/olimpiada/kontakt_active.png differ
diff --git a/edumed/static/img/menu/olimpiada/literatura.png b/edumed/static/img/menu/olimpiada/literatura.png
new file mode 100644
index 0000000..f252351
Binary files /dev/null and b/edumed/static/img/menu/olimpiada/literatura.png differ
diff --git a/edumed/static/img/menu/olimpiada/literatura_active.png b/edumed/static/img/menu/olimpiada/literatura_active.png
new file mode 100644
index 0000000..98719ac
Binary files /dev/null and b/edumed/static/img/menu/olimpiada/literatura_active.png differ
diff --git a/edumed/static/img/menu/olimpiada/program.png b/edumed/static/img/menu/olimpiada/program.png
new file mode 100644
index 0000000..56760e1
Binary files /dev/null and b/edumed/static/img/menu/olimpiada/program.png differ
diff --git a/edumed/static/img/menu/olimpiada/program_active.png b/edumed/static/img/menu/olimpiada/program_active.png
new file mode 100644
index 0000000..9b6ec98
Binary files /dev/null and b/edumed/static/img/menu/olimpiada/program_active.png differ
diff --git a/edumed/static/img/menu/olimpiada/regulamin.png b/edumed/static/img/menu/olimpiada/regulamin.png
new file mode 100644
index 0000000..449ac1c
Binary files /dev/null and b/edumed/static/img/menu/olimpiada/regulamin.png differ
diff --git a/edumed/static/img/menu/olimpiada/regulamin_active.png b/edumed/static/img/menu/olimpiada/regulamin_active.png
new file mode 100644
index 0000000..1a1516b
Binary files /dev/null and b/edumed/static/img/menu/olimpiada/regulamin_active.png differ
diff --git a/edumed/static/img/menu/olimpiada/svg/harmonogram.svg b/edumed/static/img/menu/olimpiada/svg/harmonogram.svg
new file mode 100644
index 0000000..64a3a3e
--- /dev/null
+++ b/edumed/static/img/menu/olimpiada/svg/harmonogram.svg
@@ -0,0 +1,145 @@
+
+
+
+
\ No newline at end of file
diff --git a/edumed/static/img/menu/olimpiada/svg/harmonogram_active.svg b/edumed/static/img/menu/olimpiada/svg/harmonogram_active.svg
new file mode 100644
index 0000000..f690251
--- /dev/null
+++ b/edumed/static/img/menu/olimpiada/svg/harmonogram_active.svg
@@ -0,0 +1,146 @@
+
+
+
+
\ No newline at end of file
diff --git a/edumed/static/img/menu/olimpiada/svg/komitet.svg b/edumed/static/img/menu/olimpiada/svg/komitet.svg
new file mode 100644
index 0000000..d04c979
--- /dev/null
+++ b/edumed/static/img/menu/olimpiada/svg/komitet.svg
@@ -0,0 +1,63 @@
+
+
+
+
\ No newline at end of file
diff --git a/edumed/static/img/menu/olimpiada/svg/komitet_active.svg b/edumed/static/img/menu/olimpiada/svg/komitet_active.svg
new file mode 100644
index 0000000..9202ac9
--- /dev/null
+++ b/edumed/static/img/menu/olimpiada/svg/komitet_active.svg
@@ -0,0 +1,63 @@
+
+
+
+
\ No newline at end of file
diff --git a/edumed/static/img/menu/olimpiada/svg/kontakt.svg b/edumed/static/img/menu/olimpiada/svg/kontakt.svg
new file mode 100644
index 0000000..1e9339f
--- /dev/null
+++ b/edumed/static/img/menu/olimpiada/svg/kontakt.svg
@@ -0,0 +1,74 @@
+
+
+
+
\ No newline at end of file
diff --git a/edumed/static/img/menu/olimpiada/svg/kontakt_active.svg b/edumed/static/img/menu/olimpiada/svg/kontakt_active.svg
new file mode 100644
index 0000000..940e21e
--- /dev/null
+++ b/edumed/static/img/menu/olimpiada/svg/kontakt_active.svg
@@ -0,0 +1,74 @@
+
+
+
+
\ No newline at end of file
diff --git a/edumed/static/img/menu/olimpiada/svg/literatura.svg b/edumed/static/img/menu/olimpiada/svg/literatura.svg
new file mode 100644
index 0000000..a004d7e
--- /dev/null
+++ b/edumed/static/img/menu/olimpiada/svg/literatura.svg
@@ -0,0 +1,63 @@
+
+
+
+
\ No newline at end of file
diff --git a/edumed/static/img/menu/olimpiada/svg/literatura_active.svg b/edumed/static/img/menu/olimpiada/svg/literatura_active.svg
new file mode 100644
index 0000000..20395e7
--- /dev/null
+++ b/edumed/static/img/menu/olimpiada/svg/literatura_active.svg
@@ -0,0 +1,63 @@
+
+
+
+
\ No newline at end of file
diff --git a/edumed/static/img/menu/olimpiada/svg/program.svg b/edumed/static/img/menu/olimpiada/svg/program.svg
new file mode 100644
index 0000000..2418f09
--- /dev/null
+++ b/edumed/static/img/menu/olimpiada/svg/program.svg
@@ -0,0 +1,104 @@
+
+
+
+
\ No newline at end of file
diff --git a/edumed/static/img/menu/olimpiada/svg/program_active.svg b/edumed/static/img/menu/olimpiada/svg/program_active.svg
new file mode 100644
index 0000000..cf39f15
--- /dev/null
+++ b/edumed/static/img/menu/olimpiada/svg/program_active.svg
@@ -0,0 +1,104 @@
+
+
+
+
\ No newline at end of file
diff --git a/edumed/static/img/menu/olimpiada/svg/regulamin.svg b/edumed/static/img/menu/olimpiada/svg/regulamin.svg
new file mode 100644
index 0000000..61c274e
--- /dev/null
+++ b/edumed/static/img/menu/olimpiada/svg/regulamin.svg
@@ -0,0 +1,98 @@
+
+
+
+
\ No newline at end of file
diff --git a/edumed/static/img/menu/olimpiada/svg/regulamin_active.svg b/edumed/static/img/menu/olimpiada/svg/regulamin_active.svg
new file mode 100644
index 0000000..50f8f6d
--- /dev/null
+++ b/edumed/static/img/menu/olimpiada/svg/regulamin_active.svg
@@ -0,0 +1,98 @@
+
+
+
+
\ No newline at end of file
diff --git a/edumed/templates/base.html b/edumed/templates/base.html
index d336201..96641ad 100644
--- a/edumed/templates/base.html
+++ b/edumed/templates/base.html
@@ -9,7 +9,7 @@
{% comment %}{% endcomment %}
-
+
diff --git a/edumed/templates/base_super.html b/edumed/templates/base_super.html
index 73080d4..497a868 100644
--- a/edumed/templates/base_super.html
+++ b/edumed/templates/base_super.html
@@ -60,11 +60,13 @@
{% block tagline %}{% endblock %}
-
-
-
+ {% block searchbox %}
+
+
+
+ {% endblock %}
@@ -97,6 +99,7 @@
JeÅli nie oznaczono inaczej, wszystkie materiaÅy na stronie sÄ
objÄte wolnÄ
licencjÄ
Creative Commons Uznanie autorstwa
â Na tych samych warunkach 3.0.
+ {% block copyrights %}{% endblock %}
{% block sponsors %}
diff --git a/edumed/templates/olimpiada_teaser.html b/edumed/templates/olimpiada_teaser.html
index 071e68e..51b8c02 100644
--- a/edumed/templates/olimpiada_teaser.html
+++ b/edumed/templates/olimpiada_teaser.html
@@ -1,15 +1,28 @@
{% extends "base_super.html" %}
+{% load textile_pl from fnp_markup %}
-{% block logo %}{% endblock %}
-{% block title %}Olimpiada cyfrowa{% endblock %}
+{% block full_title %}Olimpiada cyfrowa{% endblock %}
+
+{% block logo %}{% endblock %}
+
+{% block searchbox %}{% endblock %}
+
+{% block top_navigation %}
+
+
+
+
+
+
+{% endblock %}
{% block body %}
-
- Tutaj bÄdzie coÅ zajebistego!
- Podaj swój adres e-mail, żeby dostaÄ powiadomienie:
-
+
+ {{ flatpage.content|textile_pl }}
+
+{% endblock %}
+
+{% block copyrights %}
+
Ikonki w menu:
+ Designed by Freepik and distributed by Flaticon
{% endblock %}
\ No newline at end of file
diff --git a/edumed/urls.py b/edumed/urls.py
index 2d0d0a0..a62aee3 100644
--- a/edumed/urls.py
+++ b/edumed/urls.py
@@ -4,8 +4,7 @@ from django.conf import settings
from django.contrib.flatpages.views import flatpage
from django.shortcuts import redirect
-from .views import HomeView, AvatarlessProfileEditView
-
+from .views import HomeView, AvatarlessProfileEditView, flatpage_with_template
urlpatterns = patterns(
'',
@@ -15,7 +14,9 @@ urlpatterns = patterns(
url(r'^info/(?P.*)$', flatpage, name="info"),
url(r'^olimpiada/$', lambda request: flatpage(request, 'turniej/'), name='olimpiada'),
url(r'^olimpiada/(?P.*)$', lambda request, url: flatpage(request, 'turniej/' + url), name='olimpiada'),
- url(r'^olimpiada-teaser/$', 'edumed.views.olimpiada_teaser', name='olimpiada_teaser'),
+ url(r'^olimpiada-teaser/(?P.*)$',
+ lambda request, url: flatpage_with_template(request, 'turniej/' + url, 'olimpiada_teaser.html'),
+ name='olimpiada_teaser'),
url(r'^szukaj/', include('haystack.urls')),
url(r'^zglos/', include('contact.urls')),
url(r'^forum/profile/edit/$', AvatarlessProfileEditView.as_view(), name='edit_profile'),
diff --git a/edumed/views.py b/edumed/views.py
index 1ba6137..af9bad5 100644
--- a/edumed/views.py
+++ b/edumed/views.py
@@ -1,15 +1,9 @@
# -*- coding: utf-8 -*-
from django.contrib.flatpages.views import flatpage
-from django.core.exceptions import ValidationError
-from django.core.validators import EmailValidator
-from django.http.response import HttpResponseRedirect
-from django.shortcuts import render_to_response
-from django.template.context import RequestContext
from django.views.defaults import page_not_found
from django.views.generic import TemplateView
from pybb.views import ProfileEditView
-from contact.models import Contact
from .forms import AvatarlessEditProfileForm
@@ -37,17 +31,34 @@ class AvatarlessProfileEditView(ProfileEditView):
form_class = AvatarlessEditProfileForm
-def olimpiada_teaser(request):
- if request.POST:
- email = request.POST.get('email')
- try:
- EmailValidator()(email)
- Contact.objects.create(
- contact=email,
- body={},
- ip=request.META['REMOTE_ADDR'],
- form_tag='olimpiada-teaser')
- except ValidationError:
- pass
- return HttpResponseRedirect(request.path)
- return render_to_response('olimpiada_teaser.html', context_instance=RequestContext(request))
+def flatpage_with_template(request, url, template_name):
+ """
+ Public interface to the flat page view.
+
+ Models: `flatpages.flatpages`
+ Templates: Uses the template defined by the ``template_name`` field,
+ or :template:`flatpages/default.html` if template_name is not defined.
+ Context:
+ flatpage
+ `flatpages.flatpages` object
+ """
+ from django.conf import settings
+ from django.contrib.flatpages.models import FlatPage
+ from django.contrib.flatpages.views import render_flatpage
+ from django.contrib.sites.models import get_current_site
+ from django.http.response import Http404, HttpResponsePermanentRedirect
+ from django.shortcuts import get_object_or_404
+ if not url.startswith('/'):
+ url = '/' + url
+ site_id = get_current_site(request).id
+ try:
+ f = get_object_or_404(FlatPage, url__exact=url, sites__id__exact=site_id)
+ except Http404:
+ if not url.endswith('/') and settings.APPEND_SLASH:
+ url += '/'
+ get_object_or_404(FlatPage, url__exact=url, sites__id__exact=site_id)
+ return HttpResponsePermanentRedirect('%s/' % request.path)
+ else:
+ raise
+ f.template_name = template_name
+ return render_flatpage(request, f)