fixes
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
26
src/project/migrations/0008_auto_20180607_0810.py
Normal file
26
src/project/migrations/0008_auto_20180607_0810.py
Normal file
@@ -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'),
|
||||
),
|
||||
]
|
||||
@@ -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'
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
<div class="contact__content__main reveal reveal_animation data_delay_3">
|
||||
<h1>{% page_attribute 'page_title' %}</h1>
|
||||
{% placeholder 'contact' %}
|
||||
{% static_placeholder 'social_media' %}
|
||||
</div>
|
||||
<div class="contact__content__backdrop reveal reveal_animation data_delay_5"></div>
|
||||
</div>
|
||||
|
||||
@@ -5,7 +5,8 @@
|
||||
{% page_url 'calendar' as calendar_url %}
|
||||
{% page_url 'contact' as contact_url %}
|
||||
{% if oneday_url %}
|
||||
<a href="{{ oneday_url }}" class="header__button header__button--reverse header__button--light data_id_0">
|
||||
<a href="{{ oneday_url }}" class="header__button header__button--reverse header__button--light data_id_0
|
||||
{% if oneday_url == request.path %}active{% endif %}">
|
||||
<span class="header__button__icon">
|
||||
{% include 'project/assets/oneday.svg' %}
|
||||
</span>
|
||||
@@ -13,7 +14,8 @@
|
||||
</a>
|
||||
{% endif %}
|
||||
{% if news_url %}
|
||||
<a href="{{ news_url }}" class="header__button header__button--reverse header__button--light data_id_1">
|
||||
<a href="{{ news_url }}" class="header__button header__button--reverse header__button--light data_id_1
|
||||
{% if news_url == request.path %}active{% endif %}">
|
||||
<span class="header__button__icon">
|
||||
{% if new_news_amount %}
|
||||
<span class="header__button__icon__number">{{ new_news_amount }}</span>
|
||||
@@ -24,7 +26,8 @@
|
||||
</a>
|
||||
{% endif %}
|
||||
{% if calendar_url %}
|
||||
<a href="{{ calendar_url }}" class="header__button header__button--reverse header__button--light data_id_2">
|
||||
<a href="{{ calendar_url }}" class="header__button header__button--reverse header__button--light data_id_2
|
||||
{% if calendar_url == request.path %}active{% endif %}">
|
||||
<span class="header__button__icon">
|
||||
{% if new_calendar_amount %}
|
||||
<span class="header__button__icon__number">{{ new_calendar_amount }}</span>
|
||||
@@ -35,7 +38,8 @@
|
||||
</a>
|
||||
{% endif %}
|
||||
{% if contact_url %}
|
||||
<a href="{{ contact_url }}" class="header__button header__button--reverse header__button--light data_id_3">
|
||||
<a href="{{ contact_url }}" class="header__button header__button--reverse header__button--light data_id_3
|
||||
{% if contact_url == request.path %}active{% endif %}">
|
||||
<span class="header__button__icon">
|
||||
{% include 'project/assets/contact.svg' %}
|
||||
</span>
|
||||
@@ -43,12 +47,12 @@
|
||||
</a>
|
||||
{% endif %}
|
||||
{% if notification %}
|
||||
<a href="#"
|
||||
<a href="#" data-updated="{{ notification.updated }}"
|
||||
class="header__button header__button--notification header__button--reverse header__button--light data_id_4">
|
||||
<span class="header__button__icon">
|
||||
<span class="header__button__icon__number">1</span>
|
||||
{% include 'project/assets/bell.svg' %}
|
||||
</span>
|
||||
{% trans 'Atkuell' %}
|
||||
{% trans 'Aktuell' %}
|
||||
</a>
|
||||
{% endif %}
|
||||
@@ -0,0 +1,9 @@
|
||||
{% load i18n cms_tags %}
|
||||
|
||||
{% page_url 'cta' as cta_url %}
|
||||
{% if cta_url %}
|
||||
<a href="{{ cta_url }}" class="button button--white">
|
||||
<span class="button__icon">{% include 'project/assets/arrow-right-long.svg' %}</span>
|
||||
<span class="button__text">{% trans 'Kontakt aufnehmen' %}</span>
|
||||
</a>
|
||||
{% endif %}
|
||||
@@ -1,7 +1,9 @@
|
||||
{% load util_tags %}
|
||||
|
||||
<div class="subpage_list">
|
||||
<ul>
|
||||
{% 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 %}
|
||||
|
||||
@@ -17,6 +17,9 @@
|
||||
<span>:</span>
|
||||
{{ instance.child_plugin_instances.0.time|time:'i' }}
|
||||
</div>
|
||||
{% if instance.outro %}
|
||||
<span class="timetable__clock__digital__outro">{{ instance.outro }}</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -26,7 +29,12 @@
|
||||
<div class="timetable__start__door timetable__start__door--right"></div>
|
||||
|
||||
<a href="#" class="timetable__next reveal reveal_animation data_delay_23">
|
||||
<span></span>
|
||||
{% if instance.cta %}{{ instance.cta }}{% endif %}
|
||||
<span class="timetable__next__icon">
|
||||
<span class="data_id_0"></span>
|
||||
<span class="data_id_1"></span>
|
||||
<span class="data_id_2"></span>
|
||||
</span>
|
||||
</a>
|
||||
|
||||
{% thumbnail instance.start_image 2110x1200 box=instance.cropping crop detail as thumb %}
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user