{% extends 'base.html' %}
|
|
|
|
{% block content %}
|
|
<div class="container-xl">
|
|
|
|
<div class="row g-3 mb-4 align-items-center justify-content-between">
|
|
<div class="col-auto">
|
|
<h1 class="app-page-title mb-0">Libros</h1>
|
|
</div>
|
|
</div><!--//row-->
|
|
|
|
|
|
<nav id="orders-table-tab" class="orders-table-tab app-nav-tabs nav shadow-sm flex-column flex-sm-row mb-4">
|
|
<a class="flex-sm-fill text-sm-center nav-link active" id="libros-tab" data-bs-toggle="tab" href="#libros" role="tab" aria-controls="libros" aria-selected="true">Libros</a>
|
|
</nav>
|
|
|
|
|
|
<div class="tab-content" id="orders-table-tab-content">
|
|
<div class="tab-pane fade show active" id="libros" role="tabpanel" aria-labelledby="libros-tab">
|
|
<div class="app-card app-card-orders-table shadow-sm mb-5">
|
|
<div class="app-card-body">
|
|
<div class="table-responsive">
|
|
<table class="table app-table-hover mb-0 text-left">
|
|
<thead>
|
|
<tr>
|
|
<th class="cell">#</th>
|
|
<th class="cell">anno</th>
|
|
<th class="cell">Título</th>
|
|
<th class="cell">Autor</th>
|
|
<th class="cell">Portada</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for libro in libros %}
|
|
<tr>
|
|
<td class="cell">{{ libro.id }}</td>
|
|
<td class="cell">{{ libro.anno }}</td>
|
|
<td class="cell">{{ libro.titulo }}</td>
|
|
<td class="cell">{{ libro.autores.apellido }}, {{ libro.autores.nombre }}</td>
|
|
{% if libro.portada %}
|
|
<td class="cell"><img src="{{ url_for('paginas.uploaded_file', filename=libro.portada) }}" alt="Sin imagen" style="width:200px;height:200px;"></td>
|
|
{% else %}
|
|
<p>Sin imagen</p>
|
|
{% endif %}
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div><!--//table-responsive-->
|
|
</div><!--//app-card-body-->
|
|
</div><!--//app-card-->
|
|
</div><!--//tab-pane-->
|
|
</div><!--//tab-content-->
|
|
</div><!--//container-fluid-->
|
|
{% endblock %}
|