update
This commit is contained in:
parent
91f2f409d6
commit
34f60011a3
3 changed files with 90 additions and 15 deletions
|
|
@ -31,6 +31,7 @@
|
|||
box-shadow: 0 1px 4px #0001;
|
||||
padding: 24px 20px 18px 20px;
|
||||
margin-bottom: 30px;
|
||||
overflow-x: auto;
|
||||
}
|
||||
.btn {
|
||||
display: inline-block;
|
||||
|
|
@ -152,6 +153,40 @@
|
|||
.noticia-item { flex-direction: column; align-items: flex-start; gap: 9px; }
|
||||
.noticia-imagen { align-self: flex-start; }
|
||||
}
|
||||
/* ------ BADGES DE ESTADO ------ */
|
||||
.badge-ok {
|
||||
background: #ddffdd;
|
||||
color: #1c8c1c;
|
||||
font-weight: bold;
|
||||
padding: 3px 14px;
|
||||
border-radius: 8px;
|
||||
font-size: 1em;
|
||||
display: inline-block;
|
||||
min-width: 38px;
|
||||
text-align: center;
|
||||
}
|
||||
.badge-ko {
|
||||
background: #ffdddd;
|
||||
color: #b20000;
|
||||
font-weight: bold;
|
||||
padding: 3px 14px;
|
||||
border-radius: 8px;
|
||||
font-size: 1em;
|
||||
display: inline-block;
|
||||
min-width: 38px;
|
||||
text-align: center;
|
||||
}
|
||||
.badge-warn {
|
||||
background: #fff7cc;
|
||||
color: #b68900;
|
||||
font-weight: bold;
|
||||
padding: 3px 14px;
|
||||
border-radius: 8px;
|
||||
font-size: 1em;
|
||||
display: inline-block;
|
||||
min-width: 38px;
|
||||
text-align: center;
|
||||
}
|
||||
/* Scroll suave para tablas grandes */
|
||||
.card { overflow-x: auto; }
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -56,12 +56,13 @@
|
|||
<th>URL</th>
|
||||
<th>Categoría</th>
|
||||
<th>País</th>
|
||||
<th>Activo</th>
|
||||
<th style="min-width: 80px;">Estado</th>
|
||||
<th style="min-width: 60px;">Fallos</th>
|
||||
<th>Acciones</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for id, nombre, descripcion, url, categoria_id, pais_id, activo, cat_nom, pais_nom in feeds %}
|
||||
{% for id, nombre, descripcion, url, categoria_id, pais_id, activo, fallos, cat_nom, pais_nom in feeds %}
|
||||
<tr>
|
||||
<td>
|
||||
<strong>{{ nombre }}</strong>
|
||||
|
|
@ -72,15 +73,33 @@
|
|||
<td><a href="{{ url }}" target="_blank">{{ url }}</a></td>
|
||||
<td>{{ cat_nom or 'N/A' }}</td>
|
||||
<td>{{ pais_nom or 'N/A' }}</td>
|
||||
<td>{{ 'Sí' if activo else 'No' }}</td>
|
||||
<td>
|
||||
{% if not activo %}
|
||||
<span class="badge-ko" title="Inactivo: {{ fallos }} fallos">KO</span>
|
||||
{% elif fallos > 0 %}
|
||||
<span class="badge-warn" title="{{ fallos }} fallos recientes">⚠️</span>
|
||||
{% else %}
|
||||
<span class="badge-ok">OK</span>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
{% if fallos > 0 %}
|
||||
<span style="color:orange;">{{ fallos }}</span>
|
||||
{% else %}
|
||||
0
|
||||
{% endif %}
|
||||
</td>
|
||||
<td class="actions">
|
||||
<a href="/edit/{{ id }}">Editar</a> |
|
||||
<a href="/delete/{{ id }}" onclick="return confirm('¿Seguro que quieres eliminar este feed?');">Eliminar</a>
|
||||
{% if not activo %}
|
||||
| <a href="/reactivar_feed/{{ id }}" style="color:#198754;" title="Reactivar feed">Reactivar</a>
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
{% else %}
|
||||
<tr>
|
||||
<td colspan="6">No hay feeds aún.</td>
|
||||
<td colspan="7">No hay feeds aún.</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
|
|
@ -101,7 +120,7 @@
|
|||
optionNA.textContent = '— N/A —';
|
||||
selectPais.appendChild(optionNA);
|
||||
paises.forEach(([id, nombre, contId]) => {
|
||||
if (!continenteId || contId == continenteId) {
|
||||
if (!continenteId || contId == continenteId || contId == Number(continenteId)) {
|
||||
const opt = document.createElement('option');
|
||||
opt.value = id;
|
||||
opt.textContent = nombre;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue