From 5d0f7c94b79d959b13357ca8d9a5d0a6ab4ca78a Mon Sep 17 00:00:00 2001
From: josgrarom
Date: Wed, 5 Jan 2022 18:09:30 +0100
Subject: [PATCH 1/4] =?UTF-8?q?Feature:=20css=20del=20bot=C3=B3n=20de=20go?=
=?UTF-8?q?ogle;=20#=2028?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Se ha recolocado el botón de google y agregado un css.
---
decide/authentication/templates/login.html | 1 +
decide/booth/static/booth/style.css | 39 ++++++++++++++++++++++
decide/booth/templates/booth/booth.html | 26 ++++++++++++++-
decide/decide/settings.py | 26 ++++++++++-----
4 files changed, 82 insertions(+), 10 deletions(-)
diff --git a/decide/authentication/templates/login.html b/decide/authentication/templates/login.html
index a357f1f341..c7f908a6dd 100644
--- a/decide/authentication/templates/login.html
+++ b/decide/authentication/templates/login.html
@@ -73,3 +73,4 @@
microsoft
GitHub
+
diff --git a/decide/booth/static/booth/style.css b/decide/booth/static/booth/style.css
index e5aa677cad..ad6e89e129 100644
--- a/decide/booth/static/booth/style.css
+++ b/decide/booth/static/booth/style.css
@@ -2,3 +2,42 @@
margin-top: 20px;
margin-left: 40px;
}
+
+#customBtn {
+ display: inline-block;
+ background: white;
+ color: #444;
+ width: 190px;
+ border-radius: 5px;
+ border: thin solid #888;
+ box-shadow: 1px 1px 1px grey;
+ white-space: nowrap;
+ }
+
+ #main{
+ text-align:center;
+
+ }
+ #customBtn:hover {
+ cursor: pointer;
+ }
+ span.label {
+ font-family: serif;
+ font-weight: normal;
+ }
+ span.icon {
+ display: inline-block;
+ vertical-align: middle;
+ width: 20px;
+ height: 42px;
+ }
+ span.buttonText {
+ display: inline-block;
+ vertical-align: middle;
+ padding-left: 20px;
+ padding-right: 42px;
+ font-size: 14px;
+ font-weight: bold;
+ /* Use the Roboto font that is loaded in the
*/
+ font-family: 'Roboto', sans-serif;
+ }
\ No newline at end of file
diff --git a/decide/booth/templates/booth/booth.html b/decide/booth/templates/booth/booth.html
index 66afbbc56e..6f70ddbb9b 100644
--- a/decide/booth/templates/booth/booth.html
+++ b/decide/booth/templates/booth/booth.html
@@ -1,6 +1,8 @@
{% extends "base.html" %}
-{% load i18n static %}
+{% load i18n static %}
+{% load socialaccount %}
+{% providers_media_js %}
{% block extrahead %}
@@ -9,6 +11,7 @@
{% endblock %}
+
{% block content %}
@@ -50,7 +53,25 @@
[[ voting.id ]] - [[ voting.name ]]
{% trans "Login" %}
+
+
Inicia sesión con:
+
+
+
+
+
+ {% if user.is_authenticated %}
+ estoy autenticado
+
Logout
+ {% endif %}
+
+
[[ voting.question.desc ]]
@@ -65,8 +86,10 @@ [[ voting.question.desc ]]
{% trans "Vote" %}
+
+
{% endblock %}
{% block extrabody %}
@@ -152,6 +175,7 @@
[[ voting.question.desc ]]
}
});
},
+
onSubmitLogin(evt) {
evt.preventDefault();
this.postData("{% url "gateway" "authentication" "/login/" %}", this.form)
diff --git a/decide/decide/settings.py b/decide/decide/settings.py
index 36cdc3e4ed..00e32e7acc 100644
--- a/decide/decide/settings.py
+++ b/decide/decide/settings.py
@@ -10,7 +10,7 @@
"""
import os
-
+from django.urls import reverse_lazy
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
@@ -55,6 +55,19 @@
]
+
+SOCIALACCOUNT_PROVIDERS = {
+ 'google': {
+ 'SCOPE': [
+ 'profile',
+ 'email',
+ ],
+ 'AUTH_PARAMS': {
+ 'access_type': 'online',
+ }
+ }
+}
+
REST_FRAMEWORK = {
'DEFAULT_AUTHENTICATION_CLASSES': (
'rest_framework.authentication.BasicAuthentication',
@@ -66,6 +79,7 @@
AUTHENTICATION_BACKENDS = [
'django.contrib.auth.backends.ModelBackend',
'base.backends.AuthBackend',
+ 'allauth.account.auth_backends.AuthenticationBackend'
]
MODULES = [
@@ -206,16 +220,10 @@
INSTALLED_APPS = INSTALLED_APPS + MODULES
-AUTHENTICATION_BACKENDS = (
- 'django.contrib.auth.backends.ModelBackend',
- 'allauth.account.auth_backends.AuthenticationBackend'
-)
-
SITE_ID = 2
-LOGIN_REDIRECT_URL = '/'
-LOGOUT_REDIRECT_URL = '/'
-
+LOGIN_REDIRECT_URL ='/booth/voting'
+LOGOUT_REDIRECT_URL = '/booth/voting'
NOSE_ARGS = [
'--with-xunit'
From 91b749be0bcf0aa1f31b67e8bc861890dfb5e62a Mon Sep 17 00:00:00 2001
From: josgrarom
Date: Wed, 5 Jan 2022 19:01:54 +0100
Subject: [PATCH 2/4] =?UTF-8?q?Style:=20Css=20botones=20en=20la=20p=C3=A1g?=
=?UTF-8?q?ina=20principal;=20#29?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Se han trasladado los botones de login a la página principal.
---
decide/booth/templates/booth/booth.html | 1 +
1 file changed, 1 insertion(+)
diff --git a/decide/booth/templates/booth/booth.html b/decide/booth/templates/booth/booth.html
index ccfe7fa716..ed0c618953 100644
--- a/decide/booth/templates/booth/booth.html
+++ b/decide/booth/templates/booth/booth.html
@@ -82,6 +82,7 @@ [[ voting.id ]] - [[ voting.name ]]
+
From ad7dde37fab163d8beab19364c1e61f31b32a520 Mon Sep 17 00:00:00 2001
From: josgrarom
Date: Wed, 5 Jan 2022 19:12:21 +0100
Subject: [PATCH 3/4] Fix: arreglo de malos olores; #29
Se han arreglado malos olores en el css.
---
decide/booth/static/booth/style.css | 74 +++++++++++++++--------------
decide/decide/settings.py | 1 -
2 files changed, 38 insertions(+), 37 deletions(-)
diff --git a/decide/booth/static/booth/style.css b/decide/booth/static/booth/style.css
index ad6e89e129..174b55ad89 100644
--- a/decide/booth/static/booth/style.css
+++ b/decide/booth/static/booth/style.css
@@ -4,40 +4,42 @@
}
#customBtn {
- display: inline-block;
- background: white;
- color: #444;
- width: 190px;
- border-radius: 5px;
- border: thin solid #888;
- box-shadow: 1px 1px 1px grey;
- white-space: nowrap;
- }
+ display: inline-block;
+ background: white;
+ color: #444;
+ width: 190px;
+ border-radius: 5px;
+ border: thin solid #888;
+ box-shadow: 1px 1px 1px grey;
+ white-space: nowrap;
+}
+
+#main {
+ text-align:center;
+}
+
+#customBtn:hover {
+ cursor: pointer;
+}
+
+span.label {
+ font-family: serif;
+ font-weight: normal;
+}
+
+span.icon {
+ display: inline-block;
+ vertical-align: middle;
+ width: 20px;
+ height: 42px;
+}
- #main{
- text-align:center;
-
- }
- #customBtn:hover {
- cursor: pointer;
- }
- span.label {
- font-family: serif;
- font-weight: normal;
- }
- span.icon {
- display: inline-block;
- vertical-align: middle;
- width: 20px;
- height: 42px;
- }
- span.buttonText {
- display: inline-block;
- vertical-align: middle;
- padding-left: 20px;
- padding-right: 42px;
- font-size: 14px;
- font-weight: bold;
- /* Use the Roboto font that is loaded in the */
- font-family: 'Roboto', sans-serif;
- }
\ No newline at end of file
+span.buttonText {
+ display: inline-block;
+ vertical-align: middle;
+ padding-left: 20px;
+ padding-right: 42px;
+ font-size: 14px;
+ font-weight: bold;
+ font-family: 'Roboto', sans-serif;
+}
\ No newline at end of file
diff --git a/decide/decide/settings.py b/decide/decide/settings.py
index 51e9522816..7c2cc23140 100644
--- a/decide/decide/settings.py
+++ b/decide/decide/settings.py
@@ -10,7 +10,6 @@
"""
import os
-from django.urls import reverse_lazy
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
From b9278f3427d45850a56970c92f47f83b715124c0 Mon Sep 17 00:00:00 2001
From: josgrarom
Date: Wed, 5 Jan 2022 19:16:41 +0100
Subject: [PATCH 4/4] Fix: arreglo de malos olores; #29
Se han arreglado malos olores en el css.
---
decide/booth/static/booth/style.css | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/decide/booth/static/booth/style.css b/decide/booth/static/booth/style.css
index 174b55ad89..0d8c2359e1 100644
--- a/decide/booth/static/booth/style.css
+++ b/decide/booth/static/booth/style.css
@@ -15,7 +15,7 @@
}
#main {
- text-align:center;
+ text-align: center;
}
#customBtn:hover {
@@ -42,4 +42,4 @@ span.buttonText {
font-size: 14px;
font-weight: bold;
font-family: 'Roboto', sans-serif;
-}
\ No newline at end of file
+}