From ecf10d5c8470a6fdb16e96211e4ec07b41eee43a Mon Sep 17 00:00:00 2001 From: Yuri Resende Date: Mon, 8 May 2023 23:03:34 -0300 Subject: [PATCH] =?UTF-8?q?Retirando=20o=20plano=20de=20trabalho=20para=20?= =?UTF-8?q?as=20fun=C3=A7=C3=B5es=20que=20n=C3=A3o=20precisam?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Requests/StoreTrabalho.php | 3 +-- .../views/evento/formulario/integrantes.blade.php | 11 ++++++++++- .../views/evento/formulario/participantes.blade.php | 10 +++++----- 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/app/Http/Requests/StoreTrabalho.php b/app/Http/Requests/StoreTrabalho.php index 74fa099..955db15 100755 --- a/app/Http/Requests/StoreTrabalho.php +++ b/app/Http/Requests/StoreTrabalho.php @@ -59,8 +59,7 @@ class StoreTrabalho extends FormRequest $rules['media_do_curso.' . $value] = ['required', 'string']; } - - if($evento->tipo != "CONTINUO"){ + if($evento->tipo != "CONTINUO" && ($this->funcaoParticipante[$value] == "Voluntário" || $this->funcaoParticipante[$value] == "Bolsista")){ $rules['anexoPlanoTrabalho.'.$value] = ['required']; $rules['nomePlanoTrabalho.'.$value] = ['required', 'string']; } diff --git a/resources/views/evento/formulario/integrantes.blade.php b/resources/views/evento/formulario/integrantes.blade.php index a7d574a..c90f525 100644 --- a/resources/views/evento/formulario/integrantes.blade.php +++ b/resources/views/evento/formulario/integrantes.blade.php @@ -222,7 +222,6 @@ let modal_id = 0; function exibirUsuarioAdicionado(data) { - console.log(`${modal_id}`, data); $('#modalIntegrante').modal('hide'); document.getElementById(`nome${modal_id}`).value = data[0]['name']; document.getElementById(`nome${modal_id}`).setAttribute("readonly", ""); @@ -268,6 +267,16 @@ document.getElementById(`curso[${modal_id}]`).value = data[2]['curso']; document.getElementById(`curso[${modal_id}]`).setAttribute("readonly", ""); + + console.log(document.getElementById(`funcaoParticipante${modal_id}`)); + document.getElementById(`funcaoParticipante${modal_id}`).value = data[1]['nome']; + + if(data[1].nome != "Bolsista" && data[1].nome != "Voluntário"){ + document.getElementById(`plano-titulo${modal_id}`).setAttribute('hidden', ""); + document.getElementById(`plano-nome${modal_id}`).setAttribute('hidden', ""); + document.getElementById(`plano-anexo${modal_id}`).setAttribute('hidden', ""); + } + $(`#exampleModal${modal_id}`).modal('show'); } diff --git a/resources/views/evento/formulario/participantes.blade.php b/resources/views/evento/formulario/participantes.blade.php index accec51..e1d412f 100755 --- a/resources/views/evento/formulario/participantes.blade.php +++ b/resources/views/evento/formulario/participantes.blade.php @@ -69,9 +69,9 @@
- +
-
Dados do discente
+
Dados do integrante
@component('componentes.input', ['label' => 'Nome completo']) @@ -354,10 +354,10 @@ @endif @if($edital->tipo != "CONTINUO") -
+
Plano de trabalho
-
+
@component('componentes.input', ['label' => 'Título']) @@ -369,7 +369,7 @@ @enderror @endcomponent
-
+
@component('componentes.input', ['label' => 'Anexo (.pdf)']) @error('anexoPlanoTrabalho.'.$i) -- GitLab