From e4f4a5e73b888cc927fad072de40a2cbac0b2984 Mon Sep 17 00:00:00 2001 From: Anna Sidwell Date: Sat, 31 Mar 2018 22:38:06 +1100 Subject: [PATCH] Add non-indigenous people list, as per client request --- apps/map/forms.py | 8 ++--- .../map/migrations/0049_auto_20180331_1134.py | 33 +++++++++++++++++++ apps/map/models.py | 22 ++++++------- apps/map/templates/map/detail.html | 9 +++-- 4 files changed, 54 insertions(+), 18 deletions(-) create mode 100644 apps/map/migrations/0049_auto_20180331_1134.py diff --git a/apps/map/forms.py b/apps/map/forms.py index 6d7bd13..7294dfa 100644 --- a/apps/map/forms.py +++ b/apps/map/forms.py @@ -53,8 +53,8 @@ class ShortCaseStudyForm(BaseCaseStudyForm): 'location_context', 'type_of_ecosystem', 'describe_ecosystem', - 'affects_indigenous', - 'affects_indigenous_detail', + 'people_affected_indigenous', + 'people_affected_other', 'project_status', 'synopsis', 'full_description', @@ -84,8 +84,8 @@ class LongCaseStudyForm(BaseCaseStudyForm): 'location_context', 'type_of_ecosystem', 'describe_ecosystem', - 'affects_indigenous', - 'affects_indigenous_detail', + 'people_affected_indigenous', + 'people_affected_other', 'project_status', 'synopsis', 'full_description', diff --git a/apps/map/migrations/0049_auto_20180331_1134.py b/apps/map/migrations/0049_auto_20180331_1134.py new file mode 100644 index 0000000..8d701c0 --- /dev/null +++ b/apps/map/migrations/0049_auto_20180331_1134.py @@ -0,0 +1,33 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.6 on 2018-03-31 11:34 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('map', '0048_auto_20180331_0933'), + ] + + operations = [ + migrations.RemoveField( + model_name='casestudy', + name='affects_indigenous', + ), + migrations.RemoveField( + model_name='casestudy', + name='affects_indigenous_detail', + ), + migrations.AddField( + model_name='casestudy', + name='people_affected_indigenous', + field=models.TextField(blank=True, help_text='What group or groups of indigenous people are affected by this project? Please separate by newline.', verbose_name='Indigenous people affected'), + ), + migrations.AddField( + model_name='casestudy', + name='people_affected_other', + field=models.TextField(blank=True, help_text='What other group or groups of people are affected by this project? Please separate by newline.', verbose_name='Non-indigenous people affected'), + ), + ] diff --git a/apps/map/models.py b/apps/map/models.py index e9e54fb..1d8f56c 100644 --- a/apps/map/models.py +++ b/apps/map/models.py @@ -320,20 +320,18 @@ class CaseStudy(models.Model): help_text=_("In your own words, add more detail about the ecosystem."), ) - # 1.5.6 - affects_indigenous = models.BooleanField( - verbose_name=_("Affects indigenous people?"), - help_text=_("Does the project affect indigenous communities?") + # Was 1.5.6; spec not being followed here after request from client + people_affected_indigenous = models.TextField( + verbose_name=_("Indigenous people affected"), + help_text=_("What group or groups of indigenous people are affected by this project? \ + Please separate by newline."), + blank=True ) - # 1.5.6.1 - affects_indigenous_detail = models.CharField( - verbose_name=_("Affects Indigenous - Details"), - help_text=_("What group of indigenous people does the community belong\ - to?"), - max_length=256, - default=None, - null=True, + people_affected_other = models.TextField( + verbose_name=_("Non-indigenous people affected"), + help_text=_("What other group or groups of people are affected by this project? \ + Please separate by newline."), blank=True ) diff --git a/apps/map/templates/map/detail.html b/apps/map/templates/map/detail.html index fa51892..860aef2 100644 --- a/apps/map/templates/map/detail.html +++ b/apps/map/templates/map/detail.html @@ -165,8 +165,13 @@ dd ul { padding-left: 0; margin-left: 0; } {% if case_study.affects_indigenous %} -

{% trans "Affected groups of indigenous people" %}

- {{ case_study.affects_indigenous_detail | linebreaks }} +

{% trans "Affected groups of people" %}

+ +

{% trans "Indigenous people" %}

+ {{ case_study.people_affected_indigenous | linebreaks }} + +

{% trans "Non-indigenous people" %}

+ {{ case_study.people_affected_other | linebreaks }} {% endif %}

Project status