From 9f16806179221ff587a7a326b6cf6017f1a34545 Mon Sep 17 00:00:00 2001 From: Timon Ostertun Date: Fri, 25 Sep 2020 18:48:42 +0200 Subject: [PATCH] New regattas list on index --- .htaccess_example | 1 - client/styles/style.css | 1 + index.php | 4 +- {content => server/content}/404.php | 0 {content => server/content}/index.php | 23 +- {content => server/content}/regattas.php | 5 +- server/page/install.php | 7 +- server/scripts/index.js | 318 ++++++++++++----------- server/scripts/onRegattaClicked.js | 157 +++++++++++ server/scripts/regattas.js | 160 ++---------- service-worker.js.php | 2 +- 11 files changed, 365 insertions(+), 313 deletions(-) rename {content => server/content}/404.php (100%) rename {content => server/content}/index.php (69%) rename {content => server/content}/regattas.php (82%) create mode 100644 server/scripts/onRegattaClicked.js diff --git a/.htaccess_example b/.htaccess_example index 76dd3f8..73e3dbf 100644 --- a/.htaccess_example +++ b/.htaccess_example @@ -6,7 +6,6 @@ RewriteBase /projects/RegattenApp/ ### RESTRICTED FOLDER RewriteRule ^(.*)server(.*)$ / [R=301,L,NC] -RewriteRule ^(.*)content(.*)$ / [R=301,L,NC] diff --git a/client/styles/style.css b/client/styles/style.css index 22e1688..6634c8a 100644 --- a/client/styles/style.css +++ b/client/styles/style.css @@ -1220,6 +1220,7 @@ img.mx-auto { bottom: 0px; z-index: 99999; transition: all 150ms ease; + background-color: #0f1117; } #preloader .spinner-border { diff --git a/index.php b/index.php index 6b2f486..4ff9644 100644 --- a/index.php +++ b/index.php @@ -24,7 +24,7 @@ exit; } - if (!file_exists(__DIR__ . '/content/' . $site . '.php')) { + if (!file_exists(__DIR__ . '/server/content/' . $site . '.php')) { $site = '404'; } @@ -40,7 +40,7 @@ $tpl = new Templates(__DIR__ . '/server/templates/'); $scripts = new Scripts(__DIR__ . '/server/scripts/'); - require_once(__DIR__ . '/content/' . $site . '.php'); + require_once(__DIR__ . '/server/content/' . $site . '.php'); require_once(__DIR__ . '/server/buildpage.php'); diff --git a/content/404.php b/server/content/404.php similarity index 100% rename from content/404.php rename to server/content/404.php diff --git a/content/index.php b/server/content/index.php similarity index 69% rename from content/index.php rename to server/content/index.php index 7fd163a..f040ebf 100644 --- a/content/index.php +++ b/server/content/index.php @@ -22,8 +22,7 @@ // Planning next $content = '

Deine nächsten Regatten

'; - $thead = 'DatumRegattaInformationenRLFSegler'; - $content .= $tpl->load('table', [$thead, 'html-id' => 'table-yournext', 'css-class' => 'mb-0 mt-3']); + $content .= '
'; $content .= '

'; $content .= 'Du fährst in den nächsten vier Wochen auf keine Regatta!'; $content .= '

'; @@ -41,8 +40,7 @@ // Next $content = '

Nächste Regatten

'; - $thead = 'DatumRegattaInformationenRLF'; - $content .= $tpl->load('table', [$thead, 'html-id' => 'table-next', 'css-class' => 'mb-0 mt-3']); + $content .= '
'; $content .= '

'; $content .= 'Keine Regatten in den nächsten zwei Wochen!'; $content .= '

'; @@ -51,8 +49,7 @@ // Last $content = '

Letzte Regatten

'; - $thead = 'DatumRegattaErgebnisseRLF'; - $content .= $tpl->load('table', [$thead, 'html-id' => 'table-last', 'css-class' => 'mb-0 mt-3']); + $content .= '
'; $content .= '

'; $content .= 'Keine Regatten in den letzten zwei Wochen!'; $content .= '

'; @@ -71,6 +68,18 @@ $sp['output'] .= $tpl->load('card', [$content]); - $sp['scripts'] = $scripts->load('index'); + // Regattas Menu + $items = ''; + $items .= $tpl->load('menu/item-icon', ['Saison-Planungen', '', 'html-id' => 'menu-item-plannings', 'icon' => 'fa-calendar-alt']); + $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('onRegattaClicked'); + $sp['scripts'] .= $scripts->load('index'); ?> \ No newline at end of file diff --git a/content/regattas.php b/server/content/regattas.php similarity index 82% rename from content/regattas.php rename to server/content/regattas.php index 4754d56..f6256f1 100644 --- a/content/regattas.php +++ b/server/content/regattas.php @@ -22,7 +22,9 @@ $sp['output'] .= $tpl->load('card', [$content, 'html-id' => 'card-regattas']); // Menu - $items = $tpl->load('menu/item-icon', ['Ergebnisse', '', 'html-id' => 'menu-item-results', 'icon' => 'fa-poll']); + $items = ''; + $items .= $tpl->load('menu/item-icon', ['Saison-Planungen', '', 'html-id' => 'menu-item-plannings', 'icon' => 'fa-calendar-alt']); + $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']); @@ -30,6 +32,7 @@ $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('onRegattaClicked'); $sp['scripts'] .= $scripts->load('regattas'); ?> \ No newline at end of file diff --git a/server/page/install.php b/server/page/install.php index 14e2d87..61754fa 100644 --- a/server/page/install.php +++ b/server/page/install.php @@ -1,6 +1,6 @@