Add interface to create and see note sheets

Signed-off-by: Yohann D'ANELLO <ynerant@crans.org>
This commit is contained in:
Yohann D'ANELLO 2022-08-18 14:27:02 +02:00
parent 44994a3ae7
commit 51e5e3669e
Signed by: ynerant
GPG Key ID: 3A75C55819C8CF85
15 changed files with 591 additions and 49 deletions

View File

@ -0,0 +1,18 @@
# Generated by Django 2.2.27 on 2022-08-18 11:01
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('member', '0008_auto_20211005_1544'),
]
operations = [
migrations.AlterField(
model_name='profile',
name='promotion',
field=models.PositiveSmallIntegerField(default=2022, help_text='Year of entry to the school (None if not ENS student)', null=True, verbose_name='promotion'),
),
]

41
apps/sheets/forms.py Normal file
View File

@ -0,0 +1,41 @@
# Copyright (C) 2018-2022 by BDE ENS Paris-Saclay
# SPDX-License-Identifier: GPL-3.0-or-later
from django import forms
from member.models import Club
from note_kfet.inputs import AmountInput, Autocomplete, DateTimePickerInput
from .models import Food, Meal, Sheet
class SheetForm(forms.ModelForm):
class Meta:
model = Sheet
fields = '__all__'
widgets = {
'date': DateTimePickerInput(),
}
class FoodForm(forms.ModelForm):
class Meta:
model = Food
exclude = ('sheet', )
widgets = {
'price': AmountInput(),
'club': Autocomplete(
model=Club,
attrs={"api_url": "/api/members/club/"},
),
}
class MealForm(forms.ModelForm):
class Meta:
model = Meal
exclude = ('sheet', )
widgets = {
'content': forms.CheckboxSelectMultiple(),
'price': AmountInput(),
}

View File

@ -1,4 +1,4 @@
# Generated by Django 2.2.27 on 2022-08-18 10:25 # Generated by Django 2.2.27 on 2022-08-18 11:01
from django.db import migrations, models from django.db import migrations, models
import django.db.models.deletion import django.db.models.deletion
@ -10,8 +10,8 @@ class Migration(migrations.Migration):
initial = True initial = True
dependencies = [ dependencies = [
('member', '0009_auto_20220818_1301'),
('note', '0006_trust'), ('note', '0006_trust'),
('member', '0009_auto_20220818_1225'),
] ]
operations = [ operations = [
@ -93,6 +93,7 @@ class Migration(migrations.Migration):
('name', models.CharField(max_length=255, verbose_name='name')), ('name', models.CharField(max_length=255, verbose_name='name')),
('date', models.DateTimeField(default=django.utils.timezone.now, verbose_name='start date')), ('date', models.DateTimeField(default=django.utils.timezone.now, verbose_name='start date')),
('description', models.TextField(verbose_name='description')), ('description', models.TextField(verbose_name='description')),
('visible', models.BooleanField(default=False, help_text='the note sheet will be private until this field is checked.', verbose_name='visible')),
], ],
options={ options={
'verbose_name': 'note sheet', 'verbose_name': 'note sheet',

View File

@ -2,6 +2,7 @@
# SPDX-License-Identifier: GPL-3.0-or-later # SPDX-License-Identifier: GPL-3.0-or-later
from django.db import models from django.db import models
from django.urls import reverse_lazy
from django.utils import timezone from django.utils import timezone
from django.utils.translation import gettext_lazy as _ from django.utils.translation import gettext_lazy as _
@ -24,6 +25,18 @@ class Sheet(models.Model):
verbose_name=_("description"), verbose_name=_("description"),
) )
visible = models.BooleanField(
default=False,
verbose_name=_("visible"),
help_text=_("the note sheet will be private until this field is checked."),
)
def get_absolute_url(self):
return reverse_lazy('sheets:sheet_detail', args=(self.pk,))
def __str__(self):
return self.name
class Meta: class Meta:
verbose_name = _("note sheet") verbose_name = _("note sheet")
verbose_name_plural = _("note sheets") verbose_name_plural = _("note sheets")
@ -57,6 +70,9 @@ class Food(models.Model):
help_text=_("If set to false, this option won't be offered (in case of out of stock)"), help_text=_("If set to false, this option won't be offered (in case of out of stock)"),
) )
def __str__(self):
return self.name
class Meta: class Meta:
verbose_name = _("food") verbose_name = _("food")
verbose_name_plural = _("food") verbose_name_plural = _("food")
@ -85,6 +101,9 @@ class FoodOption(models.Model):
help_text=_("If set to false, this option won't be offered (in case of out of stock)"), help_text=_("If set to false, this option won't be offered (in case of out of stock)"),
) )
def __str__(self):
return self.name
class Meta: class Meta:
verbose_name = _("food option") verbose_name = _("food option")
verbose_name_plural = _("food options") verbose_name_plural = _("food options")
@ -117,6 +136,9 @@ class Meal(models.Model):
help_text=_("If set to false, this option won't be offered (in case of out of stock)"), help_text=_("If set to false, this option won't be offered (in case of out of stock)"),
) )
def __str__(self):
return self.name
class Meta: class Meta:
verbose_name = _("meal") verbose_name = _("meal")
verbose_name_plural = _("meals") verbose_name_plural = _("meals")

