Commit 7edf98f9 authored by Yuri Resende's avatar Yuri Resende
Browse files

Exibindo mensagem quando o limite de integrantes for atingido

parent 64631712
...@@ -109,6 +109,25 @@ ...@@ -109,6 +109,25 @@
</div> </div>
</div> </div>
<div class="modal fade" id="aviso-modal-limite-de-integrantes" data-backdrop="static" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header" style="background-color: #dc3545;">
<h5 class="modal-title" id="exampleModalLabel" style="color: white;">Aviso</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body" >
<span id="texto-erro">O limite de integrantes para esse projeto foi atingido.</span>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary btn-color-dafault" data-dismiss="modal">Ok</button>
</div>
</div>
</div>
</div>
<script> <script>
...@@ -138,6 +157,12 @@ ...@@ -138,6 +157,12 @@
} }
function preencherUsuarioExistente() { function preencherUsuarioExistente() {
if(!document.getElementById(`exampleModal${modal_id}`)){
exibirModalNumeroMaximoDeIntegrantes();
return;
}
$.ajaxSetup({ $.ajaxSetup({
headers: { headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
...@@ -186,9 +211,14 @@ ...@@ -186,9 +211,14 @@
$('#aviso-modal-usuario-nao-existe').modal('show'); $('#aviso-modal-usuario-nao-existe').modal('show');
} }
function exibirModalNumeroMaximoDeIntegrantes() {
$('#aviso-modal-limite-de-integrantes').modal('show');
}
let modal_id = 0; let modal_id = 0;
function exibirUsuarioAdicionado(data) { function exibirUsuarioAdicionado(data) {
console.log(`${modal_id}`, data);
$('#modalIntegrante').modal('hide'); $('#modalIntegrante').modal('hide');
document.getElementById(`nome${modal_id}`).value = data[0]['name']; document.getElementById(`nome${modal_id}`).value = data[0]['name'];
document.getElementById(`nome${modal_id}`).setAttribute("readonly", ""); document.getElementById(`nome${modal_id}`).setAttribute("readonly", "");
......
...@@ -157,7 +157,7 @@ ...@@ -157,7 +157,7 @@
} }
function preencherUsuarioExistente() { function preencherUsuarioExistente() {
console.log(modal_id); //console.log(modal_id);
if(!document.getElementById(`exampleModal${modal_id}`)){ if(!document.getElementById(`exampleModal${modal_id}`)){
exibirModalNumeroMaximoDeIntegrantes(); exibirModalNumeroMaximoDeIntegrantes();
return; return;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment