From 51e5e3669e5b87ebe738c16f1c9825e5a6bc01fd Mon Sep 17 00:00:00 2001 From: Yohann D'ANELLO Date: Thu, 18 Aug 2022 14:27:02 +0200 Subject: [PATCH] Add interface to create and see note sheets Signed-off-by: Yohann D'ANELLO --- .../migrations/0009_auto_20220818_1301.py | 18 ++ apps/sheets/forms.py | 41 +++++ apps/sheets/migrations/0001_initial.py | 5 +- apps/sheets/models.py | 22 +++ apps/sheets/tables.py | 22 +++ apps/sheets/templates/sheets/food_form.html | 21 +++ apps/sheets/templates/sheets/meal_form.html | 21 +++ .../sheets/templates/sheets/sheet_detail.html | 83 +++++++++ apps/sheets/templates/sheets/sheet_form.html | 21 +++ apps/sheets/templates/sheets/sheet_list.html | 74 ++++++++ apps/sheets/urls.py | 11 ++ apps/sheets/views.py | 134 +++++++++++++++ locale/fr/LC_MESSAGES/django.po | 159 +++++++++++++----- note_kfet/static/css/custom.css | 7 +- note_kfet/urls.py | 1 + 15 files changed, 591 insertions(+), 49 deletions(-) create mode 100644 apps/member/migrations/0009_auto_20220818_1301.py create mode 100644 apps/sheets/forms.py create mode 100644 apps/sheets/tables.py create mode 100644 apps/sheets/templates/sheets/food_form.html create mode 100644 apps/sheets/templates/sheets/meal_form.html create mode 100644 apps/sheets/templates/sheets/sheet_detail.html create mode 100644 apps/sheets/templates/sheets/sheet_form.html create mode 100644 apps/sheets/templates/sheets/sheet_list.html diff --git a/apps/member/migrations/0009_auto_20220818_1301.py b/apps/member/migrations/0009_auto_20220818_1301.py new file mode 100644 index 00000000..4e956532 --- /dev/null +++ b/apps/member/migrations/0009_auto_20220818_1301.py @@ -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'), + ), + ] diff --git a/apps/sheets/forms.py b/apps/sheets/forms.py new file mode 100644 index 00000000..32fe0b72 --- /dev/null +++ b/apps/sheets/forms.py @@ -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(), + } diff --git a/apps/sheets/migrations/0001_initial.py b/apps/sheets/migrations/0001_initial.py index 2e8c68bd..5ab044ac 100644 --- a/apps/sheets/migrations/0001_initial.py +++ b/apps/sheets/migrations/0001_initial.py @@ -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 import django.db.models.deletion @@ -10,8 +10,8 @@ class Migration(migrations.Migration): initial = True dependencies = [ + ('member', '0009_auto_20220818_1301'), ('note', '0006_trust'), - ('member', '0009_auto_20220818_1225'), ] operations = [ @@ -93,6 +93,7 @@ class Migration(migrations.Migration): ('name', models.CharField(max_length=255, verbose_name='name')), ('date', models.DateTimeField(default=django.utils.timezone.now, verbose_name='start date')), ('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={ 'verbose_name': 'note sheet', diff --git a/apps/sheets/models.py b/apps/sheets/models.py index b05d71a1..7ae3bce1 100644 --- a/apps/sheets/models.py +++ b/apps/sheets/models.py @@ -2,6 +2,7 @@ # SPDX-License-Identifier: GPL-3.0-or-later from django.db import models +from django.urls import reverse_lazy from django.utils import timezone from django.utils.translation import gettext_lazy as _ @@ -24,6 +25,18 @@ class Sheet(models.Model): 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: verbose_name = _("note sheet") 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)"), ) + def __str__(self): + return self.name + class Meta: verbose_name = _("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)"), ) + def __str__(self): + return self.name + class Meta: verbose_name = _("food option") 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)"), ) + def __str__(self): + return self.name + class Meta: verbose_name = _("meal") verbose_name_plural = _("meals") diff --git a/apps/sheets/tables.py b/apps/sheets/tables.py new file mode 100644 index 00000000..f2a41a28 --- /dev/null +++ b/apps/sheets/tables.py @@ -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,)) + } diff --git a/apps/sheets/templates/sheets/food_form.html b/apps/sheets/templates/sheets/food_form.html new file mode 100644 index 00000000..c62fec40 --- /dev/null +++ b/apps/sheets/templates/sheets/food_form.html @@ -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 %} +
+

+ {{ title }} +

+
+
+ {% csrf_token %} + {{ form|crispy }} + +
+
+
+{% endblock %} \ No newline at end of file diff --git a/apps/sheets/templates/sheets/meal_form.html b/apps/sheets/templates/sheets/meal_form.html new file mode 100644 index 00000000..c62fec40 --- /dev/null +++ b/apps/sheets/templates/sheets/meal_form.html @@ -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 %} +
+

