Skip to content

Commit

Permalink
Template view to book meeting
Browse files Browse the repository at this point in the history
  • Loading branch information
Guilouf committed Feb 14, 2025
1 parent 30d8f84 commit eeb4580
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 7 deletions.
24 changes: 24 additions & 0 deletions lemarche/templates/auth/meeting_calendar.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{% extends BASE_TEMPLATE %}
{% load dsfr_tags process_dict static humanize wagtailcore_tags advert_cms %}
{% block page_title %}
Prise de rendez-vous
{% endblock page_title %}

{% block breadcrumb %}
{% process_dict root_dir=HOME_PAGE_PATH current="Prise de rendez-vous" as breadcrumb_data %}
{% dsfr_breadcrumb breadcrumb_data %}
{% endblock breadcrumb %}
{% block content %}
<section>
<div class="fr-container">
<div class="fr-grid-row">
<div class="fr-col-12 fr-col-lg-10">
<h2>Prenez rendez-vous pour activer votre compte</h2>
<span>
Veuillez sélectionner un créneau
</span>
</div>
</div>
</div>
</section>
{% endblock content %}
3 changes: 2 additions & 1 deletion lemarche/www/auth/urls.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from django.contrib.auth import views as auth_views
from django.urls import path, reverse_lazy

from lemarche.www.auth.views import LoginView, PasswordResetView, SignupView
from lemarche.www.auth.views import LoginView, MeetingCalendarView, PasswordResetView, SignupView


# https://docs.djangoproject.com/en/dev/topics/http/urls/#url-namespaces-and-included-urlconfs
Expand All @@ -11,6 +11,7 @@
path("login/", LoginView.as_view(), name="login"),
path("logout/", auth_views.LogoutView.as_view(template_name="auth/logged_out.html"), name="logout"),
path("signup/", SignupView.as_view(), name="signup"),
path("rendez-vous/", MeetingCalendarView.as_view(), name="booking-meeting-view"),
path("password-reset/", PasswordResetView.as_view(), name="password_reset"),
path(
"password-reset/sent/",
Expand Down
12 changes: 6 additions & 6 deletions lemarche/www/auth/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from django.http import HttpResponseRedirect
from django.urls import reverse_lazy
from django.utils.safestring import mark_safe
from django.views.generic import CreateView
from django.views.generic import CreateView, TemplateView

from lemarche.users.models import User
from lemarche.utils.emails import add_to_contact_list
Expand Down Expand Up @@ -99,17 +99,13 @@ def get_success_url(self):
- next_url if there is a next param
- or dashboard if SIAE
"""
success_url = reverse_lazy("wagtail_serve", args=("",))
success_url = reverse_lazy("auth:booking-meeting-view")
next_url = self.request.GET.get("next", None)
# sanitize next_url
if next_url:
safe_url = get_safe_url(self.request, param_name="next")
if safe_url:
return safe_url
elif self.request.POST.get("kind") == User.KIND_SIAE:
return reverse_lazy("dashboard:home")
elif self.request.POST.get("kind") == User.KIND_BUYER:
return reverse_lazy("siae:search_results")
return success_url

def get_success_message(self, cleaned_data):
Expand All @@ -134,3 +130,7 @@ def get_success_url(self):
success_url = super().get_success_url()
user_email = self.request.POST.get("email")
return f"{success_url}?email={user_email}"


class MeetingCalendarView(TemplateView):
template_name = "auth/meeting_calendar.html"

0 comments on commit eeb4580

Please sign in to comment.