From c626bb5e8d74fe8a538b58934f2b5e5bbc0ba7ea Mon Sep 17 00:00:00 2001 From: Gabriel-31415 Date: Tue, 9 Jun 2020 03:34:38 +0000 Subject: [PATCH] atualizar o caminho do input file --- app/Http/Controllers/TrabalhoController.php | 5 ++-- .../views/evento/submeterTrabalho.blade.php | 23 +++++++++++-------- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/app/Http/Controllers/TrabalhoController.php b/app/Http/Controllers/TrabalhoController.php index e219498..a6d80aa 100644 --- a/app/Http/Controllers/TrabalhoController.php +++ b/app/Http/Controllers/TrabalhoController.php @@ -104,7 +104,8 @@ class TrabalhoController extends Controller 'funcaoParticipante.*' => ['required', 'string'], 'nomePlanoTrabalho.*' => ['required', 'string'], 'anexoProjeto' => ['required', 'file', 'mimes:pdf', 'max:2000000'], - //'anexoCONSU' => ['required', 'file', 'mimes:pdf', 'max:2000000'], + 'anexoCONSU' => ['required', 'file', 'mimes:pdf', 'max:2000000'], + 'anexoComiteEtica' => ['required', 'file', 'mimes:pdf', 'max:2000000'], 'anexoLatterCoordenador' => ['required', 'file', 'mimes:pdf', 'max:2000000'], 'anexoPlanilha' => ['required', 'file', 'mimes:pdf', 'max:2000000'], 'anexoPlanoTrabalho.*' => ['required', 'file', 'mimes:pdf', 'max:2000000'], @@ -125,7 +126,7 @@ class TrabalhoController extends Controller 'avaliado' => 0, 'proponente_id' => $proponente->id, //Anexos - 'anexoDecisaoCONSU' => $request->anexoCONSU, + 'anexoCONSU' => $request->anexoCONSU, 'anexoProjeto' => $request->anexoProjeto, 'anexoAutorizacaoComiteEtica' => $request->anexoComiteEtica, 'justificativaAutorizacaoEtica' => $request->justificativaAutorizacaoEtica, diff --git a/resources/views/evento/submeterTrabalho.blade.php b/resources/views/evento/submeterTrabalho.blade.php index c3a0d40..83d4aa1 100644 --- a/resources/views/evento/submeterTrabalho.blade.php +++ b/resources/views/evento/submeterTrabalho.blade.php @@ -16,10 +16,10 @@ {{-- Nome do Projeto --}}
- - + + - @error('nomeTrabalho') + @error('nomeProjeto') {{ $message }} @@ -140,7 +140,7 @@ {{-- Arquivo --}}
- +
@@ -408,11 +408,16 @@ return false; } }); - $('#anexoProjeto').on('change', function() { - //get the file name - var fileName = $(this).val(); - //replace the "Choose a file" label - $(this).next('#custom-file-label').html(fileName); + $('.custom-file-input').on('change', function() { + var fieldVal = $(this).val(); + + // Change the node's value by removing the fake path (Chrome) + fieldVal = fieldVal.replace("C:\\fakepath\\", ""); + + if (fieldVal != undefined || fieldVal != "") { + $(this).next(".custom-file-label").attr('data-content', fieldVal); + $(this).next(".custom-file-label").text(fieldVal); + } }) // F $('#buttonSim').on('click', function(e) { -- GitLab