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
742a6215
Commit
742a6215
authored
May 12, 2021
by
Carlos André
Browse files
seleção de editais na home
parent
e1614e1d
Changes
4
Show whitespace changes
Inline
Side-by-side
app/Http/Controllers/EventoController.php
View file @
742a6215
...
...
@@ -343,7 +343,7 @@ class EventoController extends Controller
'natureza'
=>
[
'required'
],
'inicioSubmissao'
=>
[
'required'
,
'date'
],
'fimSubmissao'
=>
[
'required'
,
'date'
],
'inicioRevisao'
=>
[
'required'
,
'date'
,
'after:
yesterday
'
],
'inicioRevisao'
=>
[
'required'
,
'date'
,
'after:
fimSubmissao
'
],
'fimRevisao'
=>
[
'required'
,
'date'
],
'resultado_preliminar'
=>
[
'required'
,
'date'
],
'inicio_recurso'
=>
[
'required'
,
'date'
],
...
...
@@ -359,10 +359,10 @@ class EventoController extends Controller
'descricao'
=>
[
'required'
,
'string'
,
'max:1500'
],
'tipo'
=>
[
'required'
,
'string'
],
'natureza'
=>
[
'required'
],
'inicioSubmissao'
=>
[
'required'
,
'date'
,
'after
:yesterday
'
],
'inicioSubmissao'
=>
[
'required'
,
'date'
,
'after
_or_equal:inicioSubmissao
'
],
'fimSubmissao'
=>
[
'required'
,
'date'
,
'after_or_equal:inicioSubmissao'
],
'inicioRevisao'
=>
[
'required'
,
'date'
,
'after:
yesterday
'
],
'fimRevisao'
=>
[
'required'
,
'date'
,
'after:inicioRevisao'
,
'after:fimSubmissao'
],
'inicioRevisao'
=>
[
'required'
,
'date'
,
'after:
fimSubmissao
'
],
'fimRevisao'
=>
[
'required'
,
'date'
,
'after:inicioRevisao'
],
'resultado_preliminar'
=>
[
'required'
,
'date'
,
'after_or_equal:fimRevisao'
],
'inicio_recurso'
=>
[
'required'
,
'date'
,
'after_or_equal:resultado_preliminar'
],
'fim_recurso'
=>
[
'required'
,
'date'
,
'after:inicio_recurso'
],
...
...
@@ -402,8 +402,8 @@ class EventoController extends Controller
$evento
->
update
();
$eventos
=
Evento
::
all
();
return
view
(
'
coordenador.home
'
,[
'eventos'
=>
$eventos
]);
$eventos
=
Evento
::
orderBy
(
'nome'
)
->
get
();
return
view
(
'
administrador.editais
'
,[
'eventos'
=>
$eventos
]);
}
/**
...
...
app/Http/Controllers/UserController.php
View file @
742a6215
...
...
@@ -24,7 +24,8 @@ class UserController extends Controller
public
function
index
()
{
$eventos
=
Evento
::
all
();
$eventos
=
Evento
::
orderBy
(
'created_at'
,
'desc'
)
->
get
();
dd
(
$eventos
);
if
(
Auth
::
check
()){
Log
::
debug
(
'UserController check'
);
return
redirect
()
->
route
(
'home'
);
...
...
@@ -37,8 +38,7 @@ class UserController extends Controller
}
public
function
inicial
()
{
$eventos
=
Evento
::
all
();
$eventos
=
Evento
::
orderBy
(
'created_at'
,
'desc'
)
->
get
();
$hoje
=
Carbon
::
today
(
'America/Recife'
);
$hoje
=
$hoje
->
toDateString
();
return
view
(
'index'
,
[
'eventos'
=>
$eventos
,
'hoje'
=>
$hoje
]);
...
...
public/css/layout.css
View file @
742a6215
...
...
@@ -461,3 +461,15 @@ button.close {
border
:
none
;
}
.select-submeta
{
border-radius
:
5px
;
border
:
1px
solid
rgb
(
172
,
172
,
172
);
}
.background-yellow
{
background-color
:
rgb
(
42
,
212
,
0
);
}
.background-red
{
background-color
:
rgb
(
235
,
0
,
0
);
}
\ No newline at end of file
resources/views/index.blade.php
View file @
742a6215
...
...
@@ -23,9 +23,18 @@
<
h4
style
=
"color: rgb(0, 140, 255);"
>
Editais
</
h4
>
<
div
id
=
"editais"
>
<
ul
class
=
"col-sm-12 list-editais flexcroll"
style
=
"list-style-type: none;"
>
@
foreach
(
$eventos
as
$evento
)
@
if
(
\
Carbon\Carbon
::
create
(
$evento
->
fimSubmissao
)
>=
\
Carbon\Carbon
::
create
(
$hoje
))
<
li
class
=
"col-sm-12 li-editais"
>
@
php
$today
=
\
Carbon\Carbon
::
create
(
$hoje
);
@
endphp
@
foreach
(
$eventos
as
$i
=>
$evento
)
@
php
$fimSub
=
\
Carbon\Carbon
::
create
(
$evento
->
fimSubmissao
);
$inicioRev
=
\
Carbon\Carbon
::
create
(
$evento
->
inicioRevisao
);
$fimRev
=
\
Carbon\Carbon
::
create
(
$evento
->
fimRevisao
);
@
endphp
@
if
(
$fimSub
>=
$today
)
<
li
class
=
"col-sm-12 li-editais aberto"
>
<
div
class
=
"container"
>
<
div
class
=
"row"
>
<
div
class
=
"col-sm-1"
>
...
...
@@ -37,7 +46,7 @@
</
div
>
<
div
class
=
"col-sm-3"
>
<
a
href
=
"{{ route('evento.visualizarNaoLogado', ['id' =>
$evento->id
]) }}"
>
<
button
class
=
"btn btn-opcoes-edital"
style
=
"float:
lef
t;"
>
<
button
class
=
"btn btn-opcoes-edital"
style
=
"float:
righ
t;"
>
Visualizar
</
button
>
</
a
>
...
...
@@ -45,8 +54,60 @@
</
div
>
</
div
>
</
li
>
@
elseif
(
$fimSub
<
$today
&&
$fimRev
>=
$today
||
$i
==
1
)
<
li
class
=
"col-sm-12 li-editais avaliacao"
style
=
"display: none;"
>
<
div
class
=
"container"
>
<
div
class
=
"row"
>
<
div
class
=
"col-sm-1"
>
<
img
class
=
"img-arquivo"
src
=
"{{ asset('img/icons/logo_arquivo.png') }}"
alt
=
""
>
</
div
>
<
div
class
=
"col-sm-7"
>
<
div
>
{{
$evento
->
nome
}}
</
div
>
<
div
class
=
"color-subtitle-edital"
>
Submissão
até
o
dia
{{
date
(
'd/m/Y'
,
strtotime
(
$evento
->
fimSubmissao
))
}}
</
div
>
</
div
>
<
div
class
=
"col-sm-4"
>
<
button
class
=
"btn btn-opcoes-edital background-yellow"
style
=
"float: right;"
disable
>
Em
avaliação
</
button
>
</
div
>
</
div
>
</
div
>
</
li
>
@
elseif
(
$fimRev
<=
$today
)
<
li
class
=
"col-sm-12 li-editais encerrado"
style
=
"display: none;"
>
<
div
class
=
"container"
>
<
div
class
=
"row"
>
<
div
class
=
"col-sm-1"
>
<
img
class
=
"img-arquivo"
src
=
"{{ asset('img/icons/logo_arquivo.png') }}"
alt
=
""
>
</
div
>
<
div
class
=
"col-sm-8"
>
<
div
>
{{
$evento
->
nome
}}
</
div
>
<
div
class
=
"color-subtitle-edital"
>
Submissão
até
o
dia
{{
date
(
'd/m/Y'
,
strtotime
(
$evento
->
fimSubmissao
))
}}
</
div
>
</
div
>
<
div
class
=
"col-sm-3"
>
<
button
class
=
"btn btn-opcoes-edital background-red"
style
=
"float: right;"
disabled
>
Encerrado
</
button
>
</
div
>
</
div
>
</
div
>
</
li
>
@
endif
@
endforeach
</
ul
>
</
div
>
<
br
>
<
div
class
=
"row"
>
<
div
class
=
"col-md-8"
style
=
"float: right;"
>
</
div
>
<
div
class
=
"col-md-4"
style
=
"float: right;"
>
<
select
id
=
""
class
=
"form-control select-submeta"
onchange
=
"exibirEditais(this)"
>
<
option
value
=
"aberto"
selected
>
Aberto
</
option
>
<
option
value
=
"avaliacao"
>
Em
Avaliação
</
option
>
<
option
value
=
"encerrado"
>
Encerrado
</
option
>
<
option
value
=
"todos"
>
Todos
</
option
>
</
select
>
</
div
>
</
div
>
</
div
>
</
div
>
...
...
@@ -54,6 +115,42 @@
@
endsection
@
section
(
'javascript'
)
<
script
>
function
exibirEditais
(
select
)
{
var
abertos
=
document
.
getElementsByClassName
(
"aberto"
);
var
avaliacao
=
document
.
getElementsByClassName
(
"avaliacao"
);
var
encerrado
=
document
.
getElementsByClassName
(
"encerrado"
);
console
.
log
(
abertos
);
if
(
select
.
value
==
"aberto"
||
select
.
value
==
"todos"
)
{
for
(
var
i
=
0
;
i
<
abertos
.
length
;
i
++
)
{
abertos
[
i
]
.
style
.
display
=
""
;
}
}
else
{
for
(
var
i
=
0
;
i
<
abertos
.
length
;
i
++
)
{
abertos
[
i
]
.
style
.
display
=
"none"
;
}
}
if
(
select
.
value
==
"avaliacao"
||
select
.
value
==
"todos"
)
{
for
(
var
i
=
0
;
i
<
avaliacao
.
length
;
i
++
)
{
avaliacao
[
i
]
.
style
.
display
=
""
;
}
}
else
{
for
(
var
i
=
0
;
i
<
avaliacao
.
length
;
i
++
)
{
avaliacao
[
i
]
.
style
.
display
=
"none"
;
}
}
if
(
select
.
value
==
"encerrado"
||
select
.
value
==
"todos"
)
{
for
(
var
i
=
0
;
i
<
encerrado
.
length
;
i
++
)
{
encerrado
[
i
]
.
style
.
display
=
""
;
}
}
else
{
for
(
var
i
=
0
;
i
<
encerrado
.
length
;
i
++
)
{
encerrado
[
i
]
.
style
.
display
=
"none"
;
}
}
}
</
script
>
@
endsection
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