From 2344bc5fe35872624b64377e4e0d6a7b3820b118 Mon Sep 17 00:00:00 2001 From: perro Date: Thu, 16 Mar 2023 11:23:48 -0700 Subject: [PATCH 1/2] Fix #14 - Barra en home --- source/main/static/css/main.css | 14 ++++++++++++-- source/static/css/main.css | 13 +++++++++++-- source/templates/nav.html | 21 +++++++-------------- source/templates/search-bar.html | 8 ++++++++ source/templates/search.html | 11 ----------- 5 files changed, 38 insertions(+), 29 deletions(-) create mode 100644 source/templates/search-bar.html diff --git a/source/main/static/css/main.css b/source/main/static/css/main.css index 82c1966..0c10983 100644 --- a/source/main/static/css/main.css +++ b/source/main/static/css/main.css @@ -23,6 +23,10 @@ width: 100%; } +.navbar-burger { + margin-left: 0; +} + /* Cada flecha en los títulos de secciones */ .arrows { font-size: 1.5rem; @@ -297,17 +301,23 @@ section#notice a { /* SEARCH */ +#search-form { + width: 80vw; + margin: auto auto auto 3rem; +} + .search-div > * { display: inline-block; } .search-div input { width: calc(100% - 4.1rem); + vertical-align: text-top; } .search-div button { - width: 3.8rem; - height: 3.8rem; + width: 2.9rem; + height: 2.9rem; } /* ICONS; cfr: https://css.gg */ diff --git a/source/static/css/main.css b/source/static/css/main.css index 82c1966..a4ab280 100644 --- a/source/static/css/main.css +++ b/source/static/css/main.css @@ -297,17 +297,26 @@ section#notice a { /* SEARCH */ +#search-form { + width: calc(100% - 7em); +} + +.search-div { + margin-top: .5em; +} + .search-div > * { display: inline-block; } .search-div input { width: calc(100% - 4.1rem); + font-size: 1.25rem; } .search-div button { - width: 3.8rem; - height: 3.8rem; + width: 3.1rem; + height: 3.1rem; } /* ICONS; cfr: https://css.gg */ diff --git a/source/templates/nav.html b/source/templates/nav.html index a1242bd..77162a4 100644 --- a/source/templates/nav.html +++ b/source/templates/nav.html @@ -4,6 +4,11 @@ + {% if query %} + {% include 'search-bar.html' with query=query %} + {% else %} + {% include 'search-bar.html' %} + {% endif %} diff --git a/source/templates/search-bar.html b/source/templates/search-bar.html new file mode 100644 index 0000000..307162d --- /dev/null +++ b/source/templates/search-bar.html @@ -0,0 +1,8 @@ +
+
+ +
+ +
+
+
diff --git a/source/templates/search.html b/source/templates/search.html index d65ef56..996af18 100644 --- a/source/templates/search.html +++ b/source/templates/search.html @@ -2,17 +2,6 @@ {% block content %} -
-
-
- -
- -
-
-
-
- {% if movies %} {% include 'section.html' with section='Resultados de búsqueda.' content=movies %} {% else %} From 71325272b83965404a1476c66e2ea0c04c351441 Mon Sep 17 00:00:00 2001 From: perro Date: Thu, 16 Mar 2023 12:15:31 -0700 Subject: [PATCH 2/2] Fix #10 #15 login/logout con redireccionamiento habilitado --- source/main/static/css/main.css | 12 ++++++++++++ source/main/views.py | 4 ++++ source/mauflix/urls.py | 3 +++ source/templates/404.html | 11 +++++++++++ source/templates/nav.html | 6 +++++- source/templates/registration/login.html | 14 ++++++++++++++ 6 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 source/templates/404.html create mode 100644 source/templates/registration/login.html diff --git a/source/main/static/css/main.css b/source/main/static/css/main.css index 0c10983..38adeee 100644 --- a/source/main/static/css/main.css +++ b/source/main/static/css/main.css @@ -320,6 +320,18 @@ section#notice a { height: 2.9rem; } +/* LOGIN / LOGOUT */ + +#login-form { + width: 16rem; + margin: auto; + text-align: center; +} + +#login-form > * { + margin-top: .5rem; +} + /* ICONS; cfr: https://css.gg */ .gg-time { diff --git a/source/main/views.py b/source/main/views.py index 0cb8760..a407e55 100644 --- a/source/main/views.py +++ b/source/main/views.py @@ -44,3 +44,7 @@ def movie(request, id): def api(request): context = Movie.objects.api(request) return JsonResponse(context) + + +def error_404(request, exception): + return render(request, "404.html") diff --git a/source/mauflix/urls.py b/source/mauflix/urls.py index f5a2e96..50d31e3 100644 --- a/source/mauflix/urls.py +++ b/source/mauflix/urls.py @@ -17,4 +17,7 @@ urlpatterns = [ path("movie/", views.movie, name="movie"), path("ultimas/rss/", LatestMoviesFeed()), path("admin/", admin.site.urls), + path("user/", include("django.contrib.auth.urls")), ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) + +handler404 = views.error_404 diff --git a/source/templates/404.html b/source/templates/404.html new file mode 100644 index 0000000..01fddf2 --- /dev/null +++ b/source/templates/404.html @@ -0,0 +1,11 @@ +{% extends "base.html" %} + +{% block content %} + +
+
+

¡Ups! Página no encontrada.

+
+
+ +{% endblock %} diff --git a/source/templates/nav.html b/source/templates/nav.html index 77162a4..807897d 100644 --- a/source/templates/nav.html +++ b/source/templates/nav.html @@ -23,7 +23,11 @@ Acerca Ayuda - Ingresa + {% if user.is_authenticated %} + Salir + {% else %} + Ingresa + {% endif %} diff --git a/source/templates/registration/login.html b/source/templates/registration/login.html new file mode 100644 index 0000000..410524c --- /dev/null +++ b/source/templates/registration/login.html @@ -0,0 +1,14 @@ +{% extends "base.html" %} + +{% block content %} +
+
+
+ {% csrf_token %} + + + +
+
+
+{% endblock %}