rss/templates/feeds_list.html
2025-08-16 13:12:01 +02:00

81 lines
3.8 KiB
HTML

{% extends "base.html" %}
{% block title %}Gestionar Feeds RSS{% endblock %}
{% block content %}
<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">
{% if page > 1 %}
<a href="{{ url_for('manage_feeds', page=page-1) }}" class="page-link">&laquo; Anterior</a>
{% endif %}
{% for p in range(1, total_pages + 1) %}
{% if p == page %}
<a href="#" class="page-link active">{{ p }}</a>
{% else %}
<a href="{{ url_for('manage_feeds', page=p) }}" class="page-link">{{ p }}</a>
{% endif %}
{% endfor %}
{% if page < total_pages %}
<a href="{{ url_for('manage_feeds', page=page+1) }}" class="page-link">Siguiente &raquo;</a>
{% endif %}
</nav>
{% endif %}
{% endblock %}