Navbar works properly again

This commit is contained in:
2021-09-13 16:14:09 +01:00
parent 6458f016f0
commit 796f5b44b0
5 changed files with 23 additions and 25 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 164 KiB

View File

@@ -4,7 +4,7 @@
{% load invoices_waiting from filters %}
{% block titleheader %}
<a class="navbar-brand" href="/">RIGS</a>
<a class="navbar-brand" style="margin-left: auto; margin-right: auto;" href="/">RIGS</a>
{% endblock %}
{% block titleelements %}

View File

@@ -31,28 +31,26 @@
<a class="skip-link" href='#main'>Skip to content</a>
{% include "analytics.html" %}
{% block navbar %}
<nav class="navbar navbar-expand-lg navbar-dark bg-dark flex-nowrap text-nowrap" role="navigation">
<a class="navbar-brand" href="{% if request.user.is_authenticated %}https://members.nottinghamtec.co.uk{%else%}https://nottinghamtec.co.uk{%endif%}">
<nav class="navbar navbar-expand-lg navbar-dark bg-dark" role="navigation">
<div class="container">
<a class="navbar-brand" style="position: absolute; left:0.5em; top: 2px;" href="{% if request.user.is_authenticated %}https://members.nottinghamtec.co.uk{%else%}https://nottinghamtec.co.uk{%endif%}">
<img src="{% static 'imgs/logo.webp' %}" width="40" height="40" alt="TEC's Logo: Serif 'TEC' vertically next to a blue box with the words 'PA and Lighting', surrounded by graduated rings" id="logo">
</a>
<div class="container" style="padding-left: 0; padding-right: 0;">
<div class="row">
{% block titleheader %}
{% endblock %}
<button class="navbar-toggler ml-auto" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation" onclick="document.getElementById('logo').classList.toggle('d-none');">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav">
{% block titleelements %}
{% endblock %}
</ul>
<ul class="navbar-nav ml-auto">
{% block titleelements_right %}
{% endblock %}
</ul>
</div>
</div>
{% block titleheader %}
{% endblock %}
<button class="navbar-toggler ml-auto" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation" onclick="document.getElementById('logo').classList.toggle('d-none');">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse justify-content-between" id="navbarSupportedContent">
<ul class="navbar-nav">
{% block titleelements %}
{% endblock %}
</ul>
<ul class="navbar-nav align-self-end">
{% block titleelements_right %}
{% endblock %}
</ul>
</div>
</div>
</nav>
{% endblock %}

View File

@@ -1,4 +1,4 @@
from captcha.fields import ReCaptchaField
from hcaptcha.fields import hCaptchaField
from django import forms
from django.contrib.auth.forms import (AuthenticationForm, PasswordResetForm,
UserChangeForm, UserCreationForm)
@@ -9,7 +9,7 @@ from RIGS import models
# Registration
class ProfileRegistrationFormUniqueEmail(RegistrationFormUniqueEmail):
captcha = ReCaptchaField()
hcaptcha = hCaptchaField()
class Meta:
model = models.Profile
@@ -41,7 +41,7 @@ class EmbeddedAuthenticationForm(CheckApprovedForm):
class PasswordReset(PasswordResetForm):
captcha = ReCaptchaField(label='Captcha')
hcaptcha = hCaptchaField()
class ProfileCreationForm(UserCreationForm):

View File

@@ -1,4 +1,4 @@
<li class="nav-item dropdown" id="user">
<li class="nav-item dropdown align-self-end" id="user">
{% if user.is_authenticated %}
<a class="nav-link dropdown-toggle" href="#" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Hi {{ user.first_name }}