33< head >
44 < meta charset ="UTF-8 " />
55 < meta name ="viewport " content ="width=device-width, initial-scale=1.0 " />
6- < title > 🌍 Terra Dourada - Candidato Sem Partido </ title >
6+ < title > 🌍 Terra Dourada - Cadastro de Candidato </ title >
77 < link rel ="stylesheet " href ="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css " />
88 < script src ="
https://cdn.jsdelivr.net/npm/[email protected] /dist/pouchdb.min.js "
> </ script > 99 < script src ="
https://cdn.jsdelivr.net/npm/[email protected] /dist/html2canvas.min.js "
> </ script > 4848 margin-bottom : 8px ;
4949 color : # d4af37 ;
5050 }
51+ .optional {
52+ color : # 888 ;
53+ font-size : 0.8rem ;
54+ font-style : italic;
55+ }
5156 input , textarea {
5257 width : 100% ;
5358 padding : 12px ;
234239 <!-- Formulário de cadastro -->
235240 < div class ="container " id ="formContainer ">
236241 < h1 > 🌍 Terra Dourada</ h1 >
237- < p class ="subtitle "> Candidato Sem Partido </ p >
242+ < p class ="subtitle "> Cadastro de Candidato </ p >
238243
239244 < div class ="photo-upload ">
240245 < div class ="photo-preview " id ="photoPreview ">
@@ -257,7 +262,14 @@ <h1>🌍 Terra Dourada</h1>
257262 </ div >
258263
259264 < div class ="form-group ">
260- < label for ="bioInput "> Biografia (Opcional)</ label >
265+ < label for ="partyInput ">
266+ Partido < span class ="optional "> (Opcional)</ span >
267+ </ label >
268+ < input type ="text " id ="partyInput " placeholder ="Nome do partido ">
269+ </ div >
270+
271+ < div class ="form-group ">
272+ < label for ="bioInput "> Biografia < span class ="optional "> (Opcional)</ span > </ label >
261273 < textarea id ="bioInput " placeholder ="Fale sobre sua trajetória e propostas "> </ textarea >
262274 </ div >
263275
@@ -268,7 +280,7 @@ <h1>🌍 Terra Dourada</h1>
268280 </ div >
269281
270282 < button class ="back-button " id ="backButton ">
271- < i class ="fas fa-arrow-left "> </ i > Voltar ao Login
283+ < i class ="fas fa-arrow-left "> </ i > Voltar
272284 </ button >
273285 </ div >
274286
@@ -279,7 +291,8 @@ <h1>🌍 Terra Dourada</h1>
279291 < h2 id ="confirmationName "> Confirmação de Cadastro</ h2 >
280292 < p > Você está prestes a cadastrar:</ p >
281293 < h3 id ="confirmationCandidateName " style ="color: #d4af37; margin: 10px 0 20px; "> </ h3 >
282- < p id ="confirmationPosition " style ="margin-bottom: 20px; "> </ p >
294+ < p id ="confirmationPosition " style ="margin-bottom: 10px; "> </ p >
295+ < p id ="confirmationParty " style ="margin-bottom: 20px; "> </ p >
283296 < p > Tem certeza de que deseja confirmar o cadastro?</ p >
284297 < div class ="confirmation-buttons ">
285298 < button id ="confirmCadastroButton " class ="confirm-button "> Sim, confirmar cadastro</ button >
@@ -299,6 +312,7 @@ <h3 id="confirmationCandidateName" style="color: #d4af37; margin: 10px 0 20px;">
299312const photoPreview = document . getElementById ( 'photoPreview' ) ;
300313const nameInput = document . getElementById ( 'nameInput' ) ;
301314const positionInput = document . getElementById ( 'positionInput' ) ;
315+ const partyInput = document . getElementById ( 'partyInput' ) ;
302316const bioInput = document . getElementById ( 'bioInput' ) ;
303317const registerButton = document . getElementById ( 'registerButton' ) ;
304318const successMessage = document . getElementById ( 'successMessage' ) ;
@@ -353,6 +367,16 @@ <h3 id="confirmationCandidateName" style="color: #d4af37; margin: 10px 0 20px;">
353367 document . getElementById ( 'confirmationCandidateName' ) . textContent = dadosCandidato . name ;
354368 document . getElementById ( 'confirmationPosition' ) . textContent = `Cargo: ${ dadosCandidato . position } ` ;
355369
370+ // Mostrar partido se existir
371+ const partyElement = document . getElementById ( 'confirmationParty' ) ;
372+ if ( dadosCandidato . party && dadosCandidato . party . trim ( ) !== '' ) {
373+ partyElement . textContent = `Partido: ${ dadosCandidato . party } ` ;
374+ partyElement . style . display = 'block' ;
375+ } else {
376+ partyElement . textContent = 'Partido: Não informado' ;
377+ partyElement . style . display = 'block' ;
378+ }
379+
356380 // Configurar o botão de confirmação
357381 const confirmButton = document . getElementById ( 'confirmCadastroButton' ) ;
358382 confirmButton . onclick = function ( ) {
@@ -391,6 +415,7 @@ <h3 id="confirmationCandidateName" style="color: #d4af37; margin: 10px 0 20px;">
391415 _id : candidateId ,
392416 name : candidateData . name ,
393417 position : candidateData . position ,
418+ party : candidateData . party || '' , // ✅ PARTIDO ADICIONADO
394419 bio : candidateData . bio ,
395420 photo : candidateData . photo ,
396421 screenshot_hash : hashPrint , // ✅ HASH DO SCREENSHOT INCLUÍDO
@@ -409,6 +434,7 @@ <h3 id="confirmationCandidateName" style="color: #d4af37; margin: 10px 0 20px;">
409434 // Limpar o formulário
410435 nameInput . value = '' ;
411436 positionInput . value = '' ;
437+ partyInput . value = '' ;
412438 bioInput . value = '' ;
413439 photoPreview . innerHTML = '<i class="fas fa-user"></i>' ;
414440 photoBase64 = null ;
@@ -434,6 +460,7 @@ <h3 id="confirmationCandidateName" style="color: #d4af37; margin: 10px 0 20px;">
434460registerButton . addEventListener ( 'click' , function ( ) {
435461 const name = nameInput . value . trim ( ) ;
436462 const position = positionInput . value . trim ( ) ;
463+ const party = partyInput . value . trim ( ) ; // ✅ CAPTURAR PARTIDO
437464 const bio = bioInput . value . trim ( ) ;
438465
439466 // Validação básica
@@ -451,6 +478,7 @@ <h3 id="confirmationCandidateName" style="color: #d4af37; margin: 10px 0 20px;">
451478 const dadosCandidato = {
452479 name : name ,
453480 position : position ,
481+ party : party , // ✅ PARTIDO INCLUÍDO
454482 bio : bio ,
455483 photo : photoBase64
456484 } ;
@@ -459,9 +487,9 @@ <h3 id="confirmationCandidateName" style="color: #d4af37; margin: 10px 0 20px;">
459487 abrirTelaConfirmacao ( dadosCandidato ) ;
460488} ) ;
461489
462- // Voltar para a tela de login
490+ // Voltar para o painel de autoridade
463491backButton . addEventListener ( 'click' , function ( ) {
464- window . location . href = 'login .html' ;
492+ window . location . href = 'autoridade .html' ;
465493} ) ;
466494</ script >
467495</ body >
0 commit comments