Spaces:
Running
Running
Ajusta a visualização padrão para "cards" e oculta a tabela inicialmente
Browse files- templates/index.html +7 -4
templates/index.html
CHANGED
@@ -9,17 +9,17 @@
|
|
9 |
<div class="d-flex justify-content-between align-items-center mb-4">
|
10 |
<h2 class="mb-0">Eventos Disponíveis</h2>
|
11 |
<div class="btn-group" role="group" aria-label="Opções de visualização">
|
12 |
-
<button type="button" class="btn btn-outline-primary view-toggle
|
13 |
<i class="bi bi-table"></i> Tabela
|
14 |
</button>
|
15 |
-
<button type="button" class="btn btn-outline-primary view-toggle" data-view="cards">
|
16 |
<i class="bi bi-grid-3x3-gap"></i> Cards
|
17 |
</button>
|
18 |
</div>
|
19 |
</div>
|
20 |
|
21 |
<!-- Visualização em Tabela -->
|
22 |
-
<div class="table-responsive view-content" id="tableView">
|
23 |
<table class="table table-hover" id="conferencesTable">
|
24 |
<thead class="table-dark">
|
25 |
<tr>
|
@@ -52,7 +52,7 @@
|
|
52 |
</div>
|
53 |
|
54 |
<!-- Visualização em Cards -->
|
55 |
-
<div class="row row-cols-1 row-cols-md-2 row-cols-lg-3 g-4 view-content" id="cardsView"
|
56 |
{% for conference in conferences %}
|
57 |
<div class="col">
|
58 |
<div class="card h-100 shadow-sm">
|
@@ -86,6 +86,9 @@
|
|
86 |
const tableView = document.getElementById('tableView');
|
87 |
const cardsView = document.getElementById('cardsView');
|
88 |
|
|
|
|
|
|
|
89 |
viewToggles.forEach(toggle => {
|
90 |
toggle.addEventListener('click', function() {
|
91 |
// Remover classe active de todos os botões
|
|
|
9 |
<div class="d-flex justify-content-between align-items-center mb-4">
|
10 |
<h2 class="mb-0">Eventos Disponíveis</h2>
|
11 |
<div class="btn-group" role="group" aria-label="Opções de visualização">
|
12 |
+
<button type="button" class="btn btn-outline-primary view-toggle" data-view="table">
|
13 |
<i class="bi bi-table"></i> Tabela
|
14 |
</button>
|
15 |
+
<button type="button" class="btn btn-outline-primary view-toggle active" data-view="cards">
|
16 |
<i class="bi bi-grid-3x3-gap"></i> Cards
|
17 |
</button>
|
18 |
</div>
|
19 |
</div>
|
20 |
|
21 |
<!-- Visualização em Tabela -->
|
22 |
+
<div class="table-responsive view-content" id="tableView" style="display: none;">
|
23 |
<table class="table table-hover" id="conferencesTable">
|
24 |
<thead class="table-dark">
|
25 |
<tr>
|
|
|
52 |
</div>
|
53 |
|
54 |
<!-- Visualização em Cards -->
|
55 |
+
<div class="row row-cols-1 row-cols-md-2 row-cols-lg-3 g-4 view-content" id="cardsView">
|
56 |
{% for conference in conferences %}
|
57 |
<div class="col">
|
58 |
<div class="card h-100 shadow-sm">
|
|
|
86 |
const tableView = document.getElementById('tableView');
|
87 |
const cardsView = document.getElementById('cardsView');
|
88 |
|
89 |
+
// Atualizar os contadores imediatamente para a visualização padrão (cards)
|
90 |
+
updateCountdowns();
|
91 |
+
|
92 |
viewToggles.forEach(toggle => {
|
93 |
toggle.addEventListener('click', function() {
|
94 |
// Remover classe active de todos os botões
|