+ {{ title }} +

+
+
+ {% csrf_token %} + {{ form|crispy }} + +
+
+
+{% endblock %} \ No newline at end of file diff --git a/apps/sheets/templates/sheets/sheet_detail.html b/apps/sheets/templates/sheets/sheet_detail.html new file mode 100644 index 00000000..a52a69ff --- /dev/null +++ b/apps/sheets/templates/sheets/sheet_detail.html @@ -0,0 +1,83 @@ +{% extends "base.html" %} + +{% load i18n %} +{% load pretty_money %} + +{% block content %} +
+
+

{{ sheet.name }}

+
+
+
+
+
+ {{ sheet.description }} +
+ {% if can_change_sheet %} + + {% endif %} +
+
+ +

{% trans "menu"|capfirst %} :

+
    + {% for meal in sheet.meal_set.all %} + + {{ meal }} ({{ meal.price|pretty_money }}) + {% if can_change_sheet %} + + + {% trans "Edit" %} + + {% endif %} + + {% endfor %} +
    + {% for food in sheet.food_set.all %} + + {{ food }} ({{ food.price|pretty_money }}) + {% if can_change_sheet %} + + + {% trans "Edit" %} + + {% endif %} + {% if food.option_set.all %} +
      + {% for option in food.available_options %} + + {{ option }}{% if option.extra_price %} ({{ option.extra_price|pretty_money }}){% endif %} + + {% endfor %} +
    + {% endif %} + + {% empty %} +
    + {% trans "The menu is empty for now." %} +
    + {% endfor %} +
+ +
+ {% if can_add_food %} + {% trans "Add new food" %} + {% endif %} + {% if can_add_meal %} + {% trans "Add new meal" %} + {% endif %} +
+
+ +
+{% endblock %} diff --git a/apps/sheets/templates/sheets/sheet_form.html b/apps/sheets/templates/sheets/sheet_form.html new file mode 100644 index 00000000..c62fec40 --- /dev/null +++ b/apps/sheets/templates/sheets/sheet_form.html @@ -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 %} +
+

+ {{ title }} +

+
+
+ {% csrf_token %} + {{ form|crispy }} + +
+
+
+{% endblock %} \ No newline at end of file diff --git a/apps/sheets/templates/sheets/sheet_list.html b/apps/sheets/templates/sheets/sheet_list.html new file mode 100644 index 00000000..563d7436 --- /dev/null +++ b/apps/sheets/templates/sheets/sheet_list.html @@ -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 %} +
+
+ + {% if can_create_sheet %} +
+ {% trans "Create a sheet" %} + {% endif %} +
+
+
+
+
+
+
{% trans "Note sheet listing" %}
+
+
+ {% render_table table %} +
+
+
+
+ +{% endblock %} +{% block extrajavascript %} + +{% endblock %} diff --git a/apps/sheets/urls.py b/apps/sheets/urls.py index abcf9534..3b7e91ed 100644 --- a/apps/sheets/urls.py +++ b/apps/sheets/urls.py @@ -3,7 +3,18 @@ from django.urls import path +from sheets.views import FoodCreateView, FoodUpdateView, MealCreateView, MealUpdateView, \ + SheetCreateView, SheetDetailView, SheetListView, SheetUpdateView + app_name = 'sheets' urlpatterns = [ + path('list/', SheetListView.as_view(), name="sheet_list"), + path('create/', SheetCreateView.as_view(), name="sheet_create"), + path('update//', SheetUpdateView.as_view(), name="sheet_update"), + path('detail//', SheetDetailView.as_view(), name="sheet_detail"), + path('food/create//', FoodCreateView.as_view(), name="food_create"), + path('food//update/', FoodUpdateView.as_view(), name="food_update"), + path('meal/create//', MealCreateView.as_view(), name="meal_create"), + path('meal//update/', MealUpdateView.as_view(), name="meal_update"), ] diff --git a/apps/sheets/views.py b/apps/sheets/views.py index 1d576f3f..1a241369 100644 --- a/apps/sheets/views.py +++ b/apps/sheets/views.py @@ -1,2 +1,136 @@ # Copyright (C) 2018-2022 by BDE ENS Paris-Saclay # 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,)) diff --git a/locale/fr/LC_MESSAGES/django.po b/locale/fr/LC_MESSAGES/django.po index 019afec9..afc19b5b 100644 --- a/locale/fr/LC_MESSAGES/django.po +++ b/locale/fr/LC_MESSAGES/django.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \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" "Last-Translator: elkmaennchen \n" "Language-Team: French \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/permission/models.py:330 #: 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/templates/wei/base.html:26 #: apps/wei/templates/wei/weimembership_form.html:14 @@ -96,7 +96,7 @@ msgstr "types d'activité" #: apps/activity/models.py:68 #: apps/activity/templates/activity/includes/activity_info.html:19 #: 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 msgid "description" msgstr "description" @@ -145,7 +145,7 @@ msgstr "" #: apps/activity/models.py:109 #: apps/activity/templates/activity/includes/activity_info.html:25 -#: apps/sheets/models.py:19 +#: apps/sheets/models.py:20 msgid "start date" msgstr "date de début" @@ -174,7 +174,7 @@ msgid "entry time" msgstr "heure d'entrée" #: 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" msgstr "note" @@ -337,7 +337,10 @@ msgstr "Entrée effectuée !" #: apps/member/templates/member/add_members.html:46 #: apps/member/templates/member/club_form.html:16 #: 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/wei/templates/wei/bus_form.html:17 #: apps/wei/templates/wei/busteam_form.html:17 @@ -1595,8 +1598,10 @@ msgid "Delete" msgstr "Supprimer" #: apps/note/tables.py:222 apps/note/templates/note/conso_form.html:132 -#: apps/wei/tables.py:49 apps/wei/tables.py:50 -#: apps/wei/templates/wei/base.html:89 +#: apps/sheets/templates/sheets/sheet_detail.html:21 +#: 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/busteam_detail.html:20 #: apps/wei/templates/wei/busteam_detail.html:40 @@ -2170,144 +2175,208 @@ msgstr "" msgid "Invalidate pre-registration" 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" msgstr "feuilles de notes" -#: apps/sheets/models.py:28 apps/sheets/models.py:41 apps/sheets/models.py:97 -#: apps/sheets/models.py:129 apps/sheets/models.py:246 +#: apps/sheets/models.py:30 +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" msgstr "feuille de note" -#: apps/sheets/models.py:35 apps/sheets/models.py:61 apps/sheets/models.py:62 -#: apps/sheets/models.py:74 apps/sheets/models.py:188 +#: apps/sheets/models.py:48 apps/sheets/models.py:77 apps/sheets/models.py:78 +#: apps/sheets/models.py:90 apps/sheets/models.py:210 msgid "food" msgstr "nourriture" -#: apps/sheets/models.py:45 apps/sheets/models.py:111 +#: apps/sheets/models.py:58 apps/sheets/models.py:130 msgid "price" msgstr "prix" -#: apps/sheets/models.py:51 +#: apps/sheets/models.py:64 msgid "destination club" 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" 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)" msgstr "" "Si mis à faux, cette option ne sera pas présentée (en cas de rupture de " "stock)" -#: apps/sheets/models.py:79 +#: apps/sheets/models.py:95 msgid "extra cost" msgstr "surcoût" -#: apps/sheets/models.py:89 +#: apps/sheets/models.py:108 msgid "food option" msgstr "option de nourriture" -#: apps/sheets/models.py:90 +#: apps/sheets/models.py:109 msgid "food options" msgstr "options de nourriture" -#: apps/sheets/models.py:107 +#: apps/sheets/models.py:126 msgid "content" msgstr "contenu" -#: apps/sheets/models.py:121 apps/sheets/models.py:162 +#: apps/sheets/models.py:143 apps/sheets/models.py:184 msgid "meal" msgstr "menu" -#: apps/sheets/models.py:122 +#: apps/sheets/models.py:144 msgid "meals" msgstr "menus" -#: apps/sheets/models.py:139 +#: apps/sheets/models.py:161 msgid "date" msgstr "date" -#: apps/sheets/models.py:144 +#: apps/sheets/models.py:166 msgid "gift" msgstr "don" -#: apps/sheets/models.py:148 apps/sheets/models.py:156 -#: apps/sheets/models.py:174 +#: apps/sheets/models.py:170 apps/sheets/models.py:178 +#: apps/sheets/models.py:196 msgid "order" msgstr "commande" -#: apps/sheets/models.py:149 +#: apps/sheets/models.py:171 msgid "orders" 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" msgstr "menu commandé" -#: apps/sheets/models.py:167 +#: apps/sheets/models.py:189 msgid "ordered meals" msgstr "menus commandés" -#: apps/sheets/models.py:194 +#: apps/sheets/models.py:216 msgid "options" msgstr "options" -#: apps/sheets/models.py:200 +#: apps/sheets/models.py:222 msgid "remark" msgstr "remarques" -#: apps/sheets/models.py:207 +#: apps/sheets/models.py:229 msgid "priority request" msgstr "demande de priorité" -#: apps/sheets/models.py:211 +#: apps/sheets/models.py:233 msgid "number" msgstr "numéro" -#: apps/sheets/models.py:212 +#: apps/sheets/models.py:234 msgid "How many times the user ordered this." msgstr "Combien de fois cet⋅te utilisateur⋅rice a commandé ceci." -#: apps/sheets/models.py:218 +#: apps/sheets/models.py:240 msgid "queued" msgstr "en attente" -#: apps/sheets/models.py:219 +#: apps/sheets/models.py:241 msgid "ready" msgstr "prêt" -#: apps/sheets/models.py:220 +#: apps/sheets/models.py:242 msgid "served" msgstr "servi" -#: apps/sheets/models.py:221 +#: apps/sheets/models.py:243 msgid "canceled" msgstr "annulé" -#: apps/sheets/models.py:223 +#: apps/sheets/models.py:245 msgid "status" msgstr "statut" -#: apps/sheets/models.py:229 +#: apps/sheets/models.py:251 msgid "served date" msgstr "date de service" -#: apps/sheets/models.py:233 apps/sheets/models.py:234 -#: apps/sheets/models.py:241 +#: apps/sheets/models.py:255 apps/sheets/models.py:256 +#: apps/sheets/models.py:263 msgid "ordered food" msgstr "nourriture commandée" -#: apps/sheets/models.py:259 +#: apps/sheets/models.py:281 msgid "sheet order transaction" msgstr "transaction de commande sur feuille de note" -#: apps/sheets/models.py:260 +#: apps/sheets/models.py:282 msgid "sheet order transactions" 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 msgid "Treasury" msgstr "Trésorerie" diff --git a/note_kfet/static/css/custom.css b/note_kfet/static/css/custom.css index 521e5a82..a9fe1ecb 100644 --- a/note_kfet/static/css/custom.css +++ b/note_kfet/static/css/custom.css @@ -97,13 +97,16 @@ body { .btn-primary:hover, .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; background-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); background-color: rgb(102, 83, 105); border-color: rgb(102, 83, 105); diff --git a/note_kfet/urls.py b/note_kfet/urls.py index 7fc37fa7..982e31d7 100644 --- a/note_kfet/urls.py +++ b/note_kfet/urls.py @@ -21,6 +21,7 @@ urlpatterns = [ path('activity/', include('activity.urls')), path('treasury/', include('treasury.urls')), path('wei/', include('wei.urls')), + path('sheets/', include('sheets.urls')), # Include Django Contrib and Core routers path('i18n/', include('django.conf.urls.i18n')),