Actualización del 2025-08-16 a las 13:12:01

This commit is contained in:
jlimolina 2025-08-16 13:12:01 +02:00
parent b44096b07c
commit b26e9ad87f
13 changed files with 710 additions and 222 deletions

View file

@ -1,12 +1,62 @@
{% extends "base.html" %}
{% block title %}Lista Detallada de Feeds{% endblock %}
{% block title %}Gestionar Feeds RSS{% endblock %}
{% block content %}
<header>
<h1>Lista de Feeds</h1>
<p class="subtitle">Mostrando {{ feeds|length }} de {{ total_feeds }} feeds. Página {{ page }} de {{ total_pages }}.</p>
<a href="{{ url_for('dashboard') }}" class="top-link" style="margin-top:15px;">← Volver al Dashboard</a>
</header>
<div class="card feed-detail-card">
<div class="feed-header">
<h2>Lista de Feeds RSS ({{ total_feeds }})</h2>
<div class="nav-actions">
<a href="{{ url_for('add_feed') }}" class="btn btn-small">
<i class="fas fa-plus"></i> Añadir Feed
</a>
</div>
</div>
<div class="feed-body" style="padding: 0;">
<table style="width:100%; border-collapse: collapse;">
<thead>
<tr style="background-color: rgba(0,0,0,0.05);">
<th style="padding: 12px 15px; text-align: left;">Nombre</th>
<th style="padding: 12px 15px; text-align: left;">Categoría</th>
<th style="padding: 12px 15px; text-align: left;">País</th>
<th style="padding: 12px 15px; text-align: center;">Estado</th>
<th style="padding: 12px 15px; text-align: right;">Acciones</th>
</tr>
</thead>
<tbody>
{% for feed in feeds %}
<tr>
<td style="padding: 12px 15px; border-top: 1px solid var(--border-color);">
<a href="{{ feed.url }}" target="_blank" title="{{ feed.url }}">{{ feed.nombre }}</a>
</td>
<td style="padding: 12px 15px; border-top: 1px solid var(--border-color);">{{ feed.categoria or 'N/A' }}</td>
<td style="padding: 12px 15px; border-top: 1px solid var(--border-color);">{{ feed.pais or 'Global' }}</td>
<td style="padding: 12px 15px; border-top: 1px solid var(--border-color); text-align: center;">
{% if not feed.activo %}
<span style="color: #c0392b; font-weight: bold;" title="Inactivo por {{ feed.fallos }} fallos">KO</span>
{% else %}
<span style="color: #27ae60; font-weight:bold;">OK</span>
{% endif %}
</td>
<td style="padding: 12px 15px; text-align: right; border-top: 1px solid var(--border-color);">
<a href="{{ url_for('edit_feed', feed_id=feed.id) }}" class="btn btn-small btn-info" title="Editar"><i class="fas fa-edit"></i></a>
<a href="{{ url_for('delete_feed', feed_id=feed.id) }}" class="btn btn-small btn-danger" title="Eliminar" onclick="return confirm('¿Estás seguro de que quieres eliminar este feed?')"><i class="fas fa-trash"></i></a>
{% if not feed.activo %}
<a href="{{ url_for('reactivar_feed', feed_id=feed.id) }}" class="btn btn-small" title="Reactivar"><i class="fas fa-sync-alt"></i></a>
{% endif %}
</td>
</tr>
{% else %}
<tr>
<td colspan="5" style="padding: 20px; text-align: center;">No hay feeds para mostrar. <a href="{{ url_for('add_feed') }}">Añade el primero</a>.</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
{% if total_pages > 1 %}
<nav class="pagination">
@ -28,37 +78,4 @@
</nav>
{% endif %}
{% for feed in feeds %}
<div class="card feed-detail-card">
<div class="feed-header">
<h2>{{ feed.nombre }}</h2>
<div class="actions">
<a href="{{ url_for('edit_feed', feed_id=feed.id) }}" class="btn btn-small">Editar</a>
</div>
</div>
<div class="feed-body">
<dl>
<dt>ID:</dt><dd>{{ feed.id }}</dd>
<dt>URL:</dt><dd><a href="{{ feed.url }}" target="_blank" rel="noopener">{{ feed.url }}</a></dd>
<dt>Descripción:</dt><dd>{{ feed.descripcion or 'N/A' }}</dd>
<dt>Idioma:</dt><dd>{{ feed.idioma or 'N/D' }}</dd>
<dt>Estado:</dt><dd>
{% if feed.activo %}
<span style="color: #27ae60; font-weight:bold;">Activo</span>
{% else %}
<span style="color: #c0392b; font-weight: bold;">Inactivo</span>
{% endif %}
</dd>
<dt>Fallos:</dt><dd>{{ feed.fallos }}</dd>
</dl>
</div>
</div>
{% endfor %}
{% if not feeds %}
<div class="card" style="text-align:center;">
<p>No hay feeds para mostrar.</p>
</div>
{% endif %}
{% endblock %}