1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2025-06-21 01:48:21 +02:00

Use custom inputs for date picker and amounts

This commit is contained in:
Yohann D'ANELLO
2020-03-27 13:50:02 +01:00
parent 45b14ed1bd
commit f81e2b5b5b
16 changed files with 518 additions and 62 deletions

View File

@ -9,6 +9,7 @@ from django.utils.translation import gettext_lazy as _
from django.views.generic import CreateView, UpdateView
from django_tables2 import SingleTableView
from django.urls import reverse_lazy
from note_kfet.inputs import AmountInput
from permission.backends import PermissionBackend
from .forms import TransactionTemplateForm
@ -40,6 +41,7 @@ class TransactionCreateView(LoginRequiredMixin, SingleTableView):
"""
context = super().get_context_data(**kwargs)
context['title'] = _('Transfer money')
context['amount_widget'] = AmountInput(attrs={"id": "amount"})
context['polymorphic_ctype'] = ContentType.objects.get_for_model(Transaction).pk
context['special_polymorphic_ctype'] = ContentType.objects.get_for_model(SpecialTransaction).pk
context['special_types'] = NoteSpecial.objects.order_by("special_type").all()