diff --git a/Padel/exit b/Padel/exit new file mode 100644 index 0000000..e69de29 diff --git a/Padel/padel/README.md b/Padel/padel/README.md new file mode 100644 index 0000000..ee7a728 --- /dev/null +++ b/Padel/padel/README.md @@ -0,0 +1,2 @@ +# fuente + https://www.digitalocean.com/community/tutorials/how-to-add-authentication-to-your-app-with-flask-login \ No newline at end of file diff --git a/Padel/padel/auth.py b/Padel/padel/auth.py index 9311298..85d9315 100644 --- a/Padel/padel/auth.py +++ b/Padel/padel/auth.py @@ -22,7 +22,7 @@ def login_post(): # check if the user actually exists # take the user-supplied password, hash it, and compare it to the hashed password in the database if not user or not check_password_hash(user.password, password): - flash('Please check your login details and try again.') + flash('Por favor, comprueba los datos de registro y vuelve a intentarlo.') return redirect(url_for('auth.login')) # if the user doesn't exist or password is wrong, reload the page # if the above check passes, then we know the user has the right credentials diff --git a/Padel/padel/paginas.py b/Padel/padel/paginas.py index 94a61cb..d28c9a2 100644 --- a/Padel/padel/paginas.py +++ b/Padel/padel/paginas.py @@ -7,7 +7,7 @@ bp = Blueprint("paginas", __name__) @bp.route("/") def inicio(): - return render_template("paginas/inicio.html") + return render_template("autorizacion/index.html") @bp.route("/acerca") def acerca(): diff --git a/Padel/padel/reservas.py b/Padel/padel/reservas.py index 830b6a3..1a1de7d 100644 --- a/Padel/padel/reservas.py +++ b/Padel/padel/reservas.py @@ -19,7 +19,7 @@ def misreservas(): reservas = db.execute( # "SELECT id, nombre, fecha, hora FROM reservas WHERE fecha>=? AND fecha<=? ORDER BY fecha DESC", (hoy,pasado) - "SELECT id, nombre, fecha, hora FROM reservas ORDER BY fecha DESC" + "SELECT id, nombre, fecha, hora FROM reservas WHERE nombre=? ORDER BY fecha DESC", (current_user.name,) ).fetchall() return render_template("reservas/misreservas.html", reservas=reservas, name=current_user.name) @@ -28,7 +28,6 @@ def misreservas(): @login_required def inserta(diaelegido): if request.method == "POST": - nombre = request.form["nombre"] or "Anónimo" fecha = diaelegido hora = request.form["hora"] diff --git a/Padel/padel/templates/_navegacion.html b/Padel/padel/templates/_navegacion.html index 2073f11..221cdce 100644 --- a/Padel/padel/templates/_navegacion.html +++ b/Padel/padel/templates/_navegacion.html @@ -3,18 +3,28 @@
diff --git a/Padel/padel/templates/autorizacion/index.html b/Padel/padel/templates/autorizacion/index.html index ce45b56..640cec8 100644 --- a/Padel/padel/templates/autorizacion/index.html +++ b/Padel/padel/templates/autorizacion/index.html @@ -1,10 +1,10 @@ {% extends "base.html" %} {% block content %} -

- Flask Login Example +

+ Pista de padel Devesa Park

-

- Easy authentication and authorization in Flask. +

+ Reservas de padel.

{% endblock %} \ No newline at end of file diff --git a/Padel/padel/templates/autorizacion/login.html b/Padel/padel/templates/autorizacion/login.html index 6ec1a6f..9e7b448 100644 --- a/Padel/padel/templates/autorizacion/login.html +++ b/Padel/padel/templates/autorizacion/login.html @@ -26,10 +26,10 @@
- + diff --git a/Padel/padel/templates/base.html b/Padel/padel/templates/base.html index cfb01b4..8b98c70 100644 --- a/Padel/padel/templates/base.html +++ b/Padel/padel/templates/base.html @@ -18,17 +18,16 @@
{% include("_navegacion.html") %} -
{% block header %}{% endblock header %}
-
+
{% block content %} {% endblock %}
-
+
diff --git a/Padel/padel/templates/paginas/inicio.html b/Padel/padel/templates/paginas/inicio.html index fd99817..4b57575 100644 --- a/Padel/padel/templates/paginas/inicio.html +++ b/Padel/padel/templates/paginas/inicio.html @@ -1,7 +1,7 @@ {% extends 'base.html' %} {% block header %} -

{% block title %}Inicio{% endblock title %}

+

Inicio

{% endblock header %} {% block content %} diff --git a/Padel/padel/templates/reservas/misreservas.html b/Padel/padel/templates/reservas/misreservas.html index 271e521..d1ccf52 100644 --- a/Padel/padel/templates/reservas/misreservas.html +++ b/Padel/padel/templates/reservas/misreservas.html @@ -1,20 +1,24 @@ {% extends 'base.html' %} {% block header %} -

- Welcome, {{ name }}! -

-

{% block title %}Reservas de padel{% endblock title %}

+
+
+

¡Bienvenido, {{ name }}!

+
+
+

Estas son tus reservas de padel

+
+
{% endblock header %} {% block content %} - +
- - - - - + + + + + {% for reserva in reservas %} @@ -25,7 +29,7 @@ diff --git a/Padel/padel/templates/reservas/reservar.html b/Padel/padel/templates/reservas/reservar.html index 7cefbdc..8a6d999 100644 --- a/Padel/padel/templates/reservas/reservar.html +++ b/Padel/padel/templates/reservas/reservar.html @@ -6,21 +6,21 @@ {% block content %} - -
+ +
-

Fecha de la reserva: {{ diaelegido }}

+
-
+
-
+
@@ -35,7 +35,7 @@
- +
IDNombreFechaHoraEliminarIDNombreFechaHora
{{ reserva.hora }}
- +