From cc488d386475727bdf95b8d8256b678c491bdae2 Mon Sep 17 00:00:00 2001 From: Celestino Rey Date: Fri, 5 Jul 2024 14:27:33 +0200 Subject: [PATCH] =?UTF-8?q?Incluyo=20formularios=20de=20b=C3=BAsqueda=20y?= =?UTF-8?q?=20ajustes=20decorativos.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LyricsPy/servicios/instance/songs.db | Bin 77824 -> 77824 bytes LyricsPy/servicios/lyrics/paginas.py | 19 +++++++++++++++ .../servicios/lyrics/templates/_cabecera.html | 9 ------- .../servicios/lyrics/templates/_footer.html | 5 ++++ .../servicios/lyrics/templates/albumes.html | 4 ++-- LyricsPy/servicios/lyrics/templates/base.html | 9 ++----- .../servicios/lyrics/templates/letras.html | 4 ++-- .../servicios/lyrics/templates/login.html | 9 ++----- .../lyrics/templates/searchalbum.html | 22 ++++++++++++++++++ .../lyrics/templates/searchsong.html | 22 ++++++++++++++++++ .../servicios/lyrics/templates/signup.html | 9 ++----- 11 files changed, 78 insertions(+), 34 deletions(-) create mode 100644 LyricsPy/servicios/lyrics/templates/_footer.html create mode 100644 LyricsPy/servicios/lyrics/templates/searchalbum.html create mode 100644 LyricsPy/servicios/lyrics/templates/searchsong.html diff --git a/LyricsPy/servicios/instance/songs.db b/LyricsPy/servicios/instance/songs.db index 596e6043f170fa6e49bf68af6afe5b6ed23558e1..f516d434cf4b82e98e0ffda31848678aa4d6cdc2 100644 GIT binary patch delta 112 zcmZp8z|!!5Wr8%L%|sbzMw^WZOZWxY_=*_#*7Kj`ui#hb`@vVVSy3R4&(@lajloc# zN!KaAC{H0XPoX3uRUuR_SkF<bC^Ij;xFj_-kNrRrP*G+cP)TWVqFz=( Odh>d@?d#EI_zumt5fA~J4uh{A Jx33-nQ4zB&5MBTP diff --git a/LyricsPy/servicios/lyrics/paginas.py b/LyricsPy/servicios/lyrics/paginas.py index c01b5c7..af1308f 100644 --- a/LyricsPy/servicios/lyrics/paginas.py +++ b/LyricsPy/servicios/lyrics/paginas.py @@ -106,3 +106,22 @@ def album(album_id): @bp.route('/uploads/') def uploaded_file(filename): return send_from_directory(current_app.config['UPLOAD_FOLDER'], filename) + +@bp.route('/searchsong') +def searchsong(): + query = request.args.get('query', '') + if query: + songs = Song.query.filter(Song.title.contains(query)).all() + else: + songs = [] + return render_template('searchsong.html', query=query, songs=songs) + + +@bp.route('/searchalbum') +def searchalbum(): + query = request.args.get('query', '') + if query: + albumes = Album.query.filter(Album.name.contains(query)).all() + else: + albumes = [] + return render_template('searchalbum.html', query=query, albumes=albumes) diff --git a/LyricsPy/servicios/lyrics/templates/_cabecera.html b/LyricsPy/servicios/lyrics/templates/_cabecera.html index 5016d9f..661252d 100644 --- a/LyricsPy/servicios/lyrics/templates/_cabecera.html +++ b/LyricsPy/servicios/lyrics/templates/_cabecera.html @@ -9,15 +9,6 @@ Menu -
- -
-