diff --git a/client/scripts/database.js b/client/scripts/database.js index ba7a4b3..71edcb8 100644 --- a/client/scripts/database.js +++ b/client/scripts/database.js @@ -125,7 +125,7 @@ function dbGetRegattasRange(minDate, maxDate) { var regatta = regattas[id]; var dateFrom = parseDate(regatta['date']); var dateTo = parseDate(regatta['date']); - dateTo.setDate(dateTo.getDate() + parseInt(regatta['length']) - 1); + dateTo.setDate(dateTo.getDate() + Math.max(parseInt(regatta['length']) - 1, 0)); if ((minDate <= dateTo) && (maxDate >= dateFrom)) { regatta['dateFrom'] = dateFrom; regatta['dateTo'] = dateTo; diff --git a/client/styles/regatten.css b/client/styles/regatten.css new file mode 100644 index 0000000..b98181a --- /dev/null +++ b/client/styles/regatten.css @@ -0,0 +1,43 @@ +.regattas-list > div { + padding-top: 1rem; + padding-bottom: 1rem; + border-bottom: 1px solid #dee2e6; + cursor: pointer; +} + +.regattas-list > div:last-child { + border: 0; + padding-bottom: 0; +} + +.regattas-list div { + white-space: nowrap; +} + +.regattas-list > div > div > div { + display: inline-block; +} + +.regattas-list > div > div:nth-child(2) > div:nth-child(1) { + width: 25%; +} +.regattas-list > div > div:nth-child(2) > div:nth-child(2) { + width: 25%; +} +.regattas-list > div > div:nth-child(2) > div:nth-child(3) { + width: 25%; + text-align: center; +} +.regattas-list > div > div:nth-child(2) > div:nth-child(4) { + width: 25%; + text-align: right; + font-size: 14px; +} + +.regattas-list > div > div:nth-child(3) > div:nth-child(1) { + width: 75%; +} +.regattas-list > div > div:nth-child(3) > div:nth-child(2) { + width: 25%; + text-align: right; +} \ No newline at end of file diff --git a/content/regattas.php b/content/regattas.php index 0cfad75..4754d56 100644 --- a/content/regattas.php +++ b/content/regattas.php @@ -17,16 +17,19 @@ // Regattas $content = '

'; $content .= $tpl->load('input', ['html-id' => 'input-search', 'placeholder' => 'Suche', 'type' => 'text', 'css-class' => 'mt-2']); - $thead = '#DatumRegatta'; - if (($showSpecial = $_CLASS['special']) !== false) { - $thead .= '' . $_CLASS['special'] . ''; - } - $thead .= 'InformationenErgebnisseRLF'; - $content .= $tpl->load('table', [$thead, 'html-id' => 'table-regattas', 'css-class' => 'mb-0']); + $content .= '
'; $sp['output'] .= $tpl->load('card', [$content, 'html-id' => 'card-regattas']); - $sp['scripts'] = ''; + // Menu + $items = $tpl->load('menu/item-icon', ['Ergebnisse', '', 'html-id' => 'menu-item-results', 'icon' => 'fa-poll']); + $items .= $tpl->load('menu/item-icon', ['Bericht', '', 'html-id' => 'menu-item-bericht', 'icon' => 'fa-book']); + $items .= $tpl->load('menu/item-icon', ['Informationen', '', 'html-id' => 'menu-item-info', 'icon' => 'fa-info']); + $items .= $tpl->load('menu/item-icon-badge', ['Meldung', '', 'html-id' => 'menu-item-meldung', 'icon' => 'fa-file-signature', 'badge-id' => 'badge-regatta-meldung']); + $items .= $tpl->load('menu/item-icon', ['offizielle Ergebnisse', '', 'html-id' => 'menu-item-oresults', 'icon' => 'fa-poll']); + $items .= $tpl->load('menu/item-icon', ['Vereins-Website', '', 'html-id' => 'menu-item-clubwebsite', 'icon' => 'fa-globe']); + $sp['menus'] .= $tpl->load('menu/bottom', [$items, 'html-id' => 'menu-regatta', 'title' => 'Regatta-Details', 'height' => 320]); + $sp['scripts'] .= $scripts->load('regattas'); ?> \ No newline at end of file diff --git a/server/page/menus.php b/server/page/menus.php index 05ec487..46925dd 100644 --- a/server/page/menus.php +++ b/server/page/menus.php @@ -161,12 +161,12 @@