diff --git a/fiches/forms.py b/fiches/forms.py index 934f624..8c10468 100644 --- a/fiches/forms.py +++ b/fiches/forms.py @@ -8,6 +8,7 @@ class ProfileForm(forms.ModelForm): fields = [ "full_name", "nickname", + "pronoun", "picture", "department", "promotion", diff --git a/fiches/migrations/0005_profile_pronoun.py b/fiches/migrations/0005_profile_pronoun.py new file mode 100644 index 0000000..a15493d --- /dev/null +++ b/fiches/migrations/0005_profile_pronoun.py @@ -0,0 +1,18 @@ +# Generated by Django 2.2.9 on 2020-02-19 20:30 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('fiches', '0004_auto_20200212_2130'), + ] + + operations = [ + migrations.AddField( + model_name='profile', + name='pronoun', + field=models.CharField(blank=True, max_length=15, verbose_name='pronom utilisé'), + ), + ] diff --git a/fiches/models.py b/fiches/models.py index 02ff5ab..ef82b81 100644 --- a/fiches/models.py +++ b/fiches/models.py @@ -13,6 +13,7 @@ class Profile(models.Model): ) full_name = models.CharField(max_length=1023, verbose_name=_("nom")) nickname = models.CharField(blank=True, max_length=1023, verbose_name=_("surnom")) + pronoun = models.CharField(blank=True, max_length = 15, verbose_name=_("pronom utilisé")) picture = models.ImageField( blank=True, upload_to="picture", verbose_name=_("photo") ) diff --git a/fiches/templates/fiches/fiche.html b/fiches/templates/fiches/fiche.html index 7458f52..930ae4f 100644 --- a/fiches/templates/fiches/fiche.html +++ b/fiches/templates/fiches/fiche.html @@ -8,8 +8,13 @@

{{ profile.full_name }} ({{ profile.promotion }}) {% if profile.nickname %} - alias:{{ profile.nickname }})

+ (alias:{{ profile.nickname }}) {% endif %} +

+ {% if profile.pronoun %} + Pronom utilisé :{{ profile.pronoun }} + {% endif %} +

{% if profile.department.exists %} Département{{ profile.department.count|pluralize}} :