diff --git a/locale/de/LC_MESSAGES/django.mo b/locale/de/LC_MESSAGES/django.mo index d106450..ea7e313 100644 Binary files a/locale/de/LC_MESSAGES/django.mo and b/locale/de/LC_MESSAGES/django.mo differ diff --git a/locale/de/LC_MESSAGES/django.po b/locale/de/LC_MESSAGES/django.po index 9635067..3d10698 100644 --- a/locale/de/LC_MESSAGES/django.po +++ b/locale/de/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-03-27 12:11-0500\n" +"POT-Creation-Date: 2018-06-07 11:18-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -18,30 +18,39 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: src/portal/models.py:20 src/project/forms.py:10 +#: src/portal/models.py:19 src/project/forms.py:10 msgid "Vorname" msgstr "" -#: src/portal/models.py:21 src/project/forms.py:11 +#: src/portal/models.py:20 src/project/forms.py:11 msgid "Nachname" msgstr "" -#: src/portal/models.py:22 +#: src/portal/models.py:21 msgid "Strasse" msgstr "" -#: src/portal/models.py:23 +#: src/portal/models.py:22 msgid "PLZ" msgstr "" -#: src/portal/models.py:24 +#: src/portal/models.py:23 msgid "Ort" msgstr "" -#: src/portal/models.py:25 src/project/forms.py:16 src/project/forms.py:17 +#: src/portal/models.py:24 src/project/forms.py:16 src/project/forms.py:17 msgid "E-Mail" msgstr "" +#: src/portal/templates/portal/content.html:12 +#: src/portal/templates/portal/content.html:34 +msgid "Zurück zur Übersicht" +msgstr "" + +#: src/portal/templates/portal/content.html:39 +msgid "Als gelesen markieren" +msgstr "" + #: src/portal/templates/portal/edit_form.html:11 msgid "Speichern" msgstr "" @@ -54,15 +63,6 @@ msgstr "" msgid "Schliessen" msgstr "" -#: src/portal/templates/portal/information.html:12 -#: src/portal/templates/portal/information.html:34 -msgid "Zurück zur Übersicht" -msgstr "" - -#: src/portal/templates/portal/information.html:39 -msgid "Als gelesen markieren" -msgstr "" - #: src/portal/templates/portal/overview.html:4 msgid "Elementa Portal" msgstr "" @@ -80,7 +80,7 @@ msgid "Logout" msgstr "" #: src/portal/templates/portal/overview.html:24 -#: src/project/templates/main.html:93 +#: src/project/templates/project/includes/meta_navigation.html:56 msgid "Aktuell" msgstr "" @@ -102,19 +102,26 @@ msgid "Abbrechen" msgstr "" #: src/portal/templates/portal/overview.html:96 -#: src/portal/templates/portal/overview.html:114 -msgid "Downloads" +#: src/portal/templates/portal/overview.html:131 +msgid "Informationen" msgstr "" -#: src/portal/templates/portal/overview.html:102 +#: src/portal/templates/portal/overview.html:103 +#: src/portal/templates/portal/overview.html:142 msgid "Suchbegriff eingeben" msgstr "" -#: src/portal/templates/portal/overview.html:103 +#: src/portal/templates/portal/overview.html:104 +#: src/portal/templates/portal/overview.html:143 #: src/project/templates/project/includes/search_form.html:14 msgid "Suchen" msgstr "" +#: src/portal/templates/portal/overview.html:136 +#: src/portal/templates/portal/overview.html:154 +msgid "Downloads" +msgstr "" + #: src/portal/templates/registration/login.html:4 #: src/project/templates/project/includes/header_button_menu.html:13 msgid "Eltern-Login" @@ -150,18 +157,22 @@ msgid "^account/edit/profile/success/$" msgstr "" #: src/portal/urls.py:33 -msgid "^information/(?P\\d+)/$" +msgid "^announcement/(?P\\d+)/$" msgstr "" #: src/portal/urls.py:36 +msgid "^information/(?P\\d+)/$" +msgstr "" + +#: src/portal/urls.py:40 msgid "^$" msgstr "" -#: src/portal/views.py:51 +#: src/portal/views.py:68 msgid "Benutzerdaten" msgstr "" -#: src/portal/views.py:52 +#: src/portal/views.py:69 msgid "Passwort" msgstr "" @@ -219,28 +230,53 @@ msgstr "" msgid "Suche" msgstr "" -#: src/project/templates/main.html:104 +#: src/project/templates/main.html:94 msgid "Menü" msgstr "" -#: src/project/templates/main.html:128 +#: src/project/templates/main.html:118 #: src/project/templates/project/includes/navigation.html:13 +#: src/project/templates/project/plugins/content/contact_form_button.html:5 msgid "Kontakt aufnehmen" msgstr "" -#: src/project/templates/project/includes/meta_navigation.html:12 +#: src/project/templates/main.html:142 +msgid "Schliessen (Esc)" +msgstr "" + +#: src/project/templates/main.html:143 +msgid "Bild herunterladen" +msgstr "" + +#: src/project/templates/main.html:144 +msgid "Vollbildmodus ein/aus" +msgstr "" + +#: src/project/templates/main.html:145 +msgid "rein/raus zoomen" +msgstr "" + +#: src/project/templates/main.html:158 +msgid "Vorheriges Foto (linke Pfeiltaste)" +msgstr "" + +#: src/project/templates/main.html:161 +msgid "Nächstes Foto (rechte Pfeiltaste)" +msgstr "" + +#: src/project/templates/project/includes/meta_navigation.html:13 msgid "One Day" msgstr "" -#: src/project/templates/project/includes/meta_navigation.html:23 +#: src/project/templates/project/includes/meta_navigation.html:25 msgid "News" msgstr "" -#: src/project/templates/project/includes/meta_navigation.html:34 +#: src/project/templates/project/includes/meta_navigation.html:37 msgid "Kalender" msgstr "" -#: src/project/templates/project/includes/meta_navigation.html:42 +#: src/project/templates/project/includes/meta_navigation.html:46 msgid "Standort & Kontakt" msgstr "" diff --git a/locale/en/LC_MESSAGES/django.mo b/locale/en/LC_MESSAGES/django.mo index ffed3ba..15e989f 100644 Binary files a/locale/en/LC_MESSAGES/django.mo and b/locale/en/LC_MESSAGES/django.mo differ diff --git a/locale/en/LC_MESSAGES/django.po b/locale/en/LC_MESSAGES/django.po index 2114422..7651d17 100644 --- a/locale/en/LC_MESSAGES/django.po +++ b/locale/en/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-03-27 12:11-0500\n" +"POT-Creation-Date: 2018-06-07 11:18-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -17,30 +17,39 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: src/portal/models.py:20 src/project/forms.py:10 +#: src/portal/models.py:19 src/project/forms.py:10 msgid "Vorname" msgstr "First Name" -#: src/portal/models.py:21 src/project/forms.py:11 +#: src/portal/models.py:20 src/project/forms.py:11 msgid "Nachname" msgstr "Last Name" -#: src/portal/models.py:22 +#: src/portal/models.py:21 msgid "Strasse" msgstr "Street" -#: src/portal/models.py:23 +#: src/portal/models.py:22 msgid "PLZ" msgstr "ZIP" -#: src/portal/models.py:24 +#: src/portal/models.py:23 msgid "Ort" msgstr "Place" -#: src/portal/models.py:25 src/project/forms.py:16 src/project/forms.py:17 +#: src/portal/models.py:24 src/project/forms.py:16 src/project/forms.py:17 msgid "E-Mail" msgstr "" +#: src/portal/templates/portal/content.html:12 +#: src/portal/templates/portal/content.html:34 +msgid "Zurück zur Übersicht" +msgstr "Back to the overview" + +#: src/portal/templates/portal/content.html:39 +msgid "Als gelesen markieren" +msgstr "Mark as read" + #: src/portal/templates/portal/edit_form.html:11 msgid "Speichern" msgstr "Save" @@ -53,15 +62,6 @@ msgstr "Your information has been successfully altered." msgid "Schliessen" msgstr "Close" -#: src/portal/templates/portal/information.html:12 -#: src/portal/templates/portal/information.html:34 -msgid "Zurück zur Übersicht" -msgstr "Back to the overview" - -#: src/portal/templates/portal/information.html:39 -msgid "Als gelesen markieren" -msgstr "Mark as read" - #: src/portal/templates/portal/overview.html:4 msgid "Elementa Portal" msgstr "" @@ -79,9 +79,9 @@ msgid "Logout" msgstr "" #: src/portal/templates/portal/overview.html:24 -#: src/project/templates/main.html:93 +#: src/project/templates/project/includes/meta_navigation.html:56 msgid "Aktuell" -msgstr "News" +msgstr "Topical" #: src/portal/templates/portal/overview.html:55 msgid "Ältere laden" @@ -101,19 +101,26 @@ msgid "Abbrechen" msgstr "Abort" #: src/portal/templates/portal/overview.html:96 -#: src/portal/templates/portal/overview.html:114 -msgid "Downloads" -msgstr "" +#: src/portal/templates/portal/overview.html:131 +msgid "Informationen" +msgstr "Informations" -#: src/portal/templates/portal/overview.html:102 +#: src/portal/templates/portal/overview.html:103 +#: src/portal/templates/portal/overview.html:142 msgid "Suchbegriff eingeben" msgstr "Enter search term" -#: src/portal/templates/portal/overview.html:103 +#: src/portal/templates/portal/overview.html:104 +#: src/portal/templates/portal/overview.html:143 #: src/project/templates/project/includes/search_form.html:14 msgid "Suchen" msgstr "Search" +#: src/portal/templates/portal/overview.html:136 +#: src/portal/templates/portal/overview.html:154 +msgid "Downloads" +msgstr "" + #: src/portal/templates/registration/login.html:4 #: src/project/templates/project/includes/header_button_menu.html:13 msgid "Eltern-Login" @@ -149,18 +156,22 @@ msgid "^account/edit/profile/success/$" msgstr "" #: src/portal/urls.py:33 -msgid "^information/(?P\\d+)/$" +msgid "^announcement/(?P\\d+)/$" msgstr "" #: src/portal/urls.py:36 +msgid "^information/(?P\\d+)/$" +msgstr "" + +#: src/portal/urls.py:40 msgid "^$" msgstr "" -#: src/portal/views.py:51 +#: src/portal/views.py:68 msgid "Benutzerdaten" msgstr "User details" -#: src/portal/views.py:52 +#: src/portal/views.py:69 msgid "Passwort" msgstr "Password" @@ -218,28 +229,54 @@ msgstr "Strengthen strengths. Learn to learn." msgid "Suche" msgstr "Search" -#: src/project/templates/main.html:104 +#: src/project/templates/main.html:94 msgid "Menü" msgstr "Menu" -#: src/project/templates/main.html:128 +#: src/project/templates/main.html:118 #: src/project/templates/project/includes/navigation.html:13 +#: src/project/templates/project/plugins/content/contact_form_button.html:5 msgid "Kontakt aufnehmen" msgstr "Get in touch" -#: src/project/templates/project/includes/meta_navigation.html:12 +#: src/project/templates/main.html:142 +#| msgid "Schliessen" +msgid "Schliessen (Esc)" +msgstr "Close (Esc)" + +#: src/project/templates/main.html:143 +msgid "Bild herunterladen" +msgstr "Download Image" + +#: src/project/templates/main.html:144 +msgid "Vollbildmodus ein/aus" +msgstr "Fullscreen on/off" + +#: src/project/templates/main.html:145 +msgid "rein/raus zoomen" +msgstr "zoom in/out" + +#: src/project/templates/main.html:158 +msgid "Vorheriges Foto (linke Pfeiltaste)" +msgstr "Previous Image (left arrow key)" + +#: src/project/templates/main.html:161 +msgid "Nächstes Foto (rechte Pfeiltaste)" +msgstr "Next Image (right arrow key)" + +#: src/project/templates/project/includes/meta_navigation.html:13 msgid "One Day" msgstr "" -#: src/project/templates/project/includes/meta_navigation.html:23 +#: src/project/templates/project/includes/meta_navigation.html:25 msgid "News" msgstr "" -#: src/project/templates/project/includes/meta_navigation.html:34 +#: src/project/templates/project/includes/meta_navigation.html:37 msgid "Kalender" msgstr "Calendar" -#: src/project/templates/project/includes/meta_navigation.html:42 +#: src/project/templates/project/includes/meta_navigation.html:46 msgid "Standort & Kontakt" msgstr "Location & Contact" diff --git a/private/js/modules/navigation.js b/private/js/modules/navigation.js index 8731184..f369ead 100644 --- a/private/js/modules/navigation.js +++ b/private/js/modules/navigation.js @@ -107,6 +107,7 @@ $(function() { } function close_navigation() { + $body.removeClass('notification_open'); $navigation.removeAttr('style'); var $navigation_main = $navigation.find('.navigation__main'); $body.removeClass('navigation_open'); diff --git a/private/scss/_config.scss b/private/scss/_config.scss index 1223528..060ba4c 100644 --- a/private/scss/_config.scss +++ b/private/scss/_config.scss @@ -10,6 +10,8 @@ $black: #000000; $green: #98C53A; +$facebook_blue: #29487d; + $violet: rgba(149, 72, 200, 0.66); $red: rgba(200, 0, 0, 0.66); $blue: rgba(65, 93, 200, 0.66); diff --git a/private/scss/modules/_header.scss b/private/scss/modules/_header.scss index 9f6154b..a2b7e2b 100644 --- a/private/scss/modules/_header.scss +++ b/private/scss/modules/_header.scss @@ -232,6 +232,9 @@ .search_open &, .navigation_open & { transform: translateY(em(-50px)); } + &.active { + color: $green; + } @media screen and (max-width: $small_breakpoint) { padding: 0 em(54px) 0 em(12px); &.header__button--reverse { diff --git a/private/scss/modules/_navigation.scss b/private/scss/modules/_navigation.scss index 2151164..5f91667 100644 --- a/private/scss/modules/_navigation.scss +++ b/private/scss/modules/_navigation.scss @@ -305,6 +305,9 @@ width: 100%; margin-top: em(20px); li { + &.selected { + color: $green; + } a { font-size: em(28px); text-decoration: none; diff --git a/private/scss/modules/_pages.scss b/private/scss/modules/_pages.scss index a0ac1b2..c25bd86 100644 --- a/private/scss/modules/_pages.scss +++ b/private/scss/modules/_pages.scss @@ -10,6 +10,7 @@ text-decoration: none; padding-left: 50%; position: relative; + background: $white; transition: border-color 0.2s ease-in-out; &:hover { border-color: $green; diff --git a/private/scss/modules/plugins/_form.scss b/private/scss/modules/plugins/_form.scss index 203288b..565386c 100644 --- a/private/scss/modules/plugins/_form.scss +++ b/private/scss/modules/plugins/_form.scss @@ -86,6 +86,16 @@ font-size: em(14px); } +.button--white { + background: $white; + color: $green; + .button__icon { + svg { + fill: $green; + } + } +} + .button--ghost { background: none; color: $green; diff --git a/private/scss/modules/plugins/_social_media.scss b/private/scss/modules/plugins/_social_media.scss index a753ddb..b66dc50 100644 --- a/private/scss/modules/plugins/_social_media.scss +++ b/private/scss/modules/plugins/_social_media.scss @@ -33,7 +33,7 @@ margin: em(50px) 0; } .social_media__item { - background: $green; + background: $facebook_blue; color: $white; } } \ No newline at end of file diff --git a/private/scss/modules/plugins/_timetable.scss b/private/scss/modules/plugins/_timetable.scss index f9aefa9..c85072e 100644 --- a/private/scss/modules/plugins/_timetable.scss +++ b/private/scss/modules/plugins/_timetable.scss @@ -151,7 +151,7 @@ $timetable_count: 15; } } -.timetable__clock__digital__intro { +.timetable__clock__digital__intro, .timetable__clock__digital__outro { position: absolute; bottom: 100%; left: 20%; @@ -169,6 +169,11 @@ $timetable_count: 15; } } +.timetable__clock__digital__outro { + top: 100%; + bottom: auto; +} + #timetable__clock__digital__time span { display: inline-block; position: relative; @@ -235,23 +240,6 @@ $timetable_count: 15; transform: translateX(100%); } -@keyframes point { - 0% { - transform: translate(0, 0); - opacity: 0; - } - 20% { - opacity: 1; - } - 80% { - opacity: 1; - } - 100% { - transform: translate(0, em(20px)); - opacity: 0; - } -} - .timetable__next { position: fixed; bottom: 0; @@ -260,49 +248,17 @@ $timetable_count: 15; text-decoration: none; color: $green; text-align: center; - height: em(60px); + height: em(100px); z-index: 10; opacity: 0; -webkit-tap-highlight-color: transparent; transition: opacity 2s $reveal_timing_function, color 0s 1s !important; - span { - display: block; - position: absolute; - left: 50%; - bottom: em(40px); - margin-left: em(-15px); - width: em(30px); - height: em(50px); - border: em(2.5px) solid $green; - border-radius: em(50px); - transition: border 0s 1s; - &:before { - content: ''; - position: absolute; - top: em(10px); - left: 50%; - width: em(6px); - height: em(6px); - margin-left: em(-3px); - background: $green; - border-radius: 50%; - display: block; - animation: point 2s infinite; - transition: background 0s 1s; - } - #timetable[data-active="0"] & { - border-color: $white; - &:before { - background: $white; - } - } - } &.hidden { opacity: 0; pointer-events: none; } #timetable[data-active="0"] & { - color: $black; + color: $white; opacity: 1; &:before { opacity: 1; @@ -313,6 +269,46 @@ $timetable_count: 15; } } +@keyframes opacity { + 0% { + opacity: 0.2; + } + 30% { + opacity: 1; + } + 60% { + opacity: 0.2; + } + 100% { + opacity: 0.2; + } +} + +.timetable__next__icon { + display: block; + margin: em(15px) auto; + width: em(25px); + span { + display: block; + width: em(25px); + height: em(25px); + margin-top: em(-12px); + border-right: 2px solid currentColor; + border-bottom: 2px solid currentColor; + transform: rotate(45deg); + animation: opacity 1.2s infinite ease-in-out; + &.data_id_1 { + animation-delay: 0.2s; + } + &.data_id_2 { + animation-delay: 0.4s; + } + } + #timetable[data-active="0"] & { + color: $white; + } +} + .timetable__intro__placeholder { width: 100%; height: 50%; diff --git a/settings.py b/settings.py index 3eba910..45e57af 100644 --- a/settings.py +++ b/settings.py @@ -89,7 +89,7 @@ CMS_PLACEHOLDER_CONF = { 'plugins': ['SectionPlugin'], }, 'contact': { - 'plugins': ['SectionTextPlugin', 'JourneyCalculatorPlugin'], + 'plugins': ['SectionTextPlugin', 'ContactFormButtonPlugin', 'JourneyCalculatorPlugin'], }, 'timetable': { 'plugins': ['TimetablePlugin'], diff --git a/src/project/cms_plugins.py b/src/project/cms_plugins.py index 4b55899..749dd20 100644 --- a/src/project/cms_plugins.py +++ b/src/project/cms_plugins.py @@ -255,6 +255,14 @@ class SubPageListPlugin(CMSPluginBase): render_template = 'project/plugins/content/subpage_list.html' +@plugin_pool.register_plugin +class ContactFormButtonPlugin(CMSPluginBase): + model = CMSPlugin + module = 'Content' + name = 'Contact Form Button' + render_template = 'project/plugins/content/contact_form_button.html' + + @plugin_pool.register_plugin class PartnerPlugin(CMSPluginBase): model = Partner diff --git a/src/project/context_processors.py b/src/project/context_processors.py index e7596e5..7a68ba1 100644 --- a/src/project/context_processors.py +++ b/src/project/context_processors.py @@ -1,5 +1,7 @@ from cms.models import Page +from cms.utils.page import _page_is_published from haystack.forms import ModelSearchForm +from parler.utils.i18n import get_language from project.models import Notification @@ -22,8 +24,12 @@ def new_page_amount(request): try: page = Page.objects.public().get(reverse_id=tracked_page) id = 'new_{}_amount'.format(tracked_page) + amount = 0 + for page in page.get_child_pages(): + if page.is_published(get_language()) and _page_is_published(page): + amount = amount + 1 context.update({ - id: page.get_child_pages().count() + id: amount }) except Page.DoesNotExist: pass diff --git a/src/project/migrations/0008_auto_20180607_0810.py b/src/project/migrations/0008_auto_20180607_0810.py new file mode 100644 index 0000000..babaf81 --- /dev/null +++ b/src/project/migrations/0008_auto_20180607_0810.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.11 on 2018-06-07 08:10 +from __future__ import unicode_literals + +from django.db import migrations +import djangocms_text_ckeditor.fields + + +class Migration(migrations.Migration): + + dependencies = [ + ('project', '0007_gallery'), + ] + + operations = [ + migrations.AddField( + model_name='timetable', + name='cta', + field=djangocms_text_ckeditor.fields.HTMLField(blank=True, null=True, verbose_name='CTA'), + ), + migrations.AddField( + model_name='timetable', + name='outro', + field=djangocms_text_ckeditor.fields.HTMLField(blank=True, null=True, verbose_name='Schluss'), + ), + ] diff --git a/src/project/models.py b/src/project/models.py index 9651b58..052f08b 100644 --- a/src/project/models.py +++ b/src/project/models.py @@ -262,7 +262,9 @@ class SocialMediaListItem(models.Model): class Timetable(CMSPlugin): start_image = CroppableFilerImageField(verbose_name='Startbild') cropping = ImageRatioField('start_image', '1000x1000', free_crop=True) - introduction = HTMLField(verbose_name='Einleitung', configuration='CKEDITOR_SETTINGS_INPUT') + introduction = HTMLField(verbose_name='Intro', configuration='CKEDITOR_SETTINGS_INPUT') + outro = HTMLField(verbose_name='Outro', configuration='CKEDITOR_SETTINGS_INPUT', blank=True, null=True) + cta = HTMLField(verbose_name='CTA', configuration='CKEDITOR_SETTINGS_INPUT', blank=True, null=True) class Meta(CMSPlugin.Meta): verbose_name = 'Timetable' diff --git a/src/project/templates/project/contact.html b/src/project/templates/project/contact.html index 035dbf9..fab909d 100644 --- a/src/project/templates/project/contact.html +++ b/src/project/templates/project/contact.html @@ -9,7 +9,6 @@

