Modularización de GKACHELE SaaS
This commit is contained in:
178
demo/templates/admin.html
Normal file
178
demo/templates/admin.html
Normal file
@@ -0,0 +1,178 @@
|
||||
<!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>👥 Usuarios Registrados</h2>
|
||||
<table>
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>Email</th>
|
||||
<th>Plan</th>
|
||||
<th>Rubro</th>
|
||||
<th>Sitios</th>
|
||||
<th>Publicados</th>
|
||||
<th>Solicitudes</th>
|
||||
<th>Fecha</th>
|
||||
<th>Acción</th>
|
||||
</tr>
|
||||
{% for user in users %}
|
||||
<tr>
|
||||
<td>{{ user.id }}</td>
|
||||
<td>{{ user.email }}</td>
|
||||
<td>{{ user.plan }}</td>
|
||||
<td>{{ user.rubro }}</td>
|
||||
<td>{{ user.num_sitios }}</td>
|
||||
<td>{{ user.sitios_publicados }}</td>
|
||||
<td>{{ user.num_solicitudes }}</td>
|
||||
<td>{{ user.created_at[:10] if user.created_at else 'N/A' }}</td>
|
||||
<td>
|
||||
{% if user.id != 1 %}
|
||||
<button class="btn-danger" onclick="deleteUser({{ user.id }}, '{{ user.email }}')">🗑️ Eliminar</button>
|
||||
{% else %}
|
||||
<span style="color: #999;">Admin Principal</span>
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% if not users %}
|
||||
<tr><td colspan="9">No hay usuarios registrados</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>
|
||||
|
||||
<style>
|
||||
.btn-danger {
|
||||
background: #d63638;
|
||||
color: white;
|
||||
}
|
||||
.btn-danger:hover {
|
||||
background: #b32d2e;
|
||||
}
|
||||
</style>
|
||||
|
||||
<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();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function deleteUser(userId, email) {
|
||||
if (confirm(`⚠️ ¿Eliminar usuario ${userId} (${email})?\n\nEsto eliminará TODOS sus datos:\n- Sitios\n- Menús\n- Widgets\n- Media\n- Solicitudes\n\nEsta acción NO se puede deshacer.`)) {
|
||||
fetch(`/admin/users/delete/${userId}`, {method: 'POST'})
|
||||
.then(r => r.json())
|
||||
.then(data => {
|
||||
if (data.success) {
|
||||
alert('✅ Usuario eliminado exitosamente');
|
||||
location.reload();
|
||||
} else {
|
||||
alert('❌ Error: ' + (data.error || 'Error al eliminar'));
|
||||
}
|
||||
})
|
||||
.catch(err => {
|
||||
alert('❌ Error: ' + err);
|
||||
});
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
219
demo/templates/client_admin.html
Normal file
219
demo/templates/client_admin.html
Normal file
@@ -0,0 +1,219 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="es">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Dashboard - Administración del Sitio</title>
|
||||
<style>
|
||||
* { box-sizing: border-box; }
|
||||
body {
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
|
||||
margin: 0;
|
||||
background: #f0f0f1;
|
||||
display: flex;
|
||||
height: 100vh;
|
||||
color: #3c434a;
|
||||
}
|
||||
|
||||
/* Sidebar similar a WP */
|
||||
.sidebar {
|
||||
width: 160px;
|
||||
background: #1d2327;
|
||||
color: #fff;
|
||||
flex-shrink: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
.sidebar-header {
|
||||
padding: 10px 0 10px 20px;
|
||||
font-weight: 600;
|
||||
font-size: 14px;
|
||||
color: #fff;
|
||||
}
|
||||
.menu-item {
|
||||
display: block;
|
||||
padding: 10px 20px;
|
||||
color: #f0f0f1;
|
||||
text-decoration: none;
|
||||
font-size: 13px;
|
||||
border-left: 4px solid transparent;
|
||||
cursor: pointer;
|
||||
}
|
||||
.menu-item:hover, .menu-item.active {
|
||||
background: #2c3338;
|
||||
color: #72aee6;
|
||||
border-left-color: #72aee6;
|
||||
}
|
||||
.menu-item i { margin-right: 8px; width: 16px; text-align: center; }
|
||||
|
||||
/* Main Content */
|
||||
.main-content {
|
||||
flex-grow: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/* Top Bar */
|
||||
.top-bar {
|
||||
height: 32px;
|
||||
background: #1d2327;
|
||||
color: #fff;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 0 20px;
|
||||
justify-content: space-between;
|
||||
font-size: 13px;
|
||||
}
|
||||
.top-bar a { color: #fff; text-decoration: none; margin-left: 20px; }
|
||||
.top-bar a:hover { color: #72aee6; }
|
||||
|
||||
/* Content Area */
|
||||
.wp-content {
|
||||
padding: 20px;
|
||||
overflow-y: auto;
|
||||
flex-grow: 1;
|
||||
}
|
||||
|
||||
h1 { font-size: 23px; font-weight: 400; margin: 0 0 20px 0; padding: 0; }
|
||||
|
||||
.card {
|
||||
background: #fff;
|
||||
border: 1px solid #c3c4c7;
|
||||
padding: 20px;
|
||||
margin-bottom: 20px;
|
||||
max-width: 800px;
|
||||
box-shadow: 0 1px 1px rgba(0,0,0,.04);
|
||||
}
|
||||
|
||||
.welcome-panel {
|
||||
background: #fff;
|
||||
padding: 30px;
|
||||
border: 1px solid #c3c4c7;
|
||||
margin-bottom: 20px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.btn-primary {
|
||||
background: #2271b1;
|
||||
border-color: #2271b1;
|
||||
color: #fff;
|
||||
text-decoration: none;
|
||||
padding: 8px 12px;
|
||||
border-radius: 3px;
|
||||
font-size: 13px;
|
||||
cursor: pointer;
|
||||
display: inline-block;
|
||||
}
|
||||
.btn-primary:hover { background: #135e96; }
|
||||
|
||||
table { width: 100%; border-collapse: collapse; margin-top: 10px; }
|
||||
th, td { text-align: left; padding: 10px; border-bottom: 1px solid #f0f0f1; }
|
||||
th { font-weight: 600; }
|
||||
.status-badge {
|
||||
background: #f0f0f1;
|
||||
color: #646970;
|
||||
padding: 2px 6px;
|
||||
border-radius: 3px;
|
||||
font-size: 11px;
|
||||
font-weight: 600;
|
||||
}
|
||||
.status-badge.published { background: #edfaef; color: #008a20; }
|
||||
.status-badge.pending { background: #fff8e5; color: #996800; }
|
||||
</style>
|
||||
<!-- FontAwesome simplificado para iconos -->
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<!-- Sidebar -->
|
||||
<div class="sidebar">
|
||||
<div class="sidebar-header">
|
||||
<i class="fab fa-wordpress-simple"></i> GKACHELE
|
||||
</div>
|
||||
<a href="#" class="menu-item active"><i class="fas fa-tachometer-alt"></i> Escritorio</a>
|
||||
<a href="#" class="menu-item"><i class="fas fa-thumbtack"></i> Entradas</a>
|
||||
<a href="#" class="menu-item"><i class="fas fa-images"></i> Medios</a>
|
||||
<a href="#" class="menu-item"><i class="fas fa-file-alt"></i> Páginas</a>
|
||||
<a href="#" class="menu-item"><i class="fas fa-paint-brush"></i> Apariencia</a>
|
||||
<a href="#" class="menu-item"><i class="fas fa-plug"></i> Plugins</a>
|
||||
<a href="#" class="menu-item"><i class="fas fa-users"></i> Usuarios</a>
|
||||
<a href="#" class="menu-item"><i class="fas fa-cog"></i> Ajustes</a>
|
||||
</div>
|
||||
|
||||
<!-- Main Content -->
|
||||
<div class="main-content">
|
||||
<!-- Top Bar -->
|
||||
<div class="top-bar">
|
||||
<div>
|
||||
<a href="/"><i class="fas fa-home"></i> Ir al sitio</a>
|
||||
</div>
|
||||
<div>
|
||||
<span>Hola, {{ user_email }}</span>
|
||||
<a href="/logout">Salir</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- WP Content -->
|
||||
<div class="wp-content">
|
||||
<h1>Escritorio</h1>
|
||||
|
||||
<div class="welcome-panel">
|
||||
<div>
|
||||
<h2 style="margin-top: 0;">¡Te damos la bienvenida a tu panel!</h2>
|
||||
<p style="color: #646970;">Aquí puedes gestionar todos tus sitios y contenidos de forma profesional.</p>
|
||||
</div>
|
||||
<button class="btn-primary" onclick="window.location.href='/dashboard/create'">+ Crear Nuevo Sitio</button>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<h3><i class="fas fa-globe"></i> Tus Sitios Web</h3>
|
||||
{% if not sites %}
|
||||
<p>No tienes sitios creados. ¡Empieza ahora!</p>
|
||||
{% else %}
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Nombre (Slug)</th>
|
||||
<th>Tema</th>
|
||||
<th>Estado</th>
|
||||
<th>Acciones</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for site in sites %}
|
||||
<tr>
|
||||
<td><strong>{{ site.slug }}</strong></td>
|
||||
<td>{{ site.theme }}</td>
|
||||
<td><span class="status-badge {{ site.status }}">{{ site.status|upper }}</span></td>
|
||||
<td>
|
||||
<a href="/customizer/{{ site.id }}" class="btn-primary" style="padding: 4px 8px; font-size: 11px;">Personalizar</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<h3><i class="fas fa-chart-line"></i> Estadísticas Rápidas</h3>
|
||||
<div style="display: flex; gap: 20px;">
|
||||
<div>
|
||||
<span style="font-size: 24px; font-weight: bold;">{{ sites|length }}</span><br>
|
||||
<span style="color: #646970;">Sitios</span>
|
||||
</div>
|
||||
<div>
|
||||
<span style="font-size: 24px; font-weight: bold;">{{ user_plan|upper }}</span><br>
|
||||
<span style="color: #646970;">Plan Actual</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
82
demo/templates/create_site.html
Normal file
82
demo/templates/create_site.html
Normal file
@@ -0,0 +1,82 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Crear Sitio - Demo</title>
|
||||
<style>
|
||||
* { margin: 0; padding: 0; box-sizing: border-box; }
|
||||
body {
|
||||
font-family: Arial, sans-serif;
|
||||
background: #f5f5f5;
|
||||
padding: 20px;
|
||||
}
|
||||
.container {
|
||||
max-width: 600px;
|
||||
margin: 0 auto;
|
||||
background: white;
|
||||
padding: 30px;
|
||||
border-radius: 10px;
|
||||
}
|
||||
h1 { margin-bottom: 20px; }
|
||||
input, select {
|
||||
width: 100%;
|
||||
padding: 12px;
|
||||
margin-bottom: 15px;
|
||||
border: 1px solid #ddd;
|
||||
border-radius: 5px;
|
||||
}
|
||||
.btn {
|
||||
padding: 12px 30px;
|
||||
background: #667eea;
|
||||
color: white;
|
||||
border: none;
|
||||
border-radius: 5px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.btn:hover { background: #5568d3; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<h1>➕ Crear Nuevo Sitio</h1>
|
||||
<form id="createForm">
|
||||
<input type="text" id="site_name" placeholder="Nombre del sitio" required>
|
||||
<input type="text" id="slug" placeholder="Slug (URL)" required>
|
||||
<input type="text" id="hero_title" placeholder="Título principal" required>
|
||||
<textarea id="hero_description" placeholder="Descripción" style="width: 100%; padding: 12px; border: 1px solid #ddd; border-radius: 5px; margin-bottom: 15px;"></textarea>
|
||||
<select id="theme">
|
||||
<option value="default">Tema Default</option>
|
||||
<option value="modern">Tema Moderno</option>
|
||||
</select>
|
||||
<button type="submit" class="btn">Crear Sitio</button>
|
||||
</form>
|
||||
<a href="/dashboard" style="display: inline-block; margin-top: 15px; color: #667eea;">← Volver</a>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
document.getElementById('createForm').addEventListener('submit', async (e) => {
|
||||
e.preventDefault();
|
||||
const data = {
|
||||
site_name: document.getElementById('site_name').value,
|
||||
slug: document.getElementById('slug').value,
|
||||
hero_title: document.getElementById('hero_title').value,
|
||||
hero_description: document.getElementById('hero_description').value,
|
||||
theme: document.getElementById('theme').value
|
||||
};
|
||||
|
||||
const res = await fetch('/dashboard/create', {
|
||||
method: 'POST',
|
||||
headers: {'Content-Type': 'application/json'},
|
||||
body: JSON.stringify(data)
|
||||
});
|
||||
|
||||
const result = await res.json();
|
||||
if (result.success) {
|
||||
window.location.href = `/customizer/${result.site_id}`;
|
||||
} else {
|
||||
alert(result.error || 'Error al crear sitio');
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
1279
demo/templates/customizer-wordpress-COMPLETO.html
Normal file
1279
demo/templates/customizer-wordpress-COMPLETO.html
Normal file
File diff suppressed because it is too large
Load Diff
688
demo/templates/customizer-wordpress-demo.html
Normal file
688
demo/templates/customizer-wordpress-demo.html
Normal file
@@ -0,0 +1,688 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Customizer Demo - Estilo WordPress</title>
|
||||
<style>
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/* HEADER - Estilo WordPress */
|
||||
.customizer-header {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
height: 46px;
|
||||
background: #23282d;
|
||||
border-bottom: 1px solid #000;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 0 15px;
|
||||
z-index: 1000;
|
||||
}
|
||||
|
||||
.customizer-header-left {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 15px;
|
||||
}
|
||||
|
||||
.customizer-logo {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
background: #fff;
|
||||
border-radius: 3px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
color: #23282d;
|
||||
font-weight: bold;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.customizer-title {
|
||||
color: #fff;
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.customizer-close {
|
||||
background: transparent;
|
||||
border: none;
|
||||
color: #a7aaad;
|
||||
font-size: 20px;
|
||||
cursor: pointer;
|
||||
padding: 5px 10px;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.customizer-close:hover {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
/* MAIN CONTAINER */
|
||||
.customizer-container {
|
||||
display: flex;
|
||||
height: 100vh;
|
||||
padding-top: 46px;
|
||||
}
|
||||
|
||||
/* SIDEBAR - Estilo WordPress */
|
||||
.customizer-sidebar {
|
||||
width: 300px;
|
||||
background: #fff;
|
||||
border-right: 1px solid #ddd;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.customizer-sidebar-content {
|
||||
flex: 1;
|
||||
overflow-y: auto;
|
||||
overflow-x: hidden;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
/* Menú lateral de secciones (como WordPress) */
|
||||
.customizer-nav {
|
||||
background: #f6f7f7;
|
||||
border-bottom: 1px solid #ddd;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.customizer-nav-item {
|
||||
display: block;
|
||||
padding: 12px 15px;
|
||||
color: #23282d;
|
||||
text-decoration: none;
|
||||
border-bottom: 1px solid #ddd;
|
||||
font-size: 13px;
|
||||
cursor: pointer;
|
||||
transition: background 0.1s;
|
||||
}
|
||||
|
||||
.customizer-nav-item:hover {
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.customizer-nav-item.active {
|
||||
background: #fff;
|
||||
border-left: 4px solid #2271b1;
|
||||
padding-left: 11px;
|
||||
}
|
||||
|
||||
/* Secciones de controles */
|
||||
.customizer-section {
|
||||
display: none;
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.customizer-section.active {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.customizer-section-title {
|
||||
font-size: 13px;
|
||||
font-weight: 600;
|
||||
color: #23282d;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.5px;
|
||||
margin-bottom: 15px;
|
||||
padding-bottom: 10px;
|
||||
border-bottom: 1px solid #ddd;
|
||||
}
|
||||
|
||||
.customizer-control {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.customizer-control-label {
|
||||
display: block;
|
||||
font-size: 13px;
|
||||
font-weight: 600;
|
||||
color: #23282d;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.customizer-control-input {
|
||||
width: 100%;
|
||||
padding: 8px 12px;
|
||||
border: 1px solid #8c8f94;
|
||||
border-radius: 4px;
|
||||
font-size: 14px;
|
||||
font-family: inherit;
|
||||
transition: border-color 0.2s, box-shadow 0.2s;
|
||||
}
|
||||
|
||||
.customizer-control-input:focus {
|
||||
outline: none;
|
||||
border-color: #2271b1;
|
||||
box-shadow: 0 0 0 1px #2271b1;
|
||||
}
|
||||
|
||||
.customizer-control-textarea {
|
||||
min-height: 80px;
|
||||
resize: vertical;
|
||||
}
|
||||
|
||||
.customizer-control-description {
|
||||
font-size: 12px;
|
||||
color: #646970;
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
/* Color picker */
|
||||
.customizer-color-group {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.customizer-color-picker {
|
||||
width: 50px;
|
||||
height: 40px;
|
||||
border: 1px solid #8c8f94;
|
||||
border-radius: 4px;
|
||||
cursor: pointer;
|
||||
padding: 2px;
|
||||
}
|
||||
|
||||
.customizer-color-text {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
/* PREVIEW */
|
||||
.customizer-preview {
|
||||
flex: 1;
|
||||
background: #f0f0f1;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.customizer-preview iframe {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border: none;
|
||||
}
|
||||
|
||||
/* FOOTER - Estilo WordPress */
|
||||
.customizer-footer {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
height: 50px;
|
||||
background: #f6f7f7;
|
||||
border-top: 1px solid #ddd;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 0 20px;
|
||||
z-index: 1000;
|
||||
}
|
||||
|
||||
.customizer-footer-left {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.customizer-footer-right {
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.customizer-btn {
|
||||
padding: 8px 16px;
|
||||
border: none;
|
||||
border-radius: 4px;
|
||||
font-size: 13px;
|
||||
font-weight: 500;
|
||||
cursor: pointer;
|
||||
transition: all 0.2s;
|
||||
}
|
||||
|
||||
.customizer-btn-secondary {
|
||||
background: #f0f0f1;
|
||||
color: #2c3338;
|
||||
}
|
||||
|
||||
.customizer-btn-secondary:hover {
|
||||
background: #dcdcde;
|
||||
}
|
||||
|
||||
.customizer-btn-primary {
|
||||
background: #2271b1;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.customizer-btn-primary:hover {
|
||||
background: #135e96;
|
||||
}
|
||||
|
||||
.customizer-btn-primary:disabled {
|
||||
background: #c3c4c7;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
.customizer-btn-discard {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.customizer-btn-discard.has-changes {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.customizer-status {
|
||||
font-size: 12px;
|
||||
color: #646970;
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
.customizer-status.saving {
|
||||
color: #2271b1;
|
||||
}
|
||||
|
||||
.customizer-status.saved {
|
||||
color: #00a32a;
|
||||
}
|
||||
|
||||
.customizer-status.error {
|
||||
color: #d63638;
|
||||
}
|
||||
|
||||
/* Indicador de cambios sin guardar */
|
||||
.customizer-unsaved-indicator {
|
||||
display: inline-block;
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
background: #d63638;
|
||||
border-radius: 50%;
|
||||
margin-right: 8px;
|
||||
display: none;
|
||||
}
|
||||
|
||||
.customizer-unsaved-indicator.has-changes {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
/* Scroll suave */
|
||||
.customizer-sidebar-content {
|
||||
scroll-behavior: smooth;
|
||||
}
|
||||
|
||||
/* Loading */
|
||||
.customizer-loading {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
color: #646970;
|
||||
font-size: 14px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<!-- HEADER -->
|
||||
<div class="customizer-header">
|
||||
<div class="customizer-header-left">
|
||||
<div class="customizer-logo">W</div>
|
||||
<div class="customizer-title">Personalizar</div>
|
||||
</div>
|
||||
<button class="customizer-close" onclick="closeCustomizer()" title="Cerrar">×</button>
|
||||
</div>
|
||||
|
||||
<!-- MAIN CONTAINER -->
|
||||
<div class="customizer-container">
|
||||
<!-- SIDEBAR -->
|
||||
<div class="customizer-sidebar">
|
||||
<!-- Menú lateral de secciones -->
|
||||
<div class="customizer-nav">
|
||||
<a href="#" class="customizer-nav-item active" data-section="site-identity">Identidad del sitio</a>
|
||||
<a href="#" class="customizer-nav-item" data-section="colors">Colores</a>
|
||||
<a href="#" class="customizer-nav-item" data-section="typography">Tipografía</a>
|
||||
<a href="#" class="customizer-nav-item" data-section="content">Contenido</a>
|
||||
<a href="#" class="customizer-nav-item" data-section="media">Medios</a>
|
||||
<a href="#" class="customizer-nav-item" data-section="contact">Contacto</a>
|
||||
<a href="#" class="customizer-nav-item" data-section="social">Redes Sociales</a>
|
||||
</div>
|
||||
|
||||
<!-- Contenido de secciones -->
|
||||
<div class="customizer-sidebar-content">
|
||||
<!-- Sección: Identidad del sitio -->
|
||||
<div class="customizer-section active" id="site-identity">
|
||||
<div class="customizer-section-title">Identidad del sitio</div>
|
||||
|
||||
<div class="customizer-control">
|
||||
<label class="customizer-control-label">Nombre del sitio</label>
|
||||
<input type="text" class="customizer-control-input" id="site_name" value="Mi Restaurante" data-setting="site_name">
|
||||
<div class="customizer-control-description">El nombre aparece en el encabezado del sitio.</div>
|
||||
</div>
|
||||
|
||||
<div class="customizer-control">
|
||||
<label class="customizer-control-label">Descripción corta</label>
|
||||
<textarea class="customizer-control-input customizer-control-textarea" id="site_description" data-setting="site_description">El mejor restaurante de la ciudad</textarea>
|
||||
<div class="customizer-control-description">En pocas palabras, explica de qué trata este sitio.</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Sección: Colores -->
|
||||
<div class="customizer-section" id="colors">
|
||||
<div class="customizer-section-title">Colores</div>
|
||||
|
||||
<div class="customizer-control">
|
||||
<label class="customizer-control-label">Color primario</label>
|
||||
<div class="customizer-color-group">
|
||||
<input type="color" class="customizer-color-picker" id="color_primary" value="#c94d4d" data-setting="color_primary">
|
||||
<input type="text" class="customizer-control-input customizer-color-text" id="color_primary_text" value="#c94d4d" readonly>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="customizer-control">
|
||||
<label class="customizer-control-label">Color secundario</label>
|
||||
<div class="customizer-color-group">
|
||||
<input type="color" class="customizer-color-picker" id="color_secondary" value="#d97757" data-setting="color_secondary">
|
||||
<input type="text" class="customizer-control-input customizer-color-text" id="color_secondary_text" value="#d97757" readonly>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="customizer-control">
|
||||
<label class="customizer-control-label">Color de texto</label>
|
||||
<div class="customizer-color-group">
|
||||
<input type="color" class="customizer-color-picker" id="color_text" value="#2c2c2c" data-setting="color_text">
|
||||
<input type="text" class="customizer-control-input customizer-color-text" id="color_text_text" value="#2c2c2c" readonly>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Sección: Tipografía -->
|
||||
<div class="customizer-section" id="typography">
|
||||
<div class="customizer-section-title">Tipografía</div>
|
||||
|
||||
<div class="customizer-control">
|
||||
<label class="customizer-control-label">Familia de fuente</label>
|
||||
<select class="customizer-control-input" id="font_family" data-setting="font_family">
|
||||
<option value="Roboto">Roboto</option>
|
||||
<option value="Georgia">Georgia</option>
|
||||
<option value="Playfair Display">Playfair Display</option>
|
||||
<option value="Cormorant Garamond">Cormorant Garamond</option>
|
||||
<option value="Oswald">Oswald</option>
|
||||
<option value="Arial">Arial</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Sección: Contenido -->
|
||||
<div class="customizer-section" id="content">
|
||||
<div class="customizer-section-title">Contenido</div>
|
||||
|
||||
<div class="customizer-control">
|
||||
<label class="customizer-control-label">Título principal</label>
|
||||
<input type="text" class="customizer-control-input" id="hero_title" value="Bienvenido" data-setting="hero_title">
|
||||
</div>
|
||||
|
||||
<div class="customizer-control">
|
||||
<label class="customizer-control-label">Descripción</label>
|
||||
<textarea class="customizer-control-input customizer-control-textarea" id="hero_description" data-setting="hero_description">Descripción de tu restaurante...</textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Sección: Medios -->
|
||||
<div class="customizer-section" id="media">
|
||||
<div class="customizer-section-title">Medios</div>
|
||||
|
||||
<div class="customizer-control">
|
||||
<label class="customizer-control-label">Logo</label>
|
||||
<input type="url" class="customizer-control-input" id="media_logo" placeholder="https://ejemplo.com/logo.png" data-setting="media_logo">
|
||||
<div class="customizer-control-description">URL de la imagen del logo</div>
|
||||
</div>
|
||||
|
||||
<div class="customizer-control">
|
||||
<label class="customizer-control-label">Imagen Hero</label>
|
||||
<input type="url" class="customizer-control-input" id="media_hero" placeholder="https://ejemplo.com/hero.jpg" data-setting="media_hero">
|
||||
<div class="customizer-control-description">Imagen de fondo para la sección principal</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Sección: Contacto -->
|
||||
<div class="customizer-section" id="contact">
|
||||
<div class="customizer-section-title">Contacto</div>
|
||||
|
||||
<div class="customizer-control">
|
||||
<label class="customizer-control-label">Dirección</label>
|
||||
<input type="text" class="customizer-control-input" id="contact_address" placeholder="Calle Principal 123" data-setting="contact_address">
|
||||
</div>
|
||||
|
||||
<div class="customizer-control">
|
||||
<label class="customizer-control-label">Teléfono</label>
|
||||
<input type="tel" class="customizer-control-input" id="contact_phone" placeholder="+34 123 456 789" data-setting="contact_phone">
|
||||
</div>
|
||||
|
||||
<div class="customizer-control">
|
||||
<label class="customizer-control-label">Email</label>
|
||||
<input type="email" class="customizer-control-input" id="contact_email" placeholder="contacto@restaurante.com" data-setting="contact_email">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Sección: Redes Sociales -->
|
||||
<div class="customizer-section" id="social">
|
||||
<div class="customizer-section-title">Redes Sociales</div>
|
||||
|
||||
<div class="customizer-control">
|
||||
<label class="customizer-control-label">Facebook</label>
|
||||
<input type="url" class="customizer-control-input" id="social_facebook" placeholder="https://facebook.com/tu-pagina" data-setting="social_facebook">
|
||||
</div>
|
||||
|
||||
<div class="customizer-control">
|
||||
<label class="customizer-control-label">Instagram</label>
|
||||
<input type="url" class="customizer-control-input" id="social_instagram" placeholder="https://instagram.com/tu-cuenta" data-setting="social_instagram">
|
||||
</div>
|
||||
|
||||
<div class="customizer-control">
|
||||
<label class="customizer-control-label">WhatsApp</label>
|
||||
<input type="tel" class="customizer-control-input" id="social_whatsapp" placeholder="+34123456789" data-setting="social_whatsapp">
|
||||
<div class="customizer-control-description">Número de WhatsApp para botón flotante</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- PREVIEW -->
|
||||
<div class="customizer-preview">
|
||||
<div class="customizer-loading" id="preview-loading">Cargando vista previa...</div>
|
||||
<iframe id="preview-iframe" src="about:blank" style="display: none;"></iframe>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- FOOTER -->
|
||||
<div class="customizer-footer">
|
||||
<div class="customizer-footer-left">
|
||||
<span class="customizer-unsaved-indicator" id="unsaved-indicator"></span>
|
||||
<span class="customizer-status" id="status-text">Listo</span>
|
||||
</div>
|
||||
<div class="customizer-footer-right">
|
||||
<button class="customizer-btn customizer-btn-secondary customizer-btn-discard" id="btn-discard" onclick="discardChanges()">Descartar cambios</button>
|
||||
<button class="customizer-btn customizer-btn-primary" id="btn-save" onclick="saveChanges()">Guardar y Publicar</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
// Estado del customizer
|
||||
let hasUnsavedChanges = false;
|
||||
let originalValues = {};
|
||||
let currentValues = {};
|
||||
|
||||
// Inicializar
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
// Guardar valores originales
|
||||
document.querySelectorAll('[data-setting]').forEach(input => {
|
||||
originalValues[input.dataset.setting] = input.value;
|
||||
currentValues[input.dataset.setting] = input.value;
|
||||
});
|
||||
|
||||
// Navegación entre secciones
|
||||
document.querySelectorAll('.customizer-nav-item').forEach(item => {
|
||||
item.addEventListener('click', function(e) {
|
||||
e.preventDefault();
|
||||
const section = this.dataset.section;
|
||||
showSection(section);
|
||||
});
|
||||
});
|
||||
|
||||
// Sincronizar color pickers
|
||||
document.querySelectorAll('.customizer-color-picker').forEach(picker => {
|
||||
const textInput = document.getElementById(picker.id + '_text');
|
||||
if (textInput) {
|
||||
picker.addEventListener('input', function() {
|
||||
textInput.value = this.value;
|
||||
markAsChanged();
|
||||
updatePreview();
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// Escuchar cambios en inputs
|
||||
document.querySelectorAll('[data-setting]').forEach(input => {
|
||||
input.addEventListener('input', function() {
|
||||
markAsChanged();
|
||||
updatePreview();
|
||||
});
|
||||
|
||||
input.addEventListener('change', function() {
|
||||
markAsChanged();
|
||||
updatePreview();
|
||||
});
|
||||
});
|
||||
|
||||
// Confirmar antes de salir si hay cambios
|
||||
window.addEventListener('beforeunload', function(e) {
|
||||
if (hasUnsavedChanges) {
|
||||
e.preventDefault();
|
||||
e.returnValue = '';
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// Mostrar sección
|
||||
function showSection(sectionId) {
|
||||
// Ocultar todas las secciones
|
||||
document.querySelectorAll('.customizer-section').forEach(section => {
|
||||
section.classList.remove('active');
|
||||
});
|
||||
|
||||
// Mostrar sección seleccionada
|
||||
document.getElementById(sectionId).classList.add('active');
|
||||
|
||||
// Actualizar navegación
|
||||
document.querySelectorAll('.customizer-nav-item').forEach(item => {
|
||||
item.classList.remove('active');
|
||||
if (item.dataset.section === sectionId) {
|
||||
item.classList.add('active');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Marcar como cambiado
|
||||
function markAsChanged() {
|
||||
hasUnsavedChanges = true;
|
||||
document.getElementById('unsaved-indicator').classList.add('has-changes');
|
||||
document.getElementById('btn-discard').classList.add('has-changes');
|
||||
|
||||
// Actualizar valores actuales
|
||||
document.querySelectorAll('[data-setting]').forEach(input => {
|
||||
currentValues[input.dataset.setting] = input.value;
|
||||
});
|
||||
}
|
||||
|
||||
// Actualizar preview (simulado)
|
||||
function updatePreview() {
|
||||
// En un customizer real, aquí se actualizaría el iframe
|
||||
// Por ahora solo simulamos
|
||||
console.log('Preview actualizado:', currentValues);
|
||||
}
|
||||
|
||||
// Guardar cambios
|
||||
function saveChanges() {
|
||||
const btn = document.getElementById('btn-save');
|
||||
const status = document.getElementById('status-text');
|
||||
|
||||
btn.disabled = true;
|
||||
status.textContent = 'Guardando...';
|
||||
status.className = 'customizer-status saving';
|
||||
|
||||
// Simular guardado
|
||||
setTimeout(() => {
|
||||
// Guardar valores originales
|
||||
Object.keys(currentValues).forEach(key => {
|
||||
originalValues[key] = currentValues[key];
|
||||
});
|
||||
|
||||
hasUnsavedChanges = false;
|
||||
document.getElementById('unsaved-indicator').classList.remove('has-changes');
|
||||
document.getElementById('btn-discard').classList.remove('has-changes');
|
||||
|
||||
status.textContent = 'Guardado';
|
||||
status.className = 'customizer-status saved';
|
||||
btn.disabled = false;
|
||||
|
||||
setTimeout(() => {
|
||||
status.textContent = 'Listo';
|
||||
status.className = 'customizer-status';
|
||||
}, 2000);
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
// Descartar cambios
|
||||
function discardChanges() {
|
||||
if (!confirm('¿Descartar todos los cambios sin guardar?')) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Restaurar valores originales
|
||||
Object.keys(originalValues).forEach(key => {
|
||||
const input = document.querySelector(`[data-setting="${key}"]`);
|
||||
if (input) {
|
||||
input.value = originalValues[key];
|
||||
currentValues[key] = originalValues[key];
|
||||
}
|
||||
});
|
||||
|
||||
// Sincronizar color pickers
|
||||
document.querySelectorAll('.customizer-color-picker').forEach(picker => {
|
||||
const textInput = document.getElementById(picker.id + '_text');
|
||||
if (textInput) {
|
||||
picker.value = textInput.value;
|
||||
}
|
||||
});
|
||||
|
||||
hasUnsavedChanges = false;
|
||||
document.getElementById('unsaved-indicator').classList.remove('has-changes');
|
||||
document.getElementById('btn-discard').classList.remove('has-changes');
|
||||
|
||||
updatePreview();
|
||||
}
|
||||
|
||||
// Cerrar customizer
|
||||
function closeCustomizer() {
|
||||
if (hasUnsavedChanges) {
|
||||
if (!confirm('¿Tienes cambios sin guardar. ¿Seguro que quieres salir?')) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
// En un customizer real, aquí se redirigiría
|
||||
alert('Redirigiendo al dashboard...');
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
1597
demo/templates/customizer.html
Normal file
1597
demo/templates/customizer.html
Normal file
File diff suppressed because it is too large
Load Diff
108
demo/templates/dashboard.html
Normal file
108
demo/templates/dashboard.html
Normal file
@@ -0,0 +1,108 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Dashboard - 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;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
.btn {
|
||||
padding: 10px 20px;
|
||||
background: #667eea;
|
||||
color: white;
|
||||
text-decoration: none;
|
||||
border-radius: 5px;
|
||||
}
|
||||
.sites {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
|
||||
gap: 20px;
|
||||
}
|
||||
.site-card {
|
||||
background: white;
|
||||
padding: 20px;
|
||||
border-radius: 5px;
|
||||
box-shadow: 0 2px 5px rgba(0,0,0,0.1);
|
||||
}
|
||||
.status {
|
||||
display: inline-block;
|
||||
padding: 5px 10px;
|
||||
border-radius: 3px;
|
||||
font-size: 12px;
|
||||
margin-top: 10px;
|
||||
}
|
||||
.status.draft { background: #ffc107; }
|
||||
.status.pending { background: #ff9800; }
|
||||
.status.published { background: #4caf50; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="header">
|
||||
<h1>📊 Mi Panel de Control</h1>
|
||||
<div>
|
||||
<a href="/dashboard/admin" class="btn" style="background: #28a745;">⚙️ Admin</a>
|
||||
<a href="/dashboard/create" class="btn">➕ Crear Sitio</a>
|
||||
<a href="/logout" class="btn" style="background: #ff4d4d;">Salir</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="sites">
|
||||
{% for site in sites %}
|
||||
<div class="site-card">
|
||||
<h3>{{ site.slug }}</h3>
|
||||
<p>Tema: {{ site.theme }}</p>
|
||||
<span class="status {{ site.status }}">{{ site.status }}</span>
|
||||
<div style="margin-top: 15px;">
|
||||
<a href="/customizer/{{ site.id }}" class="btn">✏️ Editar</a>
|
||||
{% if site.status == 'draft' %}
|
||||
<button onclick="submitSite({{ site.id }})" class="btn" style="background: #ff9800; border: none; cursor: pointer;">📤 Enviar</button>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
|
||||
{% if not sites %}
|
||||
<div class="site-card">
|
||||
<p>No tienes sitios aún. <a href="/dashboard/create">Crear uno</a></p>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function submitSite(siteId) {
|
||||
if (confirm('¿Enviar sitio para aprobación?')) {
|
||||
fetch(`/dashboard/submit/${siteId}`, {
|
||||
method: 'POST',
|
||||
headers: {'Content-Type': 'application/json'}
|
||||
})
|
||||
.then(r => r.json())
|
||||
.then(data => {
|
||||
if (data.success) {
|
||||
alert('✅ Sitio enviado para aprobación');
|
||||
location.reload();
|
||||
} else {
|
||||
alert('❌ Error: ' + (data.error || 'Error al enviar'));
|
||||
}
|
||||
})
|
||||
.catch(err => {
|
||||
console.error('Error:', err);
|
||||
alert('❌ Error de conexión');
|
||||
});
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
47
demo/templates/landing.html
Normal file
47
demo/templates/landing.html
Normal file
@@ -0,0 +1,47 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>PageBuilder SaaS - Demo</title>
|
||||
<style>
|
||||
* { margin: 0; padding: 0; box-sizing: border-box; }
|
||||
body {
|
||||
font-family: Arial, sans-serif;
|
||||
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
||||
min-height: 100vh;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.container {
|
||||
background: white;
|
||||
padding: 40px;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0 10px 40px rgba(0,0,0,0.2);
|
||||
text-align: center;
|
||||
max-width: 500px;
|
||||
}
|
||||
h1 { color: #333; margin-bottom: 20px; }
|
||||
p { color: #666; margin-bottom: 30px; }
|
||||
.btn {
|
||||
display: inline-block;
|
||||
padding: 12px 30px;
|
||||
background: #667eea;
|
||||
color: white;
|
||||
text-decoration: none;
|
||||
border-radius: 5px;
|
||||
margin: 5px;
|
||||
}
|
||||
.btn:hover { background: #5568d3; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<h1>🎨 PageBuilder SaaS</h1>
|
||||
<p>Crea tu sitio web en minutos</p>
|
||||
<a href="/register" class="btn">Registrarse</a>
|
||||
<a href="/login" class="btn">Iniciar Sesión</a>
|
||||
<a href="/admin" class="btn" style="background: #ff4d4d;">Admin</a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
1442
demo/templates/landing_real.html
Normal file
1442
demo/templates/landing_real.html
Normal file
File diff suppressed because it is too large
Load Diff
95
demo/templates/login.html
Normal file
95
demo/templates/login.html
Normal file
@@ -0,0 +1,95 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Login - Demo</title>
|
||||
<style>
|
||||
* { margin: 0; padding: 0; box-sizing: border-box; }
|
||||
body {
|
||||
font-family: Arial, sans-serif;
|
||||
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
||||
min-height: 100vh;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.container {
|
||||
background: white;
|
||||
padding: 40px;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0 10px 40px rgba(0,0,0,0.2);
|
||||
max-width: 400px;
|
||||
width: 100%;
|
||||
}
|
||||
h1 { margin-bottom: 20px; color: #333; }
|
||||
input {
|
||||
width: 100%;
|
||||
padding: 12px;
|
||||
margin-bottom: 15px;
|
||||
border: 1px solid #ddd;
|
||||
border-radius: 5px;
|
||||
}
|
||||
.btn {
|
||||
width: 100%;
|
||||
padding: 12px;
|
||||
background: #667eea;
|
||||
color: white;
|
||||
border: none;
|
||||
border-radius: 5px;
|
||||
cursor: pointer;
|
||||
font-size: 16px;
|
||||
}
|
||||
.btn:hover { background: #5568d3; }
|
||||
a { color: #667eea; text-decoration: none; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<h1>🔐 Iniciar Sesión</h1>
|
||||
<form id="loginForm">
|
||||
<input type="email" id="email" placeholder="Email" required>
|
||||
<input type="password" id="password" placeholder="Contraseña" required>
|
||||
<button type="submit" class="btn">Iniciar Sesión</button>
|
||||
</form>
|
||||
<p style="text-align: center; margin-top: 15px;">
|
||||
<a href="/register">¿No tienes cuenta? Regístrate</a>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
document.getElementById('loginForm').addEventListener('submit', async (e) => {
|
||||
e.preventDefault();
|
||||
const data = {
|
||||
email: document.getElementById('email').value,
|
||||
password: document.getElementById('password').value
|
||||
};
|
||||
|
||||
const res = await fetch('/login', {
|
||||
method: 'POST',
|
||||
headers: {'Content-Type': 'application/json'},
|
||||
body: JSON.stringify(data)
|
||||
});
|
||||
|
||||
let result;
|
||||
try {
|
||||
result = await res.json();
|
||||
} catch (e) {
|
||||
const text = await res.text();
|
||||
console.error('❌ Servidor devolvió HTML:', text.substring(0, 200));
|
||||
alert('❌ Error del servidor. Revisa la consola.');
|
||||
return;
|
||||
}
|
||||
|
||||
if (result.success) {
|
||||
console.log('[LOGIN FRONTEND] Respuesta recibida:', result);
|
||||
console.log('[LOGIN FRONTEND] Redirect URL:', result.redirect);
|
||||
const redirectUrl = result.redirect || '/dashboard';
|
||||
console.log('[LOGIN FRONTEND] Redirigiendo a:', redirectUrl);
|
||||
window.location.href = redirectUrl;
|
||||
} else {
|
||||
alert('❌ ' + (result.error || 'Error al iniciar sesión'));
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
33
demo/templates/public_site.html
Normal file
33
demo/templates/public_site.html
Normal file
@@ -0,0 +1,33 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>{{ content.site_name or 'Mi Sitio' }}</title>
|
||||
<style>
|
||||
* { margin: 0; padding: 0; box-sizing: border-box; }
|
||||
body {
|
||||
font-family: {{ content.typography.font_family if content.typography else 'Arial' }};
|
||||
background: white;
|
||||
padding: 40px;
|
||||
}
|
||||
.container {
|
||||
max-width: 800px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
h1 {
|
||||
color: {{ content.colors.primary if content.colors else '#ff4d4d' }};
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
p {
|
||||
color: {{ content.colors.text if content.colors else '#333' }};
|
||||
line-height: 1.6;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<h1>{{ content.hero_title or 'Título' }}</h1>
|
||||
<p>{{ content.hero_description or 'Descripción' }}</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
132
demo/templates/register.html
Normal file
132
demo/templates/register.html
Normal file
@@ -0,0 +1,132 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Registro - Demo</title>
|
||||
<style>
|
||||
* { margin: 0; padding: 0; box-sizing: border-box; }
|
||||
body {
|
||||
font-family: Arial, sans-serif;
|
||||
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
||||
min-height: 100vh;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.container {
|
||||
background: white;
|
||||
padding: 40px;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0 10px 40px rgba(0,0,0,0.2);
|
||||
max-width: 400px;
|
||||
width: 100%;
|
||||
}
|
||||
h1 { margin-bottom: 20px; color: #333; }
|
||||
input, select {
|
||||
width: 100%;
|
||||
padding: 12px;
|
||||
margin-bottom: 15px;
|
||||
border: 1px solid #ddd;
|
||||
border-radius: 5px;
|
||||
}
|
||||
.btn {
|
||||
width: 100%;
|
||||
padding: 12px;
|
||||
background: #667eea;
|
||||
color: white;
|
||||
border: none;
|
||||
border-radius: 5px;
|
||||
cursor: pointer;
|
||||
font-size: 16px;
|
||||
}
|
||||
.btn:hover { background: #5568d3; }
|
||||
a { color: #667eea; text-decoration: none; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<h1>📝 Registrarse</h1>
|
||||
<form id="registerForm">
|
||||
<input type="email" id="email" placeholder="Email" required>
|
||||
<input type="password" id="password" placeholder="Contraseña" required>
|
||||
<select id="plan">
|
||||
<option value="base" {% if plan == 'base' %}selected{% endif %}>Base</option>
|
||||
<option value="pro" {% if plan == 'pro' %}selected{% endif %}>Pro</option>
|
||||
<option value="premium" {% if plan == 'premium' %}selected{% endif %}>Premium</option>
|
||||
</select>
|
||||
<select id="rubro">
|
||||
<option value="gimnasio" {% if rubro == 'gimnasio' or rubro == 'gimnasios' %}selected{% endif %}>Gimnasio</option>
|
||||
<option value="restaurante" {% if rubro == 'restaurante' %}selected{% endif %}>Restaurante</option>
|
||||
<option value="danza" {% if rubro == 'danza' %}selected{% endif %}>Danza</option>
|
||||
<option value="cosmeticos" {% if rubro == 'cosmeticos' %}selected{% endif %}>Cosméticos</option>
|
||||
<option value="despachos" {% if rubro == 'despachos' %}selected{% endif %}>Despachos</option>
|
||||
<option value="educacion" {% if rubro == 'educacion' %}selected{% endif %}>Educación</option>
|
||||
<option value="tienda" {% if rubro == 'tienda' %}selected{% endif %}>Tienda</option>
|
||||
</select>
|
||||
<button type="submit" class="btn">Registrarse</button>
|
||||
</form>
|
||||
<p style="text-align: center; margin-top: 15px;">
|
||||
<a href="/login">¿Ya tienes cuenta? Inicia sesión</a>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
document.getElementById('registerForm').addEventListener('submit', async (e) => {
|
||||
e.preventDefault();
|
||||
|
||||
const email = document.getElementById('email').value;
|
||||
const password = document.getElementById('password').value;
|
||||
const plan = document.getElementById('plan').value;
|
||||
const rubro = document.getElementById('rubro').value;
|
||||
|
||||
if (!email || !password) {
|
||||
alert('❌ Por favor completa email y contraseña');
|
||||
return;
|
||||
}
|
||||
|
||||
const data = {
|
||||
email: email,
|
||||
password: password,
|
||||
plan: plan,
|
||||
rubro: rubro
|
||||
};
|
||||
|
||||
console.log('Enviando registro:', data);
|
||||
|
||||
try {
|
||||
const res = await fetch('/register', {
|
||||
method: 'POST',
|
||||
headers: {'Content-Type': 'application/json'},
|
||||
body: JSON.stringify(data)
|
||||
});
|
||||
|
||||
console.log('Respuesta del servidor:', res.status, res.statusText);
|
||||
|
||||
let result;
|
||||
try {
|
||||
result = await res.json();
|
||||
} catch (e) {
|
||||
// Si no es JSON, el servidor devolvió HTML (error 500)
|
||||
const text = await res.text();
|
||||
console.error('❌ Servidor devolvió HTML en vez de JSON:', text.substring(0, 200));
|
||||
alert('❌ Error del servidor. Revisa la consola para más detalles.');
|
||||
return;
|
||||
}
|
||||
|
||||
console.log('Resultado:', result);
|
||||
|
||||
if (result.success) {
|
||||
// Registro exitoso - mostrar mensaje y redirigir al login
|
||||
alert(result.message || '✅ Registro exitoso. Por favor inicia sesión.');
|
||||
window.location.href = result.redirect || '/login';
|
||||
} else {
|
||||
alert('❌ Error: ' + (result.error || 'Error al registrarse'));
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Error en registro:', error);
|
||||
alert('❌ Error de conexión. Verifica la consola para más detalles.');
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user