From 799f2317f74049fd90aab6231f80d6f4b17a84e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20P=C3=A9pin?= Date: Sun, 4 Sep 2016 13:14:26 +0200 Subject: [PATCH] Champ commentaires MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit le champ `comments` du modèle `CofProfile` est maintenant visible par l'urilisateur via la vue “profil”. --- bda/migrations/0008_py3.py | 103 ++++++++++++ gestioncof/migrations/0008_py3.py | 253 ++++++++++++++++++++++++++++++ gestioncof/models.py | 2 +- gestioncof/templates/profile.html | 10 +- 4 files changed, 366 insertions(+), 2 deletions(-) create mode 100644 bda/migrations/0008_py3.py create mode 100644 gestioncof/migrations/0008_py3.py diff --git a/bda/migrations/0008_py3.py b/bda/migrations/0008_py3.py new file mode 100644 index 00000000..fe6a8eaf --- /dev/null +++ b/bda/migrations/0008_py3.py @@ -0,0 +1,103 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('bda', '0007_extends_spectacle'), + ] + + operations = [ + migrations.AlterField( + model_name='choixspectacle', + name='double_choice', + field=models.CharField( + verbose_name='Nombre de places', + choices=[('1', '1 place'), + ('autoquit', '2 places si possible, 1 sinon'), + ('double', '2 places sinon rien')], + max_length=10, default='1'), + ), + migrations.AlterField( + model_name='participant', + name='paymenttype', + field=models.CharField( + blank=True, + choices=[('cash', 'Cash'), ('cb', 'CB'), + ('cheque', 'Chèque'), ('autre', 'Autre')], + max_length=6, verbose_name='Moyen de paiement'), + ), + migrations.AlterField( + model_name='salle', + name='address', + field=models.TextField(verbose_name='Adresse'), + ), + migrations.AlterField( + model_name='salle', + name='name', + field=models.CharField(verbose_name='Nom', max_length=300), + ), + migrations.AlterField( + model_name='spectacle', + name='date', + field=models.DateTimeField(verbose_name='Date & heure'), + ), + migrations.AlterField( + model_name='spectacle', + name='description', + field=models.TextField(verbose_name='Description', blank=True), + ), + migrations.AlterField( + model_name='spectacle', + name='listing', + field=models.BooleanField( + verbose_name='Les places sont sur listing'), + ), + migrations.AlterField( + model_name='spectacle', + name='price', + field=models.FloatField(verbose_name="Prix d'une place"), + ), + migrations.AlterField( + model_name='spectacle', + name='slots', + field=models.IntegerField(verbose_name='Places'), + ), + migrations.AlterField( + model_name='spectacle', + name='slots_description', + field=models.TextField(verbose_name='Description des places', + blank=True), + ), + migrations.AlterField( + model_name='spectacle', + name='title', + field=models.CharField(verbose_name='Titre', max_length=300), + ), + migrations.AlterField( + model_name='tirage', + name='active', + field=models.BooleanField(verbose_name='Tirage actif', + default=False), + ), + migrations.AlterField( + model_name='tirage', + name='fermeture', + field=models.DateTimeField( + verbose_name='Date et heure de fermerture du tirage'), + ), + migrations.AlterField( + model_name='tirage', + name='ouverture', + field=models.DateTimeField( + verbose_name="Date et heure d'ouverture du tirage"), + ), + migrations.AlterField( + model_name='tirage', + name='title', + field=models.CharField(verbose_name='Titre', max_length=300), + ), + ] diff --git a/gestioncof/migrations/0008_py3.py b/gestioncof/migrations/0008_py3.py new file mode 100644 index 00000000..7d94d7ce --- /dev/null +++ b/gestioncof/migrations/0008_py3.py @@ -0,0 +1,253 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations + + +def forwards(apps, schema_editor): + Profile = apps.get_model("gestioncof", "CofProfile") + Profile.objects.update(comments="") + + +class Migration(migrations.Migration): + + dependencies = [ + ('gestioncof', '0007_alter_club'), + ] + + operations = [ + migrations.AlterField( + model_name='clipper', + name='fullname', + field=models.CharField(verbose_name='Nom complet', max_length=200), + ), + migrations.AlterField( + model_name='clipper', + name='username', + field=models.CharField(verbose_name='Identifiant', max_length=20), + ), + migrations.AlterField( + model_name='cofprofile', + name='comments', + field=models.TextField( + verbose_name="Commentaires visibles par l'utilisateur", + blank=True), + ), + migrations.AlterField( + model_name='cofprofile', + name='is_cof', + field=models.BooleanField(verbose_name='Membre du COF', + default=False), + ), + migrations.AlterField( + model_name='cofprofile', + name='login_clipper', + field=models.CharField(verbose_name='Login clipper', max_length=8, + blank=True), + ), + migrations.AlterField( + model_name='cofprofile', + name='mailing_bda', + field=models.BooleanField(verbose_name='Recevoir les mails BdA', + default=False), + ), + migrations.AlterField( + model_name='cofprofile', + name='mailing_bda_revente', + field=models.BooleanField( + verbose_name='Recevoir les mails de revente de places BdA', + default=False), + ), + migrations.AlterField( + model_name='cofprofile', + name='mailing_cof', + field=models.BooleanField(verbose_name='Recevoir les mails COF', + default=False), + ), + migrations.AlterField( + model_name='cofprofile', + name='occupation', + field=models.CharField(verbose_name='Occupation', + choices=[('exterieur', 'Extérieur'), + ('1A', '1A'), + ('2A', '2A'), + ('3A', '3A'), + ('4A', '4A'), + ('archicube', 'Archicube'), + ('doctorant', 'Doctorant'), + ('CST', 'CST')], + max_length=9, default='1A'), + ), + migrations.AlterField( + model_name='cofprofile', + name='petits_cours_accept', + field=models.BooleanField(verbose_name='Recevoir des petits cours', + default=False), + ), + migrations.AlterField( + model_name='cofprofile', + name='petits_cours_remarques', + field=models.TextField( + blank=True, + verbose_name='Remarques et précisions pour les petits cours', + default=''), + ), + migrations.AlterField( + model_name='cofprofile', + name='type_cotiz', + field=models.CharField( + verbose_name='Type de cotisation', + choices=[('etudiant', 'Normalien étudiant'), + ('normalien', 'Normalien élève'), + ('exterieur', 'Extérieur')], + max_length=9, default='normalien'), + ), + migrations.AlterField( + model_name='custommail', + name='comments', + field=models.TextField( + verbose_name='Informations contextuelles sur le mail', + blank=True), + ), + migrations.AlterField( + model_name='custommail', + name='content', + field=models.TextField(verbose_name='Contenu'), + ), + migrations.AlterField( + model_name='custommail', + name='title', + field=models.CharField(verbose_name='Titre', max_length=200), + ), + migrations.AlterField( + model_name='event', + name='description', + field=models.TextField(verbose_name='Description', blank=True), + ), + migrations.AlterField( + model_name='event', + name='end_date', + field=models.DateTimeField(null=True, verbose_name='Date de fin', + blank=True), + ), + migrations.AlterField( + model_name='event', + name='image', + field=models.ImageField(upload_to='imgs/events/', null=True, + verbose_name='Image', blank=True), + ), + migrations.AlterField( + model_name='event', + name='location', + field=models.CharField(verbose_name='Lieu', max_length=200), + ), + migrations.AlterField( + model_name='event', + name='registration_open', + field=models.BooleanField(verbose_name='Inscriptions ouvertes', + default=True), + ), + migrations.AlterField( + model_name='event', + name='title', + field=models.CharField(verbose_name='Titre', max_length=200), + ), + migrations.AlterField( + model_name='eventcommentfield', + name='fieldtype', + field=models.CharField(verbose_name='Type', + choices=[('text', 'Texte long'), + ('char', 'Texte court')], + max_length=10, default='text'), + ), + migrations.AlterField( + model_name='eventcommentfield', + name='name', + field=models.CharField(verbose_name='Champ', max_length=200), + ), + migrations.AlterField( + model_name='eventcommentvalue', + name='content', + field=models.TextField(null=True, verbose_name='Contenu', + blank=True), + ), + migrations.AlterField( + model_name='eventoption', + name='multi_choices', + field=models.BooleanField(verbose_name='Choix multiples', + default=False), + ), + migrations.AlterField( + model_name='eventoption', + name='name', + field=models.CharField(verbose_name='Option', max_length=200), + ), + migrations.AlterField( + model_name='eventoptionchoice', + name='value', + field=models.CharField(verbose_name='Valeur', max_length=200), + ), + migrations.AlterField( + model_name='petitcoursability', + name='niveau', + field=models.CharField( + choices=[('college', 'Collège'), ('lycee', 'Lycée'), + ('prepa1styear', 'Prépa 1ère année / L1'), + ('prepa2ndyear', 'Prépa 2ème année / L2'), + ('licence3', 'Licence 3'), + ('other', 'Autre (préciser dans les commentaires)')], + max_length=12, verbose_name='Niveau'), + ), + migrations.AlterField( + model_name='petitcoursattribution', + name='rank', + field=models.IntegerField(verbose_name="Rang dans l'email"), + ), + migrations.AlterField( + model_name='petitcoursattributioncounter', + name='count', + field=models.IntegerField(verbose_name="Nombre d'envois", + default=0), + ), + migrations.AlterField( + model_name='petitcoursdemande', + name='niveau', + field=models.CharField( + verbose_name='Niveau', + choices=[('college', 'Collège'), ('lycee', 'Lycée'), + ('prepa1styear', 'Prépa 1ère année / L1'), + ('prepa2ndyear', 'Prépa 2ème année / L2'), + ('licence3', 'Licence 3'), + ('other', 'Autre (préciser dans les commentaires)')], + max_length=12, default=''), + ), + migrations.AlterField( + model_name='survey', + name='old', + field=models.BooleanField(verbose_name='Archiver (sondage fini)', + default=False), + ), + migrations.AlterField( + model_name='survey', + name='survey_open', + field=models.BooleanField(verbose_name='Sondage ouvert', + default=True), + ), + migrations.AlterField( + model_name='survey', + name='title', + field=models.CharField(verbose_name='Titre', max_length=200), + ), + migrations.AlterField( + model_name='surveyquestion', + name='multi_answers', + field=models.BooleanField(verbose_name='Choix multiples', + default=False), + ), + migrations.AlterField( + model_name='surveyquestion', + name='question', + field=models.CharField(verbose_name='Question', max_length=200), + ), + migrations.RunPython(forwards, migrations.RunPython.noop), + ] diff --git a/gestioncof/models.py b/gestioncof/models.py index 382a5750..19590aff 100644 --- a/gestioncof/models.py +++ b/gestioncof/models.py @@ -62,7 +62,7 @@ class CofProfile(models.Model): mailing_bda_revente = models.BooleanField( "Recevoir les mails de revente de places BdA", default=False) comments = models.TextField( - "Commentaires visibles uniquement par le Buro", blank=True) + "Commentaires visibles par l'utilisateur", blank=True) is_buro = models.BooleanField("Membre du Burô", default=False) petits_cours_accept = models.BooleanField( "Recevoir des petits cours", default=False) diff --git a/gestioncof/templates/profile.html b/gestioncof/templates/profile.html index 6ba101e9..7b185150 100644 --- a/gestioncof/templates/profile.html +++ b/gestioncof/templates/profile.html @@ -13,10 +13,18 @@ {% csrf_token %} {% for field in form %} - {{ field | bootstrap}} + {{ field | bootstrap }} {% endfor %} + {% if user.profile.comments %} +
+

Commentaires

+

+ {{ user.profile.comments }} +

+
+ {% endif %}