-
Notifications
You must be signed in to change notification settings - Fork 0
/
resume.html
190 lines (173 loc) · 9.5 KB
/
resume.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Crie Seu Currículo</title>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
<link href="https://fonts.googleapis.com/css2?family=Montserrat:wght@400;700&family=Roboto:wght@400;700&display=swap" rel="stylesheet">
<script src="https://www.gstatic.com/firebasejs/10.9.0/firebase-app-compat.js"></script>
<script src="https://www.gstatic.com/firebasejs/10.9.0/firebase-firestore-compat.js"></script>
<link rel="stylesheet" href="formStyle.css">
<link rel="stylesheet" href="style.css">
</head>
<body>
<header>
<div>
<div class="header-container">
<div id="home-link-container">
<a href="index.html" id="home-link">
<h1>Mãos Que Ajudam</h1>
</a>
</div>
</div>
<div id="nav-links">
<a href="login.html" class="nav-link">Login</a>
<a href="register.html" class="nav-link">Registrar</a>
</div>
</div>
</header>
<div id="header-bt">
<button type="button" id="bt_resume">Página do Usuário</button>
<button type="button" id="bt_employer">Busque Trabalhadores</button>
</div>
<div id="spinner">
<div class="spinner-border" role="status">
<span class="sr-only"></span>
</div>
</div>
<div id="form-container" class="container">
<div class="row">
<h2>Crie Seu Currículo</h2>
<form id="resumeForm">
<div class="mb-3" id="name_div">
<label for="name" class="form-label">Nome</label>
<input type="text" class="form-control" id="name" name="name" minlength="5" required>
</div>
<div class="mb-3" id="birthdate_div">
<label for="birthdate" class="form-label">Data de Nascimento</label>
<input type="date" class="form-control" id="birthdate" name="birthdate" required>
</div>
<div class="mb-3" id="email_div">
<label for="email" class="form-label">Email</label>
<input type="email" class="form-control" id="email" name="email" required>
</div>
<div class="mb-3" id="gender_div">
<label for="gender" class="form-label">Gênero</label>
<div>
<button class="dropdown-button" onclick="toggleDropdown('gender-dropdown')"><span id="selected-gender"></span></button>
<div id="gender-dropdown" class="dropdown-content">
<div class="dropdown-option" data-value="Masculino" data-target="selected-gender">Masculino</div>
<div class="dropdown-option" data-value="Feminino" data-target="selected-gender">Feminino</div>
<div class="dropdown-option" data-value="Outro" data-target="selected-gender">Outro</div>
</div>
</div>
</div>
<div class="mb-3" id="phone_div">
<label for="phone" class="form-label">Telefone</label>
<input type="tel" class="form-control" id="phone" name="phone" required pattern="\(\d{2}\) \d{4,5}\d{4}" title="Format: (XX) XXXXXXXX or (XX) XXXXXXXXX">
</div>
<div class="mb-3" id="location_div">
<label for="location" class="form-label">Município de Residência</label>
<input type="text" class="form-control" id="location" name="location" minlength="5" required>
</div>
<div class="mb-3" id="area-div">
<label for="area" class="form-label">Área de Atuação</label>
<div>
<button class="dropdown-button" onclick="toggleDropdown('area-dropdown')"><span id="selected-area"></span></button>
<div id="area-dropdown" class="dropdown-content">
<div class="dropdown-option" data-value="Área da Saúde" data-target="selected-area">Área da Saúde</div>
<div class="dropdown-option" data-value="Logística" data-target="selected-area">Logística</div>
<div class="dropdown-option" data-value="Culinária" data-target="selected-area">Culinária</div>
<div class="dropdown-option" data-value="Trabalho Manual" data-target="selected-area">Trabalho Manual</div>
<div class="dropdown-option" data-value="Engenharia e Reconstrução" data-target="selected-area">Engenharia e Reconstrução</div>
<div class="dropdown-option" data-value="Suporte Social" data-target="selected-area">Suporte Social</div>
<div class="dropdown-option" data-value="Segurança e Proteção" data-target="selected-area">Segurança e Proteção</div>
</div>
</div>
</div>
<div class="mb-3" id="formacao-div">
<label for="formacao" class="form-label">Formação Acadêmica</label>
<div>
<button class="dropdown-button" onclick="toggleDropdown('formacao-dropdown')"><span id="selected-formacao"></span></button>
<div id="formacao-dropdown" class="dropdown-content">
<div class="dropdown-option" data-value="Ensino Superior Completo" data-target="selected-formacao">Ensino Superior Completo</div>
<div class="dropdown-option" data-value="Ensino Superior Incompleto" data-target="selected-formacao">Ensino Superior Incompleto</div>
<div class="dropdown-option" data-value="Ensino Médio Completo" data-target="selected-formacao">Ensino Médio Completo</div>
<div class="dropdown-option" data-value="Ensino Médio Incompleto" data-target="selected-formacao">Ensino Médio Incompleto</div>
</div>
</div>
</div>
<div class="mb-3" id="description_div">
<label for="description" class="form-label">Descrição</label>
<textarea class="form-control" id="description" name="description"></textarea>
</div>
<div class="form-check form-switch" id="check-visibility">
<input class="form-check-input" type="checkbox" id="visibility-checkbox">
<label class="form-check-label" for="visibility-checkbox">Currículo visível para outros usuários</label>
</div>
<button type="submit" class="btn btn-primary">Enviar</button>
</form>
</div>
</div>
<script src="resume.js"></script>
<script>
function getCookie(name) {
const value = `; ${document.cookie}`;
const parts = value.split(`; ${name}=`);
if (parts.length === 2) return parts.pop().split(';').shift();
return null;
}
function checkLoginStatus() {
const loggedIn = getCookie('logged_in');
if (loggedIn) {
return true;
} else {
return false;
}
}
async function logout() {
const accessToken = getCookie('access_token');
try {
const response = await fetch(`${apiPath}/logout`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${accessToken}`
}
});
if (!response.ok) {
console.error('Error logging out:', response.statusText);
return;
}
const data = await response.json();
if (data.error) {
console.error('Error logging out:', data.error);
} else {
console.log('User logged out');
window.location.href = 'index.html';
}
} catch (error) {
console.error('Error logging out:', error);
}
}
document.addEventListener('DOMContentLoaded', function() {
if (checkLoginStatus()) {
document.getElementById('nav-links').innerHTML = '<a href="#" onclick="logout()" class="nav-link">Logout</a>';
}
});
document.getElementById('bt_resume').addEventListener('click', function() {
window.location.href = 'user_page.html'
});
document.getElementById('bt_employer').addEventListener('click', function() {
window.location.href = 'employer.html';
});
document.addEventListener('DOMContentLoaded', function() {
var today = new Date();
var maxDate = new Date(today.getFullYear() - 18, today.getMonth(), today.getDate());
var maxDateString = maxDate.toISOString().split('T')[0];
document.getElementById('birthdate').setAttribute('max', maxDateString);
});
</script>
</body>
</html>