Commit 234a3045 authored by carlos's avatar carlos
Browse files

baixar anexos

parent b2c6b081
......@@ -470,6 +470,21 @@ class EventoController extends Controller
public function baixarEdital($id) {
$evento = Evento::find($id);
return Storage::download($evento->pdfEdital);
if (Storage::disk()->exists($evento->pdfEdital)) {
return Storage::download($evento->pdfEdital);
}
return abort(404);
}
public function baixarModelos($id) {
$evento = Evento::find($id);
if (Storage::disk()->exists($evento->modeloDocumento)) {
return Storage::download($evento->modeloDocumento);
}
return abort(404);
}
}
......@@ -856,7 +856,12 @@ class TrabalhoController extends Controller
public function baixarAnexoJustificativa($id) {
$projeto = Trabalho::find($id);
return Storage::download($projeto->justificativaAutorizacaoEtica);
if (Storage::disk()->exists($projeto->justificativaAutorizacaoEtica)) {
return Storage::download($projeto->justificativaAutorizacaoEtica);
}
return abort(404);
}
public function baixarAnexoTemp($eventoId, $nomeAnexo) {
......
......@@ -123,6 +123,34 @@
</div>
</div>
<div class="row justify-content-center">
<div class="col-sm-12">
<table class="table table-responsive-lg table-hover">
<thead>
<tr>
<th style="text-align:center">Edital</th>
<th style="text-align:center">Modelos</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:center">
<a href="{{route('baixar.edital', ['id' => $evento->id])}}" target="_new" style="font-size: 20px; color: #114048ff;" >
<img class="" src="{{asset('img/icons/file-download-solid.svg')}}" style="width:20px">
</a>
</td>
<td style="text-align:center">
<a href="{{route('baixar.modelos', ['id' => $evento->id])}}" target="_new" style="font-size: 20px; color: #114048ff;" >
<img class="" src="{{asset('img/icons/file-download-solid.svg')}}" style="width:20px">
</a>
</td>
</tr>
</tbody>
</table>
</div>
</div>
@if($hasFile == true)
<div class="row margin">
<div class="col-sm-12">
......
......@@ -117,6 +117,7 @@ Route::group(['middleware' => ['isTemp', 'auth', 'verified']], function(){
//########## Rotas de download de documentos ###########################
Route::get('/baixar/edital/{id}', 'EventoController@baixarEdital' )->name('baixar.edital');
Route::get('/baixar/modelos/{id}', 'EventoController@baixarModelos' )->name('baixar.modelos');
Route::get('/baixar/anexo-projeto/{id}', 'TrabalhoController@baixarAnexoProjeto' )->name('baixar.anexo.projeto');
Route::get('/baixar/anexo-consu/{id}', 'TrabalhoController@baixarAnexoConsu' )->name('baixar.anexo.consu');
Route::get('/baixar/anexo-comite/{id}', 'TrabalhoController@baixarAnexoComite' )->name('baixar.anexo.comite');
......
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