Browse Source

Incluyo formularios de búsqueda y ajustes decorativos.

politica
Celestino Rey 1 year ago
parent
commit
cc488d3864
11 changed files with 78 additions and 34 deletions
  1. BIN
      LyricsPy/servicios/instance/songs.db
  2. +19
    -0
      LyricsPy/servicios/lyrics/paginas.py
  3. +0
    -9
      LyricsPy/servicios/lyrics/templates/_cabecera.html
  4. +5
    -0
      LyricsPy/servicios/lyrics/templates/_footer.html
  5. +2
    -2
      LyricsPy/servicios/lyrics/templates/albumes.html
  6. +2
    -7
      LyricsPy/servicios/lyrics/templates/base.html
  7. +2
    -2
      LyricsPy/servicios/lyrics/templates/letras.html
  8. +2
    -7
      LyricsPy/servicios/lyrics/templates/login.html
  9. +22
    -0
      LyricsPy/servicios/lyrics/templates/searchalbum.html
  10. +22
    -0
      LyricsPy/servicios/lyrics/templates/searchsong.html
  11. +2
    -7
      LyricsPy/servicios/lyrics/templates/signup.html

BIN
LyricsPy/servicios/instance/songs.db View File


+ 19
- 0
LyricsPy/servicios/lyrics/paginas.py View File

@ -106,3 +106,22 @@ def album(album_id):
@bp.route('/uploads/<filename>')
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)

+ 0
- 9
LyricsPy/servicios/lyrics/templates/_cabecera.html View File

@ -9,15 +9,6 @@
<svg xmlns="http://www.w3.org/2000/svg" width="30" height="30" viewBox="0 0 30 30" role="img"><title>Menu</title><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg>
</a>
</div><!--//col-->
<div class="search-mobile-trigger d-sm-none col">
<i class="search-mobile-trigger-icon fa-solid fa-magnifying-glass"></i>
</div><!--//col-->
<div class="app-search-box col">
<form class="app-search-form">
<input type="text" placeholder="Search..." name="search" class="form-control search-input">
<button type="submit" class="btn search-btn btn-primary" value="Search"><i class="fa-solid fa-magnifying-glass"></i></button>
</form>
</div><!--//app-search-box-->
<div class="app-utilities col-auto">
<div class="app-utility-item app-user-dropdown dropdown">


+ 5
- 0
LyricsPy/servicios/lyrics/templates/_footer.html View File

@ -0,0 +1,5 @@
<footer class="app-auth-footer">
<div class="container text-center py-3">
<small class="copyright">(c) <a class="app-link" href="http://reymota.es" target="_blank">Celestino Rey</a></small>
</div>
</footer><!--//app-auth-footer-->

+ 2
- 2
LyricsPy/servicios/lyrics/templates/albumes.html View File

@ -11,9 +11,9 @@
<div class="page-utilities">
<div class="row g-2 justify-content-start justify-content-md-end align-items-center">
<div class="col-auto">
<form class="table-search-form row gx-1 align-items-center">
<form class="table-search-form row gx-1 align-items-center" action="{{ url_for('paginas.searchalbum') }}" method="get">
<div class="col-auto">
<input type="text" id="search-orders" name="searchorders" class="form-control search-orders" placeholder="Search">
<input type="text" id="search-orders" name="query" class="form-control search-orders" placeholder="Search">
</div>
<div class="col-auto">
<button type="submit" class="btn app-btn-secondary">Buscar</button>


+ 2
- 7
LyricsPy/servicios/lyrics/templates/base.html View File

@ -9,13 +9,8 @@
{% block content %}{% endblock %}
</div><!--//app-content-->
<footer class="app-footer">
<div class="container text-center py-3">
<!--/* This template is free as long as you keep the footer attribution link. If you'd like to use the template without the attribution link, you can buy the commercial license via our website: themes.3rdwavemedia.com Thank you for your support. :) */-->
<small class="copyright">Designed with <span class="sr-only">love</span><i class="fas fa-heart" style="color: #fb866a;"></i> by <a class="app-link" href="http://themes.3rdwavemedia.com" target="_blank">Xiaoying Riley</a> for developers</small>
</div>
</footer><!--//app-footer-->
{% include("_footer.html") %}
</div><!--//app-wrapper-->


