From 2eeb8eee100c44e685057bc5ce20f6596ab013bf Mon Sep 17 00:00:00 2001 From: Mark Hoekveen Date: Tue, 20 Feb 2024 17:52:52 +0100 Subject: [PATCH] login thingy --- playlist/static/img/login.png | Bin 0 -> 749 bytes playlist/static/style.css | 10 +++++++ playlist/templates/Base.html | 3 --- playlist/templates/Login.html | 49 +++++++++++++++++++++++++--------- playlist/views.py | 8 ++++-- 5 files changed, 52 insertions(+), 18 deletions(-) create mode 100644 playlist/static/img/login.png diff --git a/playlist/static/img/login.png b/playlist/static/img/login.png new file mode 100644 index 0000000000000000000000000000000000000000..9d69b7e6ab2c41d32bc449a18d971d79b6ff5a7b GIT binary patch literal 749 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDB3?!H8JlO)ISkfJR9T^xl_H+M9WCijSl0AZa z85pY67#JE_7#My5g&JNkFq8r{zDi(Vu$sZZAYL$MSD+10LOsAI#1*8Vp#ex9IB?+q z|NkH+5dCNP{~tmFWk7t7Y-J}Pld&YoFPOpM*^M+1C&}C0g{42^W+0HmUgGKN%KnH= zLR>&jMUcS`D80?o#WBR<^wdfF{SP@vwDqgqU3hfvJ`tT)ixM6^aN5~8K`%xjv8=Fs zf~<4V=Gl2#-Li9Mdbt17*uPu*OMA%&-&+r>f88nH`(DC3ID5v17zTr9-%8g-N8VlZ zK58rDbxBLf4=)O1V&$6ByF$a)FI#!|yvS<1W%Bs>yr*<$Y2Yy+WSK| zVogx1!~Ms5YSoWc|LNtcO%vICWdcv3;C`l{WnD&j4R(?pg`Ez|Vy7f3T{v9E?)clQ z(JtS}DPec`@@O3>fJbv|^Mn>zVZ~M(k_F1O{ zn{){+QoG`Hyi+4}U#Gf_mlM-X9?zYk!mI9I7AR)Y)W0nHwMXb(YisqQ0}5S}mZ;oF zX3|?;bz7fnQp3JN*MkhtisX;-or%*3kZwr~Ojxs+q1Zb-JXV)CWcs25Eo@7suvDix ztc@2+OJ<(I9L8eA`t-(QErZnzIdQCO0$BzA=K*Qg&|<6D!m9A@%!C8<`)MX5lF!N|bSLf61d*T^Kq$k@uz%*xn6*TBTez(6wl g) Nomineren -
  • - Statistieken -
  • diff --git a/playlist/templates/Login.html b/playlist/templates/Login.html index 165d9e0..8df075f 100644 --- a/playlist/templates/Login.html +++ b/playlist/templates/Login.html @@ -1,13 +1,36 @@ -{% extends "Base.html" %} - -{% block main-content %} - {% if user.is_authenticated %} -

    Current user: {{ user.email }}

    -
    - {% csrf_token %} - -
    - {% else %} - Login - {% endif %} -{% endblock %} +{% load static %} + + + {% include "head.html" %} + + + + + diff --git a/playlist/views.py b/playlist/views.py index b6663b9..3e1a693 100644 --- a/playlist/views.py +++ b/playlist/views.py @@ -1,6 +1,6 @@ from django.shortcuts import render from django.views import View -from django.http import HttpResponse +from django.http import HttpResponse, HttpResponseRedirect from django.template.response import TemplateResponse from django.contrib.auth.mixins import LoginRequiredMixin import re @@ -13,7 +13,11 @@ spt = spotify.Spotify() class AuthView(View): def get(self, request): - return TemplateResponse(request, "Login.html", {}) + if request.user.is_authenticated: + #return TemplateResponse(request, "Nominate.html", {}) + return HttpResponseRedirect('/vote') + else: + return TemplateResponse(request, "Login.html", {}) class VoteView(LoginRequiredMixin, View): def get(self, request, error=None):