Unverified Commit b8f663c3 authored by José Fernando Mendes da Costa's avatar José Fernando Mendes da Costa Committed by GitHub
Browse files

Merge pull request #821 from jofernando/addmais

Permite adicionar mais participantes se ocorrer erro na submissão
parents 216ef469 f4625df2
...@@ -202,7 +202,7 @@ ...@@ -202,7 +202,7 @@
$('#aviso-modal-limite-de-integrantes').modal('show'); $('#aviso-modal-limite-de-integrantes').modal('show');
} }
let modal_id = 0; let modal_id = Number(document.getElementById('quantidadeModais').value);
function exibirUsuarioAdicionado(data) { function exibirUsuarioAdicionado(data) {
$('#modalIntegrante').modal('hide'); $('#modalIntegrante').modal('hide');
......
...@@ -358,7 +358,8 @@ ...@@ -358,7 +358,8 @@
</div> </div>
@endif @endif
@if($edital->tipo != "CONTINUO" && (old('funcaoParticipante') == null || !array_key_exists($i, old('funcaoParticipante')) || old('funcaoParticipante')[$i] == 'Bolsista')) <div style="display: block" @if(old('funcaoParticipante') == null || !array_key_exists($i, old('funcaoParticipante')) || old('funcaoParticipante')[$i] == 'Bolsista') @else hidden @endif>
@if($edital->tipo != "CONTINUO")
<div class="col-md-12" id="plano-titulo{{$i}}"> <div class="col-md-12" id="plano-titulo{{$i}}">
<h5>Plano de trabalho</h5> <h5>Plano de trabalho</h5>
</div> </div>
...@@ -390,6 +391,7 @@ ...@@ -390,6 +391,7 @@
@endcomponent @endcomponent
</div> </div>
@endif @endif
</div>
{{-- <div class="col-6"> {{-- <div class="col-6">
<button data-dismiss="modal" type="button" id="cancelar{{$i}}" class=" btn btn-danger" style="font-size: 16px" onclick="desmarcar({{$i}})" @if(isset(old('marcado')[$i+1])) disabled @endif>Cancelar</button> <button data-dismiss="modal" type="button" id="cancelar{{$i}}" class=" btn btn-danger" style="font-size: 16px" onclick="desmarcar({{$i}})" @if(isset(old('marcado')[$i+1])) disabled @endif>Cancelar</button>
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
<form method="POST" id="criarProjetoForm" action="{{route('trabalho.store')}}" enctype="multipart/form-data" > <form method="POST" id="criarProjetoForm" action="{{route('trabalho.store')}}" enctype="multipart/form-data" >
@csrf @csrf
<input type="hidden" name="editalId" value="{{$edital->id}}"> <input type="hidden" name="editalId" value="{{$edital->id}}">
<input type="hidden" name="quantidadeModais" id="quantidadeModais" value="{{old('quantidadeModais', 0)}}" >
<div class="container"> <div class="container">
...@@ -219,16 +220,16 @@ ...@@ -219,16 +220,16 @@
if(nome.value != ""){ if(nome.value != ""){
if(planoTrabalho != null && planoTrabalho.value != ""){ if(planoTrabalho != null && planoTrabalho.value != ""){
nomePlano.innerHTML = ` <p style='font-weight: normal; line-height: normal;'><strong>Nome: </strong>${nome.value}<br> nomePlano.innerHTML = ` <strong>Nome: </strong>${nome.value}<br>
<strong>E-mail: </strong>${email.value} <br> <strong>E-mail: </strong>${email.value} <br>
<strong>Plano: </strong>${planoTrabalho.value}<br> <strong>Plano: </strong>${planoTrabalho.value}<br>
<strong>CPF: </strong>${cpf.value} <br> <strong>CPF: </strong>${cpf.value} <br>
<strong>Função: </strong>${nome_funcao}</p>`; <strong>Função: </strong>${nome_funcao}`;
}else { }else {
nomePlano.innerHTML = ` <p style='font-weight: normal; line-height: normal;'><strong>Nome: </strong>${nome.value}<br> nomePlano.innerHTML = ` <strong>Nome: </strong>${nome.value}<br>
<strong>E-mail: </strong>${email.value} <br> <strong>E-mail: </strong>${email.value} <br>
<strong>CPF: </strong>${cpf.value} <br> <strong>CPF: </strong>${cpf.value} <br>
<strong>Função: </strong>${nome_funcao}</p>`; <strong>Função: </strong>${nome_funcao}`;
} }
}else{ }else{
nomePlano.innerText = `Discente `+(id+1); nomePlano.innerText = `Discente `+(id+1);
...@@ -240,6 +241,7 @@ ...@@ -240,6 +241,7 @@
document.getElementById("checkB"+id).checked = true; document.getElementById("checkB"+id).checked = true;
//$("#atribuir1").attr('data-target','#modalIntegrante'+(id+1)); //$("#atribuir1").attr('data-target','#modalIntegrante'+(id+1));
modal_id = id+1; modal_id = id+1;
document.getElementById("quantidadeModais").value = modal_id;
document.getElementById("part"+id).removeAttribute("hidden"); document.getElementById("part"+id).removeAttribute("hidden");
//document.getElementById("exampleModal"+id).modal('hide'); //document.getElementById("exampleModal"+id).modal('hide');
...@@ -254,6 +256,7 @@ ...@@ -254,6 +256,7 @@
document.getElementById("part"+id).setAttribute("hidden",true); document.getElementById("part"+id).setAttribute("hidden",true);
//$("#atribuir1").attr('data-target','#exampleModal'+(id)); //$("#atribuir1").attr('data-target','#exampleModal'+(id));
modal_id -= 1; modal_id -= 1;
document.getElementById("quantidadeModais").value = modal_id;
document.getElementById("exampleModal"+id).modal('hide'); document.getElementById("exampleModal"+id).modal('hide');
} }
@endif @endif
......
...@@ -272,6 +272,7 @@ ...@@ -272,6 +272,7 @@
if(<?php echo json_encode($trabalho_user) ?>['funcao']){ if(<?php echo json_encode($trabalho_user) ?>['funcao']){
modal_id += 1; modal_id += 1;
document.getElementById("quantidadeModais").value = modal_id;
} }
$('#integrante').append(` $('#integrante').append(`
......
...@@ -260,6 +260,8 @@ ...@@ -260,6 +260,8 @@
document.getElementById("checkB"+id).checked = true; document.getElementById("checkB"+id).checked = true;
// $("#atribuir1").attr('data-target','#exampleModal'+(id+1)); // $("#atribuir1").attr('data-target','#exampleModal'+(id+1));
modal_id += 1; modal_id += 1;
document.getElementById("quantidadeModais").value = modal_id;
document.getElementById("part"+id).removeAttribute("hidden"); document.getElementById("part"+id).removeAttribute("hidden");
// document.getElementById("exampleModal"+id).modal('hide'); // document.getElementById("exampleModal"+id).modal('hide');
} }
...@@ -274,6 +276,7 @@ ...@@ -274,6 +276,7 @@
// $("#atribuir1").attr('data-target','#exampleModal'+(id)); // $("#atribuir1").attr('data-target','#exampleModal'+(id));
// document.getElementById("exampleModal"+id).modal('hide'); // document.getElementById("exampleModal"+id).modal('hide');
modal_id -= 1; modal_id -= 1;
document.getElementById("quantidadeModais").value = modal_id;
console.log(modal_id); console.log(modal_id);
} }
@endif @endif
......
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