Commit f4625df2 authored by José Fernando Mendes da Costa's avatar José Fernando Mendes da Costa
Browse files

recupera old modais_id

parent ae92267a
......@@ -202,7 +202,7 @@
$('#aviso-modal-limite-de-integrantes').modal('show');
}
let modal_id = 0;
let modal_id = Number(document.getElementById('quantidadeModais').value);
function exibirUsuarioAdicionado(data) {
$('#modalIntegrante').modal('hide');
......
......@@ -358,38 +358,40 @@
</div>
@endif
@if($edital->tipo != "CONTINUO" && (old('funcaoParticipante') == null || !array_key_exists($i, old('funcaoParticipante')) || old('funcaoParticipante')[$i] == 'Bolsista'))
<div class="col-md-12" id="plano-titulo{{$i}}">
<h5>Plano de trabalho</h5>
</div>
<div class="col-12" id="plano-nome{{$i}}">
@component('componentes.input', ['label' => 'Título'])
<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 style="color: red; font-size: 12px" id="caracsRestantesnomePlanoTrabalho{{$i}}">
</span>
@error('nomePlanoTrabalho.'.$i)
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent
</div>
<div class="col-12" id="plano-anexo{{$i}}">
@component('componentes.input', ['label' => 'Anexo (.pdf)'])
<input type="file" class="input-group-text" value="{{old('anexoPlanoTrabalho')[$i] ?? "" }}" name="anexoPlanoTrabalho[{{$i}}]" accept=".pdf" placeholder="Anexo do Plano de Trabalho" />
@error('anexoPlanoTrabalho.'.$i)
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@error('anexoPlanoTrabalho')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent
</div>
@endif
<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}}">
<h5>Plano de trabalho</h5>
</div>
<div class="col-12" id="plano-nome{{$i}}">
@component('componentes.input', ['label' => 'Título'])
<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 style="color: red; font-size: 12px" id="caracsRestantesnomePlanoTrabalho{{$i}}">
</span>
@error('nomePlanoTrabalho.'.$i)
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent
</div>
<div class="col-12" id="plano-anexo{{$i}}">
@component('componentes.input', ['label' => 'Anexo (.pdf)'])
<input type="file" class="input-group-text" value="{{old('anexoPlanoTrabalho')[$i] ?? "" }}" name="anexoPlanoTrabalho[{{$i}}]" accept=".pdf" placeholder="Anexo do Plano de Trabalho" />
@error('anexoPlanoTrabalho.'.$i)
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@error('anexoPlanoTrabalho')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent
</div>
@endif
</div>
{{-- <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>
......
......@@ -7,6 +7,7 @@
<form method="POST" id="criarProjetoForm" action="{{route('trabalho.store')}}" enctype="multipart/form-data" >
@csrf
<input type="hidden" name="editalId" value="{{$edital->id}}">
<input type="hidden" name="quantidadeModais" id="quantidadeModais" value="{{old('quantidadeModais', 0)}}" >
<div class="container">
......@@ -240,6 +241,7 @@
document.getElementById("checkB"+id).checked = true;
//$("#atribuir1").attr('data-target','#modalIntegrante'+(id+1));
modal_id = id+1;
document.getElementById("quantidadeModais").value = modal_id;
document.getElementById("part"+id).removeAttribute("hidden");
//document.getElementById("exampleModal"+id).modal('hide');
......@@ -254,6 +256,7 @@
document.getElementById("part"+id).setAttribute("hidden",true);
//$("#atribuir1").attr('data-target','#exampleModal'+(id));
modal_id -= 1;
document.getElementById("quantidadeModais").value = modal_id;
document.getElementById("exampleModal"+id).modal('hide');
}
@endif
......
......@@ -272,6 +272,7 @@
if(<?php echo json_encode($trabalho_user) ?>['funcao']){
modal_id += 1;
document.getElementById("quantidadeModais").value = modal_id;
}
$('#integrante').append(`
......
......@@ -260,6 +260,8 @@
document.getElementById("checkB"+id).checked = true;
// $("#atribuir1").attr('data-target','#exampleModal'+(id+1));
modal_id += 1;
document.getElementById("quantidadeModais").value = modal_id;
document.getElementById("part"+id).removeAttribute("hidden");
// document.getElementById("exampleModal"+id).modal('hide');
}
......@@ -274,6 +276,7 @@
// $("#atribuir1").attr('data-target','#exampleModal'+(id));
// document.getElementById("exampleModal"+id).modal('hide');
modal_id -= 1;
document.getElementById("quantidadeModais").value = modal_id;
console.log(modal_id);
}
@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