diff --git a/opentech/public/people/migrations/0012_personindexpage_introduction.py b/opentech/public/people/migrations/0012_personindexpage_introduction.py new file mode 100644 index 0000000000000000000000000000000000000000..1a4b6015c94f20e51df70afbbe8d7c323c033b9e --- /dev/null +++ b/opentech/public/people/migrations/0012_personindexpage_introduction.py @@ -0,0 +1,18 @@ +# Generated by Django 2.0.2 on 2018-08-31 19:40 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('people', '0011_change_the_contact_keys'), + ] + + operations = [ + migrations.AddField( + model_name='personindexpage', + name='introduction', + field=models.TextField(blank=True), + ), + ] diff --git a/opentech/public/people/models.py b/opentech/public/people/models.py index 27fae25022208e81aff17dafeb4b79e57edc138b..7a85671d438943900446726531baeeedad5559e8 100644 --- a/opentech/public/people/models.py +++ b/opentech/public/people/models.py @@ -184,6 +184,16 @@ class PersonIndexPage(BasePage): subpage_types = ['PersonPage'] parent_page_types = ['standardpages.IndexPage'] + introduction = models.TextField(blank=True) + + content_panels = BasePage.content_panels + [ + FieldPanel('introduction'), + ] + + search_fields = BasePage.search_fields + [ + index.SearchField('introduction'), + ] + def get_context(self, request, *args, **kwargs): people = PersonPage.objects.live().public().descendant_of(self).order_by( 'title', diff --git a/opentech/public/people/templates/people/person_index_page.html b/opentech/public/people/templates/people/person_index_page.html index 9713a67b44a841fdd23de8f7de15096df07f9caa..87101a091222f5e08d28513d7adc762573f6040d 100644 --- a/opentech/public/people/templates/people/person_index_page.html +++ b/opentech/public/people/templates/people/person_index_page.html @@ -3,6 +3,10 @@ {% block body_class %}light-grey-bg{% endblock %} {% 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__group form__group--checkbox"> <div class="form__select form__select--narrow form__select--inline">