refactor: encapsular CSS en páginas app, groups y preferences

Co-authored-by: aider (openrouter/openai/gpt-5) <aider@aider.chat>
webui
borja 2 weeks ago
parent ad2b612835
commit 6d3754a1fa

@ -21,11 +21,11 @@
}; };
</script> </script>
<h1 style="margin-bottom: .5rem;">Panel</h1> <h1 class="title">Panel</h1>
<p style="color: var(--color-text-muted); margin: 0 0 1rem 0;">Sesión: <strong>{data.userId}</strong></p> <p class="subtle">Sesión: <strong>{data.userId}</strong></p>
<form method="GET" action="/app" style="margin: 0 0 1rem 0; display: flex; gap: 8px; align-items: center; flex-wrap: wrap;"> <form method="GET" action="/app" class="filters">
<div style="flex: 1 1 260px; min-width: 200px;"> <div class="grow">
<TextField name="q" placeholder="Buscar tareas..." value={data.q ?? ''} /> <TextField name="q" placeholder="Buscar tareas..." value={data.q ?? ''} />
</div> </div>
<select name="soonDays"> <select name="soonDays">
@ -37,12 +37,12 @@
<button type="submit">Filtrar</button> <button type="submit">Filtrar</button>
</form> </form>
<h2 style="margin: .5rem 0;">Mis tareas (abiertas)</h2> <h2 class="section-title">Mis tareas (abiertas)</h2>
{#if data.tasks.length === 0} {#if data.tasks.length === 0}
<p>No tienes tareas abiertas.</p> <p>No tienes tareas abiertas.</p>
{:else} {:else}
<Card> <Card>
<ul style="margin: 0; padding: 0;"> <ul class="list">
{#each data.tasks as t} {#each data.tasks as t}
<TaskItem {...t} /> <TaskItem {...t} />
{/each} {/each}
@ -61,4 +61,20 @@
/> />
{/if} {/if}
<p style="margin-top:.75rem; color: var(--color-text-muted);">La cookie de sesión se renueva con cada visita (idle timeout).</p> <p class="footnote">La cookie de sesión se renueva con cada visita (idle timeout).</p>
<style>
.title { margin-bottom: .5rem; }
.subtle { color: var(--color-text-muted); margin: 0 0 1rem 0; }
.filters {
margin: 0 0 1rem 0;
display: flex;
gap: 8px;
align-items: center;
flex-wrap: wrap;
}
.grow { flex: 1 1 260px; min-width: 200px; }
.section-title { margin: .5rem 0; }
.list { margin: 0; padding: 0; list-style: none; }
.footnote { margin-top: .75rem; color: var(--color-text-muted); }
</style>

@ -26,7 +26,7 @@
{#if groups.length === 0} {#if groups.length === 0}
<p>No perteneces a ningún grupo permitido.</p> <p>No perteneces a ningún grupo permitido.</p>
{:else} {:else}
<h1 style="margin-bottom: .75rem;">Grupos</h1> <h1 class="title">Grupos</h1>
<div class="grid"> <div class="grid">
{#each groups as g} {#each groups as g}
<GroupCard id={g.id} name={g.name} counts={g.counts} previews={previews[g.id] || []} /> <GroupCard id={g.id} name={g.name} counts={g.counts} previews={previews[g.id] || []} />
@ -35,6 +35,7 @@
{/if} {/if}
<style> <style>
.title { margin-bottom: .75rem; }
.grid { .grid {
display: grid; display: grid;
grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));

@ -23,27 +23,27 @@
]; ];
</script> </script>
<section style="max-width: 720px; margin: 1.5rem auto; padding: 0 1rem;"> <section class="page">
<h1 style="font-size: 1.4rem; font-weight: 600; margin-bottom: .75rem;">Preferencias de recordatorios</h1> <h1 class="title">Preferencias de recordatorios</h1>
<Card> <Card>
<form method="POST" style="display: grid; gap: .75rem;"> <form method="POST" class="form">
<div> <div>
<label for="freq" style="display:block; font-weight:600; margin-bottom: 0.25rem;">Frecuencia</label> <label for="freq">Frecuencia</label>
<SegmentedControl name="freq" options={options} bind:value={freq} /> <SegmentedControl name="freq" options={options} bind:value={freq} />
<p style="font-size: 0.9rem; color: var(--color-text-muted); margin-top: 0.25rem;"> <p class="help">
- Diario: cada día a la hora indicada. - Laborables: solo lunes a viernes. - Semanal: los lunes. - Diario: cada día a la hora indicada. - Laborables: solo lunes a viernes. - Semanal: los lunes.
</p> </p>
</div> </div>
<div> <div>
<label for="time" style="display:block; font-weight:600; margin-bottom: 0.25rem;">Hora (HH:MM)</label> <label for="time">Hora (HH:MM)</label>
<input id="time" name="time" type="time" step="60" bind:value={time} disabled={freq === 'off'} /> <input id="time" name="time" type="time" step="60" bind:value={time} disabled={freq === 'off'} />
<p style="font-size: 0.9rem; color: var(--color-text-muted); margin-top: 0.25rem;">Zona horaria: {data.tz}</p> <p class="help">Zona horaria: {data.tz}</p>
</div> </div>
{#if form?.error} {#if form?.error}
<div style="color: var(--color-danger);">{form.error}</div> <div class="error">{form.error}</div>
{/if} {/if}
<div> <div>
@ -52,10 +52,21 @@
</form> </form>
</Card> </Card>
<div style="margin-top: 1rem;"> <div class="section">
<h2 style="font-size: 1.1rem; font-weight: 600;">Próximo recordatorio</h2> <h2 class="subtitle">Próximo recordatorio</h2>
<ul> <ul>
<li>Servidor: {data.next ?? '—'}</li> <li>Servidor: {data.next ?? '—'}</li>
</ul> </ul>
</div> </div>
</section> </section>
<style>
.page { max-width: 720px; margin: 1.5rem auto; padding: 0 1rem; }
.title { font-size: 1.4rem; font-weight: 600; margin-bottom: .75rem; }
.form { display: grid; gap: .75rem; }
label { display: block; font-weight: 600; margin-bottom: 0.25rem; }
.help { font-size: 0.9rem; color: var(--color-text-muted); margin-top: 0.25rem; }
.error { color: var(--color-danger); }
.section { margin-top: 1rem; }
.subtitle { font-size: 1.1rem; font-weight: 600; }
</style>

Loading…
Cancel
Save