From 03f9317853ad200f3929e799788decc678a7514a Mon Sep 17 00:00:00 2001 From: admtracksteel Date: Sun, 7 Jun 2026 15:49:58 +0000 Subject: [PATCH] =?UTF-8?q?Divide=20a=20interface=20Minha=20Turma=20em=20a?= =?UTF-8?q?bas=20separando=20a=20configura=C3=A7=C3=A3o=20da=20sala=20e=20?= =?UTF-8?q?equipe=20dos=20alunos?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/app.js | 96 +++++++++++++++++++++++++++++++++++++--------- public/index.html | 98 +++++++++++++++++++++++++++++++---------------- 2 files changed, 144 insertions(+), 50 deletions(-) diff --git a/public/app.js b/public/app.js index d3609ec..8dbe2a0 100644 --- a/public/app.js +++ b/public/app.js @@ -3002,10 +3002,6 @@ const initApp = () => { // Fields const cFormId = document.getElementById('childFormId'); - const cFormTurma = document.getElementById('childFormTurma'); - const cFormSala = document.getElementById('childFormSala'); - const cFormPeriodo = document.getElementById('childFormPeriodo'); - const cFormAuxiliares = document.getElementById('childFormAuxiliares'); const cFormNome = document.getElementById('childFormNome'); const cFormApelido = document.getElementById('childFormApelido'); const cFormDataNasc = document.getElementById('childFormDataNasc'); @@ -3015,6 +3011,47 @@ const initApp = () => { const cFormPais = document.getElementById('childFormPais'); const cFormAutorizados = document.getElementById('childFormAutorizados'); + // Fields Turma Config + const tabTurmaConfig = document.getElementById('tabTurmaConfig'); + const tabTurmaAlunos = document.getElementById('tabTurmaAlunos'); + const turmaConfigSection = document.getElementById('turmaConfigSection'); + const turmaAlunosSection = document.getElementById('turmaAlunosSection'); + + const configTurmaNome = document.getElementById('configTurmaNome'); + const configTurmaSala = document.getElementById('configTurmaSala'); + const configTurmaPeriodo = document.getElementById('configTurmaPeriodo'); + const configTurmaProfTitular = document.getElementById('configTurmaProfTitular'); + const configTurmaProfAux1 = document.getElementById('configTurmaProfAux1'); + const configTurmaProfAux2 = document.getElementById('configTurmaProfAux2'); + const configTurmaCuidadora = document.getElementById('configTurmaCuidadora'); + const btnSaveTurmaConfig = document.getElementById('btnSaveTurmaConfig'); + + // Tab Logic + if (tabTurmaConfig) { + tabTurmaConfig.addEventListener('click', () => { + tabTurmaConfig.classList.add('active'); + tabTurmaConfig.style.borderBottomColor = 'var(--brand-green)'; + tabTurmaConfig.style.color = 'var(--brand-green)'; + tabTurmaAlunos.classList.remove('active'); + tabTurmaAlunos.style.borderBottomColor = 'transparent'; + tabTurmaAlunos.style.color = 'var(--text-secondary)'; + turmaConfigSection.style.display = 'flex'; + turmaAlunosSection.style.display = 'none'; + }); + } + if (tabTurmaAlunos) { + tabTurmaAlunos.addEventListener('click', () => { + tabTurmaAlunos.classList.add('active'); + tabTurmaAlunos.style.borderBottomColor = 'var(--brand-green)'; + tabTurmaAlunos.style.color = 'var(--brand-green)'; + tabTurmaConfig.classList.remove('active'); + tabTurmaConfig.style.borderBottomColor = 'transparent'; + tabTurmaConfig.style.color = 'var(--text-secondary)'; + turmaAlunosSection.style.display = 'flex'; + turmaConfigSection.style.display = 'none'; + }); + } + // Toggle Especial Fields if (cFormEspecial) { cFormEspecial.addEventListener('change', () => { @@ -3034,6 +3071,40 @@ const initApp = () => { localStorage.setItem('camila_turma', JSON.stringify(turma)); }; + const loadTurmaConfig = () => { + return JSON.parse(localStorage.getItem('camila_config_turma') || '{}'); + }; + + const saveTurmaConfig = (cfg) => { + localStorage.setItem('camila_config_turma', JSON.stringify(cfg)); + showCustomAlert('Sucesso', 'Configurações da turma salvas com sucesso!'); + }; + + if (btnSaveTurmaConfig) { + btnSaveTurmaConfig.addEventListener('click', () => { + saveTurmaConfig({ + nome: configTurmaNome.value, + sala: configTurmaSala.value, + periodo: configTurmaPeriodo.value, + profTitular: configTurmaProfTitular.value, + profAux1: configTurmaProfAux1.value, + profAux2: configTurmaProfAux2.value, + cuidadora: configTurmaCuidadora.value + }); + }); + } + + const populateTurmaConfig = () => { + const cfg = loadTurmaConfig(); + if(configTurmaNome) configTurmaNome.value = cfg.nome || ''; + if(configTurmaSala) configTurmaSala.value = cfg.sala || ''; + if(configTurmaPeriodo) configTurmaPeriodo.value = cfg.periodo || 'Integral'; + if(configTurmaProfTitular) configTurmaProfTitular.value = cfg.profTitular || ''; + if(configTurmaProfAux1) configTurmaProfAux1.value = cfg.profAux1 || ''; + if(configTurmaProfAux2) configTurmaProfAux2.value = cfg.profAux2 || ''; + if(configTurmaCuidadora) configTurmaCuidadora.value = cfg.cuidadora || ''; + }; + const renderTurmaList = () => { if (!childrenList) return; const turma = loadTurma(); @@ -3049,7 +3120,7 @@ const initApp = () => {
${escapeHtml(c.nome)} ${c.especial ? '⭐' : ''}
-
${escapeHtml(c.turma || '')} - ${escapeHtml(c.periodo || '')}
+
${escapeHtml(c.apelido || '')}
@@ -3061,10 +3132,6 @@ const initApp = () => { const clearChildForm = () => { cFormId.value = ''; - cFormTurma.value = ''; - cFormSala.value = ''; - cFormPeriodo.value = 'Integral'; - cFormAuxiliares.value = ''; cFormNome.value = ''; cFormApelido.value = ''; cFormDataNasc.value = ''; @@ -3082,10 +3149,6 @@ const initApp = () => { if (!c) return; cFormId.value = c.id; - cFormTurma.value = c.turma || ''; - cFormSala.value = c.sala || ''; - cFormPeriodo.value = c.periodo || 'Integral'; - cFormAuxiliares.value = c.auxiliares || ''; cFormNome.value = c.nome || ''; cFormApelido.value = c.apelido || ''; cFormDataNasc.value = c.dataNasc || ''; @@ -3112,6 +3175,7 @@ const initApp = () => { if (btnMinhaTurma) { btnMinhaTurma.addEventListener('click', () => { minhaTurmaModal.style.display = 'flex'; + populateTurmaConfig(); renderTurmaList(); clearChildForm(); }); @@ -3139,10 +3203,6 @@ const initApp = () => { const newChild = { id, - turma: cFormTurma.value.trim(), - sala: cFormSala.value.trim(), - periodo: cFormPeriodo.value, - auxiliares: cFormAuxiliares.value.trim(), nome: cFormNome.value.trim(), apelido: cFormApelido.value.trim(), dataNasc: cFormDataNasc.value, @@ -3194,7 +3254,7 @@ const initApp = () => { role: 'user', content: `A professora ditou as seguintes informações para cadastrar uma criança na turma: "${transcript}". Por favor, extraia os dados e retorne APENAS um JSON válido com os seguintes campos: -"turma", "sala", "periodo", "auxiliares", "nome", "apelido", "dataNasc" (formato YYYY-MM-DD), "especial" (boolean), "especialDetalhes", "pais", "autorizados". +"nome", "apelido", "dataNasc" (formato YYYY-MM-DD), "especial" (boolean), "especialDetalhes", "pais", "autorizados". Se algum dado não for mencionado, deixe a string vazia ou false para boolean.` }], temperature: 0.1 diff --git a/public/index.html b/public/index.html index 60d2099..4545571 100644 --- a/public/index.html +++ b/public/index.html @@ -528,18 +528,74 @@
-
- -
-
-

Lista de Crianças

- +
+ + +
+ +
+ + +
+

Configurações e Equipe da Turma

+

Defina as informações gerais da turma. Estas informações valem para todos os alunos e serão usadas nos relatórios.

+ +
+
+ + +
+
+ + +
+
+ + +
-
- -
Carregando turma...
+ +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ +
+
+ + + +