{% page_attribute 'page_title' %}

{% placeholder 'contact' %} - {% static_placeholder 'social_media' %}
diff --git a/src/project/templates/project/includes/meta_navigation.html b/src/project/templates/project/includes/meta_navigation.html index af57ed9..5543e28 100644 --- a/src/project/templates/project/includes/meta_navigation.html +++ b/src/project/templates/project/includes/meta_navigation.html @@ -5,7 +5,8 @@ {% page_url 'calendar' as calendar_url %} {% page_url 'contact' as contact_url %} {% if oneday_url %} - + {% include 'project/assets/oneday.svg' %} @@ -13,7 +14,8 @@ {% endif %} {% if news_url %} - + {% if new_news_amount %} {{ new_news_amount }} @@ -24,7 +26,8 @@ {% endif %} {% if calendar_url %} - + {% if new_calendar_amount %} {{ new_calendar_amount }} @@ -35,7 +38,8 @@ {% endif %} {% if contact_url %} - + {% include 'project/assets/contact.svg' %} @@ -43,12 +47,12 @@ {% endif %} {% if notification %} - 1 {% include 'project/assets/bell.svg' %} - {% trans 'Atkuell' %} + {% trans 'Aktuell' %} {% endif %} \ No newline at end of file diff --git a/src/project/templates/project/plugins/content/contact_form_button.html b/src/project/templates/project/plugins/content/contact_form_button.html new file mode 100644 index 0000000..ab61bd6 --- /dev/null +++ b/src/project/templates/project/plugins/content/contact_form_button.html @@ -0,0 +1,9 @@ +{% load i18n cms_tags %} + +{% page_url 'cta' as cta_url %} +{% if cta_url %} + + {% include 'project/assets/arrow-right-long.svg' %} + {% trans 'Kontakt aufnehmen' %} + +{% endif %} \ No newline at end of file diff --git a/src/project/templates/project/plugins/content/subpage_list.html b/src/project/templates/project/plugins/content/subpage_list.html index df113fc..b5e3cef 100644 --- a/src/project/templates/project/plugins/content/subpage_list.html +++ b/src/project/templates/project/plugins/content/subpage_list.html @@ -1,7 +1,9 @@ +{% load util_tags %} +
    {% for page in request.current_page.get_child_pages %} - {% if page.get_public_url %} + {% if page|page_published %} {% include "project/includes/page_item.html" with image=page.imageextension.image cropping=page.imageextension.cropping index=forloop.counter0 subpage=True %} {% endif %} {% endfor %} diff --git a/src/project/templates/project/plugins/timetable/timetable.html b/src/project/templates/project/plugins/timetable/timetable.html index 2ae4519..dc28706 100644 --- a/src/project/templates/project/plugins/timetable/timetable.html +++ b/src/project/templates/project/plugins/timetable/timetable.html @@ -17,6 +17,9 @@ : {{ instance.child_plugin_instances.0.time|time:'i' }}
