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
aff1a02b
Commit
aff1a02b
authored
Jun 09, 2020
by
Gabriel-31415
Browse files
add anexos e ajustes da reuniao
parent
c626bb5e
Changes
13
Show whitespace changes
Inline
Side-by-side
app/Avaliador.php
View file @
aff1a02b
...
@@ -16,7 +16,7 @@ class Avaliador extends Model
...
@@ -16,7 +16,7 @@ class Avaliador extends Model
return
$this
->
belongsTo
(
'App\User'
);
return
$this
->
belongsTo
(
'App\User'
);
}
}
public
function
trabalhos
(){
public
function
trabalhos
(){
return
$this
->
belongsToMany
(
'App\Trabalho'
)
->
withPivot
(
'status'
,
'AnexoParecer'
,
'parecer'
,
'recomendacao'
);
return
$this
->
belongsToMany
(
'App\Trabalho'
)
->
withPivot
(
'status'
,
'AnexoParecer'
,
'parecer'
,
'recomendacao'
,
'created_at'
);
}
}
public
function
eventos
(){
public
function
eventos
(){
return
$this
->
belongsToMany
(
'App\Evento'
);
return
$this
->
belongsToMany
(
'App\Evento'
);
...
...
app/Http/Controllers/AdministradorController.php
View file @
aff1a02b
...
@@ -392,4 +392,8 @@ class AdministradorController extends Controller
...
@@ -392,4 +392,8 @@ class AdministradorController extends Controller
return
redirect
()
->
back
();
return
redirect
()
->
back
();
}
}
// public function baixarAnexo(Request $request) {
// return Storage::download($request->anexo);
// }
}
}
app/Http/Controllers/AvaliadorController.php
View file @
aff1a02b
...
@@ -9,6 +9,8 @@ use App\Evento;
...
@@ -9,6 +9,8 @@ use App\Evento;
use
App\Recomendacao
;
use
App\Recomendacao
;
use
App\User
;
use
App\User
;
use
App\Avaliador
;
use
App\Avaliador
;
use
Carbon\Carbon
;
use
Illuminate\Support\Facades\Storage
;
class
AvaliadorController
extends
Controller
class
AvaliadorController
extends
Controller
{
{
...
@@ -17,7 +19,7 @@ class AvaliadorController extends Controller
...
@@ -17,7 +19,7 @@ class AvaliadorController extends Controller
return
view
(
'avaliador.index'
);
return
view
(
'avaliador.index'
);
}
}
public
function
editais
(){
public
function
editais
(
Request
$request
){
$user
=
User
::
find
(
Auth
::
user
()
->
id
);
$user
=
User
::
find
(
Auth
::
user
()
->
id
);
$eventos
=
$user
->
avaliadors
->
where
(
'user_id'
,
$user
->
id
)
->
first
()
->
eventos
;
$eventos
=
$user
->
avaliadors
->
where
(
'user_id'
,
$user
->
id
)
->
first
()
->
eventos
;
...
@@ -30,7 +32,7 @@ class AvaliadorController extends Controller
...
@@ -30,7 +32,7 @@ class AvaliadorController extends Controller
$user
=
User
::
find
(
Auth
::
user
()
->
id
);
$user
=
User
::
find
(
Auth
::
user
()
->
id
);
$evento
=
Evento
::
where
(
'id'
,
$request
->
evento_id
)
->
first
();
$evento
=
Evento
::
where
(
'id'
,
$request
->
evento_id
)
->
first
();
$trabalhos
=
$user
->
avaliadors
->
where
(
'user_id'
,
$user
->
id
)
->
first
()
->
trabalhos
;
$trabalhos
=
$user
->
avaliadors
->
where
(
'user_id'
,
$user
->
id
)
->
first
()
->
trabalhos
->
where
(
'evento_id'
,
$request
->
evento_id
)
;
//dd();
//dd();
...
@@ -55,17 +57,25 @@ class AvaliadorController extends Controller
...
@@ -55,17 +57,25 @@ class AvaliadorController extends Controller
$evento
=
Evento
::
find
(
$request
->
evento_id
);
$evento
=
Evento
::
find
(
$request
->
evento_id
);
$trabalhos
=
$user
->
avaliadors
->
where
(
'user_id'
,
$user
->
id
)
->
first
()
->
trabalhos
;
$trabalhos
=
$user
->
avaliadors
->
where
(
'user_id'
,
$user
->
id
)
->
first
()
->
trabalhos
->
where
(
'evento_id'
,
$request
->
evento_id
)
;
$avaliador
=
$user
->
avaliadors
->
where
(
'user_id'
,
$user
->
id
)
->
first
();
$avaliador
=
$user
->
avaliadors
->
where
(
'user_id'
,
$user
->
id
)
->
first
();
$trabalho
=
$avaliador
->
trabalhos
->
find
(
$request
->
trabalho_id
);
$trabalho
=
$avaliador
->
trabalhos
->
find
(
$request
->
trabalho_id
);
$data
=
Carbon
::
now
(
'America/Recife'
);
if
(
$request
->
anexoParecer
==
''
){
if
(
$request
->
anexoParecer
==
''
){
$avaliador
$avaliador
->
trabalhos
()
->
trabalhos
()
->
updateExistingPivot
(
$trabalho
->
id
,[
'status'
=>
1
,
'parecer'
=>
$request
->
textParecer
,
'recomendacao'
=>
$request
->
recomendacao
]);
->
updateExistingPivot
(
$trabalho
->
id
,[
'status'
=>
1
,
'parecer'
=>
$request
->
textParecer
,
'recomendacao'
=>
$request
->
recomendacao
,
'created_at'
=>
$data
]);
}
else
{
}
else
{
$anexoParecer
=
$request
->
anexoParecer
;
$path
=
'anexoParecer/'
.
$avaliador
->
id
.
$trabalho
->
id
.
'/'
;
$nome
=
"parecer.pdf"
;
Storage
::
putFileAs
(
$path
,
$anexoParecer
,
$nome
);
$anexoParecer
=
$path
.
$nome
;
$avaliador
$avaliador
->
trabalhos
()
->
trabalhos
()
->
updateExistingPivot
(
$trabalho
->
id
,[
'status'
=>
1
,
'parecer'
=>
$request
->
textParecer
,
'AnexoParecer'
=>
$
request
->
anexoParecer
,
'recomendacao'
=>
$request
->
recomendacao
]);
->
updateExistingPivot
(
$trabalho
->
id
,[
'status'
=>
1
,
'parecer'
=>
$request
->
textParecer
,
'AnexoParecer'
=>
$anexoParecer
,
'recomendacao'
=>
$request
->
recomendacao
,
'created_at'
=>
$data
]);
}
}
...
...
app/Http/Controllers/HomeController.php
View file @
aff1a02b
...
@@ -5,6 +5,7 @@ namespace App\Http\Controllers;
...
@@ -5,6 +5,7 @@ namespace App\Http\Controllers;
use
Illuminate\Http\Request
;
use
Illuminate\Http\Request
;
use
Auth
;
use
Auth
;
use
Illuminate\Support\Facades\Log
;
use
Illuminate\Support\Facades\Log
;
use
Illuminate\Support\Facades\Storage
;
class
HomeController
extends
Controller
class
HomeController
extends
Controller
{
{
...
@@ -51,6 +52,6 @@ class HomeController extends Controller
...
@@ -51,6 +52,6 @@ class HomeController extends Controller
}
}
public
function
downloadArquivo
(
Request
$request
){
public
function
downloadArquivo
(
Request
$request
){
return
response
()
->
download
(
storage_path
(
'app/'
.
$request
->
file
)
)
;
return
Storage
::
download
(
$request
->
file
);
}
}
}
}
app/Trabalho.php
View file @
aff1a02b
...
@@ -85,6 +85,6 @@ class Trabalho extends Model
...
@@ -85,6 +85,6 @@ class Trabalho extends Model
return
$this
->
belongsTo
(
'App\CoordenadorComissao'
);
return
$this
->
belongsTo
(
'App\CoordenadorComissao'
);
}
}
public
function
avaliadors
(){
public
function
avaliadors
(){
return
$this
->
belongsToMany
(
'App\Avaliador'
)
->
withPivot
(
'status'
,
'AnexoParecer'
,
'parecer'
,
'recomendacao'
);
return
$this
->
belongsToMany
(
'App\Avaliador'
)
->
withPivot
(
'status'
,
'AnexoParecer'
,
'parecer'
,
'recomendacao'
,
'created_at'
);
}
}
}
}
resources/views/administrador/projetos.blade.php
View file @
aff1a02b
...
@@ -8,6 +8,11 @@
...
@@ -8,6 +8,11 @@
<
div
class
=
"row"
>
<
div
class
=
"row"
>
<
div
class
=
"col-sm-10"
>
<
div
class
=
"col-sm-10"
>
<
h3
>
Trabalhos
do
Edital
:
{{
$evento
->
nome
}}
</
h3
>
<
h3
>
Trabalhos
do
Edital
:
{{
$evento
->
nome
}}
</
h3
>
{{
--
<
h6
>
Data
inicioSubmissao
:
{{
date
(
'd/m/Y'
,
strtotime
(
$evento
->
inicioSubmissao
))
}}
</
h6
>
--
}}
<
h6
>
Data
fim
da
submissao
:
{{
date
(
'd/m/Y'
,
strtotime
(
$evento
->
fimSubmissao
))
}}
</
h6
>
{{
--
<
h6
>
Data
inicioRevisao
:
{{
date
(
'd/m/Y'
,
strtotime
(
$evento
->
inicioRevisao
))
}}
</
h6
>
<
h6
>
Data
fimRevisao
:
{{
date
(
'd/m/Y'
,
strtotime
(
$evento
->
fimRevisao
))
}}
</
h6
>
<
h6
>
Data
resultado
:
{{
date
(
'd/m/Y'
,
strtotime
(
$evento
->
resultado
))
}}
</
h6
>
--
}}
</
div
>
</
div
>
</
div
>
</
div
>
</
div
>
</
div
>
...
@@ -32,6 +37,8 @@
...
@@ -32,6 +37,8 @@
<
tr
>
<
tr
>
<
th
scope
=
"col"
>
Avaliador
</
th
>
<
th
scope
=
"col"
>
Avaliador
</
th
>
<
th
scope
=
"col"
>
E
-
mail
</
th
>
<
th
scope
=
"col"
>
E
-
mail
</
th
>
<
th
scope
=
"col"
>
Data
</
th
>
<
th
scope
=
"col"
>
Recomendação
</
th
>
<
th
scope
=
"col"
>
Parecer
</
th
>
<
th
scope
=
"col"
>
Parecer
</
th
>
</
tr
>
</
tr
>
</
thead
>
</
thead
>
...
@@ -40,14 +47,36 @@
...
@@ -40,14 +47,36 @@
<
tr
>
<
tr
>
<
td
>
{{
$avaliador
->
user
->
name
}}
</
td
>
<
td
>
{{
$avaliador
->
user
->
name
}}
</
td
>
<
td
>
{{
$avaliador
->
user
->
email
}}
</
td
>
<
td
>
{{
$avaliador
->
user
->
email
}}
</
td
>
<
td
>
@
if
(
$avaliador
->
trabalhos
->
where
(
'id'
,
$trabalho
->
id
)
->
first
()
->
pivot
->
parecer
==
null
)
Indisponível
@
else
{{
date
(
'd/m/Y'
,
strtotime
(
$avaliador
->
trabalhos
->
where
(
'id'
,
$trabalho
->
id
)
->
first
()
->
pivot
->
created_at
))
}}
@
endif
</
td
>
<
td
>
@
if
(
$avaliador
->
trabalhos
->
where
(
'id'
,
$trabalho
->
id
)
->
first
()
->
pivot
->
parecer
==
null
)
Indisponível
@
else
{{
$avaliador
->
trabalhos
->
where
(
'id'
,
$trabalho
->
id
)
->
first
()
->
pivot
->
recomendacao
}}
@
endif
</
td
>
<
td
>
<
td
>
<
form
action
=
"{{ route('admin.visualizarParecer') }}"
method
=
"post"
>
<
form
action
=
"{{ route('admin.visualizarParecer') }}"
method
=
"post"
>
@
csrf
@
csrf
<
input
type
=
"hidden"
name
=
"trabalho_id"
value
=
"{{
$trabalho->id
}}"
>
<
input
type
=
"hidden"
name
=
"trabalho_id"
value
=
"{{
$trabalho->id
}}"
>
<
input
type
=
"hidden"
name
=
"avaliador_id"
value
=
"{{
$avaliador->id
}}"
>
<
input
type
=
"hidden"
name
=
"avaliador_id"
value
=
"{{
$avaliador->id
}}"
>
<
button
class
=
"btn btn-primary"
@
if
(
$avaliador
->
trabalhos
->
where
(
'id'
,
$trabalho
->
id
)
->
first
()
->
pivot
->
parecer
==
null
)
disabled
=
"disabled"
@
endif
>
@
if
(
$avaliador
->
trabalhos
->
where
(
'id'
,
$trabalho
->
id
)
->
first
()
->
pivot
->
parecer
==
null
)
<
button
class
=
"btn btn-danger"
disabled
=
"disabled"
>
Indisponível
</
button
>
@
else
<
button
class
=
"btn btn-primary"
>
Visualizar
Visualizar
</
button
>
</
button
>
@
endif
</
form
>
</
form
>
</
td
>
</
td
>
...
...
resources/views/administrador/selecionarAvaliadores.blade.php
View file @
aff1a02b
...
@@ -7,9 +7,14 @@
...
@@ -7,9 +7,14 @@
<
div
class
=
"container"
>
<
div
class
=
"container"
>
<
div
class
=
"row justify-content-center d-flex align-items-center"
>
<
div
class
=
"row justify-content-center d-flex align-items-center"
>
<
div
class
=
"col-md-
10
"
>
<
div
class
=
"col-md-
9
"
>
<
h3
>
Avaliadores
</
h3
>
<
h3
>
Avaliadores
</
h3
>
</
div
>
</
div
>
<
div
class
=
"col-md-1"
>
<
a
href
=
"{{ route('admin.atribuir', ['evento_id' =>
$evento->id
]) }}"
class
=
"btn btn-primary"
>
Voltar
</
a
>
</
div
>
<
div
class
=
"col-md-2"
>
<
div
class
=
"col-md-2"
>
<!--
Button
trigger
modal
-->
<!--
Button
trigger
modal
-->
<
button
type
=
"button"
class
=
"btn btn-primary"
data
-
toggle
=
"modal"
data
-
target
=
"#exampleModalCenter"
>
<
button
type
=
"button"
class
=
"btn btn-primary"
data
-
toggle
=
"modal"
data
-
target
=
"#exampleModalCenter"
>
...
@@ -20,6 +25,7 @@
...
@@ -20,6 +25,7 @@
</
div
>
</
div
>
</
div
>
</
div
>
<
hr
>
<
hr
>
<
table
class
=
"table table-bordered"
>
<
table
class
=
"table table-bordered"
>
<
thead
>
<
thead
>
...
@@ -78,7 +84,7 @@
...
@@ -78,7 +84,7 @@
@
csrf
@
csrf
<
input
type
=
"hidden"
name
=
"avaliador_id"
value
=
"{{
$avaliador->id
}}"
>
<
input
type
=
"hidden"
name
=
"avaliador_id"
value
=
"{{
$avaliador->id
}}"
>
<
input
type
=
"hidden"
name
=
"evento_id"
value
=
"{{
$evento->id
}}"
>
<
input
type
=
"hidden"
name
=
"evento_id"
value
=
"{{
$evento->id
}}"
>
<
button
type
=
"submit"
class
=
"btn btn-primary"
@
if
(
$avaliador
->
trabalhos
->
count
()
!=
0
)
disabled
=
"disabled"
@
endif
>
Remover
</
button
>
<
button
type
=
"submit"
class
=
"btn btn-primary"
@
if
(
$avaliador
->
trabalhos
->
where
(
'evento_id'
,
$evento
->
id
)
->
count
()
!=
0
)
disabled
=
"disabled"
@
endif
>
Remover
</
button
>
</
form
>
</
form
>
</
td
>
</
td
>
</
tr
>
</
tr
>
...
...
resources/views/administrador/selecionarProjetos.blade.php
View file @
aff1a02b
...
@@ -19,6 +19,10 @@
...
@@ -19,6 +19,10 @@
</
div
>
</
div
>
</
div
>
</
div
>
<
a
href
=
"{{ route('admin.atribuir', ['evento_id' =>
$evento->id
]) }}"
class
=
"btn btn-primary"
>
Voltar
</
a
>
<
hr
>
<
hr
>
<
table
class
=
"table table-bordered"
>
<
table
class
=
"table table-bordered"
>
<
thead
>
<
thead
>
...
@@ -115,6 +119,7 @@
...
@@ -115,6 +119,7 @@
@
endforeach
@
endforeach
</
tbody
>
</
tbody
>
</
table
>
</
table
>
</
div
>
</
div
>
...
...
resources/views/administrador/visualizarParecer.blade.php
View file @
aff1a02b
...
@@ -19,6 +19,9 @@
...
@@ -19,6 +19,9 @@
</
div
>
</
div
>
<
div
class
=
"form-group"
>
<
div
class
=
"form-group"
>
<
label
for
=
"exampleFormControlSelect1"
>
Anexo
:
</
label
>
<
label
for
=
"exampleFormControlSelect1"
>
Anexo
:
</
label
>
<
a
href
=
"{{route('download', ['file' =>
$parecer->AnexoParecer
])}}"
target
=
"_new"
style
=
"font-size: 20px; color: #114048ff;"
>
<
img
class
=
""
src
=
"
{
{asset('img/icons/file-download-solid.svg')}
}
"
style
=
"width:20px"
>
</
a
>
</
div
>
</
div
>
<
a
href
=
"
{
{url()->previous()}
}
"
class
=
"btn btn-primary"
>
Voltar
</
a
>
<
a
href
=
"
{
{url()->previous()}
}
"
class
=
"btn btn-primary"
>
Voltar
</
a
>
...
...
resources/views/avaliador/listarTrabalhos.blade.php
View file @
aff1a02b
...
@@ -27,8 +27,8 @@
...
@@ -27,8 +27,8 @@
<
td
>
{{
$trabalho
->
titulo
}}
</
td
>
<
td
>
{{
$trabalho
->
titulo
}}
</
td
>
<
td
>
{{
$trabalho
->
created_at
}}
</
td
>
<
td
>
{{
$trabalho
->
created_at
}}
</
td
>
<
td
>
<
td
>
{{
--
{{
route
(
'download'
,
[
'file'
=>
$arquivo
])}}
--
}}
{{
--
--
}}
<
a
target
=
"_new"
style
=
"font-size: 20px; color: #114048ff;"
>
<
a
href
=
"{{route('download', ['file' =>
$trabalho->anexoProjeto
])}}"
target
=
"_new"
style
=
"font-size: 20px; color: #114048ff;"
>
<
img
class
=
""
src
=
"
{
{asset('img/icons/file-download-solid.svg')}
}
"
style
=
"width:20px"
>
<
img
class
=
""
src
=
"
{
{asset('img/icons/file-download-solid.svg')}
}
"
style
=
"width:20px"
>
</
a
>
</
a
>
</
td
>
</
td
>
...
...
resources/views/avaliador/parecer.blade.php
View file @
aff1a02b
...
@@ -27,13 +27,17 @@
...
@@ -27,13 +27,17 @@
@
endif
@
endif
@
endforeach
@
endforeach
</
select
>
</
select
>
<
div
class
=
"form-group"
>
<
div
class
=
"form-group
mt-3 md-3
"
>
@
if
(
$trabalho
->
pivot
->
AnexoParecer
==
null
)
@
if
(
$trabalho
->
pivot
->
AnexoParecer
==
null
)
<
label
for
=
"exampleFormControlFile1"
>
Anexo
do
Parecer
:</
label
>
<
label
for
=
"exampleFormControlFile1"
>
Anexo
do
Parecer
:</
label
>
<
input
type
=
"file"
class
=
"form-control-file"
id
=
"exampleFormControlFile1"
name
=
"anexoParecer"
>
<
input
type
=
"file"
class
=
"form-control-file"
id
=
"exampleFormControlFile1"
name
=
"anexoParecer"
>
@
else
@
else
<
label
for
=
"exampleFormControlFile1"
>
Já
existe
um
arquivo
,
quer
atualizar
?</
label
>
<
br
>
<
label
for
=
"exampleFormControlFile1"
>
Já
existe
um
arquivo
,
quer
atualizar
?</
label
>
<
br
>
<
label
for
=
"exampleFormControlFile1"
>
Arquivo
atual
:</
label
>
<
a
href
=
"{{route('download', ['file' =>
$trabalho->pivot
->AnexoParecer])}}"
target
=
"_new"
style
=
"font-size: 20px; color: #114048ff;"
>
<
img
class
=
""
src
=
"
{
{asset('img/icons/file-download-solid.svg')}
}
"
style
=
"width:20px"
>
</
a
><
br
>
<
input
type
=
"file"
class
=
"form-control-file"
id
=
"exampleFormControlFile1"
name
=
"anexoParecer"
>
<
input
type
=
"file"
class
=
"form-control-file"
id
=
"exampleFormControlFile1"
name
=
"anexoParecer"
>
@
endif
@
endif
...
...
resources/views/evento/visualizarEvento.blade.php
View file @
aff1a02b
...
@@ -237,7 +237,7 @@
...
@@ -237,7 +237,7 @@
<
div
class
=
"row justify-content-center"
style
=
"margin: 20px 0 20px 0"
>
<
div
class
=
"row justify-content-center"
style
=
"margin: 20px 0 20px 0"
>
<
div
class
=
"col-md-6 botao-form-left"
style
=
""
>
<
div
class
=
"col-md-6 botao-form-left"
style
=
""
>
<
a
class
=
"btn btn-secondary botao-form"
href
=
"
/
"
style
=
"width:100%"
>
Voltar
</
a
>
<
a
class
=
"btn btn-secondary botao-form"
href
=
"
{{ route('home') }}
"
style
=
"width:100%"
>
Voltar
</
a
>
</
div
>
</
div
>
@
if
(
$evento
->
inicioSubmissao
<=
$mytime
)
@
if
(
$evento
->
inicioSubmissao
<=
$mytime
)
...
...
routes/web.php
View file @
aff1a02b
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