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 @@
¡Bienvenido, {{ name }}!
+Estas son tus reservas de padel
+| ID | -Nombre | -Fecha | -Hora | -Eliminar | +ID | +Nombre | +Fecha | +Hora | +{% for reserva in reservas %} @@ -25,7 +29,7 @@ | {{ reserva.hora }} | 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 %} |
|---|