diff --git a/client/scripts/regatten.js.php b/client/scripts/regatten.js.php index d85764a..e09be45 100644 --- a/client/scripts/regatten.js.php +++ b/client/scripts/regatten.js.php @@ -131,6 +131,47 @@ function findGetParameter(parameterName) { return result; } +var signup = function() { + var username = $('#input-signup-username').val(); + var email = $('#input-signup-email').val(); + var password = $('#input-signup-password').val(); + if (username == '') { $('#input-signup-username').focus(); return; } + if (email == '') { $('#input-signup-email').focus(); return; } + if (password == '') { $('#input-signup-password').focus(); return; } + showLoader(); + $('#input-signup-username').val('').trigger('focusin').trigger('focusout'); + $('#input-signup-email').val('').trigger('focusin').trigger('focusout'); + $('#input-signup-password').val('').trigger('focusin').trigger('focusout'); + $.ajax({ + url: QUERY_URL + 'signup', + method: 'POST', + data: { + username: username, + email: email, + password: password + }, + error: function (xhr, status, error) { + if (xhr.status == 409) { + toastError('Benutzername bereits vergeben'); + $('#input-signup-email').val(email).trigger('focusin').trigger('focusout'); + } else if (xhr.status == 0) { + toastError('Du bist momentan offline.
Stelle eine Internetverbindung her, um Dich anzumelden'); + $('#menu-signup').hideMenu(); + } else { + log('[app] Signup: unbekannter Fehler', status, error); + log(xhr); + toastError('Ein unbekannter Fehler ist aufgetreten. Bitte versuche es noch einmal', 5000); + } + hideLoader(); + }, + success: function (data, status, xhr) { + $('#input-login-username').val(username); + $('#input-login-password').val(password); + login(); + } + }); +} + var login = function() { showLoader(); var username = $('#input-login-username').val(); @@ -406,6 +447,7 @@ function pushesOpenMenu() { } function updatePushBadge() { + if (typeof onUpdatePushBadge === 'function') onUpdatePushBadge(); if (!pushesPossible) return; if (Notification.permission == 'denied') { $('#badge-pushes').removeClass('bg-green2-dark').addClass('bg-red2-dark').text('BLOCKED'); diff --git a/server/content/index.php b/server/content/index.php index 0df2a33..acd380f 100644 --- a/server/content/index.php +++ b/server/content/index.php @@ -1,61 +1,72 @@ $_CLASS[name]"; $content .= "

$_CLASS[desc]

"; - + $sp['output'] .= $tpl->load('card', [$content]); - + // Favorites $content = '

Deine Favoriten

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

'; $content .= 'Du folgst keinen Seglern.
'; $content .= 'Um jemandem zu folgen, gehe zur Segler-Liste und wähle bis zu fünf Segler aus.'; $content .= '

'; - + $sp['output'] .= $tpl->load('card', [$content, 'html-id' => 'card-favorites']); - + // Planning next $content = '

Deine nächsten Regatten

'; $content .= '
'; $content .= '

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

'; - + $sp['output'] .= $tpl->load('card', [$content, 'html-id' => 'card-yournext']); - + // Not logged in $content = '

Nicht angemeldet

'; $content .= '

'; $content .= 'Um alle Funktionen dieser Seite nutzen zu können, logge Dich bitte ein.
'; $content .= 'Solltest Du noch kein Benutzerkonto haben, kannst Du Dich kostenlos registrieren.'; $content .= '

'; - + $sp['output'] .= $tpl->load('card', [$content, 'html-id' => 'card-notloggedin']); - + + // Notification Info + $content = '

Push-Benachrichtigungen

'; + $content .= '

'; + $content .= 'Bleibe immer auf dem Laufendem!
'; + $content .= 'Aktiviere einfach unsere Push-Benachrichtigungen und wir informieren Dich über alle Änderungen.
'; + $content .= 'Du bestimmst natürlich, welche Benachrichtigungen Du bekommen möchtest.'; + $content .= '

'; + $content .= $tpl->load('button', ['Jetzt aktivieren', '#', 'html-id' => 'button-notifications-activate', 'css-class' => 'bg-green2-dark']); + $content .= '

Vielleicht später

'; + + $sp['output'] .= $tpl->load('card', [$content, 'html-id' => 'card-notifications', 'css-class' => 'bg-blue2-dark']); + // Next $content = '

Nächste Regatten

'; $content .= '
'; $content .= '

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

'; - + $sp['output'] .= $tpl->load('card', [$content, 'html-id' => 'card-next']); - + // Last $content = '

Letzte Regatten

'; $content .= '
'; $content .= '

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

'; - + $sp['output'] .= $tpl->load('card', [$content, 'html-id' => 'card-last']); - + // Calendar $content = '

Regatta-Kalender

'; $content .= '

Du willst alle Regatta-Termine in deinem Kalender, aber nicht alles abtippen?
Kein Problem! Abonniere einfach unseren ics-Kalender.

'; @@ -65,9 +76,9 @@ $content .= '

'; $content .= $tpl->load('button', [' Regatta-Kalender', 'https://regatten.net/client/calendar/' . BOATCLASS . '/everything.ics', 'css-class' => 'mb-2']); $content .= $tpl->load('button', [' Kalender für ', 'https://regatten.net/client/calendar/' . BOATCLASS . '/user_%USERID%.ics', 'css-class' => 'show-loggedin replace-userid-href']); - + $sp['output'] .= $tpl->load('card', [$content]); - + // Regattas Menu $items = ''; $items .= $tpl->load('menu/item-icon', ['Saison-Planungen', '', 'html-id' => 'menu-item-plannings', 'icon' => 'fa-calendar-alt']); @@ -78,8 +89,12 @@ $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]); - + + // Favorites Menu + $items = $tpl->load('menu/item-icon', ['Nicht mehr folgen', '#', 'html-id' => 'menu-item-unfollow', 'icon' => 'fa-heart', 'css-class' => ' border-0']); + $sp['menus'] .= $tpl->load('menu/bottom', [$items, 'html-id' => 'menu-favorite', 'title' => 'Favorit', 'height' => 200]); + $sp['scripts'] .= $scripts->load('onRegattaClicked'); $sp['scripts'] .= $scripts->load('index'); - -?> \ No newline at end of file + +?> diff --git a/server/content/sailors.php b/server/content/sailors.php index 29e65f6..42858e7 100644 --- a/server/content/sailors.php +++ b/server/content/sailors.php @@ -1,14 +1,14 @@ Segler"; - + $sp['output'] .= $tpl->load('card', [$content]); - + // Info Years $content = '

Jahrgänge

'; $content .= '

'; @@ -17,30 +17,32 @@ $content .= 'Klicke dazu einfach auf den entsprechenden Segler und wähle Jahrgang bearbeiten aus.
'; $content .= 'Vielen Dank für Deine Unterstützung!'; $content .= '

'; - + $sp['output'] .= $tpl->load('card', [$content]); - + // List $content = '

'; $content .= $tpl->load('input', ['html-id' => 'input-search', 'placeholder' => 'Suche', 'type' => 'text', 'css-class' => 'mt-2']); $content .= '
'; - + $sp['output'] .= $tpl->load('card', [$content, 'html-id' => 'card-list']); - + // Pagination $sp['output'] .= $tpl->load('pagination', ['html-id' => 'pagination']); - + // Menu - $items = $tpl->load('menu/item-icon', ['', '#', 'html-id' => 'menu-item-year', 'icon' => 'fa-edit']); + $items = $tpl->load('menu/item-switch', ['Favorit', 'html-id' => 'menu-item-follow', 'icon' => 'fa-heart']); + $items .= $tpl->load('menu/item-icon-badge', ['Favorit', '#', 'html-id' => 'menu-item-follow-disabled', 'icon' => 'fa-heart', 'badge-value' => 'MAX REACHED']); + $items .= $tpl->load('menu/item-icon', ['', '#', 'html-id' => 'menu-item-year', 'icon' => 'fa-edit']); $items .= $tpl->load('menu/item-icon', ['Vereins-Website', '', 'html-id' => 'menu-item-clubwebsite', 'icon' => 'fa-globe', 'css-class' => 'border-0']); - $sp['menus'] .= $tpl->load('menu/bottom', [$items, 'html-id' => 'menu-sailor', 'title' => 'Segler-Details', 'height' => 200]); - + $sp['menus'] .= $tpl->load('menu/bottom', [$items, 'html-id' => 'menu-sailor', 'title' => 'Segler-Details', 'height' => 260]); + $items = '

Bitte trage hier den Jahrgang ein:

'; $items .= $tpl->load('input', ['html-id' => 'input-edityear', 'placeholder' => 'Jahrgang', 'type' => 'number']); $items .= $tpl->load('button', ['Speichern', '#', 'html-id' => 'button-edityear']); $sp['menus'] .= $tpl->load('menu/bottom', [$items, 'html-id' => 'menu-edityear', 'height' => 240]); - + $sp['scripts'] .= $scripts->load('pagination', ['pageChange', 'page', 'pageCount', 'pagination']); $sp['scripts'] .= $scripts->load('sailors'); - -?> \ No newline at end of file + +?> diff --git a/server/page/menus.php b/server/page/menus.php index 30917c2..0b1374e 100644 --- a/server/page/menus.php +++ b/server/page/menus.php @@ -245,7 +245,7 @@ -