+ 2
- 2
LyricsPy/servicios/lyrics/templates/letras.html View File

@ -11,9 +11,9 @@
<div class="page-utilities">
<div class="row g-2 justify-content-start justify-content-md-end align-items-center">
<div class="col-auto">
<form class="table-search-form row gx-1 align-items-center">
<form class="table-search-form row gx-1 align-items-center" action="{{ url_for('paginas.searchsong') }}" method="get">
<div class="col-auto">
<input type="text" id="search-orders" name="searchorders" class="form-control search-orders" placeholder="Search">
<input type="text" id="search-orders" name="query" class="form-control search-orders" placeholder="Search">
</div>
<div class="col-auto">
<button type="submit" class="btn app-btn-secondary">Buscar</button>


+ 2
- 7
LyricsPy/servicios/lyrics/templates/login.html View File

@ -44,13 +44,8 @@
</div><!--//auth-body-->
<footer class="app-auth-footer">
<div class="container text-center py-3">
<!--/* This template is free as long as you keep the footer attribution link. If you'd like to use the template without the attribution link, you can buy the commercial license via our website: themes.3rdwavemedia.com Thank you for your support. :) */-->
<small class="copyright">Designed with <span class="sr-only">love</span><i class="fas fa-heart" style="color: #fb866a;"></i> by <a class="app-link" href="http://themes.3rdwavemedia.com" target="_blank">Xiaoying Riley</a> for developers</small>
</div>
</footer><!--//app-auth-footer-->
{% include("_footer.html") %}
</div><!--//flex-column-->
</div><!--//auth-main-col-->
<div class="col-12 col-md-5 col-lg-6 h-100 auth-background-col">


+ 22
- 0
LyricsPy/servicios/lyrics/templates/searchalbum.html View File

@ -0,0 +1,22 @@
{% extends 'base.html' %}
{% block content %}
<div class="container-xl">
<h2>Search Results for "{{ query }}"</h2>
{% if albumes %}
<ul>
{% for album in albumes %}
<li>
<a href="{{ url_for('paginas.album', album_id=album.id) }}">{{ album.name }} by {{ album.artist }}</a>
</li>
{% endfor %}
</ul>
{% else %}
<p>No encontré álbumes que coincidan con tu criterio.</p>
{% endif %}
<a href="{{ url_for('paginas.index') }}">Back to Home</a>
</div>
{% endblock %}

+ 22
- 0
LyricsPy/servicios/lyrics/templates/searchsong.html View File

@ -0,0 +1,22 @@
{% extends 'base.html' %}
{% block content %}
<div class="container-xl">
<h2>Search Results for "{{ query }}"</h2>
{% if songs %}
<ul>
{% for song in songs %}
<li>
<a href="{{ url_for('paginas.song', song_id=song.id) }}">{{ song.title }} by {{ song.author }}</a>
</li>
{% endfor %}
</ul>
{% else %}
<p>No songs found matching your query.</p>
{% endif %}
<a href="{{ url_for('paginas.index') }}">Back to Home</a>
</div>
{% endblock %}

+ 2
- 7
LyricsPy/servicios/lyrics/templates/signup.html View File

@ -54,13 +54,8 @@
</div><!--//auth-body-->
<footer class="app-auth-footer">
<div class="container text-center py-3">
<!--/* This template is free as long as you keep the footer attribution link. If you'd like to use the template without the attribution link, you can buy the commercial license via our website: themes.3rdwavemedia.com Thank you for your support. :) */-->
<small class="copyright">Designed with <span class="sr-only">love</span><i class="fas fa-heart" style="color: #fb866a;"></i> by <a class="app-link" href="http://themes.3rdwavemedia.com" target="_blank">Xiaoying Riley</a> for developers</small>
</div>
</footer><!--//app-auth-footer-->
{% include("_footer.html") %}
</div><!--//flex-column-->
</div><!--//auth-main-col-->
<div class="col-12 col-md-5 col-lg-6 h-100 auth-background-col">


Loading…
Cancel
Save