Commit c626bb5e authored by Gabriel-31415's avatar Gabriel-31415
Browse files

atualizar o caminho do input file

parent 7b97025b
...@@ -104,7 +104,8 @@ class TrabalhoController extends Controller ...@@ -104,7 +104,8 @@ class TrabalhoController extends Controller
'funcaoParticipante.*' => ['required', 'string'], 'funcaoParticipante.*' => ['required', 'string'],
'nomePlanoTrabalho.*' => ['required', 'string'], 'nomePlanoTrabalho.*' => ['required', 'string'],
'anexoProjeto' => ['required', 'file', 'mimes:pdf', 'max:2000000'], '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'], 'anexoLatterCoordenador' => ['required', 'file', 'mimes:pdf', 'max:2000000'],
'anexoPlanilha' => ['required', 'file', 'mimes:pdf', 'max:2000000'], 'anexoPlanilha' => ['required', 'file', 'mimes:pdf', 'max:2000000'],
'anexoPlanoTrabalho.*' => ['required', 'file', 'mimes:pdf', 'max:2000000'], 'anexoPlanoTrabalho.*' => ['required', 'file', 'mimes:pdf', 'max:2000000'],
...@@ -125,7 +126,7 @@ class TrabalhoController extends Controller ...@@ -125,7 +126,7 @@ class TrabalhoController extends Controller
'avaliado' => 0, 'avaliado' => 0,
'proponente_id' => $proponente->id, 'proponente_id' => $proponente->id,
//Anexos //Anexos
'anexoDecisaoCONSU' => $request->anexoCONSU, 'anexoCONSU' => $request->anexoCONSU,
'anexoProjeto' => $request->anexoProjeto, 'anexoProjeto' => $request->anexoProjeto,
'anexoAutorizacaoComiteEtica' => $request->anexoComiteEtica, 'anexoAutorizacaoComiteEtica' => $request->anexoComiteEtica,
'justificativaAutorizacaoEtica' => $request->justificativaAutorizacaoEtica, 'justificativaAutorizacaoEtica' => $request->justificativaAutorizacaoEtica,
......
...@@ -16,10 +16,10 @@ ...@@ -16,10 +16,10 @@
{{-- Nome do Projeto --}} {{-- Nome do Projeto --}}
<div class="row justify-content-center"> <div class="row justify-content-center">
<div class="col-sm-12"> <div class="col-sm-12">
<label for="nomeTrabalho" class="col-form-label">{{ __('Nome do Projeto:') }}</label> <label for="nomeProjeto" class="col-form-label">{{ __('Nome do Projeto:') }}</label>
<input id="nomeTrabalho" type="text" class="form-control @error('nomeTrabalho') is-invalid @enderror" name="nomeProjeto" value="{{ old('nomeTrabalho') }}" required autocomplete="nomeTrabalho" autofocus> <input id="nomeProjeto" type="text" class="form-control @error('nomeProjeto') is-invalid @enderror" name="nomeProjeto" value="{{ old('nomeProjeto') }}" required autocomplete="nomeProjeto" autofocus>
@error('nomeTrabalho') @error('nomeProjeto')
<span class="invalid-feedback" role="alert"> <span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong> <strong>{{ $message }}</strong>
</span> </span>
...@@ -140,7 +140,7 @@ ...@@ -140,7 +140,7 @@
{{-- 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">
...@@ -408,11 +408,16 @@ ...@@ -408,11 +408,16 @@
return false; return false;
} }
}); });
$('#anexoProjeto').on('change', function() { $('.custom-file-input').on('change', function() {
//get the file name var fieldVal = $(this).val();
var fileName = $(this).val();
//replace the "Choose a file" label // Change the node's value by removing the fake path (Chrome)
$(this).next('#custom-file-label').html(fileName); 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 // F
$('#buttonSim').on('click', function(e) { $('#buttonSim').on('click', function(e) {
......
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