commit
6f6119ec29
5 changed files with 25 additions and 24 deletions
|
@ -5,7 +5,7 @@ from __future__ import unicode_literals
|
|||
from django.db import models
|
||||
from modelcluster.fields import ParentalKey
|
||||
|
||||
from wagtail.wagtailcore import blocks
|
||||
from wagtail.wagtailcore.blocks import StructBlock, CharBlock, URLBlock, RichTextBlock
|
||||
from wagtail.wagtailcore.models import Page, Orderable
|
||||
from wagtail.wagtailcore.fields import StreamField, RichTextField
|
||||
from wagtail.wagtailadmin.edit_handlers import FieldPanel, StreamFieldPanel, InlinePanel, MultiFieldPanel
|
||||
|
@ -17,12 +17,12 @@ from puput.models import EntryPage
|
|||
|
||||
from ..util import TranslatedField
|
||||
|
||||
class InfoBlock(blocks.StructBlock):
|
||||
title = blocks.CharBlock(required=True)
|
||||
class InfoBlock(StructBlock):
|
||||
title = CharBlock(required=True)
|
||||
photo = ImageChooserBlock(required=True)
|
||||
summary = blocks.RichTextBlock(required=True)
|
||||
action = blocks.CharBlock(required=False)
|
||||
url = blocks.URLBlock(required=False)
|
||||
summary = RichTextBlock(required=True)
|
||||
action = CharBlock(required=False)
|
||||
url = URLBlock(required=False)
|
||||
|
||||
class ArticleIndexPage(Page):
|
||||
title_fr = models.CharField(max_length=255, default="")
|
||||
|
@ -83,15 +83,15 @@ class ArticlePage(Page):
|
|||
)
|
||||
|
||||
body_de = StreamField([
|
||||
('paragraph', blocks.RichTextBlock()),
|
||||
('paragraph', RichTextBlock()),
|
||||
('image', ImageChooserBlock()),
|
||||
('section', blocks.CharBlock(classname="full title")),
|
||||
('section', CharBlock(classname="full title")),
|
||||
('info', InfoBlock()),
|
||||
], null=True, blank=True)
|
||||
body_fr = StreamField([
|
||||
('paragraph', blocks.RichTextBlock()),
|
||||
('paragraph', RichTextBlock()),
|
||||
('image', ImageChooserBlock()),
|
||||
('section', blocks.CharBlock(classname="full title")),
|
||||
('section', CharBlock(classname="full title")),
|
||||
('info', InfoBlock()),
|
||||
], null=True, blank=True)
|
||||
trans_body = TranslatedField(
|
||||
|
@ -123,14 +123,16 @@ class ArticlePage(Page):
|
|||
MultiFieldPanel([
|
||||
FieldPanel('title'),
|
||||
FieldPanel('intro_de'),
|
||||
StreamFieldPanel('body_de'),
|
||||
], heading="Deutsch"),
|
||||
StreamFieldPanel('body_de'),
|
||||
MultiFieldPanel([
|
||||
FieldPanel('title_fr'),
|
||||
FieldPanel('intro_fr'),
|
||||
StreamFieldPanel('body_fr'),
|
||||
], heading="Français"),
|
||||
ImageChooserPanel('feed_image'),
|
||||
StreamFieldPanel('body_fr'),
|
||||
MultiFieldPanel([
|
||||
ImageChooserPanel('feed_image'),
|
||||
], heading="Images"),
|
||||
]
|
||||
promote_panels = [
|
||||
InlinePanel('related_links', label="Links"),
|
||||
|
@ -186,7 +188,7 @@ class HomePage(Page):
|
|||
FieldPanel('body_de', classname="full"),
|
||||
StreamFieldPanel('infos_de'),
|
||||
], heading="Deutsch"),
|
||||
MultiFieldPanel([
|
||||
MultiFieldPanel([
|
||||
FieldPanel('intro_fr', classname="full"),
|
||||
FieldPanel('body_fr', classname="full"),
|
||||
StreamFieldPanel('infos_fr'),
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
<div class="item">
|
||||
<div class="article-caption">
|
||||
<h3><a href="{% pageurl entry %}">{{ entry.trans_title }}</a></h3>
|
||||
<p>{{ entry.trans_intro|richtext }}</p>
|
||||
{{ entry.trans_intro|richtext }}
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<section id="news">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
{% for entry in newsfeed %}
|
||||
{% for entry in newsfeed %}
|
||||
<div class="col-md-4 col-sm-6 col-xs-12">
|
||||
<div class="panel panel-default">
|
||||
{% if entry.header_image %}
|
||||
|
@ -13,10 +13,10 @@
|
|||
<h3><span>{{ entry.title }}</span></h3>
|
||||
<p>
|
||||
{% if entry.excerpt %}
|
||||
{{ entry.excerpt|richtext }}
|
||||
{% else %}
|
||||
{{ entry.body|richtext|truncatewords_html:70 }}
|
||||
{% endif %}
|
||||
{{ entry.excerpt|striptags }}
|
||||
{% else %}
|
||||
{{ entry.body|striptags|truncatewords_html:70 }}
|
||||
{% endif %}
|
||||
</p>
|
||||
<a href="{% pageurl entry %}" class="btn btn-default btn-xs">Mehr erfahren</a>
|
||||
</div>
|
||||
|
@ -25,7 +25,7 @@
|
|||
</div>
|
||||
{% empty %}
|
||||
No news today
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
|
|
@ -126,14 +126,12 @@ AUTH_PASSWORD_VALIDATORS = [
|
|||
# Internationalization
|
||||
# https://docs.djangoproject.com/en/1.8/topics/i18n/
|
||||
|
||||
LANGUAGE_CODE = 'de-DE'
|
||||
LANGUAGE_CODE = 'de' # default language
|
||||
|
||||
TIME_ZONE = 'Europe/Zurich'
|
||||
|
||||
USE_I18N = True
|
||||
|
||||
USE_L10N = True
|
||||
|
||||
USE_TZ = True
|
||||
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@ section {
|
|||
|
||||
&:nth-child(odd) {
|
||||
background-color: $gray-lighter;
|
||||
color: black;
|
||||
}
|
||||
|
||||
h1 {
|
||||
|
|
Loading…
Reference in a new issue