diff --git a/clients/urls.py b/clients/urls.py index 8dc9ac0..5bf9d0d 100644 --- a/clients/urls.py +++ b/clients/urls.py @@ -1,6 +1,6 @@ from django.urls import path -from .views import ClientRegistrationView, ClientProfileView, ClientDashboardView +from .views import ClientRegistrationView, ClientProfileView, ClientDashboardView, ClientBookingsView app_name = "clients" @@ -8,4 +8,5 @@ urlpatterns = [ path('dashboard/', ClientDashboardView.as_view(), name="dashboard"), path('register/', ClientRegistrationView.as_view(), name="register"), path('profile/', ClientProfileView.as_view(), name="profile"), + path('bookings/', ClientBookingsView.as_view(), name="bookings"), ] \ No newline at end of file diff --git a/clients/views.py b/clients/views.py index 688db5c..019c17a 100644 --- a/clients/views.py +++ b/clients/views.py @@ -1,12 +1,14 @@ -from django.views.generic import CreateView, UpdateView, TemplateView +from django.views.generic import CreateView, UpdateView, TemplateView, ListView from django.urls import reverse_lazy from django.shortcuts import redirect from django.contrib import messages from .models import ClientProfile +from .mixins import ClientProfileRequiredMixin from localauth.mixins import LoginRequiredMixin from public.mixins import InConstructionMixin +from auction.models import Inquiry class ClientRegistrationView(InConstructionMixin, LoginRequiredMixin, CreateView): model = ClientProfile @@ -59,4 +61,11 @@ class ClientProfileView(InConstructionMixin, LoginRequiredMixin, UpdateView): return redirect("clients:register") class ClientDashboardView(InConstructionMixin, LoginRequiredMixin, TemplateView): - template_name = "clients/dashboard.html" \ No newline at end of file + template_name = "clients/dashboard.html" + +class ClientBookingsView(InConstructionMixin, ClientProfileRequiredMixin, ListView): + model = Inquiry + template_name = "clients/bookings.html" + + def get_queryset(self): + return Inquiry.objects.filter(client=self.request.user.clientprofile) \ No newline at end of file diff --git a/templates/clients/base.html b/templates/clients/base.html index 129eb8c..5c2b131 100644 --- a/templates/clients/base.html +++ b/templates/clients/base.html @@ -8,7 +8,7 @@
Servus {{ request.user.get_full_name }}, willkommen in deinem JourneyJoker-Profil!
+Servus {{ request.user.clientprofile.full_name }}, willkommen in deinem JourneyJoker-Profil!
Hier siehst du all deine gebuchten Reisen und kannst deine Daten verwalten!
12April 2021 |
+
+ Habbo Hotel+
|
+ + |