diff --git a/home/templates/inscription.html b/home/templates/inscription/closed.html similarity index 100% rename from home/templates/inscription.html rename to home/templates/inscription/closed.html diff --git a/home/templates/inscription/signin.html b/home/templates/inscription/signin.html new file mode 100644 index 0000000000000000000000000000000000000000..904613c55d940efdb2f0ca3d87b6e52a45216655 --- /dev/null +++ b/home/templates/inscription/signin.html @@ -0,0 +1,10 @@ +{% extends "base.html" %} + +{% block nav_inscription %}current{% endblock %} + +{% block "content" %} + <h2>Inscriptions</h2> + <p>Vous devez être connecté pour pouvoir vous inscrire à l'événement.</p> + <p>Aller à la page de <a href="{% url 'accounts:login' %}">connexion</a> pour vous connectez + ou à celle de <a href="{% url 'accounts:create' %}">création de compte</a> si vous n'avez pas de compte.</p> +{% endblock %} \ No newline at end of file diff --git a/home/urls.py b/home/urls.py index 21ef086dcd534939ed60c4fc6c82bbcdc0e5bd88..565dc95ddb67d73af1439928b04cafd2a5f54292 100644 --- a/home/urls.py +++ b/home/urls.py @@ -8,7 +8,7 @@ sitemaps = {"static_pages": views.StaticViewSitemap} urlpatterns = [ path('', views.static_view, {"template": "home.html"}, name = 'home'), - path('inscription/', views.static_view, {"template":"inscription.html"}, name = 'inscription'), + path('inscription/', views.sign_up, name = 'inscription'), path('activites/', views.static_view, {"template":"activites.html"}, name = 'activites'), path('faq/', views.static_view, {"template":"faq.html"}, name = 'FAQ'), path('favicon.ico', RedirectView.as_view(url='/static/imgs/favicon.ico')), diff --git a/home/views.py b/home/views.py index 8f2b6466a4b88b9d63f389aa7154630fede63da7..67e31a512792d0abb4790f379698817741b15cc7 100644 --- a/home/views.py +++ b/home/views.py @@ -13,8 +13,10 @@ def static_view(request, template): def sign_up(request): """Page d'inscription""" if not settings.REGISTRATION_EVENT_INSCRIPTIONS_OPEN: - return static_view(request, "inscription.html") - + return static_view(request, "inscription/closed.html") + if not request.user.is_authenticated: + return static_view(request, "inscription/signin.html") + # TODO : actual inscription form class StaticViewSitemap(Sitemap):