Skip to content

Commit

Permalink
fix: adiciona a opção de remover disciplina
Browse files Browse the repository at this point in the history
  • Loading branch information
cesargabrielphd committed Dec 13, 2024
1 parent e6ad6d7 commit ceb26ef
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
7 changes: 6 additions & 1 deletion css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,12 @@ div.row.g-3 > div.row.g-3 {
background-color: #157347;
border-color: #146c43;
}

.btn-danger,
.btn-danger:hover {
color: #fff;
background-color: #bb2d3b;
border-color: #b02a37;
}
footer {
position: fixed;
width: 100%;
Expand Down
10 changes: 10 additions & 0 deletions js/functionality.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ function adicionarDisciplina(periodoId) {

const disciplinaDiv = document.createElement("div");
disciplinaDiv.className = "row g-3";
disciplinaDiv.id = `periodo${periodoId}-disciplina${disciplinaId}`;
disciplinaDiv.innerHTML = `
<div class="col-sm-4">
<input
Expand Down Expand Up @@ -87,12 +88,21 @@ function adicionarDisciplina(periodoId) {
<div class="col-sm-2" id="status-col-${periodoId}-${disciplinaId}">
<span id="status-${periodoId}-${disciplinaId}">Status</span>
</div>
<div class="col-sm-12">
<button class="btn btn-danger" onclick="removerDisciplina(${periodoId}, ${disciplinaId})">Remover Disciplina</button>
</div>
`;

disciplinasDiv.appendChild(disciplinaDiv);

adicionarEventosParaMonitoramento(periodoId, disciplinaId);
}

function removerDisciplina(periodoId, disciplinaId) {
const disciplinaDiv = document.getElementById(`periodo${periodoId}-disciplina${disciplinaId}`);
disciplinaDiv.remove();
}

function determinarStatus(mencao) {
const aprovadas = ["MM", "MS", "SS"];
return aprovadas.includes(mencao) ? "Aprovado" : "Reprovado";
Expand Down

0 comments on commit ceb26ef

Please sign in to comment.