Skip to content

Commit 2d9e83b

Browse files
authored
Add files via upload
1 parent ce58e88 commit 2d9e83b

File tree

2 files changed

+147
-7
lines changed

2 files changed

+147
-7
lines changed

cad_candidato.html

Lines changed: 35 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
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>
@@ -48,6 +48,11 @@
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;
@@ -234,7 +239,7 @@
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;">
299312
const photoPreview = document.getElementById('photoPreview');
300313
const nameInput = document.getElementById('nameInput');
301314
const positionInput = document.getElementById('positionInput');
315+
const partyInput = document.getElementById('partyInput');
302316
const bioInput = document.getElementById('bioInput');
303317
const registerButton = document.getElementById('registerButton');
304318
const 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;">
434460
registerButton.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
463491
backButton.addEventListener('click', function() {
464-
window.location.href = 'login.html';
492+
window.location.href = 'autoridade.html';
465493
});
466494
</script>
467495
</body>

painel_eleicao.html

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
<!-- painel_eleicao.html -->
2+
<!DOCTYPE html>
3+
<html lang="pt-BR">
4+
<head>
5+
<meta charset="UTF-8">
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7+
<title>Painel da Eleição — Terra Dourada</title>
8+
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/pouchdb.min.js"></script>
9+
<style>
10+
body {
11+
background: #050703;
12+
color: #f5f5f5;
13+
font-family: system-ui, sans-serif;
14+
margin: 0;
15+
padding: 20px;
16+
}
17+
.container {
18+
max-width: 1000px;
19+
margin: 0 auto;
20+
}
21+
header {
22+
text-align: center;
23+
margin-bottom: 30px;
24+
border-bottom: 1px solid rgba(212,175,55,0.3);
25+
padding-bottom: 20px;
26+
}
27+
.back-btn {
28+
background: transparent;
29+
border: 1px solid #d4af37;
30+
color: #d4af37;
31+
padding: 10px 20px;
32+
border-radius: 20px;
33+
cursor: pointer;
34+
margin-bottom: 20px;
35+
}
36+
.tabs {
37+
display: flex;
38+
gap: 10px;
39+
margin-bottom: 20px;
40+
justify-content: center;
41+
flex-wrap: wrap;
42+
}
43+
.tab {
44+
background: transparent;
45+
border: 1px solid #d4af37;
46+
color: #d4af37;
47+
padding: 12px 25px;
48+
border-radius: 20px;
49+
cursor: pointer;
50+
transition: .3s;
51+
font-size: 1rem;
52+
}
53+
.tab.active {
54+
background: rgba(212,175,55,0.2);
55+
}
56+
.content {
57+
background: #111;
58+
border-radius: 15px;
59+
padding: 30px;
60+
border: 1px solid rgba(212,175,55,0.3);
61+
min-height: 400px;
62+
}
63+
</style>
64+
</head>
65+
<body>
66+
67+
<div class="container">
68+
<button class="back-btn" onclick="window.location.href='autoridade.html'">← Voltar</button>
69+
70+
<header>
71+
<h1 id="titulo-eleicao">🌍 Painel da Eleição</h1>
72+
<p id="descricao-eleicao">Gerencie candidatos, votos e créditos</p>
73+
</header>
74+
75+
<div class="tabs">
76+
<button class="tab active" onclick="showTab('candidatos')">👥 Candidatos</button>
77+
<button class="tab" onclick="showTab('autorizacao')">🔐 Autorizar Votos</button>
78+
<button class="tab" onclick="showTab('monitor')">👁️ Monitorar Votos</button>
79+
<button class="tab" onclick="showTab('pagamento')">💰 Comprar Créditos</button>
80+
</div>
81+
82+
<div class="content">
83+
<!-- Conteúdo das abas específicas para esta eleição -->
84+
<div id="tab-candidatos">
85+
<h2>Candidatos desta Eleição</h2>
86+
<!-- Lista de candidatos específicos -->
87+
</div>
88+
89+
<div id="tab-autorizacao" style="display: none;">
90+
<h2>Autorizar Votos para esta Eleição</h2>
91+
<!-- Geração de links específicos -->
92+
</div>
93+
94+
<div id="tab-monitor" style="display: none;">
95+
<h2>Monitorar Votos desta Eleição</h2>
96+
<!-- Votos específicos -->
97+
</div>
98+
99+
<div id="tab-pagamento" style="display: none;">
100+
<h2>Comprar Créditos para esta Eleição</h2>
101+
<!-- Pagamento específico -->
102+
</div>
103+
</div>
104+
</div>
105+
106+
<script>
107+
// Aqui viria o código para carregar os dados específicos da eleição
108+
// usando o ID da URL (?id=xxx) e gerenciar tudo vinculado a essa eleição
109+
</script>
110+
111+
</body>
112+
</html>

0 commit comments

Comments
 (0)