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 @@

Dein Profil

-

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!

@@ -19,7 +19,7 @@
diff --git a/templates/clients/bookings.html b/templates/clients/bookings.html new file mode 100644 index 0000000..06becac --- /dev/null +++ b/templates/clients/bookings.html @@ -0,0 +1,50 @@ +{% extends "clients/base.html" %} +{% block "dashboardcontent" %} +
+

Deine Buchungen

+
+
+
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+
+ +
+ + + + + + + + +

12

April 2021

+

Habbo Hotel

+
    +
  • Ankunft: 12. April 2021
  • +
  • Abreise: 19. April 2021
  • +
  • Preis: € 500,00
  • +
+ +
+
+
+ +
+{% endblock %} \ No newline at end of file diff --git a/templates/clients/profile.html b/templates/clients/profile.html index 0065a8b..a8830e9 100644 --- a/templates/clients/profile.html +++ b/templates/clients/profile.html @@ -31,4 +31,24 @@ +{% endblock %} +{% block "modal" %} + {% endblock %} \ No newline at end of file diff --git a/templates/frontend/base.html b/templates/frontend/base.html index 8b01d08..359c31c 100644 --- a/templates/frontend/base.html +++ b/templates/frontend/base.html @@ -149,9 +149,9 @@ {% trans "Mein Urlaub" %}