Repository: liqd/a4-opin

Issue:
Dashboard: Edit profile form changes
Thanks for releasing the new user profile on the dev server. Here are some changes for the dashboard form I’d like to see implemented.

![unknown-33](https://cloud.githubusercontent.com/assets/15341015/20519546/9ff474ba-b0a3-11e6-9a77-9cdbe1745019.png)



Discussion:
Please ignore the meaningless „text“ comments in the social media section. My mistake

Resolving patch:
diff --git a/euth/dashboard/forms.py b/euth/dashboard/forms.py
--- a/euth/dashboard/forms.py
+++ b/euth/dashboard/forms.py
@@ -23,8 +23,8 @@ class ProfileForm(forms.ModelForm):
 
     class Meta:
         model = user_models.User
-        fields = ['username', '_avatar', 'description', 'birthdate', 'city',
-                  'country', 'gender', 'languages', 'twitter_handle',
+        fields = ['username', '_avatar', 'description', 'birthdate',
+                  'country', 'city', 'gender', 'languages', 'twitter_handle',
                   'facebook_handle', 'instagram_handle', 'get_notifications']
         widgets = {
             '_avatar': widgets.ImageInputWidget(),
@@ -32,6 +32,33 @@ class Meta:
             'birthdate': widgets.DateInput(),
         }
 
+    @property
+    def formsections(self):
+        formsections = collections.OrderedDict([
+            (_('Basic Info'), [
+                'username',
+                '_avatar',
+            ]),
+            (_('Personal Info'), [
+                'description',
+                'birthdate',
+                'country',
+                'city',
+                'gender',
+            ]),
+            (_('Ways to connect with you'), [
+                'languages',
+                'twitter_handle',
+                'facebook_handle',
+                'instagram_handle',
+            ]),
+            (_('Notifications'), [
+                'get_notifications',
+            ])
+        ])
+
+        return formsections
+
 
 class ProjectInviteForm(forms.Form):
     emails = forms.CharField()
diff --git a/euth/users/migrations/0007_update_gender_options_and_helptexts_verbose_names.py b/euth/users/migrations/0007_update_gender_options_and_helptexts_verbose_names.py
new file mode 100644
--- /dev/null
+++ b/euth/users/migrations/0007_update_gender_options_and_helptexts_verbose_names.py
@@ -0,0 +1,35 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+import euth.contrib.validators
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('euth_users', '0006_change_avatar_validator_and_helptext'),
+    ]
+
+    operations = [
+        migrations.AlterField(
+            model_name='user',
+            name='_avatar',
+            field=models.ImageField(verbose_name='Avatar picture', upload_to='users/images', blank=True, validators=[euth.contrib.validators.validate_avatar]),
+        ),
+        migrations.AlterField(
+            model_name='user',
+            name='birthdate',
+            field=models.DateField(verbose_name='Date of birth', null=True, blank=True),
+        ),
+        migrations.AlterField(
+            model_name='user',
+            name='city',
+            field=models.CharField(verbose_name='City of residence', blank=True, max_length=80),
+        ),
+        migrations.AlterField(
+            model_name='user',
+            name='gender',
+            field=models.CharField(verbose_name='Gender', max_length=1, blank=True, choices=[('M', 'Male'), ('F', 'Female'), ('T', 'Transgender'), ('TF', 'Transgender Female'), ('TM', 'Transgender Male'), ('I', 'Intersex'), ('GF', 'Gender Fluid'), ('O', 'Other')]),
+        ),
+    ]
diff --git a/euth/users/models.py b/euth/users/models.py
--- a/euth/users/models.py
+++ b/euth/users/models.py
@@ -58,7 +58,7 @@ class User(auth_models.AbstractBaseUser, auth_models.PermissionsMixin):
         upload_to='users/images',
         blank=True,
         validators=[euth_validators.validate_avatar],
-        verbose_name=_('Avatar'),
+        verbose_name=_('Avatar picture'),
     )
 
     description = models.CharField(
@@ -95,13 +95,13 @@ class User(auth_models.AbstractBaseUser, auth_models.PermissionsMixin):
     city = models.CharField(
         blank=True,
         max_length=80,
-        verbose_name=_('City'),
+        verbose_name=_('City of residence'),
     )
 
     birthdate = models.DateField(
         blank=True,
         null=True,
-        verbose_name=_('Birthdate'),
+        verbose_name=_('Date of birth'),
     )
 
     gender = models.CharField(
@@ -110,7 +110,13 @@ class User(auth_models.AbstractBaseUser, auth_models.PermissionsMixin):
         max_length=1,
         choices=[
             ('M', _('Male')),
-            ('F', _('Female'))
+            ('F', _('Female')),
+            ('T', _('Transgender')),
+            ('TF', _('Transgender Female')),
+            ('TM', _('Transgender Male')),
+            ('I', _('Intersex')),
+            ('GF', _('Gender Fluid')),
+            ('O', _('Other')),
         ],
     )
 


Test patch: