forked from TagesschuleElementa/www.tagesschule-elementa.ch
added seo improvements
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
<title>{% block title %}{% page_attribute page_title %}{% endblock %} | Tagesschule Elementa Zug</title>
|
||||
{% page_attribute 'meta_description' as meta_desc %}
|
||||
{% trans 'Stärken stärken. Lernen lernen. Die Schweizer Primarschule mit einem internationalen Touch. Die Elementa - Einzigartig wie Ihr Kind.' as def_meta_desc %}
|
||||
<meta name="description" content="{% block description %}{{ meta_desc|default:def_meta_desc }}{% endblock %}">
|
||||
{# <meta name="description" content="{% block description %}{{ meta_desc|default:def_meta_desc }}{% endblock %}">#}
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="google" content="notranslate">
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{% load i18n cms_tags menu_tags thumbnail %}
|
||||
{% load i18n cms_tags menu_tags thumbnail util_tags %}
|
||||
|
||||
<div class="content__intro reveal_container reveal_self reveal reveal_animation{% if image %} image{% endif %}">
|
||||
<div class="content__intro__content reveal reveal_animation">
|
||||
@@ -14,6 +14,6 @@
|
||||
{% if image %}
|
||||
{% thumbnail image 1600x800 box=cropping crop detail as thumb %}
|
||||
<div class="content__intro__image scroll reveal reveal_animation" data-ease-multiplier="-2"
|
||||
style="background-image: url({{ thumb.url }})"></div>
|
||||
style="background-image: url({{ thumb.url|media_bridge }})"></div>
|
||||
{% endif %}
|
||||
</div>
|
||||
@@ -10,7 +10,7 @@
|
||||
<div class="navigation__item data_id_{{ forloop.counter0 }}" data-id="{{ forloop.counter0 }}">
|
||||
{% if forloop.parentloop.first %}
|
||||
<div class="navigation__item__background"
|
||||
style="background-image: url('{{ thumb.url }}');"></div>
|
||||
style="background-image: url('{{ thumb.url|media_bridge }}');"></div>
|
||||
{% else %}
|
||||
<a href="#" class="navigation__item__title"
|
||||
data-id="{{ forloop.counter0 }}">
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{% load i18n highlight thumbnail cms_tags %}
|
||||
{% load i18n highlight thumbnail cms_tags util_tags %}
|
||||
|
||||
{% if not search and not title and not text %}
|
||||
{% page_attribute 'page_title' page as title %}
|
||||
@@ -12,7 +12,7 @@
|
||||
{% if image %}
|
||||
{% thumbnail image 1000x600 box=cropping crop detail as thumb %}
|
||||
<div class="page_item__image__main scroll" data-ease-multiplier="-2"
|
||||
style="background-image: url({{ thumb.url }})"></div>
|
||||
style="background-image: url({{ thumb.url|media_bridge }})"></div>
|
||||
{% endif %}
|
||||
<span class="page_item__image__title">{% if search %}{{ page.title }}{% else %}{{ title }}{% endif %}</span>
|
||||
</div>
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
{% load util_tags %}
|
||||
<ul class="downloads">
|
||||
{% for item in instance.items %}
|
||||
<li class="reveal_self reveal reveal_animation data_delay_{{ forloop.counter0 }}">
|
||||
<a href="{{ item.url }}" target="_blank" class="download__item">
|
||||
<a href="{{ item.url|media_bridge }}" target="_blank" class="download__item">
|
||||
<span class="download__item__file">
|
||||
<span class="download__item__file__icon">{{ item.extension }}</span>
|
||||
</span>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{% load cms_tags i18n thumbnail %}
|
||||
{% load cms_tags i18n thumbnail util_tags %}
|
||||
|
||||
<div class="gallery" itemscope itemtype="http://schema.org/ImageGallery">
|
||||
{% for file in instance.files %}
|
||||
@@ -6,13 +6,13 @@
|
||||
{% thumbnail file 2000x2000 as full %}
|
||||
{% thumbnail file 500x500 as thumb %}
|
||||
<div class="gallery__item__main reveal_self reveal reveal_animation"
|
||||
style="background-image: url({{ thumb.url }})">
|
||||
style="background-image: url({{ thumb.url|media_bridge }})">
|
||||
<figure itemprop="associatedMedia" itemscope
|
||||
itemtype="http://schema.org/ImageObject">
|
||||
<a href="{{ full.url }}" class="event"
|
||||
<a href="{{ full.url|media_bridge }}" class="event"
|
||||
itemprop="contentUrl"
|
||||
data-size="{{ full.width }}x{{ full.height }}">
|
||||
<img src="{{ thumb.url }}"
|
||||
<img src="{{ thumb.url|media_bridge }}"
|
||||
itemprop="thumbnail"
|
||||
alt="{{ file.name }}"/>
|
||||
</a>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{% load thumbnail %}
|
||||
{% load thumbnail util_tags %}
|
||||
|
||||
{% thumbnail instance.image 1600x800 box=instance.cropping crop detail as thumb %}
|
||||
<div class="content__intro__image scroll reveal reveal_animation" data-ease-multiplier="-2"
|
||||
style="background-image: url({{ thumb.url }})"></div>
|
||||
style="background-image: url({{ thumb.url|media_bridge }})"></div>
|
||||
@@ -1,9 +1,9 @@
|
||||
{% load thumbnail %}
|
||||
{% load thumbnail util_tags %}
|
||||
|
||||
<div class="partner reveal_self reveal reveal_animation">
|
||||
<div class="partner__logo">
|
||||
{% thumbnail instance.logo 500x300 box=instance.cropping detail as thumb %}
|
||||
<img src="{{ thumb.url }}">
|
||||
<img src="{{ thumb.url|media_bridge }}">
|
||||
</div>
|
||||
<h3 class="section__text">{{ instance.name }}</h3>
|
||||
<p class="section__text">
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{% load thumbnail %}
|
||||
{% load thumbnail util_tags %}
|
||||
|
||||
<div class="quote reveal_container{% if instance.image %} image{% endif %}">
|
||||
<p class="quote__content reveal reveal_animation">{{ instance.content }}</p>
|
||||
@@ -7,7 +7,7 @@
|
||||
<div class="quote__image__main">
|
||||
{% thumbnail instance.image 460x576 box=instance.cropping crop detail as thumb %}
|
||||
<img class="quote__image scroll" data-ease-multiplier="-1"
|
||||
src="{{ thumb.url }}" width="{{ thumb.width }}" height="{{ thumb.height }}">
|
||||
src="{{ thumb.url|media_bridge }}" width="{{ thumb.width }}" height="{{ thumb.height }}">
|
||||
</div>
|
||||
<p class="quote__source reveal reveal_animation data_delay_4">{{ instance.source }}</p>
|
||||
</div>
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
{% load i18n thumbnail %}
|
||||
{% load i18n thumbnail util_tags %}
|
||||
|
||||
<a href="#" class="reference_list__item">
|
||||
<div class="reference_list__item__image__main">
|
||||
{% if instance.thumbnail %}
|
||||
{% thumbnail instance.thumbnail 460x576 box=instance.cropping crop detail as thumb %}
|
||||
<img class="reference_list__item__image scroll" data-ease-multiplier="-1"
|
||||
src="{{ thumb.url }}" width="{{ thumb.width }}" height="{{ thumb.height }}">
|
||||
src="{{ thumb.url|media_bridge }}" width="{{ thumb.width }}" height="{{ thumb.height }}">
|
||||
{% endif %}
|
||||
</div>
|
||||
{% if instance.vimeo_id %}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{% load cms_tags i18n thumbnail %}
|
||||
{% load cms_tags i18n thumbnail util_tags %}
|
||||
|
||||
<div class="slider reveal_container" data-active="0" data-last="{{ instance.child_plugin_instances|length|add:'-1' }}">
|
||||
<div class="slider__content">
|
||||
@@ -7,7 +7,7 @@
|
||||
{% for plugin in instance.child_plugin_instances %}
|
||||
{% thumbnail plugin.image 1000x700 box=plugin.cropping crop detail as thumb %}
|
||||
<div class="slider__image__item data_id_{{ forloop.counter0 }}"
|
||||
style="background-image: url({{ thumb.url }})"></div>
|
||||
style="background-image: url({{ thumb.url|media_bridge }})"></div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{% load i18n thumbnail %}
|
||||
{% load i18n thumbnail util_tags %}
|
||||
|
||||
<div class="video reveal_container">
|
||||
<iframe class="video__frame" src="https://player.vimeo.com/video/{{ instance.vimeo_id }}?dnt=1" width="640" height="360" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
|
||||
@@ -9,6 +9,6 @@
|
||||
</span>
|
||||
{% thumbnail instance.thumbnail 1000x1000 box=instance.cropping crop detail as thumb %}
|
||||
<div class="video__thumbnail__image scroll" data-ease-multiplier="-2"
|
||||
style="background-image: url({{ thumb.url }})"></div>
|
||||
style="background-image: url({{ thumb.url|media_bridge }})"></div>
|
||||
</a>
|
||||
</div>
|
||||
@@ -1,4 +1,4 @@
|
||||
{% load i18n cms_tags thumbnail %}
|
||||
{% load i18n cms_tags thumbnail util_tags %}
|
||||
|
||||
<div id="timetable" data-active="0" data-last="{{ instance.child_plugin_instances|length }}">
|
||||
<div class="timetable__clock__frame">
|
||||
@@ -39,7 +39,7 @@
|
||||
|
||||
{% thumbnail instance.start_image 2110x1200 box=instance.cropping crop detail as thumb %}
|
||||
<div class="timetable__start__background reveal reveal_animation data_delay_1"
|
||||
style="background-image: url({{ thumb.url }})"></div>
|
||||
style="background-image: url({{ thumb.url|media_bridge }})"></div>
|
||||
|
||||
<div class="timetable__intro__placeholder"></div>
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
{% load thumbnail %}
|
||||
{% load thumbnail util_tags %}
|
||||
|
||||
<div class="timetable__item__main reveal reveal_animation">
|
||||
<div class="timetable__item__image">
|
||||
<div class="timetable__item__image__frame">
|
||||
{% thumbnail instance.image 960x648 box=instance.cropping crop detail as thumb %}
|
||||
<div class="timetable__item__image__main scroll" data-ease-multiplier="-2"
|
||||
style="background-image: url({{ thumb.url }})"></div>
|
||||
style="background-image: url({{ thumb.url|media_bridge }})"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="timetable__item__content">
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import urllib
|
||||
|
||||
from cms.models import Page
|
||||
from cms.utils.page import _page_is_published
|
||||
from django import template
|
||||
from django.urls import reverse
|
||||
from parler.utils.i18n import get_language
|
||||
|
||||
register = template.Library()
|
||||
@@ -31,3 +34,8 @@ def page_image_cropping(id):
|
||||
@register.filter
|
||||
def field_type(field):
|
||||
return field.field.widget.__class__.__name__
|
||||
|
||||
|
||||
@register.filter
|
||||
def media_bridge(url):
|
||||
return '%s?url=%s' % (reverse('media_bridge'), urllib.parse.quote(url))
|
||||
|
||||
@@ -3,7 +3,7 @@ from django.conf.urls import url, include
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from django.views.generic.base import TemplateView
|
||||
|
||||
from project.views import SearchView, NewsletterSubscriptionView, LoginRedirectView
|
||||
from project.views import SearchView, NewsletterSubscriptionView, LoginRedirectView, MediaRedirectView
|
||||
|
||||
urlpatterns = [
|
||||
url(_(r'^suche/'), SearchView.as_view(), kwargs={'search': True}, name='search'),
|
||||
@@ -12,4 +12,5 @@ urlpatterns = [
|
||||
TemplateView.as_view(template_name='project/newsletter/subscription.html'), kwargs={'success': True},
|
||||
name='newsletter_subscription_success'),
|
||||
url(r'^login/redirect/$', LoginRedirectView.as_view(), name='login_redirect'),
|
||||
url(r'^media/bridge/$', MediaRedirectView.as_view(), name='media_bridge'),
|
||||
]
|
||||
|
||||
@@ -39,3 +39,9 @@ class LoginRedirectView(RedirectView):
|
||||
return fallback_url
|
||||
except Page.DoesNotExist:
|
||||
return fallback_url
|
||||
|
||||
|
||||
class MediaRedirectView(RedirectView):
|
||||
|
||||
def get_redirect_url(self, *args, **kwargs):
|
||||
return self.request.GET.get('url', None)
|
||||
|
||||
Reference in New Issue
Block a user