Commit a1966b04 authored by unknown's avatar unknown
Browse files

Adição de nova opção na filtragem(abrirao)

parent b44f203c
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
<option value="todos" selected>Todos</option> <option value="todos" selected>Todos</option>
<option value="aberto">Aberto(s)</option> <option value="aberto">Aberto(s)</option>
<option value="encerrado">Encerrado(s)</option> <option value="encerrado">Encerrado(s)</option>
<option value="abrira">Abrirão</option>
</select> </select>
</div> </div>
<div class="col-sm" style="margin-bottom: 10px"> <div class="col-sm" style="margin-bottom: 10px">
...@@ -43,25 +44,26 @@ ...@@ -43,25 +44,26 @@
<hr> <hr>
</div> </div>
</div> </div>
@php
$hoje = now();
@endphp
<div class="row justify-content-center"> <div class="row justify-content-center">
@if(count($eventos)>0) @if(count($eventos)>0)
@foreach ($eventos as $evento) @foreach ($eventos as $evento)
@if (Auth::check()) @if (Auth::check())
@if($evento->fimSubmissao >= $hoje) @if($evento->fimSubmissao >= $hoje && $hoje >= $evento->inicioSubmissao)
<a href="{{ route('evento.visualizar',['id'=> $evento->id]) }}" style="text-decoration: none" class="aberto"> <a href="{{ route('evento.visualizar',['id'=> $evento->id]) }}" style="text-decoration: none" class="aberto">
@else @elseif($hoje > $evento->fimSubmissao)
<a href="{{ route('evento.visualizar',['id'=> $evento->id]) }}" style="text-decoration: none" class="encerrado"> <a href="{{ route('evento.visualizar',['id'=> $evento->id]) }}" style="text-decoration: none" class="encerrado">
@else
<a href="{{ route('evento.visualizar',['id'=> $evento->id]) }}" style="text-decoration: none" class="vaiAbrir">
@endif @endif
@else @else
@if($evento->fimSubmissao >= $hoje) @if($evento->fimSubmissao >= $hoje && $hoje >= $evento->inicioSubmissao)
<a href="{{ route('evento.visualizarNaoLogado', ['id'=>$evento->id]) }}" style="text-decoration: none" class="aberto"> <a href="{{ route('evento.visualizarNaoLogado', ['id'=>$evento->id]) }}" style="text-decoration: none" class="aberto">
@else @elseif($hoje > $evento->fimSubmissao)
<a href="{{ route('evento.visualizarNaoLogado', ['id'=>$evento->id]) }}" style="text-decoration: none" class="encerrado"> <a href="{{ route('evento.visualizarNaoLogado', ['id'=>$evento->id]) }}" style="text-decoration: none" class="encerrado">
@else
<a href="{{ route('evento.visualizar',['id'=> $evento->id]) }}" style="text-decoration: none" class="vaiAbrir">
@endif @endif
@endif @endif
<div class="card" style="width: 18rem; border-radius:12px; border-width:0px; margin:10px"> <div class="card" style="width: 18rem; border-radius:12px; border-width:0px; margin:10px">
...@@ -202,7 +204,9 @@ ...@@ -202,7 +204,9 @@
function exibirEditais(select) { function exibirEditais(select) {
let abertos = document.getElementsByClassName("aberto"); let abertos = document.getElementsByClassName("aberto");
let encerrados = document.getElementsByClassName("encerrado"); let encerrados = document.getElementsByClassName("encerrado");
let vaiAbrir = document.getElementsByClassName("vaiAbrir");
if(select.value == "todos"){ if(select.value == "todos"){
for(let i = 0; i < abertos.length; i++ ){ for(let i = 0; i < abertos.length; i++ ){
abertos[i].style.display = ""; abertos[i].style.display = "";
...@@ -211,6 +215,10 @@ ...@@ -211,6 +215,10 @@
for(let j = 0; j < encerrados.length; j++ ){ for(let j = 0; j < encerrados.length; j++ ){
encerrados[j].style.display = ""; encerrados[j].style.display = "";
} }
for(let l = 0; l < vaiAbrir.length; l++ ){
vaiAbrir[l].style.display = "";
}
}else if(select.value == "aberto") { }else if(select.value == "aberto") {
for(let i = 0; i < abertos.length; i++){ for(let i = 0; i < abertos.length; i++){
abertos[i].style.display = ""; abertos[i].style.display = "";
...@@ -219,11 +227,31 @@ ...@@ -219,11 +227,31 @@
for(let j = 0; j < encerrados.length; j++ ){ for(let j = 0; j < encerrados.length; j++ ){
encerrados[j].style.display = "none"; encerrados[j].style.display = "none";
} }
for(let l = 0; l < vaiAbrir.length; l++ ){
vaiAbrir[l].style.display = "none";
}
}else if(select.value == "abrira"){
for(let i = 0; i < abertos.length; i++){
abertos[i].style.display = "none";
}
for(let j = 0; j < encerrados.length; j++ ){
encerrados[j].style.display = "none";
}
for(let l = 0; l < vaiAbrir.length; l++ ){
vaiAbrir[l].style.display = "";
}
}else { }else {
for(let i = 0; i < abertos.length; i++){ for(let i = 0; i < abertos.length; i++){
abertos[i].style.display = "none"; abertos[i].style.display = "none";
} }
for(let l = 0; l < vaiAbrir.length; l++ ){
vaiAbrir[l].style.display = "none";
}
for(let j = 0; j < encerrados.length; j++ ){ for(let j = 0; j < encerrados.length; j++ ){
encerrados[j].style.display = ""; encerrados[j].style.display = "";
} }
......
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