diff --git a/home/static/css/style.css b/home/static/css/style.css index 1683bfc9558cdb6cebfffc42df3618f37662a25d..c13207aee2b06f6a4b07cf5c689b2ab342f16cf7 100644 --- a/home/static/css/style.css +++ b/home/static/css/style.css @@ -1,6 +1,8 @@ :root { + --color-bg: #fefefe; --color_bg_1: #4c4c7c; --color_bg_2: #26263c; + --color_bg_3: #39395c; --color_sep: #eb811b; } @@ -49,6 +51,7 @@ nav { color: white; margin: 0; padding: 0 20px; + border-bottom: 6px solid var(--color_bg_1); } nav a { @@ -62,12 +65,16 @@ nav a { nav a:hover { transition-property: background-color; - background-color: var(--color_bg_1); + background-color: var(--color_bg_3); transition-duration: 0.5s; } +nav a.current { + background-color: var(--color_bg_1); +} + main { - background-color: white; + background-color: var(--color-bg); justify-content: center; text-align: justify; padding: 1px 30px; @@ -76,6 +83,7 @@ main { } main h2 { + color: var(--color_bg_2); padding-top: 20px; font-size: 1.5rem; font-weight: 300; diff --git a/home/templates/base.html b/home/templates/base.html index 7075047b4c1a7b6b284450d4a2b9ca29731a58cf..5eb252e1a952979d1f13eafcda267727db677429 100644 --- a/home/templates/base.html +++ b/home/templates/base.html @@ -25,10 +25,26 @@ </header> <nav> - <a href="/" class="internal">Inscriptions</a> - <a href="/" class="internal">Activités</a> - <a href="/" class="internal">FAQ</a> - <a href="/" class="internal">Bouton autre</a> + <a href="/" rel="text/html" + class={% if slug == "home" %}"current"{% else %}"internal"{% endif %}> + Acceuil + </a> + <a href="/inscription/" rel="text/html" + class={% if slug == "inscription" %}"current"{% else %}"internal"{% endif %}> + Inscriptions + </a> + <a href="/activites/" rel="text/html" + class={% if slug == "activites" %}"current"{% else %}"internal"{% endif %}> + Activités + </a> + <a href="/faq/" rel="text/html" + class={% if slug == "faq" %}"current"{% else %}"internal"{% endif %}> + FAQ + </a> + <a href="/undef/" rel="text/html" + class={% if slug == "undef" %}"current"{% else %}"internal"{% endif %}> + Bouton autre + </a> </nav> <main> diff --git a/home/urls.py b/home/urls.py index 355175e0cb0b91c2dcd9b20317443b9d31978138..ce62abf18c009585a430b0426cfc623813b0b326 100644 --- a/home/urls.py +++ b/home/urls.py @@ -2,5 +2,5 @@ from django.urls import path from . import views urlpatterns = [ - path('', views.home, name = 'home'), + path('', views.static_view, {"slug":"home"}, name = 'home'), ] \ No newline at end of file diff --git a/home/views.py b/home/views.py index 8e9bac250f3eb451c8f4e7574eaf3eac3f7b4083..4029562ed4e4b0bfaf789aab74eab660aa401d1e 100644 --- a/home/views.py +++ b/home/views.py @@ -1,4 +1,4 @@ from django.shortcuts import render -def home(request): - return render(request, 'home.html', {}) +def static_view(request, slug): + return render(request, slug+'.html', {'slug': slug})