internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: liqd/a4-meinberlin

Issue:
2 link limit on nav items
affects the footer, need more than 2 items 


Discussion:

Resolving patch:
diff --git a/meinberlin/apps/cms/models/navigation_menues.py b/meinberlin/apps/cms/models/navigation_menues.py
--- a/meinberlin/apps/cms/models/navigation_menues.py
+++ b/meinberlin/apps/cms/models/navigation_menues.py
@@ -32,7 +32,7 @@ def __str__(self):
 
     panels = [
         edit_handlers.FieldPanel('title'),
-        edit_handlers.InlinePanel('items', max_num=2)
+        edit_handlers.InlinePanel('items')
     ]
 
 


Test patch:
Repository: liqd/a4-meinberlin

Issue:
Red input fields on first page load
When loading some pages, input fields are redish, suggesting there where validation errors, but there was not input submit yet.
![screenshot from 2018-05-16 15-40-43](https://user-images.githubusercontent.com/2066372/40120463-8dadcf06-591f-11e8-966b-0ab68e153da8.png)



Discussion:
this can be solved by removing the invalid styling but if this is required then do we really want to? result will be is when invalid input is added it will not appear red 
@CarolingerSeilchenspringer 
for me:
code for fix 
.input-group__input {
  input:required:invalid {border-color: #ccc; color: #ccc;}
}
firefox issue @phillimorland to check other browsers
Also comment box also has red surrounding too, also to check
@phillimorland removed required (as initiator is automatically moderator now) and removed third email address

Resolving patch:
diff --git a/meinberlin/apps/users/fields.py b/meinberlin/apps/users/fields.py
--- a/meinberlin/apps/users/fields.py
+++ b/meinberlin/apps/users/fields.py
@@ -14,8 +14,7 @@ class CommaSeparatedEmailField(forms.Field):
     )
 
     widget = widgets.TextInput(attrs={
-        'placeholder': 'maria@example.com, peter@example.com, '
-                       'nicola@example.com,…'
+        'placeholder': 'maria@example.com, peter@example.com,…'
     })
 
     def to_python(self, value):


Test patch:
Repository: liqd/a4-meinberlin

Issue:
Container tile does not show number of projects 



Discussion:

Resolving patch:
diff --git a/meinberlin/apps/plans/serializers.py b/meinberlin/apps/plans/serializers.py
--- a/meinberlin/apps/plans/serializers.py
+++ b/meinberlin/apps/plans/serializers.py
@@ -45,6 +45,7 @@ class ProjectSerializer(serializers.ModelSerializer, CommonFields):
     tile_image = serializers.SerializerMethodField()
     plan_url = serializers.SerializerMethodField()
     plan_title = serializers.SerializerMethodField()
+    published_projects_count = serializers.SerializerMethodField()
 
     class Meta:
         model = Project
@@ -58,7 +59,8 @@ class Meta:
                   'participation_active',
                   'participation', 'participation_display', 'description',
                   'future_phase', 'active_phase',
-                  'past_phase', 'plan_url', 'plan_title']
+                  'past_phase', 'plan_url', 'plan_title',
+                  'published_projects_count']
 
     def _get_participation_status_project(self, instance):
         if instance.phases.active_phases():
@@ -158,6 +160,10 @@ def get_plan_title(self, instance):
             return instance.plans.first().title
         return None
 
+    def get_published_projects_count(self, instance):
+        if hasattr(instance, 'projectcontainer') and instance.projectcontainer:
+            return instance.projectcontainer.active_project_count
+
 
 class PlanSerializer(serializers.ModelSerializer, CommonFields):
     type = serializers.SerializerMethodField()


Test patch:
Repository: liqd/a4-meinberlin

Issue:
take organisation type out of django
with the new organisation filter we no longer need the organisation type in django

![bildschirmfoto 2019-02-04 um 14 33 56](https://user-images.githubusercontent.com/35491681/52211376-02dac380-288a-11e9-842e-c3f857aad589.png)



Discussion:

Resolving patch:
diff --git a/meinberlin/apps/organisations/migrations/0007_remove_organisation_type.py b/meinberlin/apps/organisations/migrations/0007_remove_organisation_type.py
new file mode 100644
--- /dev/null
+++ b/meinberlin/apps/organisations/migrations/0007_remove_organisation_type.py
@@ -0,0 +1,19 @@
+# -*- coding: utf-8 -*-
+# Generated by Django 1.11.18 on 2019-02-04 16:09
+from __future__ import unicode_literals
+
+from django.db import migrations
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('meinberlin_organisations', '0006_update_orga_type_string'),
+    ]
+
+    operations = [
+        migrations.RemoveField(
+            model_name='organisation',
+            name='type',
+        ),
+    ]
diff --git a/meinberlin/apps/organisations/models.py b/meinberlin/apps/organisations/models.py
--- a/meinberlin/apps/organisations/models.py
+++ b/meinberlin/apps/organisations/models.py
@@ -6,18 +6,6 @@
 
 from adhocracy4.images import fields
 
