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
8060f9e6
Commit
8060f9e6
authored
Mar 16, 2022
by
Jose Fernando Mendes da Costa
Browse files
Filtro por status do trabalho na tela de listagem
parent
2e8a4b10
Changes
3
Hide whitespace changes
Inline
Side-by-side
app/Http/Controllers/AdministradorController.php
View file @
8060f9e6
...
...
@@ -66,26 +66,25 @@ class AdministradorController extends Controller
return
view
(
'administrador.projetos'
)
->
with
([
'trabalhos'
=>
$trabalhos
,
'evento'
=>
$evento
]);
}
public
function
analisar
(
Request
$request
){
$evento
=
Evento
::
where
(
'id'
,
$request
->
evento_id
)
->
first
();
$trabalhosSubmetidos
=
$evento
->
trabalhos
->
where
(
'status'
,
'submetido'
);
$trabalhosAvaliados
=
$evento
->
trabalhos
->
Where
(
'status'
,
'avaliado'
);
$trabalhosAprovados
=
$evento
->
trabalhos
->
Where
(
'status'
,
'aprovado'
);
$trabalhosReprovados
=
$evento
->
trabalhos
->
Where
(
'status'
,
'reprovado'
);
$trabalhosCorrigidos
=
$evento
->
trabalhos
->
Where
(
'status'
,
'corrigido'
);
$trabalhos
=
$this
->
paginate
(
$trabalhosSubmetidos
);
$trabalhos
=
$this
->
paginate
(
$trabalhosSubmetidos
->
merge
(
$trabalhosAvaliados
)
->
merge
(
$trabalhosAprovados
)
->
merge
(
$trabalhosReprovados
)
->
merge
(
$trabalhosCorrigidos
)
->
sortBy
(
'titulo'
))
->
withPath
(
'/usuarios/analisarProjetos?evento_id='
.
$evento
->
id
);
$evento
=
Evento
::
find
(
$request
->
evento_id
);
$status
=
[
'submetido'
,
'avaliado'
,
'aprovado'
,
'reprovado'
,
'corrigido'
];
$withPath
=
'/usuarios/analisarProjetos?evento_id='
.
$evento
->
id
;
if
(
$request
->
column
!=
null
)
{
$status
=
[
$request
->
column
];
$withPath
=
'/usuarios/analisarProjetos/'
.
$request
->
column
.
'?evento_id='
.
$evento
->
id
;
}
$trabalhos
=
Trabalho
::
where
(
'evento_id'
,
$evento
->
id
)
->
whereIn
(
'status'
,
$status
)
->
orderBy
(
'titulo'
)
->
paginate
(
5
)
->
withPath
(
$withPath
);
$funcaoParticipantes
=
FuncaoParticipantes
::
all
();
// $participantes = Participante::where('trabalho_id', $id)->get();
// $participantesUsersIds = Participante::where('trabalho_id', $id)->select('user_id')->get();
// $participantes = User::whereIn('id', $participantesUsersIds)->get();
return
view
(
'administrador.analisar'
)
->
with
([
'trabalhos'
=>
$trabalhos
,
'evento'
=>
$evento
,
'funcaoParticipantes'
=>
$funcaoParticipantes
]);
return
view
(
'administrador.analisar'
)
->
with
([
'trabalhos'
=>
$trabalhos
,
'evento'
=>
$evento
,
'funcaoParticipantes'
=>
$funcaoParticipantes
,
'column'
=>
$request
->
column
]);
}
// Utilizado para paginação de Collection
...
...
resources/views/administrador/analisar.blade.php
View file @
8060f9e6
...
...
@@ -2,7 +2,7 @@
@
section
(
'content'
)
<
div
class
=
"row justify-content-center"
style
=
"margin-top: 100px;
overflow-x: hidden;overflow-y:hidden
"
>
<
div
class
=
"row justify-content-center"
style
=
"margin-top: 100px;"
>
<
div
class
=
"col-md-11"
>
<
div
class
=
"row"
>
<
div
class
=
"col-sm-7"
>
...
...
@@ -29,7 +29,35 @@
</
h6
>
</
div
>
</
div
>
<
div
class
=
"row"
>
<
div
class
=
"col-sm-1 mt-5"
>
<
div
class
=
"btn-group dropup"
>
<
button
type
=
"button"
class
=
"btn btn-primary dropdown-toggle"
data
-
toggle
=
"dropdown"
aria
-
haspopup
=
"true"
aria
-
expanded
=
"false"
>
Filtro
@
isset
(
$column
)
-
{{
$column
}}
@
endisset
</
button
>
<
div
class
=
"dropdown-menu"
aria
-
labelledby
=
"dropdownMenuLink"
>
<
a
class
=
"dropdown-item"
href
=
"{{route('admin.analisar', ['evento_id' =>
$evento->id
])}}"
>
Todos
</
a
>
<
a
class
=
"dropdown-item"
href
=
"{{route('admin.analisar', ['evento_id' =>
$evento->id
, 'column' => 'aprovado'])}}"
>
Aprovados
</
a
>
<
a
class
=
"dropdown-item"
href
=
"{{route('admin.analisar', ['evento_id' =>
$evento->id
, 'column' => 'reprovado'])}}"
>
Reprovados
</
a
>
<
a
class
=
"dropdown-item"
href
=
"{{route('admin.analisar', ['evento_id' =>
$evento->id
, 'column' => 'submetido'])}}"
>
Submetidos
</
a
>
<
a
class
=
"dropdown-item"
href
=
"{{route('admin.analisar', ['evento_id' =>
$evento->id
, 'column' => 'avaliado'])}}"
>
Avaliados
</
a
>
<
a
class
=
"dropdown-item"
href
=
"{{route('admin.analisar', ['evento_id' =>
$evento->id
, 'column' => 'corrigido'])}}"
>
Corrigidos
</
a
>
</
div
>
</
div
>
</
div
>
</
div
>
</
div
>
</
div
>
...
...
@@ -50,7 +78,7 @@
@
if
(
$trabalho
->
status
==
"aprovado"
)
<
img
src
=
"
{
{asset('img/icons/aprovado.png')}
}
"
style
=
"width: 23%;margin: auto;display: flex;margin-top: 0px;justify-content: center;align-items: center;"
alt
=
""
>
@
elseif
(
$trabalho
->
status
==
"reprovado"
)
<
img
src
=
"
{
{asset('img/icons/negado.png')}
}
"
style
=
"width:
60
%;margin: auto;display: flex;margin-top: 5px;justify-content: center;align-items: center;"
alt
=
""
>
<
img
src
=
"
{
{asset('img/icons/negado.png')}
}
"
style
=
"width:
23
%;margin: auto;display: flex;margin-top: 5px;justify-content: center;align-items: center;"
alt
=
""
>
@
elseif
(
$trabalho
->
status
==
"corrigido"
)
<
img
src
=
"
{
{asset('img/icons/parcialmenteAprovado.png')}
}
"
style
=
"width: 23%;margin: auto;display: flex;margin-top: 0px;justify-content: center;align-items: center;"
alt
=
""
>
@
else
...
...
routes/web.php
View file @
8060f9e6
...
...
@@ -206,7 +206,7 @@ Route::prefix('usuarios')->name('admin.')->group(function(){
Route
::
get
(
'/visualizarParecer'
,
'AdministradorController@visualizarParecer'
)
->
name
(
'visualizarParecer'
);
Route
::
get
(
'/visualizarParecerInterno'
,
'AdministradorController@visualizarParecerInterno'
)
->
name
(
'visualizarParecerInterno'
);
Route
::
get
(
'/pareceresProjetos'
,
'AdministradorController@pareceres'
)
->
name
(
'pareceres'
);
Route
::
get
(
'/analisarProjetos
'
,
'AdministradorController@analisar'
)
->
name
(
'analisar'
);
Route
::
get
(
'/analisarProjetos
/{column?}'
,
'AdministradorController@analisar'
)
->
name
(
'analisar'
);
Route
::
get
(
'/analisarProposta'
,
'AdministradorController@analisarProposta'
)
->
name
(
'analisarProposta'
);
Route
::
get
(
'/showProjetos'
,
'AdministradorController@showProjetos'
)
->
name
(
'showProjetos'
);
Route
::
get
(
'/showResultados'
,
'AdministradorController@showResultados'
)
->
name
(
'showResultados'
);
...
...
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