-
Notifications
You must be signed in to change notification settings - Fork 0
/
user_page.html
151 lines (137 loc) · 6.4 KB
/
user_page.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Mãos Que Ajudam - Minha Conta</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://cdnjs.cloudflare.com/ajax/libs/jspdf/1.3.2/jspdf.min.js"></script>
<link rel="stylesheet" href="cardsStyle.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="usr-page-content" class="container-fluid content">
<div class="col-6 mx-auto">
<h1 id="user-name">Bem-vindo!</h1>
<div class="d-flex justify-content-between align-items-center">
<h2 id="resume-title">Seu Currículo</h2>
<div id="usr-page-bt">
<button id="edit-resume" type="button" class="btn btn-info mr-2">Editar Currículo</button>
<button id="generate-pdf" type="button" class="btn btn-primary">Gerar PDF</button>
</div>
</div>
<div class="card" id="resume-card">
<div class="container mt-5">
<div class="card-header bg-primary text-white">
<h3 class="card-title mb-0">Currículo</h3>
</div>
<div class="card-body">
<div class="row mb-3">
<div class="col-sm-4"><strong>Nome:</strong></div>
<div class="col-sm-8" id="name"></div>
</div>
<div class="row mb-3">
<div class="col-sm-4"><strong>Idade:</strong></div>
<div class="col-sm-8" id="age"></div>
</div>
<div class="row mb-3">
<div class="col-sm-4"><strong>Área de Atuação:</strong></div>
<div class="col-sm-8" id="area"></div>
</div>
<div class="row mb-3">
<div class="col-sm-4"><strong>Gênero:</strong></div>
<div class="col-sm-8" id="gender"></div>
</div>
<div class="row mb-3">
<div class="col-sm-4"><strong>Formação:</strong></div>
<div class="col-sm-8" id="formation"></div>
</div>
<div class="row mb-3">
<div class="col-sm-4"><strong>Localização:</strong></div>
<div class="col-sm-8" id="location"></div>
</div>
<div class="row mb-3">
<div class="col-sm-4"><strong>Descrição:</strong></div>
<div class="col-sm-8" id="description"></div>
</div>
<div class="row mb-3">
<div class="col-sm-4"><strong>Email:</strong></div>
<div class="col-sm-8" id="email"></div>
</div>
<div class="row mb-3">
<div class="col-sm-4"><strong>Telefone:</strong></div>
<div class="col-sm-8" id="phone"></div>
</div>
<div class="row mb-3">
<div class="col-sm-4"><strong>Visibilidade:</strong></div>
<div class="col-sm-8" id="visibility"></div>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="user_page.js"></script>
<script>
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.getElementById('generate-pdf').addEventListener('click', function(event) {
event.preventDefault();
const html = document.getElementById('resume-card').innerHTML;
generatePDF(html);
});
function generatePDF(html) {
const doc = new jsPDF();
html = html.replace(/<div class="row mb-3">\s*<div class="col-sm-4"><strong>Visibilidade:<\/strong><\/div>\s*<div class="col-sm-8" id="visibility">.*<\/div>\s*<\/div>/, '');
doc.fromHTML(html, 10, 10, {
'width': 180
});
doc.save('Currículo.pdf');
}
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');
return !!loggedIn;
}
</script>
</body>
</html>