From a71ab96af7635679d6c7630805feee4a82e7c76c Mon Sep 17 00:00:00 2001 From: sabinammm Date: Thu, 3 Mar 2022 14:45:37 +0100 Subject: [PATCH 1/2] apps/plans: remove default text from plan-participation-explanation Fixes #4222 --- ...054_alter_plan_participation_explanation.py | 18 ++++++++++++++++++ meinberlin/apps/plans/models.py | 1 - 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 meinberlin/apps/plans/migrations/0054_alter_plan_participation_explanation.py diff --git a/meinberlin/apps/plans/migrations/0054_alter_plan_participation_explanation.py b/meinberlin/apps/plans/migrations/0054_alter_plan_participation_explanation.py new file mode 100644 index 0000000000..fcf334eebe --- /dev/null +++ b/meinberlin/apps/plans/migrations/0054_alter_plan_participation_explanation.py @@ -0,0 +1,18 @@ +# Generated by Django 3.2.12 on 2022-03-03 12:30 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('meinberlin_plans', '0053_plan_participation_explanation'), + ] + + operations = [ + migrations.AlterField( + model_name='plan', + name='participation_explanation', + field=models.TextField(help_text='Justify your selection. The justification appears below the description of the project.', max_length=4000, verbose_name='Participation explanation'), + ), + ] diff --git a/meinberlin/apps/plans/models.py b/meinberlin/apps/plans/models.py index d3c1569888..22ba8dccb7 100644 --- a/meinberlin/apps/plans/models.py +++ b/meinberlin/apps/plans/models.py @@ -156,7 +156,6 @@ class Plan(ProjectContactDetailMixin, UserGeneratedContentModel): ) participation_explanation = models.TextField( verbose_name=_('Participation explanation'), - default='Bitte Begründung einfügen', max_length=4000, help_text=_('Justify your selection. ' 'The justification appears ' From 93b535ba1a39f4cf22e3ea276ae431fa97b9ed4f Mon Sep 17 00:00:00 2001 From: sabinammm Date: Thu, 3 Mar 2022 14:46:36 +0100 Subject: [PATCH 2/2] apps/plans/templates: plan detail shows no participation explanation box when explanation is default text in old plans Fixes #4225 --- .../meinberlin_plans/plan_detail.html | 52 +++++++++---------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/meinberlin/apps/plans/templates/meinberlin_plans/plan_detail.html b/meinberlin/apps/plans/templates/meinberlin_plans/plan_detail.html index 68b4cc1e84..8f242b441d 100644 --- a/meinberlin/apps/plans/templates/meinberlin_plans/plan_detail.html +++ b/meinberlin/apps/plans/templates/meinberlin_plans/plan_detail.html @@ -116,37 +116,37 @@

{% endif %} + {% if object.participation_explanation != "Bitte Begründung einfügen" %}

{% trans 'Level of participation' %}: {{ object.get_participation_display }}

- {% if object.participation_explanation != "Bitte Begründung einfügen" %} - {% if object.participation_explanation|length > 300 %} -
- {{ object.participation_explanation|truncatechars:160 }} -
-
- {{ object.participation_explanation }} -
- - {% else %} + {% if object.participation_explanation|length > 300 %} +
+ {{ object.participation_explanation|truncatechars:160 }} +
+
{{ object.participation_explanation }} - {% endif %} +
+ + {% else %} + {{ object.participation_explanation }} {% endif %}
+ {% endif %} {% if object.contact_name or object.contact_address_text or object.contact_email or object.contact_phone or object.contact_url or object.organisation.address or object.organisation.url %}
{% if object.contact_name or object.contact_address_text or object.contact_email or object.contact_phone or object.contact_url %}