3
0
Fork 0
mirror of https://github.com/nanoy42/coope synced 2024-11-05 01:16:28 +00:00

Merge branch 'release-3.4.1'

This commit is contained in:
Yoann Pétri 2019-04-28 13:33:57 +02:00
commit e79c42fab4
14 changed files with 138 additions and 58 deletions

1
.gitignore vendored
View file

@ -44,3 +44,4 @@ venv
static/
Pipfile
mediafiles
Pipfile.lock

View file

@ -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

View file

@ -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/'

View file

@ -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 '<a target="_blank" href="' + gp.menu.url + '">' + str(gp.menu) + '</a>'
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 '<a target="_blank" href="' + gp.alcohol_charter.url + '">' + str(gp.alcohol_charter) + '</a>'
except:
return "Pas de document"

View file

@ -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):
"""

View file

@ -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):

View file

@ -13,7 +13,7 @@ class GeneralPreferencesAdmin(SimpleHistoryAdmin):
"""
The admin class for :class:`Consumptions <preferences.models.GeneralPreferences>`.
"""
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):
"""

View file

@ -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'})
}

View file

@ -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'),
),
]

View file

@ -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',
),
]

View file

@ -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'),
),
]

View file

@ -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):

View file

@ -69,23 +69,15 @@
{{form.president}}
</div>
<div class="6u">
{{form.vice_president}}
{{form.secretary}}
</div>
</div>
<div class="row uniform">
<div class="6u">
{{form.secretary}}
</div>
<div class="6u">
{{form.treasurer}}
</div>
</div>
<div class="row uniform">
<div class="6u">
{{form.grocer}}
</div>
<div class="6u">
{{form.brewer}}
{{form.phoenixTM_responsible}}
</div>
</div>
<div class="row uniform">
@ -146,6 +138,12 @@
<label for="{{form.menu.id_for_label}}">Menu / Carte</label>
</div>
</div>
<div class="row uniform">
<div class="12u">
{{form.alcohol_charter}}
<label for="{{form.menu.id_for_label}}">Charte alcool</label>
</div>
</div>
<div class="row uniform">
<div class="12u">
<button type="submit"><i class="fa fa-save"></i> Enregistrer</button>

View file

@ -10,6 +10,8 @@
<dd>{% autoescape off %}{% rules %}{% endautoescape %}</dd>
<dt>Carte</dt>
<dd>{% autoescape off %}{% menu %}{% endautoescape %}</dd>
<dt>Charte alcool</dt>
<dd>{% autoescape off %}{% alcool_charter %}{% endautoescape %}</dd>
</dl>
</section>
<section>
@ -20,13 +22,9 @@
<td>coopemetz@gmail.com</td>
</tr>
<tr>
<td>Prez</td>
<td>Président</td>
<td>{% president %}</td>
</tr>
<tr>
<td>V-Prez</td>
<td>{% vice_president %}</td>
</tr>
<tr>
<td>Trésorier</td>
<td>{% treasurer %}</td>
@ -36,18 +34,14 @@
<td>{% secretary %}</td>
</tr>
<tr>
<td>Maitre brasseur</td>
<td>{% brewer %}</td>
</tr>
<tr>
<td>Epic Epicier</td>
<td>{% grocer %}</td>
<td>Responsable Phœnix Technopôle Metz</td>
<td>{% phoenix %}</td>
</tr>
</table>
<ul class="icons">
<li><a href="https://www.facebook.com/coopesmetz/" class="icon fa-facebook alt"><span class="label">Facebook</span></a></li>
</ul>
</section>
<p class="copyright">coope.rez v3.4.0 (release stable) &copy; 2018 Yoann Pietri.</p>
<p class="copyright">coope.rez v3.4.1 (release stable) &copy; 2018-2019 Yoann Pietri.</p>