diff --git a/.gitignore b/.gitignore index 80eb75b..6cfebb4 100644 --- a/.gitignore +++ b/.gitignore @@ -44,3 +44,4 @@ venv static/ Pipfile mediafiles +Pipfile.lock diff --git a/CHANGELOG.md b/CHANGELOG.md index 09c9d3b..33a2ed5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## v3.4.1 +* Rajout d'un bouton actif sur les KegForm +* Suppression épic épicier, maitre brasseur et vice-président. +* Rajout responsable Phoenix Technopôle Metz +* Rajout de la charte alcool ## v3.4.0 * Fix bugs et améliorations * Réparation de la génération de documents en latex diff --git a/coopeV3/settings.py b/coopeV3/settings.py index 089e45c..4a4abca 100644 --- a/coopeV3/settings.py +++ b/coopeV3/settings.py @@ -124,6 +124,6 @@ STATIC_ROOT = os.path.join(BASE_DIR, 'static') LOGIN_URL = '/users/login' -MEDIA_ROOT = 'mediafiles/' +MEDIA_ROOT = os.path.join(BASE_DIR, 'mediafiles') MEDIA_URL = '/media/' diff --git a/coopeV3/templatetags/vip.py b/coopeV3/templatetags/vip.py index 2f95e12..d4266f1 100644 --- a/coopeV3/templatetags/vip.py +++ b/coopeV3/templatetags/vip.py @@ -12,14 +12,6 @@ def president(): gp,_ = GeneralPreferences.objects.get_or_create(pk=1) return gp.president -@register.simple_tag -def vice_president(): - """ - A tag which returns :attr:`preferences.models.GeneralPreferences.vice_president`. - """ - gp,_ = GeneralPreferences.objects.get_or_create(pk=1) - return gp.vice_president - @register.simple_tag def treasurer(): """ @@ -37,20 +29,12 @@ def secretary(): return gp.secretary @register.simple_tag -def brewer(): +def phoenix(): """ - A tag which returns :attr:`preferences.models.GeneralPreferences.brewer`. + A tag which returns :attr:`preferences.models.GeneralPreferences.phoenixTM_responsible`. """ gp,_ = GeneralPreferences.objects.get_or_create(pk=1) - return gp.brewer - -@register.simple_tag -def grocer(): - """ - A tag which returns :attr:`preferences.models.GeneralPreferences.grocer`. - """ - gp,_ = GeneralPreferences.objects.get_or_create(pk=1) - return gp.grocer + return gp.phoenixTM_responsible @register.simple_tag def global_message(): @@ -102,3 +86,14 @@ def menu(): return '' + str(gp.menu) + '' except: return "Pas de document" + +@register.simple_tag +def alcool_charter(): + """ + A tag which returns :attr:`preferences.models.GeneralPreferences.alcool_charter`. + """ + gp,_ = GeneralPreferences.objects.get_or_create(pk=1) + try: + return '' + str(gp.alcohol_charter) + '' + except: + return "Pas de document" diff --git a/django_tex/core.py b/django_tex/core.py index 9a3a927..6d67d5f 100644 --- a/django_tex/core.py +++ b/django_tex/core.py @@ -8,7 +8,7 @@ from django.template.loader import get_template from django_tex.exceptions import TexError from django.conf import settings -DEFAULT_INTERPRETER = 'lualatex' +DEFAULT_INTERPRETER = 'pdflatex' def run_tex(source): """ diff --git a/gestion/forms.py b/gestion/forms.py index db7d602..9e734a0 100644 --- a/gestion/forms.py +++ b/gestion/forms.py @@ -52,7 +52,7 @@ class KegForm(forms.ModelForm): class Meta: model = Keg - exclude = ("is_active", ) + fields = "__all__" widgets = {'amount': forms.TextInput} class MenuForm(forms.ModelForm): diff --git a/preferences/admin.py b/preferences/admin.py index 53a1ba0..1641d96 100644 --- a/preferences/admin.py +++ b/preferences/admin.py @@ -13,7 +13,7 @@ class GeneralPreferencesAdmin(SimpleHistoryAdmin): """ The admin class for :class:`Consumptions `. """ - list_display = ('is_active', 'president', 'vice_president', 'treasurer', 'secretary', 'brewer', 'grocer', 'use_pinte_monitoring', 'lost_pintes_allowed', 'floating_buttons', 'automatic_logout_time') + list_display = ('is_active', 'president', 'treasurer', 'secretary', 'phoenixTM_responsible', 'use_pinte_monitoring', 'lost_pintes_allowed', 'floating_buttons', 'automatic_logout_time') class PaymentMethodAdmin(SimpleHistoryAdmin): """ diff --git a/preferences/forms.py b/preferences/forms.py index 2b9604b..52a7dc6 100644 --- a/preferences/forms.py +++ b/preferences/forms.py @@ -31,11 +31,9 @@ class GeneralPreferencesForm(forms.ModelForm): 'global_message': forms.Textarea(attrs={'placeholder': 'Message global à afficher sur le site'}), 'active_message': forms.Textarea(attrs={'placeholder': 'Ce message s\'affichera si le site n\'est pas actif'}), 'president': forms.TextInput(attrs={'placeholder': 'Président'}), - 'vice_president': forms.TextInput(attrs={'placeholder': 'Vice-président'}), 'secretary': forms.TextInput(attrs={'placeholder': 'Secrétaire'}), 'treasurer': forms.TextInput(attrs={'placeholder': 'Trésorier'}), - 'brewer': forms.TextInput(attrs={'placeholder': 'Maître brasseur'}), - 'grocer': forms.TextInput(attrs={'placeholder': 'Epic épicier'}), + 'phoenixTM_responsible': forms.TextInput(attrs={'placeholder': 'Responsable Phœnix Technopôle Metz'}), 'home_text': forms.Textarea(attrs={'placeholder': 'Ce message sera affiché sur la page d\'accueil'}) } diff --git a/preferences/migrations/0010_auto_20190428_1319.py b/preferences/migrations/0010_auto_20190428_1319.py new file mode 100644 index 0000000..e263da6 --- /dev/null +++ b/preferences/migrations/0010_auto_20190428_1319.py @@ -0,0 +1,23 @@ +# Generated by Django 2.1 on 2019-04-28 11:19 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('preferences', '0009_auto_20190227_0859'), + ] + + operations = [ + migrations.AddField( + model_name='generalpreferences', + name='alchohol_charter', + field=models.FileField(blank=True, null=True, upload_to='', verbose_name='Charte alcool'), + ), + migrations.AddField( + model_name='historicalgeneralpreferences', + name='alchohol_charter', + field=models.TextField(blank=True, max_length=100, null=True, verbose_name='Charte alcool'), + ), + ] diff --git a/preferences/migrations/0011_auto_20190428_1321.py b/preferences/migrations/0011_auto_20190428_1321.py new file mode 100644 index 0000000..18ccc1a --- /dev/null +++ b/preferences/migrations/0011_auto_20190428_1321.py @@ -0,0 +1,23 @@ +# Generated by Django 2.1 on 2019-04-28 11:21 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('preferences', '0010_auto_20190428_1319'), + ] + + operations = [ + migrations.RenameField( + model_name='generalpreferences', + old_name='alchohol_charter', + new_name='alcohol_charter', + ), + migrations.RenameField( + model_name='historicalgeneralpreferences', + old_name='alchohol_charter', + new_name='alcohol_charter', + ), + ] diff --git a/preferences/migrations/0012_auto_20190428_1327.py b/preferences/migrations/0012_auto_20190428_1327.py new file mode 100644 index 0000000..e066d07 --- /dev/null +++ b/preferences/migrations/0012_auto_20190428_1327.py @@ -0,0 +1,47 @@ +# Generated by Django 2.1 on 2019-04-28 11:27 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('preferences', '0011_auto_20190428_1321'), + ] + + operations = [ + migrations.RemoveField( + model_name='generalpreferences', + name='brewer', + ), + migrations.RemoveField( + model_name='generalpreferences', + name='grocer', + ), + migrations.RemoveField( + model_name='generalpreferences', + name='vice_president', + ), + migrations.RemoveField( + model_name='historicalgeneralpreferences', + name='brewer', + ), + migrations.RemoveField( + model_name='historicalgeneralpreferences', + name='grocer', + ), + migrations.RemoveField( + model_name='historicalgeneralpreferences', + name='vice_president', + ), + migrations.AddField( + model_name='generalpreferences', + name='phoenixTM_responsible', + field=models.CharField(blank=True, max_length=255, verbose_name='Responsable Phœnix Technopôle Metz'), + ), + migrations.AddField( + model_name='historicalgeneralpreferences', + name='phoenixTM_responsible', + field=models.CharField(blank=True, max_length=255, verbose_name='Responsable Phœnix Technopôle Metz'), + ), + ] diff --git a/preferences/models.py b/preferences/models.py index a84b8d3..31409dd 100644 --- a/preferences/models.py +++ b/preferences/models.py @@ -64,10 +64,6 @@ class GeneralPreferences(models.Model): """ The name of the president """ - vice_president = models.CharField(max_length=255, blank=True, verbose_name="Vice Président") - """ - The name of the vice-president - """ treasurer = models.CharField(max_length=255, blank=True, verbose_name="Trésorier") """ The name of the treasurer @@ -76,13 +72,9 @@ class GeneralPreferences(models.Model): """ The name of the secretary """ - brewer = models.CharField(max_length=255, blank=True, verbose_name="Maître Brasseur") + phoenixTM_responsible = models.CharField(max_length=255, blank=True, verbose_name="Responsable Phœnix Technopôle Metz") """ - The name of the brewer - """ - grocer = models.CharField(max_length=255, blank=True, verbose_name="Épic Épicier") - """ - The name of the grocer + The name of the people in charge of the club """ use_pinte_monitoring = models.BooleanField(default=False, verbose_name="Suivi de pintes") """ @@ -116,6 +108,10 @@ class GeneralPreferences(models.Model): """ The file of the menu """ + alcohol_charter = models.FileField(blank=True, null=True, verbose_name="Charte alcool") + """ + The file of the alcohol charter + """ history = HistoricalRecords() class Cotisation(models.Model): diff --git a/preferences/templates/preferences/general_preferences.html b/preferences/templates/preferences/general_preferences.html index 18b22b6..9b2328e 100644 --- a/preferences/templates/preferences/general_preferences.html +++ b/preferences/templates/preferences/general_preferences.html @@ -69,23 +69,15 @@ {{form.president}}
- {{form.vice_president}} + {{form.secretary}}
-
- {{form.secretary}} -
{{form.treasurer}}
-
-
- {{form.grocer}} -
-
- {{form.brewer}} + {{form.phoenixTM_responsible}}
@@ -146,6 +138,12 @@
+
+
+ {{form.alcohol_charter}} + +
+
diff --git a/templates/footer.html b/templates/footer.html index 5d00040..43a8569 100644 --- a/templates/footer.html +++ b/templates/footer.html @@ -10,6 +10,8 @@
{% autoescape off %}{% rules %}{% endautoescape %}
Carte
{% autoescape off %}{% menu %}{% endautoescape %}
+
Charte alcool
+
{% autoescape off %}{% alcool_charter %}{% endautoescape %}
@@ -20,13 +22,9 @@ coopemetz@gmail.com - Prez + Président {% president %} - - V-Prez - {% vice_president %} - Trésorier {% treasurer %} @@ -36,18 +34,14 @@ {% secretary %} - Maitre brasseur - {% brewer %} - - - Epic Epicier - {% grocer %} + Responsable Phœnix Technopôle Metz + {% phoenix %}
- +