diff --git a/accounts/templates/profile.html b/accounts/templates/profile.html index 19001005d0c6fa32ba4deaf6a77d333c42351c0e..fe7c5710c04ca79aefbb5e185eb24af1c00ff05c 100644 --- a/accounts/templates/profile.html +++ b/accounts/templates/profile.html @@ -55,7 +55,7 @@ <br><br> {% endif %} -<div class="flex"> +<div class="flex wrap"> {% if user.profile.is_registered %} {% if settings.inscriptions_open %} <a class="button" href="{% url 'desinscription' %}">Me désinscrire</a> diff --git a/home/static/css/style.css b/home/static/css/style.css index fd39839d9ada3253c75b45242573927c3725816a..47c2ae616eb4a85eaf14e47e5d14060a4433f282 100644 --- a/home/static/css/style.css +++ b/home/static/css/style.css @@ -102,6 +102,38 @@ nav a:hover { nav a.current { background-color: var(--color_bg_1); } +nav a.icon { + display: none; + width: 40px; +} + /* hide all links except home and display menu icon */ +@media (max-width: 600px) { + nav { + padding: 0; + } + nav a:not(:first-child) {display: none;} + nav a.icon { + float: right; + display: block; + } + /* The "responsive" class is added bu JS when the user click the menu icon */ + nav.responsive { + position: relative; + flex-direction: column; + justify-content: start; + } + nav.responsive a.icon { + position: absolute; + right: 0px; + top: 0; + } + nav.responsive a { + float: none; + display: block; + } + +} + main { background-color: var(--color-bg); diff --git a/home/templates/base.html b/home/templates/base.html index 42874c013530f84db52d6016c19855fc8acc3590..f883b0cd6ae2c43b86431da32441d2c72bfa2916 100644 --- a/home/templates/base.html +++ b/home/templates/base.html @@ -33,7 +33,18 @@ </div> </header> - <nav> + <script type="text/javascript"> + function toggle_menu() { + var nav = document.getElementById("nav"); + if (nav.className === "") { + nav.className += "responsive"; + } else { + nav.className = ""; + } + } + </script> + + <nav id="nav"> <a href="{% url 'home' %}" rel="text/html" class="{% block nav_home %}{% endblock %}"> Accueil @@ -67,6 +78,9 @@ Administration </a> {% endif %} + <a href="javascript:void(0);" class="icon" onclick="toggle_menu()"> + <i class="fa fa-bars"></i> + </a> </nav> <main> diff --git a/interludes/settings.py b/interludes/settings.py index 25e9b60e7e2030acb6d21b70e9bbe1fed1174a03..70d9fedde443320be595ef44a0118879f99476e6 100644 --- a/interludes/settings.py +++ b/interludes/settings.py @@ -27,7 +27,7 @@ DEBUG = True ADMINS = [("respos", "respointerludes2021@ens.psl.eu"),] -ALLOWED_HOSTS = [] +ALLOWED_HOSTS = ['localhost', '192.168.43.13'] # Application definition