Skip to content
Snippets Groups Projects
Commit c7f4acb0 authored by Fredrik Jonsson's avatar Fredrik Jonsson
Browse files

Add introduction text to news index pages.

parent dbaf2d7f
No related branches found
No related tags found
No related merge requests found
# Generated by Django 2.0.9 on 2018-11-16 09:28
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('news', '0006_newspage_drupal_id'),
]
operations = [
migrations.AddField(
model_name='newsindex',
name='introduction',
field=models.TextField(blank=True),
),
]
......@@ -128,6 +128,12 @@ class NewsIndex(BasePage):
subpage_types = ['NewsPage']
parent_page_types = ['home.HomePage']
introduction = models.TextField(blank=True)
content_panels = BasePage.content_panels + [
FieldPanel('introduction')
]
def get_context(self, request, *args, **kwargs):
news = NewsPage.objects.live().public().descendant_of(self).annotate(
date=Coalesce('publication_date', 'first_published_at')
......
......@@ -5,6 +5,10 @@
{% block content %}
<div class="wrapper wrapper--small wrapper--inner-space-medium">
{% if page.introduction %}
<h4 class="heading heading--listings-introduction">{{ page.introduction }}</h4>
{% endif %}
<form class="form" method="GET">
<div class="form__select form__select--narrow form__select--inline">
<select name="news_type">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment