114 lines
3.0 KiB
HTML
114 lines
3.0 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<title>Admin - Demo</title>
|
|
<style>
|
|
* { margin: 0; padding: 0; box-sizing: border-box; }
|
|
body {
|
|
font-family: Arial, sans-serif;
|
|
background: #f5f5f5;
|
|
padding: 20px;
|
|
}
|
|
.header {
|
|
background: white;
|
|
padding: 20px;
|
|
border-radius: 5px;
|
|
margin-bottom: 20px;
|
|
}
|
|
table {
|
|
width: 100%;
|
|
background: white;
|
|
border-collapse: collapse;
|
|
margin-bottom: 20px;
|
|
}
|
|
th, td {
|
|
padding: 12px;
|
|
text-align: left;
|
|
border-bottom: 1px solid #ddd;
|
|
}
|
|
th {
|
|
background: #667eea;
|
|
color: white;
|
|
}
|
|
.btn {
|
|
padding: 5px 15px;
|
|
background: #4caf50;
|
|
color: white;
|
|
border: none;
|
|
border-radius: 3px;
|
|
cursor: pointer;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="header">
|
|
<h1>🔧 Panel Admin</h1>
|
|
</div>
|
|
|
|
<h2>Solicitudes Pendientes</h2>
|
|
<table>
|
|
<tr>
|
|
<th>ID</th>
|
|
<th>Slug</th>
|
|
<th>Email Cliente</th>
|
|
<th>Fecha</th>
|
|
<th>Acción</th>
|
|
</tr>
|
|
{% for req in requests %}
|
|
<tr>
|
|
<td>{{ req.id }}</td>
|
|
<td>{{ req.slug }}</td>
|
|
<td>{{ req.email }}</td>
|
|
<td>{{ req.created_at }}</td>
|
|
<td>
|
|
<button class="btn" onclick="approve({{ req.id }})">✅ Aprobar</button>
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
{% if not requests %}
|
|
<tr><td colspan="5">No hay solicitudes pendientes</td></tr>
|
|
{% endif %}
|
|
</table>
|
|
|
|
<h2>Todos los Sitios</h2>
|
|
<table>
|
|
<tr>
|
|
<th>ID</th>
|
|
<th>Slug</th>
|
|
<th>Tema</th>
|
|
<th>Status</th>
|
|
<th>Ver</th>
|
|
</tr>
|
|
{% for site in sites %}
|
|
<tr>
|
|
<td>{{ site.id }}</td>
|
|
<td>{{ site.slug }}</td>
|
|
<td>{{ site.theme }}</td>
|
|
<td>{{ site.status }}</td>
|
|
<td>
|
|
{% if site.status == 'published' %}
|
|
<a href="/site/{{ site.slug }}" target="_blank">Ver</a>
|
|
{% endif %}
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</table>
|
|
|
|
<script>
|
|
function approve(requestId) {
|
|
if (confirm('¿Aprobar este sitio?')) {
|
|
fetch(`/admin/approve/${requestId}`, {method: 'POST'})
|
|
.then(r => r.json())
|
|
.then(data => {
|
|
if (data.success) {
|
|
alert('✅ Sitio aprobado');
|
|
location.reload();
|
|
}
|
|
});
|
|
}
|
|
}
|
|
</script>
|
|
</body>
|
|
</html>
|