22
apps/sheets/tables.py Normal file
View File

@ -0,0 +1,22 @@
# Copyright (C) 2018-2022 by BDE ENS Paris-Saclay
# SPDX-License-Identifier: GPL-3.0-or-later
import django_tables2 as tables
from django.urls import reverse_lazy
from sheets.models import Sheet
class SheetTable(tables.Table):
class Meta:
attrs = {
'class': 'table table-condensed table-striped table-hover'
}
model = Sheet
template_name = 'django_tables2/bootstrap4.html'
fields = ('name', 'date', )
row_attrs = {
'class': 'table-row',
'id': lambda record: "row-" + str(record.pk),
'data-href': lambda record: reverse_lazy('sheets:sheet_detail', args=(record.pk,))
}

View File

@ -0,0 +1,21 @@
{% extends "wei/base.html" %}
{% comment %}
SPDX-License-Identifier: GPL-3.0-or-later
{% endcomment %}
{% load crispy_forms_tags %}
{% load i18n %}
{% block profile_content %}
<div class="card bg-light mb-3">
<h3 class="card-header text-center">
{{ title }}
</h3>
<div class="card-body">
<form method="post">
{% csrf_token %}
{{ form|crispy }}
<button class="btn btn-primary" type="submit">{% trans "Submit" %}</button>
</form>
</div>
</div>
{% endblock %}

View File

@ -0,0 +1,21 @@
{% extends "wei/base.html" %}
{% comment %}
SPDX-License-Identifier: GPL-3.0-or-later
{% endcomment %}
{% load crispy_forms_tags %}
{% load i18n %}
{% block profile_content %}
<div class="card bg-light mb-3">
<h3 class="card-header text-center">
{{ title }}
</h3>
<div class="card-body">
<form method="post">
{% csrf_token %}
{{ form|crispy }}
<button class="btn btn-primary" type="submit">{% trans "Submit" %}</button>
</form>
</div>
</div>
{% endblock %}

View File

@ -0,0 +1,83 @@
{% extends "base.html" %}
{% load i18n %}
{% load pretty_money %}
{% block content %}
<div class="card">
<div class="card-header text-center">
<h1>{{ sheet.name }}</h1>
</div>
<div class="card-body">
<div class="alert alert-secondary">
<div class="row">
<div class="col-sm-11">
{{ sheet.description }}
</div>
{% if can_change_sheet %}
<div class="col-sm-1">
<a class="badge badge-primary" href="{% url 'sheets:sheet_update' pk=sheet.pk %}">
<i class="fa fa-edit"></i>
{% trans "Edit" %}
</a>
</div>
{% endif %}
</div>
</div>
<h3>{% trans "menu"|capfirst %} :</h3>
<ul>
{% for meal in sheet.meal_set.all %}
<li{% if not meal.available %} class="text-danger" style="text-decoration: line-through !important;"{% endif %}>
{{ meal }} ({{ meal.price|pretty_money }})
{% if can_change_sheet %}
<a href="{% url 'sheets:meal_update' pk=meal.pk %}" class="badge badge-primary">
<i class="fa fa-edit"></i>
{% trans "Edit" %}
</a>
{% endif %}
</li>
{% endfor %}
<hr>
{% for food in sheet.food_set.all %}
<li{% if not food.available %} class="text-danger" style="text-decoration: line-through !important;"{% endif %}>
{{ food }} ({{ food.price|pretty_money }})
{% if can_change_sheet %}
<a href="{% url 'sheets:food_update' pk=food.pk %}" class="badge badge-primary">
<i class="fa fa-edit"></i>
{% trans "Edit" %}
</a>
{% endif %}
{% if food.option_set.all %}
<ul>
{% for option in food.available_options %}
<li{% if not option.available %} class="text-danger" style="text-decoration: line-through !important;"{% endif %}>
{{ option }}{% if option.extra_price %} ({{ option.extra_price|pretty_money }}){% endif %}
</li>
{% endfor %}
</ul>
{% endif %}
</li>
{% empty %}
<div class="alert alert-warning">
{% trans "The menu is empty for now." %}
</div>
{% endfor %}
</ul>
<div class="text-center">
{% if can_add_food %}
<a href="{% url 'sheets:food_create' pk=sheet.pk %}" class="btn btn-primary">{% trans "Add new food" %}</a>
{% endif %}
{% if can_add_meal %}
<a href="{% url 'sheets:meal_create' pk=sheet.pk %}" class="btn btn-primary">{% trans "Add new meal" %}</a>
{% endif %}
</div>
</div>
<div class="card-footer text-center">
<a class="btn btn-success">
{% trans "Order now" %}
</a>
</div>
</div>
{% endblock %}

View File

@ -0,0 +1,21 @@
{% extends "wei/base.html" %}
{% comment %}
SPDX-License-Identifier: GPL-3.0-or-later
{% endcomment %}
{% load crispy_forms_tags %}
{% load i18n %}
{% block profile_content %}
<div class="card bg-light mb-3">
<h3 class="card-header text-center">
{{ title }}
</h3>
<div class="card-body">
<form method="post">
{% csrf_token %}
{{ form|crispy }}
<button class="btn btn-primary" type="submit">{% trans "Submit" %}</button>
</form>
</div>
</div>
{% endblock %}

View File

@ -0,0 +1,74 @@
{% extends "base.html" %}
{% comment %}
SPDX-License-Identifier: GPL-3.0-or-later
{% endcomment %}
{% load render_table from django_tables2 %}
{% load i18n %}
{% block content %}
<div class="row justify-content-center mb-4">
<div class="col-md-10 text-center">
<input class="form-control mx-auto w-25" type="text" onkeyup="search_field_moved()" id="search_field"/>
{% if can_create_sheet %}
<hr>
<a class="btn btn-primary text-center my-4" href="{% url 'sheets:sheet_create' %}">{% trans "Create a sheet" %}</a>
{% endif %}
</div>
</div>
<div class="row justify-content-center">
<div class="col-md-10">
<div class="card card-border shadow">
<div class="card-header text-center">
<h5> {% trans "Note sheet listing" %}</h5>
</div>
<div class="card-body px-0 py-0" id="sheets_table">
{% render_table table %}
</div>
</div>
</div>
</div>
{% endblock %}
{% block extrajavascript %}
<script type="text/javascript">
function getInfo() {
var asked = $("#search_field").val();
/* on ne fait la requête que si on a au moins un caractère pour chercher */
var sel = $(".table-row");
if (asked.length >= 1) {
$.getJSON("/api/sheets/sheet/?format=json&search="+asked, function(buttons){
let selected_id = buttons.results.map((a => "#row-"+a.id));
if (selected_id.length)
$(".table-row,"+selected_id.join()).show();
$(".table-row").not(selected_id.join()).hide();
});
}else{
// show everything
$('table tr').show();
}
}
var timer;
var timer_on;
/* Fontion appelée quand le texte change (délenche le timer) */
function search_field_moved(secondfield) {
if (timer_on) { // Si le timer a déjà été lancé, on réinitialise le compteur.
clearTimeout(timer);
timer = setTimeout("getInfo(" + secondfield + ")", 300);
}
else { // Sinon, on le lance et on enregistre le fait qu'il tourne.
timer = setTimeout("getInfo(" + secondfield + ")", 300);
timer_on = true;
}
}
// clickable row
$(document).ready(function($) {
$(".table-row").click(function() {
window.document.location = $(this).data("href");
});
});
</script>
{% endblock %}

View File

@ -3,7 +3,18 @@
from django.urls import path from django.urls import path
from sheets.views import FoodCreateView, FoodUpdateView, MealCreateView, MealUpdateView, \
SheetCreateView, SheetDetailView, SheetListView, SheetUpdateView
app_name = 'sheets' app_name = 'sheets'
urlpatterns = [ urlpatterns = [
path('list/', SheetListView.as_view(), name="sheet_list"),
path('create/', SheetCreateView.as_view(), name="sheet_create"),
path('update/<int:pk>/', SheetUpdateView.as_view(), name="sheet_update"),
path('detail/<int:pk>/', SheetDetailView.as_view(), name="sheet_detail"),
path('food/create/<int:pk>/', FoodCreateView.as_view(), name="food_create"),
path('food/<int:pk>/update/', FoodUpdateView.as_view(), name="food_update"),
path('meal/create/<int:pk>/', MealCreateView.as_view(), name="meal_create"),
path('meal/<int:pk>/update/', MealUpdateView.as_view(), name="meal_update"),
] ]

View File

@ -1,2 +1,136 @@
# Copyright (C) 2018-2022 by BDE ENS Paris-Saclay # Copyright (C) 2018-2022 by BDE ENS Paris-Saclay
# SPDX-License-Identifier: GPL-3.0-or-later # SPDX-License-Identifier: GPL-3.0-or-later
from django.contrib.auth.mixins import LoginRequiredMixin
from django.urls import reverse_lazy
from django.utils import timezone
from django.utils.translation import gettext_lazy as _
from django.views.generic import DetailView, UpdateView
from django_tables2 import SingleTableView
from permission.backends import PermissionBackend
from permission.views import ProtectQuerysetMixin, ProtectedCreateView
from .forms import FoodForm, MealForm, SheetForm
from .models import Sheet, Food, Meal
from .tables import SheetTable
class SheetListView(ProtectQuerysetMixin, LoginRequiredMixin, SingleTableView):
model = Sheet
table_class = SheetTable
ordering = '-date'
extra_context = {"title": _("Search note sheet")}
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
context["can_create_sheet"] = PermissionBackend.check_perm(self.request, "sheets.add_sheet", Sheet(
name="Test",
date=timezone.now(),
description="Test sheet",
))
return context
class SheetCreateView(ProtectQuerysetMixin, ProtectedCreateView):
model = Sheet
form_class = SheetForm
extra_context = {"title": _("Create note sheet")}
def get_sample_object(self):
return Sheet(
name="Test",
date=timezone.now(),
description="Test",
)
class SheetUpdateView(ProtectQuerysetMixin, UpdateView):
model = Sheet
form_class = SheetForm
extra_context = {"title": _("Update note sheet")}
class SheetDetailView(ProtectQuerysetMixin, DetailView):
model = Sheet
def get_context_data(self, **kwargs):
context = super().get_context_data()
context['can_change_sheet'] = PermissionBackend.check_perm(self.request, 'sheets.change_sheet', self.object)
context['can_add_meal'] = PermissionBackend.check_perm(self.request,
'sheets.add_meal',
Meal(sheet=self.object, name="Test", price=500))
context['can_add_food'] = PermissionBackend.check_perm(self.request,
'sheets.add_food',
Food(sheet=self.object, name="Test", price=500))
return context
class FoodCreateView(ProtectQuerysetMixin, ProtectedCreateView):
model = Food
form_class = FoodForm
extra_context = {"title": _("Create new food")}
def get_sample_object(self):
return Food(
sheet_id=self.kwargs['pk'],
name="Test",
price=500,
)
def form_valid(self, form):
form.instance.sheet_id = self.kwargs['pk']
return super().form_valid(form)
def get_success_url(self):
return reverse_lazy('sheets:sheet_detail', args=(self.kwargs['pk'],))
class FoodUpdateView(ProtectQuerysetMixin, UpdateView):
model = Food
form_class = FoodForm
extra_context = {"title": _("Update food")}
def get_success_url(self):
return reverse_lazy('sheets:sheet_detail', args=(self.kwargs['pk'],))
class MealCreateView(ProtectQuerysetMixin, ProtectedCreateView):
model = Meal
form_class = MealForm
extra_context = {"title": _("Create new meal")}
def get_sample_object(self):
return Meal(
sheet_id=self.kwargs['pk'],
name="Test",
price=500,
)
def get_form(self, form_class=None):
form = super().get_form(form_class)
form.fields['content'].queryset = form.fields['content'].queryset.filter(sheet_id=self.kwargs['pk'])
return form
def form_valid(self, form):
form.instance.sheet_id = self.kwargs['pk']
return super().form_valid(form)
def get_success_url(self):
return reverse_lazy('sheets:sheet_detail', args=(self.object.sheet_id,))
class MealUpdateView(ProtectQuerysetMixin, UpdateView):
model = Meal
form_class = MealForm
extra_context = {"title": _("Update meal")}
def get_form(self, form_class=None):
form = super().get_form(form_class)
form.fields['content'].queryset = form.fields['content'].queryset.filter(sheet=self.object.sheet)
return form
def get_success_url(self):
return reverse_lazy('sheets:sheet_detail', args=(self.object.sheet_id,))

View File

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: \n" "Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-08-18 12:30+0200\n" "POT-Creation-Date: 2022-08-18 14:24+0200\n"
"PO-Revision-Date: 2022-04-11 22:05+0200\n" "PO-Revision-Date: 2022-04-11 22:05+0200\n"
"Last-Translator: elkmaennchen <elkmaennchen@crans.org>\n" "Last-Translator: elkmaennchen <elkmaennchen@crans.org>\n"
"Language-Team: French <http://translate.ynerant.fr/projects/nk20/nk20/fr/>\n" "Language-Team: French <http://translate.ynerant.fr/projects/nk20/nk20/fr/>\n"
@ -60,7 +60,7 @@ msgstr "Vous ne pouvez pas inviter plus de 3 personnes à cette activité."
#: apps/note/models/transactions.py:46 apps/note/models/transactions.py:301 #: apps/note/models/transactions.py:46 apps/note/models/transactions.py:301
#: apps/permission/models.py:330 #: apps/permission/models.py:330
#: apps/registration/templates/registration/future_profile_detail.html:16 #: apps/registration/templates/registration/future_profile_detail.html:16
#: apps/sheets/models.py:15 apps/sheets/models.py:68 apps/sheets/models.py:102 #: apps/sheets/models.py:16 apps/sheets/models.py:84 apps/sheets/models.py:121
#: apps/wei/models.py:67 apps/wei/models.py:131 apps/wei/tables.py:282 #: apps/wei/models.py:67 apps/wei/models.py:131 apps/wei/tables.py:282
#: apps/wei/templates/wei/base.html:26 #: apps/wei/templates/wei/base.html:26
#: apps/wei/templates/wei/weimembership_form.html:14 #: apps/wei/templates/wei/weimembership_form.html:14
@ -96,7 +96,7 @@ msgstr "types d'activité"
#: apps/activity/models.py:68 #: apps/activity/models.py:68
#: apps/activity/templates/activity/includes/activity_info.html:19 #: apps/activity/templates/activity/includes/activity_info.html:19
#: apps/note/models/transactions.py:81 apps/permission/models.py:110 #: apps/note/models/transactions.py:81 apps/permission/models.py:110
#: apps/permission/models.py:189 apps/sheets/models.py:24 apps/wei/models.py:78 #: apps/permission/models.py:189 apps/sheets/models.py:25 apps/wei/models.py:78
#: apps/wei/models.py:142 #: apps/wei/models.py:142
msgid "description" msgid "description"
msgstr "description" msgstr "description"
@ -145,7 +145,7 @@ msgstr ""
#: apps/activity/models.py:109 #: apps/activity/models.py:109
#: apps/activity/templates/activity/includes/activity_info.html:25 #: apps/activity/templates/activity/includes/activity_info.html:25
#: apps/sheets/models.py:19 #: apps/sheets/models.py:20
msgid "start date" msgid "start date"
msgstr "date de début" msgstr "date de début"
@ -174,7 +174,7 @@ msgid "entry time"
msgstr "heure d'entrée" msgstr "heure d'entrée"
#: apps/activity/models.py:178 apps/note/apps.py:14 #: apps/activity/models.py:178 apps/note/apps.py:14
#: apps/note/models/notes.py:77 apps/sheets/models.py:135 #: apps/note/models/notes.py:77 apps/sheets/models.py:157
msgid "note" msgid "note"
msgstr "note" msgstr "note"
@ -337,7 +337,10 @@ msgstr "Entrée effectuée !"
#: apps/member/templates/member/add_members.html:46 #: apps/member/templates/member/add_members.html:46
#: apps/member/templates/member/club_form.html:16 #: apps/member/templates/member/club_form.html:16
#: apps/note/templates/note/transactiontemplate_form.html:18 #: apps/note/templates/note/transactiontemplate_form.html:18
#: apps/treasury/forms.py:89 apps/treasury/forms.py:143 #: apps/sheets/templates/sheets/food_form.html:17
#: apps/sheets/templates/sheets/meal_form.html:17
#: apps/sheets/templates/sheets/sheet_form.html:17 apps/treasury/forms.py:89
#: apps/treasury/forms.py:143
#: apps/treasury/templates/treasury/invoice_form.html:74 #: apps/treasury/templates/treasury/invoice_form.html:74
#: apps/wei/templates/wei/bus_form.html:17 #: apps/wei/templates/wei/bus_form.html:17
#: apps/wei/templates/wei/busteam_form.html:17 #: apps/wei/templates/wei/busteam_form.html:17
@ -1595,8 +1598,10 @@ msgid "Delete"
msgstr "Supprimer" msgstr "Supprimer"
#: apps/note/tables.py:222 apps/note/templates/note/conso_form.html:132 #: apps/note/tables.py:222 apps/note/templates/note/conso_form.html:132
#: apps/wei/tables.py:49 apps/wei/tables.py:50 #: apps/sheets/templates/sheets/sheet_detail.html:21
#: apps/wei/templates/wei/base.html:89 #: apps/sheets/templates/sheets/sheet_detail.html:36
#: apps/sheets/templates/sheets/sheet_detail.html:48 apps/wei/tables.py:49
#: apps/wei/tables.py:50 apps/wei/templates/wei/base.html:89
#: apps/wei/templates/wei/bus_detail.html:20 #: apps/wei/templates/wei/bus_detail.html:20
#: apps/wei/templates/wei/busteam_detail.html:20 #: apps/wei/templates/wei/busteam_detail.html:20
#: apps/wei/templates/wei/busteam_detail.html:40 #: apps/wei/templates/wei/busteam_detail.html:40
@ -2170,144 +2175,208 @@ msgstr ""
msgid "Invalidate pre-registration" msgid "Invalidate pre-registration"
msgstr "Invalider l'inscription" msgstr "Invalider l'inscription"
#: apps/sheets/apps.py:10 apps/sheets/models.py:29 #: apps/sheets/apps.py:10 apps/sheets/models.py:42
msgid "note sheets" msgid "note sheets"
msgstr "feuilles de notes" msgstr "feuilles de notes"
#: apps/sheets/models.py:28 apps/sheets/models.py:41 apps/sheets/models.py:97 #: apps/sheets/models.py:30
#: apps/sheets/models.py:129 apps/sheets/models.py:246 msgid "visible"
msgstr "visible"
#: apps/sheets/models.py:31
msgid "the note sheet will be private until this field is checked."
msgstr "la feuille de note restera privée tant que ce champ n'est pas coché."
#: apps/sheets/models.py:41 apps/sheets/models.py:54 apps/sheets/models.py:116
#: apps/sheets/models.py:151 apps/sheets/models.py:268
msgid "note sheet" msgid "note sheet"
msgstr "feuille de note" msgstr "feuille de note"
#: apps/sheets/models.py:35 apps/sheets/models.py:61 apps/sheets/models.py:62 #: apps/sheets/models.py:48 apps/sheets/models.py:77 apps/sheets/models.py:78
#: apps/sheets/models.py:74 apps/sheets/models.py:188 #: apps/sheets/models.py:90 apps/sheets/models.py:210
msgid "food" msgid "food"
msgstr "nourriture" msgstr "nourriture"
#: apps/sheets/models.py:45 apps/sheets/models.py:111 #: apps/sheets/models.py:58 apps/sheets/models.py:130
msgid "price" msgid "price"
msgstr "prix" msgstr "prix"
#: apps/sheets/models.py:51 #: apps/sheets/models.py:64
msgid "destination club" msgid "destination club"
msgstr "club de destination" msgstr "club de destination"
#: apps/sheets/models.py:56 apps/sheets/models.py:84 apps/sheets/models.py:116 #: apps/sheets/models.py:69 apps/sheets/models.py:100 apps/sheets/models.py:135
msgid "available" msgid "available"
msgstr "disponible" msgstr "disponible"
#: apps/sheets/models.py:57 apps/sheets/models.py:85 apps/sheets/models.py:117 #: apps/sheets/models.py:70 apps/sheets/models.py:101 apps/sheets/models.py:136
msgid "If set to false, this option won't be offered (in case of out of stock)" msgid "If set to false, this option won't be offered (in case of out of stock)"
msgstr "" msgstr ""
"Si mis à faux, cette option ne sera pas présentée (en cas de rupture de " "Si mis à faux, cette option ne sera pas présentée (en cas de rupture de "
"stock)" "stock)"
#: apps/sheets/models.py:79 #: apps/sheets/models.py:95
msgid "extra cost" msgid "extra cost"
msgstr "surcoût" msgstr "surcoût"
#: apps/sheets/models.py:89 #: apps/sheets/models.py:108
msgid "food option" msgid "food option"
msgstr "option de nourriture" msgstr "option de nourriture"
#: apps/sheets/models.py:90 #: apps/sheets/models.py:109
msgid "food options" msgid "food options"
msgstr "options de nourriture" msgstr "options de nourriture"
#: apps/sheets/models.py:107 #: apps/sheets/models.py:126
msgid "content" msgid "content"
msgstr "contenu" msgstr "contenu"
#: apps/sheets/models.py:121 apps/sheets/models.py:162 #: apps/sheets/models.py:143 apps/sheets/models.py:184
msgid "meal" msgid "meal"
msgstr "menu" msgstr "menu"
#: apps/sheets/models.py:122 #: apps/sheets/models.py:144
msgid "meals" msgid "meals"
msgstr "menus" msgstr "menus"
#: apps/sheets/models.py:139 #: apps/sheets/models.py:161
msgid "date" msgid "date"
msgstr "date" msgstr "date"
#: apps/sheets/models.py:144 #: apps/sheets/models.py:166
msgid "gift" msgid "gift"
msgstr "don" msgstr "don"
#: apps/sheets/models.py:148 apps/sheets/models.py:156 #: apps/sheets/models.py:170 apps/sheets/models.py:178
#: apps/sheets/models.py:174 #: apps/sheets/models.py:196
msgid "order" msgid "order"
msgstr "commande" msgstr "commande"
#: apps/sheets/models.py:149 #: apps/sheets/models.py:171
msgid "orders" msgid "orders"
msgstr "commandes" msgstr "commandes"
#: apps/sheets/models.py:166 apps/sheets/models.py:182 #: apps/sheets/models.py:188 apps/sheets/models.py:204
msgid "ordered meal" msgid "ordered meal"
msgstr "menu commandé" msgstr "menu commandé"
#: apps/sheets/models.py:167 #: apps/sheets/models.py:189
msgid "ordered meals" msgid "ordered meals"
msgstr "menus commandés" msgstr "menus commandés"
#: apps/sheets/models.py:194 #: apps/sheets/models.py:216
msgid "options" msgid "options"
msgstr "options" msgstr "options"
#: apps/sheets/models.py:200 #: apps/sheets/models.py:222
msgid "remark" msgid "remark"
msgstr "remarques" msgstr "remarques"
#: apps/sheets/models.py:207 #: apps/sheets/models.py:229
msgid "priority request" msgid "priority request"
msgstr "demande de priorité" msgstr "demande de priorité"
#: apps/sheets/models.py:211 #: apps/sheets/models.py:233
msgid "number" msgid "number"
msgstr "numéro" msgstr "numéro"
#: apps/sheets/models.py:212 #: apps/sheets/models.py:234
msgid "How many times the user ordered this." msgid "How many times the user ordered this."
msgstr "Combien de fois cet⋅te utilisateur⋅rice a commandé ceci." msgstr "Combien de fois cet⋅te utilisateur⋅rice a commandé ceci."
#: apps/sheets/models.py:218 #: apps/sheets/models.py:240
msgid "queued" msgid "queued"
msgstr "en attente" msgstr "en attente"
#: apps/sheets/models.py:219 #: apps/sheets/models.py:241
msgid "ready" msgid "ready"
msgstr "prêt" msgstr "prêt"
#: apps/sheets/models.py:220 #: apps/sheets/models.py:242
msgid "served" msgid "served"
msgstr "servi" msgstr "servi"
#: apps/sheets/models.py:221 #: apps/sheets/models.py:243
msgid "canceled" msgid "canceled"
msgstr "annulé" msgstr "annulé"
#: apps/sheets/models.py:223 #: apps/sheets/models.py:245
msgid "status" msgid "status"
msgstr "statut" msgstr "statut"
#: apps/sheets/models.py:229 #: apps/sheets/models.py:251
msgid "served date" msgid "served date"
msgstr "date de service" msgstr "date de service"
#: apps/sheets/models.py:233 apps/sheets/models.py:234 #: apps/sheets/models.py:255 apps/sheets/models.py:256
#: apps/sheets/models.py:241 #: apps/sheets/models.py:263
msgid "ordered food" msgid "ordered food"
msgstr "nourriture commandée" msgstr "nourriture commandée"
#: apps/sheets/models.py:259 #: apps/sheets/models.py:281
msgid "sheet order transaction" msgid "sheet order transaction"
msgstr "transaction de commande sur feuille de note" msgstr "transaction de commande sur feuille de note"
#: apps/sheets/models.py:260 #: apps/sheets/models.py:282
msgid "sheet order transactions" msgid "sheet order transactions"
msgstr "transactions de commande sur feuille de note" msgstr "transactions de commande sur feuille de note"
#: apps/sheets/templates/sheets/sheet_detail.html:28
msgid "menu"
msgstr "menu"
#: apps/sheets/templates/sheets/sheet_detail.html:63
msgid "The menu is empty for now."
msgstr "Le menu est vide pour le moment."
#: apps/sheets/templates/sheets/sheet_detail.html:70
msgid "Add new food"
msgstr "Ajouter un plat"
#: apps/sheets/templates/sheets/sheet_detail.html:73
msgid "Add new meal"
msgstr "Ajouter un menu"
#: apps/sheets/templates/sheets/sheet_detail.html:79
msgid "Order now"
msgstr "Commander maintenant"
#: apps/sheets/templates/sheets/sheet_list.html:14
msgid "Create a sheet"
msgstr "Créer une feuille de note"
#: apps/sheets/templates/sheets/sheet_list.html:22
msgid "Note sheet listing"
msgstr "Liste des feuilles de notes"
#: apps/sheets/views.py:23
msgid "Search note sheet"
msgstr "Chercher une feuille de note"
#: apps/sheets/views.py:38
msgid "Create note sheet"
msgstr "Créer une feuille de note"
#: apps/sheets/views.py:51
msgid "Update note sheet"
msgstr "Modifier une feuille de note"
#: apps/sheets/views.py:74
msgid "Create new food"
msgstr "Créer un plat"
#: apps/sheets/views.py:94
msgid "Update food"
msgstr "Modifier un plat"
#: apps/sheets/views.py:103
msgid "Create new meal"
msgstr "Créer un menu"
#: apps/sheets/views.py:128
msgid "Update meal"
msgstr "Modifier un menu"
#: apps/treasury/apps.py:12 note_kfet/templates/base.html:96 #: apps/treasury/apps.py:12 note_kfet/templates/base.html:96
msgid "Treasury" msgid "Treasury"
msgstr "Trésorerie" msgstr "Trésorerie"

View File

@ -97,13 +97,16 @@ body {
.btn-primary:hover, .btn-primary:hover,
.btn-primary:not(:disabled):not(.disabled).active, .btn-primary:not(:disabled):not(.disabled).active,
.btn-primary:not(:disabled):not(.disabled):active { .btn-primary:not(:disabled):not(.disabled):active,
a.badge-primary:hover,
a.badge-primary:not(:disabled):not(.disabled).active,
a.badge-primary:not(:disabled):not(.disabled):active {
color: #fff; color: #fff;
background-color: rgb(102, 83, 105); background-color: rgb(102, 83, 105);
border-color: rgb(102, 83, 105); border-color: rgb(102, 83, 105);
} }
.btn-primary { .btn-primary, a.badge-primary {
color: rgba(248, 249, 250, 0.9); color: rgba(248, 249, 250, 0.9);
background-color: rgb(102, 83, 105); background-color: rgb(102, 83, 105);
border-color: rgb(102, 83, 105); border-color: rgb(102, 83, 105);

View File

@ -21,6 +21,7 @@ urlpatterns = [
path('activity/', include('activity.urls')), path('activity/', include('activity.urls')),
path('treasury/', include('treasury.urls')), path('treasury/', include('treasury.urls')),
path('wei/', include('wei.urls')), path('wei/', include('wei.urls')),
path('sheets/', include('sheets.urls')),
# Include Django Contrib and Core routers # Include Django Contrib and Core routers
path('i18n/', include('django.conf.urls.i18n')), path('i18n/', include('django.conf.urls.i18n')),