Skip to content

Commit

Permalink
Add menssagem com o id e nome #32
Browse files Browse the repository at this point in the history
  • Loading branch information
Fernando José committed Oct 9, 2020
1 parent 5048800 commit 3426483
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/main/resources/templates/project/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ <h5 class="modal-title">Deletar Registro</h5>
<a
class="btn btn-sm btn-primary"
th:href="@{/project/edit/{id}(id=${project.id})}">Editar</a>
<a th:id="${project.id}"
<a th:id="${project.id}" th:name="${project.name}"
class="delete btn btn-sm btn-danger confirModal">Excluir</a>
</div>
</td>
Expand Down Expand Up @@ -116,11 +116,12 @@ <h5 class="modal-title">Deletar Registro</h5>
/* Guardando o ID do registro (foi colocado como um atributo n o botão) */

const id = $(this).attr("id");
const name = $(this).attr("name");

/* Adicionando o texto ao modal */
$("#texto-modal").text(
"Tem certeza que deseja deletar o registro #"
+ id + "?");
"Tem certeza que deseja excluir o projeto: "
+ id + " - "+ name + " ?");

/* Adicionando a URL para delete */
$("#link-delete")
Expand Down

0 comments on commit 3426483

Please sign in to comment.