From 0de47c132166a02a91c5438d54399d5861414f13 Mon Sep 17 00:00:00 2001 From: Michele de Barros Santos Date: Thu, 28 Sep 2023 20:10:07 -0300 Subject: [PATCH] feat: links barra de navegacao --- db.sqlite3 | Bin 159744 -> 159744 bytes filme/templates/criarconta.html | 17 ++++++++++ filme/templates/editarperfil.html | 17 ++++++++++ filme/templates/logout.html | 20 +++++++++++- filme/urls.py | 10 +++--- filme/views.py | 24 ++++++++------ static/css/style_criarconta.css | 3 ++ static/css/style_editarperfil.css | 4 +++ static/css/style_logout.css | 50 ++++++++++++++++++++++++++++++ templates/navbar.html | 16 ++++++++-- 10 files changed, 145 insertions(+), 16 deletions(-) create mode 100644 filme/templates/criarconta.html create mode 100644 filme/templates/editarperfil.html create mode 100644 static/css/style_criarconta.css create mode 100644 static/css/style_editarperfil.css diff --git a/db.sqlite3 b/db.sqlite3 index 7f81c06497c998140fa0af5902766d55772c86d7..6606a28ea583329f2ab82fa769b7c8671f2ce9fb 100644 GIT binary patch delta 281 zcmZp8z}fJCbAmLZ&qNt#MxVxntqF`C{DKw=1_o9J=2oUgdWPnPMi%DN&-gG&wO{6E z+lzy98X6(H$lTn*c$)(givTmw9oyLhn6C2cF)%Qw5OM<-P!Y)G Q{Es#ZHr(cymcwm404rEfApigX delta 272 zcmZp8z}fJCbAmLZ{X`jOM*GHutqF`C{DNi*1_o9}mR3fFdWNP(#)byd&-gG&wO{6E z+eVcJ%H&dzlt)mFDD^4Y!hI7 J#xI52OaM&TP~QLm diff --git a/filme/templates/criarconta.html b/filme/templates/criarconta.html new file mode 100644 index 00000000..02f49a28 --- /dev/null +++ b/filme/templates/criarconta.html @@ -0,0 +1,17 @@ +{% extends 'base.html' %} + +{% block title %} + Criar Conta +{% endblock %} + +{% block head %} +{% load static %} + +{% endblock %} + +{% block content %} +
+

Criar Conta

+ +
+{% endblock %} diff --git a/filme/templates/editarperfil.html b/filme/templates/editarperfil.html new file mode 100644 index 00000000..b0e62302 --- /dev/null +++ b/filme/templates/editarperfil.html @@ -0,0 +1,17 @@ +{% extends 'base.html' %} + +{% block title %} + Edição de Perfil +{% endblock %} + +{% block head %} +{% load static %} + +{% endblock %} + +{% block content %} +
+

Edição do Perfil

+ +
+{% endblock %} diff --git a/filme/templates/logout.html b/filme/templates/logout.html index 5f28d069..04259c31 100644 --- a/filme/templates/logout.html +++ b/filme/templates/logout.html @@ -11,6 +11,24 @@ {% block content %}
-

Logout

