Skip to content
Snippets Groups Projects
Commit 6d9e7ea5 authored by Todd Dembrey's avatar Todd Dembrey
Browse files

Add the reviewers and project listing to the fund

parent 9fca772e
No related branches found
No related tags found
No related merge requests found
<article class="person">
<h2><a href="{% pageurl person %}">{{ person.first_name }} {{ person.last_name }}</a></h2>
{% if person.listing_summary or person.introduction %}
<p>{{ person.listing_summary|default:person.introduction }}</p>
{% endif %}
</article>
......@@ -13,13 +13,7 @@
<div class="container">
{% if people.paginator.count %}
{% for person in people %}
<article class="person">
<h2><a href="{% pageurl person %}">{{ person.first_name }} {{ person.last_name }}</a></h2>
{% if person.listing_summary or person.introduction %}
<p>{{ person.listing_summary|default:person.introduction }}</p>
{% endif %}
</article>
{% include "people/includes/person_listing.html" with person=person %}
{% endfor %}
{% include "includes/pagination.html" with paginator_page=people %}
......
from wagtail.wagtailcore.blocks import StaticBlock
from opentech.utils.blocks import StoryBlock
class ProjectsBlock(StaticBlock):
class Meta:
icon = 'grip'
label = 'List of Projects funded'
template = 'publicpages/blocks/related_projects.html'
class ReviewersBlock(StaticBlock):
class Meta:
icon = 'grip'
label = 'List of fund Reviewers'
template = 'publicpages/blocks/related_reviewers.html'
class FundBlock(StoryBlock):
project_list = ProjectsBlock()
reviewer_list = ReviewersBlock()
......@@ -11,6 +11,7 @@ import wagtail.wagtailembeds.blocks
import wagtail.wagtailimages.blocks
import wagtail.wagtailsnippets.blocks
import opentech
class Migration(migrations.Migration):
......@@ -46,7 +47,7 @@ class Migration(migrations.Migration):
('listing_title', models.CharField(blank=True, help_text='Override the page title used when this page appears in listings', max_length=255)),
('listing_summary', models.CharField(blank=True, help_text="The text summary used when this page appears in listings. It's also used as the description for search engines if the 'Search description' field above is not defined.", max_length=255)),
('introduction', models.TextField(blank=True)),
('body', wagtail.wagtailcore.fields.StreamField((('heading', wagtail.wagtailcore.blocks.CharBlock(classname='full title', icon='title')), ('paragraph', wagtail.wagtailcore.blocks.RichTextBlock()), ('image', wagtail.wagtailcore.blocks.StructBlock((('image', wagtail.wagtailimages.blocks.ImageChooserBlock()), ('caption', wagtail.wagtailcore.blocks.CharBlock(required=False))))), ('quote', wagtail.wagtailcore.blocks.StructBlock((('quote', wagtail.wagtailcore.blocks.CharBlock(classname='title')), ('attribution', wagtail.wagtailcore.blocks.CharBlock(required=False)), ('job_title', wagtail.wagtailcore.blocks.CharBlock(required=False))))), ('embed', wagtail.wagtailembeds.blocks.EmbedBlock()), ('call_to_action', wagtail.wagtailsnippets.blocks.SnippetChooserBlock('utils.CallToActionSnippet', template='blocks/call_to_action_block.html')), ('document', wagtail.wagtailcore.blocks.StructBlock((('document', wagtail.wagtaildocs.blocks.DocumentChooserBlock()), ('title', wagtail.wagtailcore.blocks.CharBlock(required=False)))))))),
('body', wagtail.wagtailcore.fields.StreamField((('heading', wagtail.wagtailcore.blocks.CharBlock(classname='full title', icon='title')), ('paragraph', wagtail.wagtailcore.blocks.RichTextBlock()), ('image', wagtail.wagtailcore.blocks.StructBlock((('image', wagtail.wagtailimages.blocks.ImageChooserBlock()), ('caption', wagtail.wagtailcore.blocks.CharBlock(required=False))))), ('quote', wagtail.wagtailcore.blocks.StructBlock((('quote', wagtail.wagtailcore.blocks.CharBlock(classname='title')), ('attribution', wagtail.wagtailcore.blocks.CharBlock(required=False)), ('job_title', wagtail.wagtailcore.blocks.CharBlock(required=False))))), ('embed', wagtail.wagtailembeds.blocks.EmbedBlock()), ('call_to_action', wagtail.wagtailsnippets.blocks.SnippetChooserBlock('utils.CallToActionSnippet', template='blocks/call_to_action_block.html')), ('document', wagtail.wagtailcore.blocks.StructBlock((('document', wagtail.wagtaildocs.blocks.DocumentChooserBlock()), ('title', wagtail.wagtailcore.blocks.CharBlock(required=False))))), ('project_list', opentech.publicpages.blocks.ProjectsBlock()), ('reviewer_list', opentech.publicpages.blocks.ReviewersBlock())))),
('fund_type', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailcore.Page')),
('header_image', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='images.CustomImage')),
('listing_image', models.ForeignKey(blank=True, help_text='Choose the image you wish to be displayed when this page appears in listings', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='images.CustomImage')),
......
......@@ -10,9 +10,10 @@ from wagtail.wagtailadmin.edit_handlers import (
)
from wagtail.wagtailcore.fields import StreamField
from opentech.utils.blocks import StoryBlock
from opentech.utils.models import BasePage
from .blocks import FundBlock
class FundPage(BasePage):
subpage_types = []
......@@ -26,7 +27,7 @@ class FundPage(BasePage):
on_delete=models.SET_NULL,
related_name='+',
)
body = StreamField(StoryBlock())
body = StreamField(FundBlock())
content_panels = BasePage.content_panels + [
FieldPanel('introduction'),
......
{% for project in page.projects %}
{% include "publicpages/includes/project_listing.html" with project=project %}
{% endfor %}
{% for person in page.reviewers %}
{% include "person/includes/person_listing.html" with person=person %}
{% endfor %}
<p>A PROJECT</p>
{% load wagtailcore_tags %}
{% for block in value %}
{% if block.block_type == 'heading' %}
<h2>{{ block.value }}</h2>
{% else %}
{{ block }}
{% include_block block %}
{% endif %}
{% endfor %}
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