+ {% if instance.outro %} + {{ instance.outro }} + {% endif %} @@ -26,7 +29,12 @@
- + {% if instance.cta %}{{ instance.cta }}{% endif %} + + + + + {% thumbnail instance.start_image 2110x1200 box=instance.cropping crop detail as thumb %} diff --git a/src/project/templatetags/util_tags.py b/src/project/templatetags/util_tags.py index 62af47a..e8caae8 100644 --- a/src/project/templatetags/util_tags.py +++ b/src/project/templatetags/util_tags.py @@ -1,6 +1,8 @@ # -*- coding: utf-8 -*- from cms.models import Page +from cms.utils.page import _page_is_published from django import template +from parler.utils.i18n import get_language register = template.Library() @@ -13,6 +15,11 @@ def page_image(id): return None +@register.filter +def page_published(page): + return page.is_published(get_language()) and _page_is_published(page) + + @register.filter def page_image_cropping(id): try: diff --git a/static/djangocms_text_ckeditor/ckeditor/plugins/autogrow/plugin.js b/static/djangocms_text_ckeditor/ckeditor/plugins/autogrow/plugin.js new file mode 100644 index 0000000..19882da --- /dev/null +++ b/static/djangocms_text_ckeditor/ckeditor/plugins/autogrow/plugin.js @@ -0,0 +1,232 @@ +/** + * @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +/** + * @fileOverview The Auto Grow plugin. + */ + +'use strict'; + +( function() { + CKEDITOR.plugins.add( 'autogrow', { + init: function( editor ) { + // This feature is available only for themed ui instance. + if ( editor.elementMode == CKEDITOR.ELEMENT_MODE_INLINE ) + return; + + editor.on( 'instanceReady', function() { + // Simply set auto height with div wysiwyg. + if ( editor.editable().isInline() ) + editor.ui.space( 'contents' ).setStyle( 'height', 'auto' ); + // For classic (`iframe`-based) wysiwyg we need to resize the editor. + else + initIframeAutogrow( editor ); + } ); + } + } ); + + function initIframeAutogrow( editor ) { + var lastHeight, + doc, + markerContainer, + scrollable, + marker, + configBottomSpace = editor.config.autoGrow_bottomSpace || 0, + configMinHeight = editor.config.autoGrow_minHeight !== undefined ? editor.config.autoGrow_minHeight : 200, + configMaxHeight = editor.config.autoGrow_maxHeight || Infinity, + maxHeightIsUnlimited = !editor.config.autoGrow_maxHeight; + + editor.addCommand( 'autogrow', { + exec: resizeEditor, + modes: { wysiwyg: 1 }, + readOnly: 1, + canUndo: false, + editorFocus: false + } ); + + var eventsList = { contentDom: 1, key: 1, selectionChange: 1, insertElement: 1, mode: 1 }; + for ( var eventName in eventsList ) { + editor.on( eventName, function( evt ) { + // Some time is required for insertHtml, and it gives other events better performance as well. + if ( evt.editor.mode == 'wysiwyg' ) { + setTimeout( function() { + if ( isNotResizable() ) { + lastHeight = null; + return; + } + + resizeEditor(); + + // Second pass to make correction upon the first resize, e.g. scrollbar. + // If height is unlimited vertical scrollbar was removed in the first + // resizeEditor() call, so we don't need the second pass. + if ( !maxHeightIsUnlimited ) + resizeEditor(); + }, 100 ); + } + } ); + } + + // Coordinate with the "maximize" plugin. (https://dev.ckeditor.com/ticket/9311) + editor.on( 'afterCommandExec', function( evt ) { + if ( evt.data.name == 'maximize' && evt.editor.mode == 'wysiwyg' ) { + if ( evt.data.command.state == CKEDITOR.TRISTATE_ON ) + scrollable.removeStyle( 'overflow-y' ); + else + resizeEditor(); + } + } ); + + editor.on( 'contentDom', refreshCache ); + + refreshCache(); + + if ( editor.config.autoGrow_onStartup && editor.editable().isVisible() ) { + editor.execCommand( 'autogrow' ); + } + + function refreshCache() { + doc = editor.document; + markerContainer = doc[ CKEDITOR.env.ie ? 'getBody' : 'getDocumentElement' ](); + + // Quirks mode overflows body, standards overflows document element. + scrollable = CKEDITOR.env.quirks ? doc.getBody() : doc.getDocumentElement(); + + // Reset scrollable body height and min-height css values. + // While set by outside code it may break resizing. (https://dev.ckeditor.com/ticket/14620) + var body = CKEDITOR.env.quirks ? scrollable : scrollable.findOne( 'body' ); + if ( body ) { + body.setStyle( 'height', 'auto' ); + body.setStyle( 'min-height', CKEDITOR.env.safari ? '0%' : 'auto' ); // Safari does not support 'min-height: auto'. + } + + marker = CKEDITOR.dom.element.createFromHtml( + '' + + ( CKEDITOR.env.webkit ? ' ' : '' ) + + '', + doc ); + } + + function isNotResizable() { + var maximizeCommand = editor.getCommand( 'maximize' ); + + return ( + !editor.window || + // Disable autogrow when the editor is maximized. (https://dev.ckeditor.com/ticket/6339) + maximizeCommand && maximizeCommand.state == CKEDITOR.TRISTATE_ON + ); + } + + // Actual content height, figured out by appending check the last element's document position. + function contentHeight() { + // Append a temporary marker element. + markerContainer.append( marker ); + var height = marker.getDocumentPosition( doc ).y + marker.$.offsetHeight; + marker.remove(); + + return height; + } + + function resizeEditor() { + // Hide scroll because we won't need it at all. + // Thanks to that we'll need only one resizeEditor() call per change. + if ( maxHeightIsUnlimited ) + scrollable.setStyle( 'overflow-y', 'hidden' ); + + var currentHeight = editor.window.getViewPaneSize().height, + newHeight = contentHeight(); + + // Additional space specified by user. + newHeight += configBottomSpace; + newHeight = Math.max( newHeight, configMinHeight ); + newHeight = Math.min( newHeight, configMaxHeight ); + + // https://dev.ckeditor.com/ticket/10196 Do not resize editor if new height is equal + // to the one set by previous resizeEditor() call. + if ( newHeight != currentHeight && lastHeight != newHeight ) { + newHeight = editor.fire( 'autoGrow', { currentHeight: currentHeight, newHeight: newHeight } ).newHeight; + editor.resize( editor.container.getStyle( 'width' ), newHeight, true ); + lastHeight = newHeight; + } + + if ( !maxHeightIsUnlimited ) { + if ( newHeight < configMaxHeight && scrollable.$.scrollHeight > scrollable.$.clientHeight ) + scrollable.setStyle( 'overflow-y', 'hidden' ); + else + scrollable.removeStyle( 'overflow-y' ); + } + } + } +} )(); + +/** + * The minimum height that the editor can assume when adjusting to content by using the Auto Grow + * feature. This option accepts a value in pixels, without the unit (for example: `300`). + * + * Read more in the [documentation](#!/guide/dev_autogrow) + * and see the [SDK sample](https://sdk.ckeditor.com/samples/autogrow.html). + * + * config.autoGrow_minHeight = 300; + * + * @since 3.4 + * @cfg {Number} [autoGrow_minHeight=200] + * @member CKEDITOR.config + */ + +/** + * The maximum height that the editor can assume when adjusting to content by using the Auto Grow + * feature. This option accepts a value in pixels, without the unit (for example: `600`). + * Zero (`0`) means that the maximum height is not limited and the editor will expand infinitely. + * + * Read more in the [documentation](#!/guide/dev_autogrow) + * and see the [SDK sample](https://sdk.ckeditor.com/samples/autogrow.html). + * + * config.autoGrow_maxHeight = 400; + * + * @since 3.4 + * @cfg {Number} [autoGrow_maxHeight=0] + * @member CKEDITOR.config + */ + +/** + * Whether automatic editor height adjustment brought by the Auto Grow feature should happen on + * editor creation. + * + * Read more in the [documentation](#!/guide/dev_autogrow) + * and see the [SDK sample](https://sdk.ckeditor.com/samples/autogrow.html). + * + * config.autoGrow_onStartup = true; + * + * @since 3.6.2 + * @cfg {Boolean} [autoGrow_onStartup=false] + * @member CKEDITOR.config + */ + +/** + * Extra vertical space to be added between the content and the editor bottom bar when adjusting + * editor height to content by using the Auto Grow feature. This option accepts a value in pixels, + * without the unit (for example: `50`). + * + * Read more in the [documentation](#!/guide/dev_autogrow) + * and see the [SDK sample](https://sdk.ckeditor.com/samples/autogrow.html). + * + * config.autoGrow_bottomSpace = 50; + * + * @since 3.6.2 + * @cfg {Number} [autoGrow_bottomSpace=0] + * @member CKEDITOR.config + */ + +/** + * Fired when the Auto Grow plugin is about to change the size of the editor. + * + * @event autogrow + * @member CKEDITOR.editor + * @param {CKEDITOR.editor} editor This editor instance. + * @param data + * @param {Number} data.currentHeight The current editor height (before resizing). + * @param {Number} data.newHeight The new editor height (after resizing). It can be changed + * to achieve a different height value to be used instead. + */ diff --git a/static/djangocms_text_ckeditor/js/dist/bundle-bca0d2d3f4.cms.ckeditor.min.js b/static/djangocms_text_ckeditor/js/dist/bundle-d8935bb598.cms.ckeditor.min.js similarity index 100% rename from static/djangocms_text_ckeditor/js/dist/bundle-bca0d2d3f4.cms.ckeditor.min.js rename to static/djangocms_text_ckeditor/js/dist/bundle-d8935bb598.cms.ckeditor.min.js