+
+
+ Logout realizado com sucesso. +
+ + +
+
{% endblock %} diff --git a/filme/urls.py b/filme/urls.py index fb5c5a29..24284855 100644 --- a/filme/urls.py +++ b/filme/urls.py @@ -1,5 +1,5 @@ from django.urls import path, include -from .views import Homepage, HomeFilmes, DetalhesFilme, PesquisaFilme +from .views import Homepage, HomeFilmes, DetalhesFilme, PesquisaFilme, EditarPerfil, CriarConta from django.contrib.auth import views as auth_view @@ -10,9 +10,11 @@ path('', Homepage.as_view(), name='homepage'), path('filmes/', HomeFilmes.as_view(), name='homefilmes'), path('filmes/', DetalhesFilme.as_view(), name='detalhesfilme'), - path('pesquisa', PesquisaFilme.as_view(), name='pesquisafilme'), - path('login', auth_view.LoginView.as_view( + path('pesquisa/', PesquisaFilme.as_view(), name='pesquisafilme'), + path('login/', auth_view.LoginView.as_view( template_name='login.html'), name='login'), - path('logout', auth_view.LogoutView.as_view( + path('logout/', auth_view.LogoutView.as_view( template_name='logout.html'), name='logout'), + path('editarperfil/', EditarPerfil.as_view(), name='editarperfil'), + path('criarconta/', CriarConta.as_view(), name='criarconta'), ] diff --git a/filme/views.py b/filme/views.py index a2afddf7..d9302db2 100644 --- a/filme/views.py +++ b/filme/views.py @@ -1,4 +1,4 @@ -from django.shortcuts import render +from django.shortcuts import render, redirect from .models import Filme from django.views.generic import TemplateView, ListView, DetailView from django.contrib.auth.mixins import LoginRequiredMixin @@ -9,6 +9,14 @@ class Homepage(TemplateView): template_name = 'homepage.html' + def get(self, request, *args, **kwargs): + if request.user.is_authenticated: + # Redireciona para o app_name filme url name homefilmes + return redirect('filme:homefilmes') + else: + # Redireciona para a url final da view neste caso a homepage + return super().get(request, *args, **kwargs) + class HomeFilmes(LoginRequiredMixin, ListView): template_name = "homefilmes.html" @@ -55,12 +63,10 @@ def get_queryset(self): else: return None -# def homepage(request): -# return render(request, "homepage.html") -#url - view - template -# def homefilmes(request): -# context = {} -# lista_filmes = Filme.objects.all() # pega todos os objetos do banco de dados -# context['lista_filmes'] = lista_filmes -# return render(request, "homefilmes.html", context) +class EditarPerfil(LoginRequiredMixin, TemplateView): + template_name = 'editarperfil.html' + + +class CriarConta(TemplateView): + template_name = 'criarconta.html' diff --git a/static/css/style_criarconta.css b/static/css/style_criarconta.css new file mode 100644 index 00000000..fc54b212 --- /dev/null +++ b/static/css/style_criarconta.css @@ -0,0 +1,3 @@ +.content { + padding-top: 4.68rem; +} diff --git a/static/css/style_editarperfil.css b/static/css/style_editarperfil.css new file mode 100644 index 00000000..837af4f5 --- /dev/null +++ b/static/css/style_editarperfil.css @@ -0,0 +1,4 @@ +.content{ + padding-top: 4.68rem; + min-height: 100vh; +} diff --git a/static/css/style_logout.css b/static/css/style_logout.css index e69de29b..8fe76b96 100644 --- a/static/css/style_logout.css +++ b/static/css/style_logout.css @@ -0,0 +1,50 @@ + +.header { + min-height: 100vh; + position: relative; /* Adicione uma posição relativa para que possamos posicionar o pseudo-elemento */ + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; +} + +.header::before { + content: ""; + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + background-image: url("../images/background_netflix.jpg"); + background-repeat: no-repeat; + background-blend-mode: overlay; + background-size: cover; /* Ajuste para cobrir todo o cabeçalho */ + background-color: rgb(0, 0, 0, 0.7); + opacity: 0.7; /* Opacidade para a imagem de fundo */ + z-index: -1; /* Coloque o pseudo-elemento atrás do conteúdo */ +} + +.title-header { + color: rgb(255, 255, 255); + font: 2rem bold; + padding: 0.8rem; +} + +.paragraph { + padding: 0.8rem; + font: 1.2rem bold; +} + +.group-btn { + display: flex; + flex-direction: row; + gap: 0.3rem; + justify-content: center; + align-items: center; + flex-wrap: wrap; +} + +.btn-access { + background-color: rgb(255, 0, 0); + padding: 0.55rem; +} diff --git a/templates/navbar.html b/templates/navbar.html index d273a350..8c696b65 100644 --- a/templates/navbar.html +++ b/templates/navbar.html @@ -5,16 +5,28 @@ logo-hashflix +
+ {% if user.is_authenticated %} + {% endif %} + {% if user.is_authenticated %} + {% else %} + + {% endif %} + {% if user.is_authenticated %} + {% endif %}
+