+{% endblock %}
\ No newline at end of file
diff --git a/home/urls.py b/home/urls.py
new file mode 100644
index 0000000..76b4fa6
--- /dev/null
+++ b/home/urls.py
@@ -0,0 +1,11 @@
+from django.urls import path, include
+from wagtail.core import urls as wagtail_urls
+
+from home import views
+
+app_name = "home"
+
+urlpatterns = [
+ path("", include(wagtail_urls)),
+ path("profil/", views.UserView.as_view(), name="profile")
+]
diff --git a/home/views.py b/home/views.py
new file mode 100644
index 0000000..0f91a5e
--- /dev/null
+++ b/home/views.py
@@ -0,0 +1,8 @@
+from django.contrib.auth import get_user_model
+from django.views.generic import DetailView
+
+
+class UserView(DetailView):
+ template_name = "home/user_view.html"
+ model = get_user_model()
+ slug_field = "username"
diff --git a/server/settings/base.py b/server/settings/base.py
index 33cf846..d114ff7 100644
--- a/server/settings/base.py
+++ b/server/settings/base.py
@@ -13,6 +13,8 @@
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
import os
+from django.urls import reverse_lazy as reverse
+
PROJECT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
BASE_DIR = os.path.dirname(PROJECT_DIR)
@@ -25,6 +27,7 @@
INSTALLED_APPS = [
'api',
'home',
+ 'user',
'search',
'wagtail.contrib.forms',
@@ -44,6 +47,7 @@
'taggit',
'corsheaders',
'sass_processor',
+ 'bulma',
'django.contrib.admin',
'django.contrib.auth',
@@ -130,6 +134,10 @@
USE_TZ = True
+LOGIN_URL = reverse("user:login")
+LOGOUT_URL = reverse("user:logout")
+LOGIN_REDIRECT_URL = LOGOUT_REDIRECT_URL = "/"
+
# CORS
CORS_ORIGIN_WHITELIST = [
@@ -153,9 +161,6 @@
# SASS configure
-SASS_PROCESSOR_INCLUDE_PATHS = [
- os.path.join(BASE_DIR, "node_modules")
-]
SASS_PROCESSOR_INCLUDE_FILE_PATTERN = r'.s[ac]ss$'
SASS_OUTPUT_STYLE = 'compact'
diff --git a/server/static/js/navbar.js b/server/static/js/interaction-base.js
similarity index 77%
rename from server/static/js/navbar.js
rename to server/static/js/interaction-base.js
index 9b18a3e..65ab4ba 100644
--- a/server/static/js/navbar.js
+++ b/server/static/js/interaction-base.js
@@ -22,4 +22,7 @@ document.addEventListener('DOMContentLoaded', () => {
});
}
+ // Destroy notification with close buttons
+ const $notificationDeleteButtons = document.querySelectorAll(".notification .delete");
+ $notificationDeleteButtons.forEach(n => console.log("notification delete", n));
});
\ No newline at end of file
diff --git a/server/static/sass/_overrides.sass b/server/static/sass/_overrides.sass
index c041066..fdfaa80 100644
--- a/server/static/sass/_overrides.sass
+++ b/server/static/sass/_overrides.sass
@@ -2,4 +2,9 @@
text-align: justify
max-width: 60em
margin-left: auto
- margin-right: auto
\ No newline at end of file
+ margin-right: auto
+
+.form-wrapper
+ max-width: 10em
+ margin-left: auto
+ margin-right: auto
diff --git a/server/static/sass/_variables.sass b/server/static/sass/_variables.sass
index 877eb17..baec3cb 100644
--- a/server/static/sass/_variables.sass
+++ b/server/static/sass/_variables.sass
@@ -12,6 +12,6 @@ $scheme-main: #eee1e1
$scheme-bis: darken($scheme-main, 3)
$scheme-ter: darken($scheme-main, 8)
-$link: $accent
+$link: $secondary
$custom-colors: ("accent": ($accent, findColorInvert($accent)), "secondary": ($secondary, findColorInvert($secondary)))
diff --git a/server/templates/base.html b/server/templates/base.html
index 849299d..9ece628 100644
--- a/server/templates/base.html
+++ b/server/templates/base.html
@@ -11,7 +11,7 @@
{% endblock %}
{% block title_suffix %}
{% with self.get_site.site_name as site_name %}
- {% if site_name %}- {{ site_name }}{% endif %}
+ {% if site_name %}- {{ site_name }}{% else %}- Tutorat Associatif Toulousain{% endif %}
{% endwith %}
{% endblock %}
@@ -31,11 +31,10 @@
{% wagtailuserbar %}
{% block header %}{% include "include/navbar.html" %}{% endblock %}
-
+{% include "include/messages.html" %}{% block content %}{% endblock %}
-
-
+
{% block extra_js %}
{# Override this in templates to add extra javascript #}
{% endblock %}
diff --git a/server/templates/form_view_base.html b/server/templates/form_view_base.html
new file mode 100644
index 0000000..ae09ba1
--- /dev/null
+++ b/server/templates/form_view_base.html
@@ -0,0 +1,14 @@
+{% extends "transitive_base.html" %}
+{% load bulma_tags %}
+
+{% block transitive %}
+
+
{{ title }}
+
{{ subtitle|safe|default:"" }}
+
+
+{% endblock %}
\ No newline at end of file
diff --git a/server/templates/include/messages.html b/server/templates/include/messages.html
new file mode 100644
index 0000000..4d59d05
--- /dev/null
+++ b/server/templates/include/messages.html
@@ -0,0 +1,7 @@
+
+
+ {% for message in messages %}
+
{{ message }}
+ {% endfor %}
+
+
\ No newline at end of file
diff --git a/server/templates/include/navbar.html b/server/templates/include/navbar.html
index c477bff..bba11d2 100644
--- a/server/templates/include/navbar.html
+++ b/server/templates/include/navbar.html
@@ -31,6 +31,16 @@
+ {% if request.user.is_authenticated %}
+ Déconnexion
+ {% else %}
+