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,38 +358,40 @@ ...@@ -358,38 +358,40 @@
</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>
<div class="col-md-12" id="plano-titulo{{$i}}"> @if($edital->tipo != "CONTINUO")
<h5>Plano de trabalho</h5> <div class="col-md-12" id="plano-titulo{{$i}}">
</div> <h5>Plano de trabalho</h5>
<div class="col-12" id="plano-nome{{$i}}"> </div>
@component('componentes.input', ['label' => 'Título']) <div class="col-12" id="plano-nome{{$i}}">
<input type="text" class="form-control" value="{{old('nomePlanoTrabalho')[$i] ?? "" }}" name="nomePlanoTrabalho[{{$i}}]" placeholder="Digite o título do plano de trabalho" maxlength="255" id="nomePlanoTrabalho{{$i}}"> @component('componentes.input', ['label' => 'Título'])
<span style="color: red; font-size: 12px" id="caracsRestantesnomePlanoTrabalho{{$i}}"> <input type="text" class="form-control" value="{{old('nomePlanoTrabalho')[$i] ?? "" }}" name="nomePlanoTrabalho[{{$i}}]" placeholder="Digite o título do plano de trabalho" maxlength="255" id="nomePlanoTrabalho{{$i}}">
</span> <span style="color: red; font-size: 12px" id="caracsRestantesnomePlanoTrabalho{{$i}}">
@error('nomePlanoTrabalho.'.$i) </span>
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block"> @error('nomePlanoTrabalho.'.$i)
<strong>{{ $message }}</strong> <span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
</span> <strong>{{ $message }}</strong>
@enderror </span>
@endcomponent @enderror
</div> @endcomponent
<div class="col-12" id="plano-anexo{{$i}}"> </div>
@component('componentes.input', ['label' => 'Anexo (.pdf)']) <div class="col-12" id="plano-anexo{{$i}}">
<input type="file" class="input-group-text" value="{{old('anexoPlanoTrabalho')[$i] ?? "" }}" name="anexoPlanoTrabalho[{{$i}}]" accept=".pdf" placeholder="Anexo do Plano de Trabalho" /> @component('componentes.input', ['label' => 'Anexo (.pdf)'])
@error('anexoPlanoTrabalho.'.$i) <input type="file" class="input-group-text" value="{{old('anexoPlanoTrabalho')[$i] ?? "" }}" name="anexoPlanoTrabalho[{{$i}}]" accept=".pdf" placeholder="Anexo do Plano de Trabalho" />
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block"> @error('anexoPlanoTrabalho.'.$i)
<strong>{{ $message }}</strong> <span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
</span> <strong>{{ $message }}</strong>
@enderror </span>
@error('anexoPlanoTrabalho') @enderror
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block"> @error('anexoPlanoTrabalho')
<strong>{{ $message }}</strong> <span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
</span> <strong>{{ $message }}</strong>
@enderror </span>
@endcomponent @enderror
</div> @endcomponent
@endif </div>
@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