diff --git a/cof/settings/common.py b/cof/settings/common.py index ecf464fe..dd80a7b3 100644 --- a/cof/settings/common.py +++ b/cof/settings/common.py @@ -75,6 +75,7 @@ INSTALLED_APPS = [ "django.contrib.admindocs", "bda", "petitscours", + "journaldecaisse.apps.JournaldecaisseConfig", "captcha", "django_cas_ng", "bootstrapform", diff --git a/cof/urls.py b/cof/urls.py index 374c0f1a..9b24f932 100644 --- a/cof/urls.py +++ b/cof/urls.py @@ -16,6 +16,8 @@ from wagtail.admin import urls as wagtailadmin_urls from wagtail.core import urls as wagtail_urls from wagtail.documents import urls as wagtaildocs_urls + + from gestioncof import csv_views, views as gestioncof_views from gestioncof.autocomplete import autocomplete from gestioncof.urls import ( @@ -43,6 +45,8 @@ urlpatterns = [ path("event/", include(events_patterns)), # Calendrier path("calendar/", include(calendar_patterns)), + #Journal de Caisse + path('journaldecaisse/', include('journaldecaisse.urls', namespace="journaldecaisse")), # Clubs path("clubs/", include(clubs_patterns)), # Authentification diff --git a/gestioncof/templates/gestioncof/home.html b/gestioncof/templates/gestioncof/home.html index e534f687..bbaeae44 100644 --- a/gestioncof/templates/gestioncof/home.html +++ b/gestioncof/templates/gestioncof/home.html @@ -91,6 +91,24 @@ {% endfor %} + +
Date | +Cofeux.se | +Objet | +Moyen de Paiement | +Montant | + + + {% for entry in entry_list %} +
---|---|---|---|---|
{{ entry.entry_date|date:"M d, Y" }} | +{{ entry.cofeux_id }} | +{{ entry.entry_text }} | +{{ entry.payment_type}} | +{{ entry.entry_amount }}€ | +
Aucune demande :(
+{% endif %} +{% endblock %} diff --git a/journaldecaisse/urls.py b/journaldecaisse/urls.py index 3ef24d97..c7547dc2 100644 --- a/journaldecaisse/urls.py +++ b/journaldecaisse/urls.py @@ -2,6 +2,7 @@ from django.urls import path from . import views +app_name = 'journaldecaisse' urlpatterns = [ path('', views.index, name='index'), ] \ No newline at end of file diff --git a/journaldecaisse/views.py b/journaldecaisse/views.py index 94bc3189..a7add974 100644 --- a/journaldecaisse/views.py +++ b/journaldecaisse/views.py @@ -1,5 +1,8 @@ from django.http import HttpResponse - +from .models import JournalEntry +from django.shortcuts import render def index(request): - return HttpResponse("Hello, world. You're at the polls index.") \ No newline at end of file + entry_list = JournalEntry.objects.order_by('entry_date') + context = {'entry_list': entry_list} + return render(request, 'journaldecaisse/index.html', context) \ No newline at end of file