Skip to content
Snippets Groups Projects
Commit b55566c5 authored by Dorian Lesbre's avatar Dorian Lesbre
Browse files

Display current page in nav menu

parent 938c7770
No related branches found
No related tags found
No related merge requests found
: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;
......
......@@ -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>
......
......@@ -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
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})
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment