From 715566db8a3faa7d1686026babbd67cf961778d1 Mon Sep 17 00:00:00 2001 From: Ju Luiselli Date: Wed, 19 Feb 2020 20:42:36 +0000 Subject: [PATCH 1/7] added pronoun to fields --- fiches/forms.py | 1 + fiches/migrations/0005_profile_pronoun.py | 18 ++++++++++++++++++ fiches/models.py | 1 + fiches/templates/fiches/fiche.html | 7 ++++++- 4 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 fiches/migrations/0005_profile_pronoun.py 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}} : From 414a1c8fe95dcbc356f6c98b4793619952efcaea Mon Sep 17 00:00:00 2001 From: Ju Luiselli Date: Wed, 19 Feb 2020 20:46:01 +0000 Subject: [PATCH 2/7] enables to display profile without pictures --- fiches/templates/fiches/fiche.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fiches/templates/fiches/fiche.html b/fiches/templates/fiches/fiche.html index 930ae4f..126f93e 100644 --- a/fiches/templates/fiches/fiche.html +++ b/fiches/templates/fiches/fiche.html @@ -2,7 +2,9 @@ {% block content %}

+ {% if profile.picture %} + {% endif %}

{{ profile.full_name }} From 360afc83b689c825f05d429aa7e1c460c8e7fe6b Mon Sep 17 00:00:00 2001 From: Ju Luiselli Date: Wed, 19 Feb 2020 21:06:23 +0000 Subject: [PATCH 3/7] cleaned gitignore --- .gitignore | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/.gitignore b/.gitignore index 51af000..ea2e335 100644 --- a/.gitignore +++ b/.gitignore @@ -6,16 +6,6 @@ /media/picture -/recensements/ /venv/ -/static/ -/dev/* *.sqlite3 - -/secrets/ - -/degette/fonts/* - -/degetteweb/settings.py -/degetteweb/local_params.py \ No newline at end of file From e20cdf5977b7c8dd6b92f2d3ab822a2c531d2b4a Mon Sep 17 00:00:00 2001 From: Ju Luiselli Date: Wed, 19 Feb 2020 21:17:30 +0000 Subject: [PATCH 4/7] added plural --- fiches/models.py | 2 +- fiches/templates/fiches/fiche.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fiches/models.py b/fiches/models.py index ef82b81..0d864f2 100644 --- a/fiches/models.py +++ b/fiches/models.py @@ -13,7 +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é")) + pronoun = models.CharField(blank=True, max_length = 15, verbose_name=_("pronom(s) utilisé(s)")) 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 126f93e..27dc3a7 100644 --- a/fiches/templates/fiches/fiche.html +++ b/fiches/templates/fiches/fiche.html @@ -14,7 +14,7 @@ {% endif %}

{% if profile.pronoun %} - Pronom utilisé :{{ profile.pronoun }} + Pronom(s) utilisé(s) :{{ profile.pronoun }} {% endif %}

From 843704c7f8913a6128ef664b066e1ed51aeff84a Mon Sep 17 00:00:00 2001 From: Ju Luiselli Date: Wed, 19 Feb 2020 21:25:42 +0000 Subject: [PATCH 5/7] give space to pronouns --- fiches/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fiches/models.py b/fiches/models.py index 0d864f2..9b023ce 100644 --- a/fiches/models.py +++ b/fiches/models.py @@ -13,7 +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(s) utilisé(s)")) + pronoun = models.CharField(blank=True, max_length = 1023, verbose_name=_("pronom(s) utilisé(s)")) picture = models.ImageField( blank=True, upload_to="picture", verbose_name=_("photo") ) From 67b23051b6368aafe7cf74535b7130caf85e5c68 Mon Sep 17 00:00:00 2001 From: Ju Luiselli Date: Wed, 19 Feb 2020 21:51:27 +0000 Subject: [PATCH 6/7] corrected migration --- fiches/migrations/0005_profile_pronoun.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fiches/migrations/0005_profile_pronoun.py b/fiches/migrations/0005_profile_pronoun.py index a15493d..9b8277d 100644 --- a/fiches/migrations/0005_profile_pronoun.py +++ b/fiches/migrations/0005_profile_pronoun.py @@ -1,4 +1,4 @@ -# Generated by Django 2.2.9 on 2020-02-19 20:30 +# Generated by Django 2.2.9 on 2020-02-19 21:50 from django.db import migrations, models @@ -13,6 +13,6 @@ class Migration(migrations.Migration): migrations.AddField( model_name='profile', name='pronoun', - field=models.CharField(blank=True, max_length=15, verbose_name='pronom utilisé'), + field=models.CharField(blank=True, max_length=1023, verbose_name='pronom(s) utilisé(s)'), ), ] From 4ba86cddc1ed241236433185dd4cfe28a051c31b Mon Sep 17 00:00:00 2001 From: Ju Luiselli Date: Fri, 21 Feb 2020 19:30:36 +0000 Subject: [PATCH 7/7] init README --- README.md | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..082c2cc --- /dev/null +++ b/README.md @@ -0,0 +1,37 @@ +# Annuaire des élèves de l'ENS + +## Installation + +Il est fortement conseillé d'utiliser un environnement virtuel pour Python. + +Il vous faudra installer pip, les librairies de développement de python ainsi +que sqlite3, un moteur de base de données léger et simple d'utilisation. Sous +Debian et dérivées (Ubuntu, ...) : + + sudo apt-get install python3-pip python3-dev python3-venv sqlite3 + +Si vous décidez d'utiliser un environnement virtuel Python (virtualenv; +fortement conseillé), déplacez-vous dans le dossier où est installé GestioCOF +(le dossier où se trouve ce README), et créez-le maintenant : + + python3 -m venv venv + +Pour l'activer, il faut taper + + . venv/bin/activate + +depuis le même dossier. + +Vous pouvez maintenant installer les dépendances Python depuis le fichier +`requirements.txt` : + + pip install -U pip # parfois nécessaire la première fois + pip install -r requirements.txt + +Vous êtes prêts à développer ! Lancez l'annuaire avec : + + python manage.py runserver + +## Développement + +En manque d'inspiration ? N'hésitez pas à aller lire les issues ouvertes actuellement, il y en a pour tous les niveaux ! \ No newline at end of file