Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Walter Felipe
submeta
Commits
234a3045
Commit
234a3045
authored
Jun 17, 2020
by
carlos
Browse files
baixar anexos
parent
b2c6b081
Changes
4
Hide whitespace changes
Inline
Side-by-side
app/Http/Controllers/EventoController.php
View file @
234a3045
...
...
@@ -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
);
}
}
app/Http/Controllers/TrabalhoController.php
View file @
234a3045
...
...
@@ -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
)
{
...
...
resources/views/evento/visualizarEvento.blade.php
View file @
234a3045
...
...
@@ -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"
>
...
...
routes/web.php
View file @
234a3045
...
...
@@ -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'
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment