Allow unauthenticated users access to about page

This commit is contained in:
Winston
2023-10-18 11:20:51 +02:00
parent e05647b8d4
commit 5078915992
7 changed files with 26 additions and 32 deletions

View File

@@ -129,6 +129,10 @@ h4 {
flex: 1;
}
.flex .noshrink {
flex-shrink: 0;
}
.actions {
float: right;
margin-top: 20px;

View File

@@ -14,6 +14,7 @@
{% include "includes/navbar.html" %}
{% endblock %}
</nav>
{% if user.is_authenticated %}
<span class="username">{{ user }}</span>
<form action="{% url 'oidc_logout' %}" method="post" id="logout-link">
{% csrf_token %}
@@ -21,7 +22,11 @@
<i class="fas fa-sign-out-alt"></i>
</button>
</form>
{% else %}
<a class="fabutton noshrink" href="{% url 'oidc_authentication_init' %}">
Login <i class="fas fa-sign-in-alt"></i>
</a>
{% endif %}
</div>
</header>
{% if messages %}

View File

@@ -1,7 +1,11 @@
<ul>
{% if can_vote %}<li class="{% if active == "vote" %}active{% endif %}"><a href="{% url 'vote' %}">Vote</a></li>{% endif %}
{% if user.is_staff %}<li class="{% if active == "showreels" %}active{% endif %}"><a href="{% url 'showreels' %}">Showreels</a></li>{% endif %}
<li class="{% if active == "submissions" %}active{% endif %}"><a href="{% url 'submissions' %}">My submissions</a></li>
<li class="{% if active == "about" %}active{% endif %}"><a href="{% url 'about' %}">About</a></li>
{% if user.is_staff %}<li><a href="{% url 'admin:index' %}">Admin</a></li>{% endif %}
{% if user.is_authenticated %}
{% if can_vote %}<li class="{% if active == 'vote' %}active{% endif %}"><a href="{% url 'vote' %}">Vote</a></li>{% endif %}
{% if user.is_staff %}<li class="{% if active == 'showreels' %}active{% endif %}"><a href="{% url 'showreels' %}">Showreels</a></li>{% endif %}
<li class="{% if active == 'submissions' %}active{% endif %}"><a href="{% url 'submissions' %}">My submissions</a></li>
{% endif %}
<li class="{% if active == 'about' %}active{% endif %}"><a href="{% url 'about' %}">About</a></li>
{% if user.is_authenticated and user.is_staff %}
<li><a href="{% url 'admin:index' %}">Admin</a></li>
{% endif %}
</ul>

View File

@@ -1,23 +0,0 @@
{% load static %}
<!DOCTYPE html>
<html>
<link rel="stylesheet" type="text/css" href="{% static 'vote/css/main.css' %}">
<body>
{% if messages %}
<ul class="messages">
{% for message in messages %}
<li{% if message.tags %} class="{{ message.tags }}"{% endif %}>{{ message }}</li>
{% endfor %}
</ul>
{% endif %}
<div class="container">
<div class="">
<div class="content">
{% block content %}
{% endblock %}
</div>
</div>
</div>
</body>
</html>

View File

@@ -1,7 +1,9 @@
{% extends 'registration/base_login.html' %}
{% extends 'base.html' %}
{% load static %}
{% block title %}{% endblock %}
{% block content %}
<div class="login_wrapper">
<img src="{% static 'vote/images/Godot_logo.svg' %}" alt="Godot Engine" width="300px">

View File

@@ -1,7 +1,9 @@
{% extends 'registration/base_login.html' %}
{% extends 'base.html' %}
{% load static %}
{% block title %}{% endblock %}
{% block content %}
<div class="login_wrapper">
<img src="{% static 'vote/images/Godot_logo.svg' %}" alt="Godot Engine" width="300px">

View File

@@ -178,7 +178,7 @@ class ShowreelListView(LoginRequiredMixin, UserPassesTestMixin, ListView):
return self.request.user.is_staff
# Display the about page
class AboutView(LoginRequiredMixin, TemplateView):
class AboutView(TemplateView):
template_name = "vote/about.html"
# Download a csv of a showreel results