Browse Source

el listado de albums desde la lista de canciones se mete en tabla también

politica
Celestino Rey 1 year ago
parent
commit
24af1f1ec2
2 changed files with 37 additions and 1 deletions
  1. +25
    -0
      LyricsPy/servicios/lyrics/templates/album.html
  2. +12
    -1
      LyricsPy/servicios/lyrics/templates/base.html

+ 25
- 0
LyricsPy/servicios/lyrics/templates/album.html View File

@ -6,6 +6,7 @@
<p><strong>Año:</strong> {{ album.year }}</p>
<h3>Canciones en este álbum</h3>
<!--
<ul>
{% for song in songs %}
<li>
@ -13,6 +14,30 @@
</li>
{% endfor %}
</ul>
-->
{% if songs %}
<table id="songTable" class="display">
<thead>
<tr>
<th>Title</th>
<th>Author</th>
<th>Album</th>
</tr>
</thead>
<tbody>
{% for song in songs %}
<tr>
<td><a href="{{ url_for('paginas.song', song_id=song.id) }}">{{ song.title }}</a></td>
<td>{{ song.author }}</td>
<td><a href="{{ url_for('paginas.album', album_id=song.album.id) }}">{{ song.album.name }}</a></td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<p>No songs found matching your query.</p>
{% endif %}
<a href="{{ url_for('paginas.index') }}">Volver al inicio</a>
{% endblock %}

+ 12
- 1
LyricsPy/servicios/lyrics/templates/base.html View File

@ -29,10 +29,21 @@
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<!-- DataTables JS -->
<script type="text/javascript" charset="utf8" src="https://cdn.datatables.net/1.11.5/js/jquery.dataTables.js"></script>
<!-- DataTables Spanish Language File -->
<script type="text/javascript" charset="utf8" src="https://cdn.datatables.net/plug-ins/1.11.5/i18n/es_es.json"></script>
<script>
$(document).ready(function() {
$('#songTable').DataTable();
$('#songTable').DataTable({
"language": {
"url": "//cdn.datatables.net/plug-ins/1.11.5/i18n/es_es.json"
}
});
$('#albumTable').DataTable({
"language": {
"url": "//cdn.datatables.net/plug-ins/1.11.5/i18n/es_es.json"
}
});
});
function openTab(evt, tabName) {


Loading…
Cancel
Save