diff --git a/playlist/static/img/login.png b/playlist/static/img/login.png new file mode 100644 index 0000000..9d69b7e Binary files /dev/null and b/playlist/static/img/login.png differ diff --git a/playlist/static/style.css b/playlist/static/style.css index f96cfcb..c3b484e 100644 --- a/playlist/static/style.css +++ b/playlist/static/style.css @@ -38,6 +38,11 @@ body { min-width: 300px; } +.window.popup.login { + width: 380px; + left: calc(50% - 190px); +} + .window.popup .window-body { display: flex; flex-flow: row nowrap; @@ -58,6 +63,11 @@ body { background-image: url('img/check.png'); } +.window.popup .window-body .icon.login { + background-image: url('img/login.png'); + background-attachment:unset; +} + .window.popup .window-body .icon.error { background-image: url('img/error.png'); } diff --git a/playlist/templates/Base.html b/playlist/templates/Base.html index 2eb6a6a..4ce0c6a 100644 --- a/playlist/templates/Base.html +++ b/playlist/templates/Base.html @@ -25,9 +25,6 @@
  • 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):