Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 57 additions & 8 deletions code/view/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,7 @@ label {
cursor: pointer;
transition: 0.3s;
margin-bottom: 1.0rem;

}

.btn-link2 {
Expand All @@ -421,7 +422,8 @@ label {
}

.btn-conf:hover{
background-color: var(--cor-secundaria);
background-color: #fff; /* Cor do botão ao passar o mouse */
color: var(--cor-primaria); /* Cor do texto ao passar o mouse */
box-shadow: 0 0 0 3px var(--cor-fundo), 0 0 0 2px var(--cor-fundo);
}

Expand All @@ -443,10 +445,6 @@ label {

/* --------------------------------------------------------- Pagina de Tarefas -------------------------------------------------------------- */

.cortxt {
color: var(--cor-text);
}

.sbody3 {
background-color: var(--cor-fundo);
font-family: Montserrat, 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
Expand All @@ -457,12 +455,41 @@ label {

}

.cortxt {
color: var(--cor-text);
}


.header-tarefa {
display: flex;
justify-content: center; /* Centraliza horizontalmente */
align-items: center; /* Centraliza verticalmente */
}

.project-activites__add,
.project-participants__add {
padding: 0.75rem 1.5rem;
display: inline-block;
text-decoration: none;
font-weight: bold;
background-color: var(--cor-botão);
color: var(--cor-text);
text-align: center;
border-radius: 0.5rem;
cursor: pointer;
transition: background-color 0.3s, color 0.3s;
margin-bottom: 1rem;
margin-top: 1rem;
border: 2px solid transparent;
}

.project-activites__add:hover,
.project-participants__add:hover {
background-color: #fff;
color: var(--cor-primaria);

}

.button-tarefa {
background-color: var(--cor-botão);
color: var(--cor-primaria);
Expand Down Expand Up @@ -610,6 +637,18 @@ label {
font-style: italic;
}

/* formulario das configurações de empresa */

.pE{
color: var(--cor-text);
text-decoration: solid, underline;
margin-top: 2rem;
}

.labelE{
color: var(--cor-text);
}

/* --------------------------------------------------------- Pagina Inicial ----------------------------------------------------------------- */

/* Estilo para o cabeçalho */
Expand Down Expand Up @@ -665,7 +704,7 @@ nav ul {
padding: 0;
}

nav ul li {
nav ul li {
display: inline-block;
margin: 0 10px;
}
Expand All @@ -685,15 +724,15 @@ nav ul li:hover {
}

.container-imagem-direita {
text-align: right; /* Para alinhar a imagem à direita */
text-align: right;
}

.inicio-container {
background: linear-gradient(to bottom right, var(--cor-primaria), var(--cor-secundaria));
padding: 20px;
border-radius: 5px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
margin-bottom: 20px; /* Adiciona espaço abaixo de cada container */
margin-bottom: 20px;
text-align: center;
position: relative;
z-index: 2;
Expand Down Expand Up @@ -724,4 +763,14 @@ nav ul li:hover {
background-color: var(--cor-link);
transform: scale(1.05);
transition: transform 0.3s ease;
}

/* --------------------------------------------------------- Pagina de Alterar Empresa ----------------------------------------------------------------- */

.input-confE {
display: block;
width: 100%;
padding: 0.75rem;
border: 1px solid #ccc;
border-radius: 0.25rem;
}
2 changes: 1 addition & 1 deletion code/view/css/style2.css
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
}

*{
margin:0;
margin:0;
padding:0;
box-sizing:border-box;
font-family: 'Poppins', sans-serif;
Expand Down
2 changes: 2 additions & 0 deletions code/view/js/mudaCor.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ function definirModoCor(modo) {
document.documentElement.style.setProperty('--cor-title', '#2A4F83');
document.documentElement.style.setProperty('--cor-fundoC', '#1A1818');
document.documentElement.style.setProperty('--cor-botaoT', '#');
document.documentElement.style.setProperty('--cor-confE', '#');
} else {
// Mudar para o modo claro (padrão)
document.documentElement.setAttribute('data-modo', 'claro');
Expand All @@ -34,6 +35,7 @@ function definirModoCor(modo) {
document.documentElement.style.setProperty('--cor-title', '#fff');
document.documentElement.style.setProperty('--cor-fundoC', '#32C6F4');
document.documentElement.style.setProperty('--cor-botaoT', '#32C6F4');
document.documentElement.style.setProperty('--cor-confE', '#');
}
}

Expand Down
136 changes: 136 additions & 0 deletions code/view/js/paginaAlteraEmpresa.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
// Função para carregar os dados da empresa
function carregarDadosEmpresa() {
var response = ControlUsers();
let empresa = JSON.parse(response)[0];
document.querySelector('#nomeE').value = empresa.name;
document.querySelector('#descricaoE').value = empresa.description;
document.querySelector('#identifierE').value = empresa.cnpj;
document.querySelector('#cepE').value = empresa.cep;

// Dividir o endereço em partes
let enderecoCompleto = empresa.endereco.split(", ");
document.querySelector('#endereco').value = enderecoCompleto[1];
document.querySelector('#bairro').value = enderecoCompleto[0];

let numeroECidade = enderecoCompleto[2].split(". ");
document.querySelector('#number').value = numeroECidade[0];
document.querySelector('#cidade').value = numeroECidade[1];
document.querySelector('#compl').value = empresa.compl;
}

// Função para validar os campos do formulário
function validarCampos() {
let nomeValido = verifyName(document.querySelector('#nomeE').value);
let descricaoValida = document.querySelector('#descricaoE').value !== "";
let cnpjValido = verifyCNPJ(document.querySelector('#identifierE').value);
let cepValido = verifyCEP(document.querySelector('#cepE').value);

return nomeValido && descricaoValida && cnpjValido && cepValido;
}

// Função para alterar os dados da empresa
function alteraCad() {
if (validarCampos()) {
let nome = document.querySelector('#nomeE').value;
let descricao = document.querySelector('#descricaoE').value;
let cnpj = document.querySelector('#identifierE').value;
let cep = document.querySelector('#cepE').value;
let endereco = document.querySelector('#endereco').value;
let bairro = document.querySelector('#bairro').value;
let numero = document.querySelector('#number').value;
let cidade = document.querySelector('#cidade').value;
let compl = document.querySelector('#compl').value;

if (alteraCadastro(nome, descricao, cnpj, cep, endereco, bairro, numero, cidade, compl) == 1) {
Swal.fire({
icon: "success",
title: "Alteração feita com sucesso!",
text: "Aperte no botão azul",
showCancelButton: true,
confirmButtonColor: "#3085d6",
cancelButtonColor: "#d33",
confirmButtonText: "Voltar à página inicial"
}).then((result) => {
if (result.isConfirmed) {
window.location.href = './paginaInicial.html';
}
});
} else {
Swal.fire({
icon: "error",
title: "Algo deu errado!",
text: "Tente novamente mais tarde.",
showCancelButton: true,
confirmButtonColor: "#3085d6",
cancelButtonColor: "#d33",
confirmButtonText: "Tentar Novamente!"
}).then((result) => {
if (result.isConfirmed) {
alteraCad();
}
});
}
} else {
Swal.fire({
icon: "error",
title: "Algo não está correto",
text: "Verifique se há alguma coisa escrita em vermelho para você corrigir ou se você deixou algo vazio.",
});
}
}

// Carregar os dados da empresa ao carregar a página
document.addEventListener('DOMContentLoaded', carregarDadosEmpresa);

// Funções de validação específicas
document.querySelector('#nomeE').addEventListener("change", function() {
const label = document.querySelector('#fix-data-name');
if (!verifyName(this.value)) {
this.style.borderColor = 'red';
label.style.color = 'red';
label.innerHTML = "Nome inválido";
} else {
this.style.borderColor = "#C6C6C6";
label.innerHTML = "";
label.style.color = 'black';
}
});

document.querySelector('#descricaoE').addEventListener("change", function() {
const label = document.querySelector('#fix-data-descricao');
if (this.value === "") {
this.style.borderColor = 'red';
label.style.color = 'red';
label.innerHTML = "Descrição inválida";
} else {
this.style.borderColor = "#C6C6C6";
label.innerHTML = "";
label.style.color = 'black';
}
});

document.querySelector('#identifierE').addEventListener("change", function() {
const label = document.querySelector('#fix-data-ident');
if (!verifyCNPJ(this.value)) {
this.style.borderColor = 'red';
label.style.color = 'red';
label.innerHTML = "CNPJ inválido";
} else {
this.style.borderColor = "#C6C6C6";
label.innerHTML = "";
label.style.color = 'black';
}
});

document.querySelector('#cepE').addEventListener("change", function() {
const label = document.querySelector('#fix-data-cep');
if (!verifyCEP(this.value)) {
this.style.borderColor = 'red';
label.style.color = 'red';
label.innerHTML = "CEP inválido";
} else {
this.style.borderColor = "#C6C6C6";
label.innerHTML = "";
label.style.color = 'black';
}
});
64 changes: 64 additions & 0 deletions code/view/js/paginaEmpresa.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
document.addEventListener('DOMContentLoaded', (event) => {

// Função para exibir pop-up de Participantes
function showParticipants() {
Swal.fire({
title: 'Participantes',
html: `
<p>Aqui você pode visualizar e gerenciar os participantes da empresa.</p>
<label for="participantName">Nome do Participante:</label>
<input type="text" id="participantName" class="swal2-input" placeholder="Nome do Participante">
<label for="participantRole">Cargo do Participante:</label>
<input type="text" id="participantRole" class="swal2-input" placeholder="Cargo do Participante">
`,
confirmButtonText: 'Adicionar',
preConfirm: () => {
const participantName = document.getElementById('participantName').value;
const participantRole = document.getElementById('participantRole').value;
return { participantName, participantRole };
}
}).then((result) => {
if (result.isConfirmed) {
const { participantName, participantRole } = result.value;
// Aqui você pode adicionar a lógica para adicionar o participante
Swal.fire('Sucesso!', 'Participante adicionado com sucesso!', 'success');
}
});
}

// Função para exibir pop-up de Permissões
function showPermissions() {
Swal.fire({
title: 'Permissões',
html: `
<p>Aqui você pode configurar as permissões dos usuários.</p>
<label for="userName">Nome do Usuário:</label>
<input type="text" id="userName" class="swal2-input" placeholder="Nome do Usuário">
<label for="userPermission">Permissão:</label>
<select id="userPermission" class="swal2-select">
<option value="admin">Administrador</option>
<option value="editor">Editor</option>
<option value="viewer">Visualizador</option>
</select>
`,
confirmButtonText: 'Salvar',
preConfirm: () => {
const userName = document.getElementById('userName').value;
const userPermission = document.getElementById('userPermission').value;
return { userName, userPermission };
}
}).then((result) => {
if (result.isConfirmed) {
const { userName, userPermission } = result.value;
// Aqui você pode adicionar a lógica para salvar as permissões do usuário
Swal.fire('Sucesso!', 'Permissões salvas com sucesso!', 'success');
}
});
}

// Adiciona os event listeners aos botões
document.querySelector('.btn-conf[onclick=""]').addEventListener('click', showCompanyInfo);
document.querySelector('.btn-conf[onclick=""]').addEventListener('click', showParticipants);
document.querySelector('.btn-conf[onclick=""]').addEventListener('click', showPermissions);
});

2 changes: 1 addition & 1 deletion code/view/js/paginaLogin.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function login(){
text: "Usuário e senha corretos",
icon: "success"
});
window.location.href = "./paginaInicial.html";
window.location.href = "./paginaInicia.html";
}else{
Swal.fire({
icon: "error",
Expand Down
Loading