-DISCTRICT_ADMINISTRATION = 'DA'
-CITY_ADMINISTRATION = 'CA'
-NEIGHBOURHOOD_MANAGEMENT = 'NM'
-OTHER = 'OT'
-
-ORGANISATION_TYPES = (
-    (DISCTRICT_ADMINISTRATION, _('district administration')),
-    (CITY_ADMINISTRATION, _('city administration')),
-    (NEIGHBOURHOOD_MANAGEMENT, _('neighbourhood management')),
-    (OTHER, _('other'))
-)
-
 
 class Organisation(models.Model):
     slug = AutoSlugField(populate_from='name', unique=True)
@@ -34,11 +22,6 @@ class Organisation(models.Model):
         ),
         upload_to='organisation/logos',
         blank=True)
-    type = models.CharField(
-        max_length=2,
-        choices=ORGANISATION_TYPES,
-        default=OTHER
-    )
 
     def __str__(self):
         return self.name


Test patch:
Repository: liqd/a4-meinberlin

Issue:
export of plans
the title of columns are partly english, please change the following

organisation = Organisation
topics = Themen
status = Status



Discussion:

Resolving patch:
diff --git a/meinberlin/apps/plans/migrations/0035_add_verbose_names.py b/meinberlin/apps/plans/migrations/0035_add_verbose_names.py
new file mode 100644
--- /dev/null
+++ b/meinberlin/apps/plans/migrations/0035_add_verbose_names.py
@@ -0,0 +1,33 @@
+# -*- coding: utf-8 -*-
+# Generated by Django 1.11.18 on 2019-02-06 15:38
+from __future__ import unicode_literals
+
+import adhocracy4.projects.fields
+from django.conf import settings
+from django.db import migrations, models
+import django.db.models.deletion
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('meinberlin_plans', '0034_choice_names'),
+    ]
+
+    operations = [
+        migrations.AlterField(
+            model_name='plan',
+            name='organisation',
+            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.A4_ORGANISATIONS_MODEL, verbose_name='Organisation'),
+        ),
+        migrations.AlterField(
+            model_name='plan',
+            name='status',
+            field=models.SmallIntegerField(choices=[(0, 'ongoing'), (1, 'done')], verbose_name='Status'),
+        ),
+        migrations.AlterField(
+            model_name='plan',
+            name='topics',
+            field=adhocracy4.projects.fields.TopicField(choices=[('ANT', 'Anti-discrimination'), ('WOR', 'Work & economy'), ('BUI', 'Building & living'), ('EDU', 'Education & research'), ('CHI', 'Children, youth & family'), ('FIN', 'Finances'), ('HEA', 'Health & sports'), ('INT', 'Integration'), ('CUL', 'Culture & leisure'), ('NEI', 'Neighborhood & participation'), ('URB', 'Urban development'), ('ENV', 'Environment & public green space'), ('TRA', 'Traffic')], default='', max_length=254, verbose_name='Topics'),
+        ),
+    ]
diff --git a/meinberlin/apps/plans/models.py b/meinberlin/apps/plans/models.py
--- a/meinberlin/apps/plans/models.py
+++ b/meinberlin/apps/plans/models.py
@@ -37,7 +37,8 @@ class Plan(UserGeneratedContentModel):
     title = models.CharField(max_length=120, verbose_name=_('Title'))
     organisation = models.ForeignKey(
         settings.A4_ORGANISATIONS_MODEL,
-        on_delete=models.CASCADE)
+        on_delete=models.CASCADE,
+        verbose_name=_('Organisation'))
     projects = models.ManyToManyField(
         project_models.Project,
         related_name='plans',
@@ -78,8 +79,11 @@ class Plan(UserGeneratedContentModel):
             'Visualize your plan.'
         ),
     )
