Skip to content
Snippets Groups Projects
Unverified Commit ff48b95d authored by Fredrik Jonsson's avatar Fredrik Jonsson Committed by GitHub
Browse files

Merge pull request #722 from OpenTechFund/feature/intro-text-news-index-page

Add introduction text to news index pages.
parents ce27e7c2 c7f4acb0
No related branches found
No related tags found
Loading
# 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