Commit ba71da40 authored by alinetenorio's avatar alinetenorio
Browse files

deletar dados de participante - formulário

parent cee2e0a1
...@@ -96,8 +96,7 @@ ...@@ -96,8 +96,7 @@
</div> </div>
<div class="col-sm-6"> <div class="col-sm-6">
<label for="nomeTrabalho" class="col-form-label">Link Lattes do Proponente</label> <label for="nomeTrabalho" class="col-form-label">Link Lattes do Proponente</label>
<input class="form-control" type="text" name="linkLattesEstudante" <input class="form-control" type="text" name="linkLattesEstudante" @if(Auth()->user()->proponentes->linkLattes != null)
@if(Auth()->user()->proponentes->linkLattes != null)
value="{{ Auth()->user()->proponentes->linkLattes }}" value="{{ Auth()->user()->proponentes->linkLattes }}"
@else @else
...@@ -121,14 +120,13 @@ ...@@ -121,14 +120,13 @@
{{-- Anexo do Projeto --}} {{-- Anexo do Projeto --}}
<div class="row justify-content-center"> <div class="row justify-content-center">
{{-- Arquivo --}} {{-- Arquivo --}}
<div class="col-sm-6" > <div class="col-sm-6">
<label for="anexoProjeto" class="col-form-label">{{ __('Anexo Projeto:') }}</label> <label for="anexoProjeto" class="col-form-label">{{ __('Anexo Projeto:') }}</label>
<div class="input-group"> <div class="input-group">
<div class="custom-file"> <div class="custom-file">
<input type="file" class="custom-file-input" id="anexoProjeto" <input type="file" class="custom-file-input" id="anexoProjeto" aria-describedby="inputGroupFileAddon01" name="anexoProjeto">
aria-describedby="inputGroupFileAddon01" name="anexoProjeto">
<label class="custom-file-label" id="custom-file-label" for="anexoProjeto">O arquivo deve ser no formato PDF de até 2mb.</label> <label class="custom-file-label" id="custom-file-label" for="anexoProjeto">O arquivo deve ser no formato PDF de até 2mb.</label>
</div> </div>
</div> </div>
...@@ -139,14 +137,13 @@ ...@@ -139,14 +137,13 @@
@enderror @enderror
</div> </div>
<div class="col-sm-6" > <div class="col-sm-6">
<label for="anexoLatterCoordenador" class="col-form-label">{{ __('Anexo do Lattes do Coordenador:') }}</label> <label for="anexoLatterCoordenador" class="col-form-label">{{ __('Anexo do Lattes do Coordenador:') }}</label>
<div class="input-group"> <div class="input-group">
<div class="custom-file"> <div class="custom-file">
<input type="file" class="custom-file-input" id="inputGroupFile01" <input type="file" class="custom-file-input" id="inputGroupFile01" aria-describedby="anexoLatterCoordenador" name="anexoLatterCoordenador">
aria-describedby="anexoLatterCoordenador" name="anexoLatterCoordenador">
<label class="custom-file-label" id="custom-file-label" for="inputGroupFile01">O arquivo deve ser no formato PDF de até 2mb.</label> <label class="custom-file-label" id="custom-file-label" for="inputGroupFile01">O arquivo deve ser no formato PDF de até 2mb.</label>
</div> </div>
</div> </div>
...@@ -161,7 +158,7 @@ ...@@ -161,7 +158,7 @@
<div class="col-sm-6" > <div class="col-sm-6">
<label for="nomeTrabalho" class="col-form-label">{{ __('Possui autorização do Comitê de Ética:') }}</label> <label for="nomeTrabalho" class="col-form-label">{{ __('Possui autorização do Comitê de Ética:') }}</label>
<button id="buttonSim" class="btn btn-primary mt-2 mb-2">Sim</button> <button id="buttonSim" class="btn btn-primary mt-2 mb-2">Sim</button>
<button id="buttonNao" class="btn btn-primary mt-2 mb-2">Não</button> <button id="buttonNao" class="btn btn-primary mt-2 mb-2">Não</button>
...@@ -169,8 +166,7 @@ ...@@ -169,8 +166,7 @@
<div class="custom-file"> <div class="custom-file">
<input type="file" class="custom-file-input" id="inputEtica" <input type="file" class="custom-file-input" id="inputEtica" aria-describedby="inputGroupFileAddon01" name="anexoComiteEtica">
aria-describedby="inputGroupFileAddon01" name="anexoComiteEtica">
<label class="custom-file-label" id="custom-file-label" for="inputGroupFile01">O arquivo deve ser no formato PDF de até 2mb.</label> <label class="custom-file-label" id="custom-file-label" for="inputGroupFile01">O arquivo deve ser no formato PDF de até 2mb.</label>
</div> </div>
</div> </div>
...@@ -181,14 +177,13 @@ ...@@ -181,14 +177,13 @@
@enderror @enderror
</div> </div>
<div class="col-sm-6 mt-3" > <div class="col-sm-6 mt-3">
<label for="anexoPlanilha" class="col-form-label">{{ __('Anexo do Planilha de Pontuação :') }}</label> <label for="anexoPlanilha" class="col-form-label">{{ __('Anexo do Planilha de Pontuação :') }}</label>
<div class="input-group"> <div class="input-group">
<div class="custom-file"> <div class="custom-file">
<input type="file" class="custom-file-input" id="anexoPlanilha" <input type="file" class="custom-file-input" id="anexoPlanilha" aria-describedby="anexoPlanilhaDescribe" name="anexoPlanilha">
aria-describedby="anexoPlanilhaDescribe" name="anexoPlanilha">
<label class="custom-file-label" id="custom-file-label" for="anexoPlanilha">O arquivo deve ser no formato PDF de até 2mb.</label> <label class="custom-file-label" id="custom-file-label" for="anexoPlanilha">O arquivo deve ser no formato PDF de até 2mb.</label>
</div> </div>
</div> </div>
...@@ -199,15 +194,14 @@ ...@@ -199,15 +194,14 @@
@enderror @enderror
</div> </div>
<div class="col-sm-6" > <div class="col-sm-6">
<label for="nomeTrabalho" class="col-form-label">{{ __('Justificativa:') }}</label> <label for="nomeTrabalho" class="col-form-label">{{ __('Justificativa:') }}</label>
<div class="input-group"> <div class="input-group">
<div class="custom-file"> <div class="custom-file">
<input type="file" class="custom-file-input" id="inputJustificativa" <input type="file" class="custom-file-input" id="inputJustificativa" aria-describedby="inputGroupFileAddon01" disabled="disabled" name="JustificativaAutorizacaoEtica">
aria-describedby="inputGroupFileAddon01" disabled="disabled" name="JustificativaAutorizacaoEtica">
<label class="custom-file-label" id="custom-file-label" for="inputGroupFile01">O arquivo deve ser no formato PDF de até 2mb.</label> <label class="custom-file-label" id="custom-file-label" for="inputGroupFile01">O arquivo deve ser no formato PDF de até 2mb.</label>
</div> </div>
</div> </div>
...@@ -220,14 +214,13 @@ ...@@ -220,14 +214,13 @@
@if($edital->tipo == 'PIBIC' || $edital->tipo == 'PIBIC-EM') @if($edital->tipo == 'PIBIC' || $edital->tipo == 'PIBIC-EM')
{{-- Decisão do CONSU --}} {{-- Decisão do CONSU --}}
<div class="col-sm-6" > <div class="col-sm-6">
<label for="anexoCONSU" class="col-form-label">{{ __('Decisão do CONSU:') }}</label> <label for="anexoCONSU" class="col-form-label">{{ __('Decisão do CONSU:') }}</label>
<div class="input-group"> <div class="input-group">
<div class="custom-file"> <div class="custom-file">
<input type="file" class="custom-file-input" id="anexoCONSU" <input type="file" class="custom-file-input" id="anexoCONSU" aria-describedby="inputGroupFileAddon01" name="anexoCONSU">
aria-describedby="inputGroupFileAddon01" name="anexoCONSU">
<label class="custom-file-label" id="custom-file-label" for="inputGroupFile01">O arquivo deve ser no formato PDF de até 2mb.</label> <label class="custom-file-label" id="custom-file-label" for="inputGroupFile01">O arquivo deve ser no formato PDF de até 2mb.</label>
</div> </div>
</div> </div>
...@@ -248,7 +241,9 @@ ...@@ -248,7 +241,9 @@
<div class="row" style="margin-top:20px"> <div class="row" style="margin-top:20px">
<div class="col-sm-12"> <div class="col-sm-12">
<div id="participantes"> <div id="participantes">
<br><h5>Dados do participante</h5> <div id="novoParticipante">
<br>
<h5>Dados do participante</h5>
<div class="row"> <div class="row">
<div class="col-sm-5"> <div class="col-sm-5">
<label>Nome Completo</label> <label>Nome Completo</label>
...@@ -279,14 +274,13 @@ ...@@ -279,14 +274,13 @@
</div> </div>
{{-- Arquivo --}} {{-- Arquivo --}}
<div class="col-sm-7"> <div class="col-sm-7">
<label for="nomeTrabalho" >Anexo</label> <label for="nomeTrabalho">Anexo</label>
<div class="input-group" > <div class="input-group">
<div class="input-group-prepend"> <div class="input-group-prepend">
<span class="input-group-text" id="anexoPlanoTrabalho">Selecione um arquivo:</span> <span class="input-group-text" id="anexoPlanoTrabalho">Selecione um arquivo:</span>
</div> </div>
<div class="custom-file"> <div class="custom-file">
<input type="file" class="custom-file-input" id="anexoPlanoTrabalho" <input type="file" class="custom-file-input" id="anexoPlanoTrabalho" aria-describedby="anexoPlanoTrabalho" name="anexoPlanoTrabalho[]">
aria-describedby="anexoPlanoTrabalho" name="anexoPlanoTrabalho[]">
<label class="custom-file-label" id="custom-file-label" for="inputGroupFile01">O arquivo deve ser no formato PDF de até 2mb.</label> <label class="custom-file-label" id="custom-file-label" for="inputGroupFile01">O arquivo deve ser no formato PDF de até 2mb.</label>
</div> </div>
</div> </div>
...@@ -306,6 +300,7 @@ ...@@ -306,6 +300,7 @@
</div> </div>
</div> </div>
</div> </div>
</div>
<a href="#" class="btn btn-primary" id="addCoautor" style="width:100%;margin-top:10px">Participantes +</a> <a href="#" class="btn btn-primary" id="addCoautor" style="width:100%;margin-top:10px">Participantes +</a>
</div> </div>
</div> </div>
...@@ -332,14 +327,12 @@ ...@@ -332,14 +327,12 @@
@section('javascript') @section('javascript')
<script type="text/javascript"> <script type="text/javascript">
$(function() {
$(function(){
var qtdLinhas = 1; var qtdLinhas = 1;
var qtdParticipantes = 2; var qtdParticipantes = 2;
// Coautores // Coautores
$('#addCoautor').click(function(e){ $('#addCoautor').click(function(e) {
if(qtdParticipantes < 100){ if (qtdParticipantes < 100) {
e.preventDefault(); e.preventDefault();
linha = montarLinhaInput(); linha = montarLinhaInput();
$('#participantes').append(linha); $('#participantes').append(linha);
...@@ -347,9 +340,9 @@ $(function(){ ...@@ -347,9 +340,9 @@ $(function(){
} }
}); });
$('#addPlanoTrabalho').click(function(e){ $('#addPlanoTrabalho').click(function(e) {
e.preventDefault(); e.preventDefault();
if(qtdLinhas < 4){ if (qtdLinhas < 4) {
linha = montarLinhaInputPlanoTrabalho(); linha = montarLinhaInputPlanoTrabalho();
$('#planoTrabalho').append(linha); $('#planoTrabalho').append(linha);
qtdLinhas++; qtdLinhas++;
...@@ -357,37 +350,37 @@ $(function(){ ...@@ -357,37 +350,37 @@ $(function(){
}); });
// Exibir modalidade de acordo com a área // Exibir modalidade de acordo com a área
$("#area").change(function(){ $("#area").change(function() {
console.log($(this).val()); console.log($(this).val());
addModalidade($(this).val()); addModalidade($(this).val());
}); });
$(document).on('click','.delete',function(){ $(document).on('click', '.delete', function() {
if(qtdParticipantes > 2){ if (qtdParticipantes > 2) {
qtdParticipantes--; qtdParticipantes--;
$(this).closest('.row').remove(); $(this).closest('#novoParticipante').remove();
return false; return false;
} }
}); });
$(document).on('click','.deletePlano',function(){ $(document).on('click', '.deletePlano', function() {
if(qtdLinhas > 1){ if (qtdLinhas > 1) {
qtdLinhas--; qtdLinhas--;
$("#planoTrabalho div.row:last").remove(); $("#planoTrabalho div.row:last").remove();
return false; return false;
} }
}); });
$('#anexoProjeto').on('change',function(){ $('#anexoProjeto').on('change', function() {
//get the file name //get the file name
var fileName = $(this).val(); var fileName = $(this).val();
//replace the "Choose a file" label //replace the "Choose a file" label
$(this).next('#custom-file-label').html(fileName); $(this).next('#custom-file-label').html(fileName);
}) })
// F // F
$('#buttonSim').on('click',function(e){ $('#buttonSim').on('click', function(e) {
e.preventDefault(); e.preventDefault();
$('#inputEtica').prop('disabled', false); $('#inputEtica').prop('disabled', false);
$('#inputJustificativa').prop('disabled', true); $('#inputJustificativa').prop('disabled', true);
}); });
$('#buttonNao').on('click',function(e){ $('#buttonNao').on('click', function(e) {
e.preventDefault(); e.preventDefault();
$('#inputEtica').prop('disabled', true); $('#inputEtica').prop('disabled', true);
$('#inputJustificativa').prop('disabled', false); $('#inputJustificativa').prop('disabled', false);
...@@ -396,19 +389,21 @@ $(function(){ ...@@ -396,19 +389,21 @@ $(function(){
}); });
// Remover Coautor // Remover Coautor
function addModalidade(areaId){ function addModalidade(areaId) {
console.log(modalidades) console.log(modalidades)
$("#modalidade").empty(); $("#modalidade").empty();
for(let i = 0; i < modalidades.length; i++){ for (let i = 0; i < modalidades.length; i++) {
if(modalidades[i].areaId == areaId){ if (modalidades[i].areaId == areaId) {
console.log(modalidades[i]); console.log(modalidades[i]);
$("#modalidade").append("<option value="+modalidades[i].modalidadeId+">"+modalidades[i].modalidadeNome+"</option>") $("#modalidade").append("<option value=" + modalidades[i].modalidadeId + ">" + modalidades[i].modalidadeNome + "</option>")
} }
} }
} }
function montarLinhaInput(){
return "<br><h5>Dados do participante</h5>" + function montarLinhaInput() {
return "<div id="+"novoParticipante"+">" +
"<br><h5>Dados do participante</h5>" +
"<div class="+"row"+">"+ "<div class="+"row"+">"+
"<div class="+"col-sm-5"+">"+ "<div class="+"col-sm-5"+">"+
"<label>Nome Completo</label>"+ "<label>Nome Completo</label>"+
...@@ -458,6 +453,7 @@ $(function(){ ...@@ -458,6 +453,7 @@ $(function(){
"<img src="+"/img/icons/user-times-solid.svg"+" style="+"width:25px;margin-top:35px"+">"+ "<img src="+"/img/icons/user-times-solid.svg"+" style="+"width:25px;margin-top:35px"+">"+
"</a>"+ "</a>"+
"</div>"+ "</div>"+
"</div>"+
"</div>"; "</div>";
} }
// function montarLinhaInputPlanoTrabalho(){ // function montarLinhaInputPlanoTrabalho(){
...@@ -493,6 +489,5 @@ $(function(){ ...@@ -493,6 +489,5 @@ $(function(){
// "</div>"+ // "</div>"+
// "</div>"; // "</div>";
// } // }
</script> </script>
@endsection @endsection
\ No newline at end of file
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