-    topics = TopicField()
-    status = models.SmallIntegerField(choices=STATUS_CHOICES)
+    topics = TopicField(verbose_name=_('Topics'))
+    status = models.SmallIntegerField(
+        choices=STATUS_CHOICES,
+        verbose_name=_('Status')
+    )
     participation = models.SmallIntegerField(
         choices=PARTICIPATION_CHOICES,
         verbose_name=_('Participation')


Test patch:
Repository: liqd/a4-meinberlin

Issue:
district, topic and localisation for external projects and bplans
external projects also need district, topic and localisation as the other projects do. 

same is true for b-plans as not all of them come via imperia


Discussion:
@CarolingerSeilchenspringer Obviously true for external projects!
But kind of only partly for bplans. We need to add the topics for the Bplans as well, but I think we shouldn't add the location and district to the dashboard as we get that automatically!?
@fuzzylogic2000 the senatsverwaltung für Stadtentwicklung sometimes also have bplans but don't use imperia. They start them via meinberlin. 
@CarolingerSeilchenspringer That should be fine as long as they fill in the bezeichner-field, which should be there. As soon as they save the bplan, we try to get district and localisation from the other bplan-API, just as we do for the stuff filled in with imperia. So, we should be fine!
@fuzzylogic2000 I will think of a helptext for the Bezeichner (Identifier) that works for both, SenStadt and Imperia
We said we will:
- add both tabs (Ort and topics) to external projects
- add topics to Bplans
- add a helptext for the identifier-field of bplans
- fix #1929 at the same time (wording change tab name/title)
@fuzzylogic2000 as just discussed: no need to add topics to Bplans, just always set them on Stadtentwicklung, no matter if they come from imperia or via meinBerlin
@CarolingerSeilchenspringer Do you already have a helptext for the identifier?
@CarolingerSeilchenspringer Can you please give me the helptext for the identifier?
"Der Bezeichner des Bebauungsgplans muss identisch mit dem Bezeichner im FIS-Broker sein. So werden Informationen zum Bezirk und zur Verortung automatisch hinzugefügt."

Resolving patch:
diff --git a/meinberlin/apps/bplan/tasks.py b/meinberlin/apps/bplan/tasks.py
--- a/meinberlin/apps/bplan/tasks.py
+++ b/meinberlin/apps/bplan/tasks.py
@@ -74,4 +74,5 @@ def get_location_information(bplan_id):
             .format(bplan.identifier, bplan)
         )
     bplan.point = point
-    bplan.save(update_fields=['point', 'administrative_district'])
+    bplan.topics = ['URB']
+    bplan.save(update_fields=['point', 'administrative_district', 'topics'])


Test patch:
Repository: liqd/a4-meinberlin

Issue:
status bar AND project finished both shown on pop up
![bildschirmfoto 2019-02-04 um 14 11 24](https://user-images.githubusercontent.com/35491681/52210297-ebe6a200-2886-11e9-8f4e-4360398140b8.png)



Discussion:
@CarolingerSeilchenspringer This project has three phases, two are active and one has ended*. What is meant to happen here anyway? Do we always show the active phase, and if we don't have one the future phase and only if we don't have both the past one? Our wording is not necessarily right for projects with multiple phases, but I say, we do it anyway, because this currently shouldn't happen on productive (or very very seldomly),
\* and to make it more complicated, the phase that has ended started later than both active ones. Looks like the project detail page also has to be thought about if we really want stuff like that on productive.
"Do we always show the active phase, and if we don't have one the future phase and only if we don't have both the past one?" sound good to me for now, @fuzzylogic2000. We will include the pop up once we make a concept for multiple module.

Resolving patch:
diff --git a/meinberlin/apps/plans/serializers.py b/meinberlin/apps/plans/serializers.py
--- a/meinberlin/apps/plans/serializers.py
+++ b/meinberlin/apps/plans/serializers.py
@@ -26,6 +26,11 @@ def get_point(self, instance):
     def get_organisation(self, instance):
         return instance.organisation.name
 
+    def get_created_or_modified(self, instance):
+        if instance.modified:
+            return str(instance.modified)
+        return str(instance.created)
+
 
 class ProjectSerializer(serializers.ModelSerializer, CommonFields):
     type = serializers.SerializerMethodField()
@@ -130,7 +135,7 @@ def get_future_phase(self, instance):
 
     def get_active_phase(self, instance):
         project_phases = instance.phases
-        if project_phases.active_phases():
+        if project_phases.active_phases() and instance.active_phase_progress:
             progress = instance.active_phase_progress
             time_left = instance.time_left
             end_date = str(project_phases.active_phases().last().end_date)
@@ -175,11 +180,6 @@ def get_point_label(self, instance):
     def get_cost(self, instance):
         return ''
 
-    def get_created_or_modified(self, instance):
-        if instance.modified:
-            return str(instance.modified)
-        return str(instance.created)
-
 
 class PlanSerializer(serializers.ModelSerializer, CommonFields):
     type = serializers.SerializerMethodField()
@@ -236,8 +236,3 @@ def get_participation_active(self, instance):
         participation_string, participation_active = \
             self._get_participation_status_plan(instance)
         return participation_active
-
-    def get_created_or_modified(self, instance):
-        if instance.modified:
-            return str(instance.modified)
-        return str(instance.created)


Test patch:
Repository: liqd/a4-meinberlin

Issue:
tiles on plans and container: blue corner missing for external projects
for external projects the little blue corner is missing

mac on chrome and firefox

<img width="400" alt="bildschirmfoto 2019-02-11 um 16 45 01" src="https://user-images.githubusercontent.com/35491681/52574395-7d708980-2e1c-11e9-8cfd-b9f8be74ea16.png">



Discussion:
just noticed: they are also gone (or where never there?) on mobile in the main project overview

Resolving patch:
diff --git a/meinberlin/apps/dashboard/__init__.py b/meinberlin/apps/dashboard/__init__.py
--- a/meinberlin/apps/dashboard/__init__.py
+++ b/meinberlin/apps/dashboard/__init__.py
@@ -20,15 +20,20 @@ def __init__(self, project):
     def get_project_components(self):
         if self.project_type == 'bplan':
             return [components.projects.get('bplan'),
+                    components.projects.get('plans'),
                     components.projects.get('adminlog')]
         elif self.project_type == 'external':
             return [components.projects.get('external'),
+                    components.projects.get('topics'),
+                    components.projects.get('point'),
+                    components.projects.get('plans'),
                     components.projects.get('adminlog')]
         elif self.project_type == 'container':
             return [components.projects.get('container-basic'),
                     components.projects.get('container-information'),
                     components.projects.get('topics'),
                     components.projects.get('point'),
+                    components.projects.get('plans'),
                     components.projects.get('container-projects')]
 
         return [component for component in components.get_project_components()


Test patch:
Repository: liqd/a4-meinberlin

Issue:
images are cropped strangely



Discussion:

Resolving patch:
diff --git a/meinberlin/apps/plans/serializers.py b/meinberlin/apps/plans/serializers.py
--- a/meinberlin/apps/plans/serializers.py
+++ b/meinberlin/apps/plans/serializers.py
@@ -51,6 +51,7 @@ class ProjectSerializer(serializers.ModelSerializer, CommonFields):
     active_phase = serializers.SerializerMethodField()
     past_phase = serializers.SerializerMethodField()
     tile_image = serializers.SerializerMethodField()
+    tile_image_copyright = serializers.SerializerMethodField()
     plan_url = serializers.SerializerMethodField()
     plan_title = serializers.SerializerMethodField()
     published_projects_count = serializers.SerializerMethodField()
@@ -120,8 +121,19 @@ def get_tile_image(self, instance):
         if instance.tile_image:
             image = get_thumbnailer(instance.tile_image)['project_tile']
             image_url = image.url
+        elif instance.image:
+            image = get_thumbnailer(instance.image)['project_tile']
+            image_url = image.url
         return image_url
 
+    def get_tile_image_copyright(self, instance):
+        if instance.tile_image:
+            return instance.tile_image_copyright
+        elif instance.image:
+            return instance.image_copyright
+        else:
+            return None
+
     def get_status(self, instance):
         project_phases = instance.phases
         if project_phases.active_phases() or project_phases.future_phases():
diff --git a/meinberlin/config/settings/base.py b/meinberlin/config/settings/base.py
--- a/meinberlin/config/settings/base.py
+++ b/meinberlin/config/settings/base.py
@@ -226,7 +226,7 @@
         'logo': {'size': (160, 160), 'background': 'white'},
         'item_image': {'size': (330, 0), 'crop': 'scale'},
         'map_thumbnail': {'size': (200, 200), 'crop': 'smart'},
-        'project_tile': {'size': (500, 500), 'crop': 'smart', 'upscale': True}
+        'project_tile': {'size': (500, 500)}
     }
 }
 


Test patch:
Repository: liqd/a4-meinberlin

Issue:
dashboard: district "gesamtstädtisch" ist ---
in dashboard the default district is "---" and should be changed to "Gesamtstädtisch"


Discussion:

Resolving patch:
diff --git a/meinberlin/apps/projects/forms.py b/meinberlin/apps/projects/forms.py
--- a/meinberlin/apps/projects/forms.py
+++ b/meinberlin/apps/projects/forms.py
@@ -92,3 +92,7 @@ class Meta:
             'point': maps_widgets.MapChoosePointWidget(
                 polygon=settings.BERLIN_POLYGON)
         }
+
+    def __init__(self, *args, **kwargs):
+        super().__init__(*args, **kwargs)
+        self.fields['administrative_district'].empty_label = _('City wide')


Test patch:
Repository: liqd/a4-meinberlin

Issue:
store window: district tile announces more results than there are if I click on them
store window tile shows ALL project of district, if I click and get to project overview, the default filter takes out all old projects and plans without beteiligung.

can we only count running projects with participation?


Discussion:

Resolving patch:
diff --git a/meinberlin/apps/cms/models/storefronts.py b/meinberlin/apps/cms/models/storefronts.py
--- a/meinberlin/apps/cms/models/storefronts.py
+++ b/meinberlin/apps/cms/models/storefronts.py
@@ -50,12 +50,17 @@ def project_url(self):
 
     @cached_property
     def district_project_count(self):
-        return Project.objects\
+        projects = Project.objects\
             .filter(administrative_district=self.district,
                     is_draft=False,
                     is_public=True,
                     is_archived=False
-                    ).count()
+                    )
+        active_project_count = 0
+        for project in projects:
+            if project.active_phase or project.future_phases:
+                active_project_count += 1
+        return active_project_count
 
     panels = [
         FieldPanel('district'),


Test patch:
Repository: liqd/a4-meinberlin

Issue:
testing 1822 show responsible administration
I tested story #1822 and here is what I've noticed:

* please add helptext to "Webseite der Organisation" (as we did last sprint for external projects): "Bitte geben Sie eine vollständige URL ein, die mit https:// or http:// beginnt."
* delete "Stelle und", it should only be Postadresse as the organisation is not mentioned again in this field and the Abteilung should be entered via Ansprechpartner
* @szukowski: do we have or need a design for the headline on mobile? it has the same size as the organisation name (this is also true for the contact person)

nothing bizzare on browserstack :-) 


Discussion:

Resolving patch:
diff --git a/meinberlin/apps/dashboard/forms.py b/meinberlin/apps/dashboard/forms.py
--- a/meinberlin/apps/dashboard/forms.py
+++ b/meinberlin/apps/dashboard/forms.py
@@ -10,6 +10,10 @@ def __init__(self, *args, **kwargs):
         super().__init__(*args, **kwargs)
         self.fields['address'].required = True
         self.fields['url'].required = True
+        self.fields['url'].help_text = _('Please enter '
+                                         'a full url which '
+                                         'starts with https:// '
+                                         'or http://')
 
     class Meta:
         model = Organisation
diff --git a/meinberlin/apps/organisations/migrations/0010_change_address_field.py b/meinberlin/apps/organisations/migrations/0010_change_address_field.py
new file mode 100644
--- /dev/null
+++ b/meinberlin/apps/organisations/migrations/0010_change_address_field.py
@@ -0,0 +1,21 @@
+# -*- coding: utf-8 -*-
+# Generated by Django 1.11.20 on 2019-03-28 09:24
+from __future__ import unicode_literals
+
+from django.db import migrations
+from django.db import models
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('meinberlin_organisations', '0009_organisation_groups'),
+    ]
+
+    operations = [
+        migrations.AlterField(
+            model_name='organisation',
+            name='address',
+            field=models.TextField(blank=True, verbose_name='Postal address'),
+        ),
+    ]
diff --git a/meinberlin/apps/organisations/models.py b/meinberlin/apps/organisations/models.py
--- a/meinberlin/apps/organisations/models.py
+++ b/meinberlin/apps/organisations/models.py
@@ -29,7 +29,7 @@ class Organisation(models.Model):
         blank=True)
     address = models.TextField(
         blank=True,
-        verbose_name=_('Unit and postal address')
+        verbose_name=_('Postal address')
     )
     url = models.URLField(
         blank=True,


Test patch:
Repository: liqd/a4-meinberlin

Issue:
testing #1824 wrong wording
Dashboard/Newsletter: the Word "Empfänger*innen" is at the wrong place. Please delete it above and replace "Projekt" by "Empfänger*innen sind alle, die diesem Projekt folgen:"
 



Discussion:

Resolving patch:
diff --git a/meinberlin/apps/newsletters/forms.py b/meinberlin/apps/newsletters/forms.py
--- a/meinberlin/apps/newsletters/forms.py
+++ b/meinberlin/apps/newsletters/forms.py
@@ -74,6 +74,8 @@ def __init__(self, user=None, organisation=None, *args, **kwargs):
             label=_('Project'),
             queryset=project_qs,
             required=False, empty_label=None)
+        self.fields['project'].label = _('Receivers are all users '
+                                         'which follow the following project:')
 
         self.fields['organisation'] = forms.ModelChoiceField(
             label=_('Organisation'),


Test patch: