Compare commits
14 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
658bfcc4a8 | ||
|
|
b5b1897dac | ||
|
|
b32b5e3c00 | ||
|
|
08e5afeb6e | ||
|
|
364fd6fea0 | ||
|
|
4143545117 | ||
|
|
9e30ed5e9c | ||
|
|
9d1ba271f3 | ||
|
|
8eff91f28b | ||
|
|
641210e7f4 | ||
|
|
c660fed9f0 | ||
|
|
5bc2d19800 | ||
|
|
89d53e0854 | ||
|
|
9f16806179 |
@@ -6,7 +6,6 @@ RewriteBase /projects/RegattenApp/
|
|||||||
|
|
||||||
### RESTRICTED FOLDER
|
### RESTRICTED FOLDER
|
||||||
RewriteRule ^(.*)server(.*)$ / [R=301,L,NC]
|
RewriteRule ^(.*)server(.*)$ / [R=301,L,NC]
|
||||||
RewriteRule ^(.*)content(.*)$ / [R=301,L,NC]
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -389,7 +389,7 @@
|
|||||||
if ($response === false) done(DONE_DATABASE);
|
if ($response === false) done(DONE_DATABASE);
|
||||||
$keys = array_keys($response);
|
$keys = array_keys($response);
|
||||||
if (isset($_REQUEST['changed-after'])) {
|
if (isset($_REQUEST['changed-after'])) {
|
||||||
$response = db_get_data($mysqli, DB_TABLE_USERS, 'id,username,email,' . $followFields, '`changed` > "' . mysqli_real_escape_string($mysqli, date('Y-m-d H:i:s', $_REQUEST['changed-after'])) . '"' . ($whereString ? (' AND ' . $whereString) : ''));
|
$response = db_get_data($mysqli, DB_TABLE_USERS, 'id,username,email' . $followFields, '`changed` > "' . mysqli_real_escape_string($mysqli, date('Y-m-d H:i:s', $_REQUEST['changed-after'])) . '"' . ($whereString ? (' AND ' . $whereString) : ''));
|
||||||
if ($response === false) done(DONE_DATABASE);
|
if ($response === false) done(DONE_DATABASE);
|
||||||
}
|
}
|
||||||
$response = array_map(function ($entry) {
|
$response = array_map(function ($entry) {
|
||||||
|
|||||||
@@ -188,7 +188,7 @@ $(document).ready(function(){
|
|||||||
});
|
});
|
||||||
|
|
||||||
//Generating Cookies
|
//Generating Cookies
|
||||||
function createCookie(e, t, n) {if (n) {var o = new Date;o.setTime(o.getTime() + 48 * n * 60 * 3600 * 1e3);var r = "; expires=" + o.toGMTString()} else var r = "";document.cookie = e + "=" + t + r + "; path=/"}
|
function createCookie(e, t, n) {if (n) {var o = new Date;o.setTime(o.getTime() + n * 365 * 24 * 3600 * 1e3);var r = "; expires=" + o.toGMTString()} else var r = "";document.cookie = e + "=" + t + r + "; path=/"}
|
||||||
function readCookie(e) {for (var t = e + "=", n = document.cookie.split(";"), o = 0; o < n.length; o++) {for (var r = n[o];" " == r.charAt(0);) r = r.substring(1, r.length);if (0 == r.indexOf(t)) return r.substring(t.length, r.length)}return null}
|
function readCookie(e) {for (var t = e + "=", n = document.cookie.split(";"), o = 0; o < n.length; o++) {for (var r = n[o];" " == r.charAt(0);) r = r.substring(1, r.length);if (0 == r.indexOf(t)) return r.substring(t.length, r.length)}return null}
|
||||||
function eraseCookie(e) {createCookie(e, "", -1)}
|
function eraseCookie(e) {createCookie(e, "", -1)}
|
||||||
|
|
||||||
@@ -215,8 +215,8 @@ $(document).ready(function(){
|
|||||||
}
|
}
|
||||||
},150);
|
},150);
|
||||||
})
|
})
|
||||||
if (readCookie('sticky_dark_mode')) {darkSwitch.prop('checked', true); $('body').removeClass('detect-theme').removeClass('theme-light').addClass('theme-dark');}
|
if (readCookie('sticky_dark_mode')) {createCookie('sticky_dark_mode', true, 1); darkSwitch.prop('checked', true); $('body').removeClass('detect-theme').removeClass('theme-light').addClass('theme-dark');}
|
||||||
if (readCookie('sticky_light_mode')) {darkSwitch.prop('checked', false); $('body').removeClass('detect-theme').removeClass('theme-dark').addClass('theme-light');}
|
if (readCookie('sticky_light_mode')) {createCookie('sticky_light_mode', true, 1); darkSwitch.prop('checked', false); $('body').removeClass('detect-theme').removeClass('theme-dark').addClass('theme-light');}
|
||||||
|
|
||||||
|
|
||||||
//Auto Dark Mode
|
//Auto Dark Mode
|
||||||
@@ -1331,6 +1331,20 @@ $(document).ready(function(){
|
|||||||
colorsArray.forEach(function (gradientBodyValue) {$('.generated-styles').append('.body-'+gradientBodyValue[0]+'{background-image: linear-gradient(to bottom, '+gradientBodyValue[1]+' 0, '+gradientBodyValue[3]+' 100%)}')});
|
colorsArray.forEach(function (gradientBodyValue) {$('.generated-styles').append('.body-'+gradientBodyValue[0]+'{background-image: linear-gradient(to bottom, '+gradientBodyValue[1]+' 0, '+gradientBodyValue[3]+' 100%)}')});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function welcomeOk() {
|
||||||
|
createCookie('sticky_welcome_banner', true, 1);
|
||||||
|
$('#menu-welcome').hideMenu();
|
||||||
|
$('.menu-hider').removeClass('no-click');
|
||||||
|
}
|
||||||
|
function showWelcome() {
|
||||||
|
if (!readCookie('sticky_welcome_banner')) {
|
||||||
|
$('.menu-hider').addClass('no-click');
|
||||||
|
$('#menu-welcome').showMenu();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$('#menu-welcome-a-okay').click(welcomeOk);
|
||||||
|
showWelcome();
|
||||||
|
|
||||||
initRegatten();
|
initRegatten();
|
||||||
|
|
||||||
hideLoader();
|
hideLoader();
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
const DB_VERSION = 3;
|
const DB_VERSION = 4;
|
||||||
|
|
||||||
const USER_ID = localStorage.getItem('auth_user');
|
const USER_ID = localStorage.getItem('auth_user');
|
||||||
const USER_NAME = localStorage.getItem('auth_username');
|
const USER_NAME = localStorage.getItem('auth_username');
|
||||||
@@ -256,6 +256,147 @@ function dbGetResultCalculated(regatta) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function dbGetRanking(minDate, maxDate, jugend, jugstrict) {
|
||||||
|
return new Promise(async function(resolve) {
|
||||||
|
var rankNoResults = [];
|
||||||
|
|
||||||
|
var sailors = await dbGetData('sailors');
|
||||||
|
var regattas = await dbGetRegattasRange(minDate, maxDate);
|
||||||
|
|
||||||
|
var sailorIds = {};
|
||||||
|
for (s in sailors) {
|
||||||
|
sailorIds[sailors[s].id] = s;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (var i in sailors) {
|
||||||
|
sailors[i].regattas = {};
|
||||||
|
sailors[i].tmp_rlp = [];
|
||||||
|
}
|
||||||
|
|
||||||
|
for (var i in regattas) {
|
||||||
|
var regatta = regattas[i];
|
||||||
|
|
||||||
|
// regatta has to be min. 2 days to be ranking regatta
|
||||||
|
if (regatta.length < 2) continue;
|
||||||
|
|
||||||
|
var results = await dbGetDataIndex('results', 'regatta', regatta.id);
|
||||||
|
if (results.length <= 0) {
|
||||||
|
if (regatta.dateTo <= getToday()) {
|
||||||
|
if (regatta.canceled == '0') {
|
||||||
|
rankNoResults.push(regatta);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// in one race there must be at least 10 boats started
|
||||||
|
var ok = false;
|
||||||
|
for (var j = 1; j <= regatta.races; j ++) {
|
||||||
|
var temp = 0;
|
||||||
|
for (var r in results) {
|
||||||
|
if ((results[r]['race' + j] != 'DNC') && (results[r]['race' + j] != 'DNS')) {
|
||||||
|
temp ++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (temp >= 10) {
|
||||||
|
ok = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!ok) continue;
|
||||||
|
|
||||||
|
var fb = regatta.finishedBoats;
|
||||||
|
|
||||||
|
// calc m
|
||||||
|
var m;
|
||||||
|
if (regatta.m > 0) {
|
||||||
|
m = regatta.m;
|
||||||
|
} else if (regatta.races <= 4) {
|
||||||
|
m = regatta.races;
|
||||||
|
} else {
|
||||||
|
if ((regatta.length > 2) && (regatta.races >= 6)) {
|
||||||
|
m = 5;
|
||||||
|
} else {
|
||||||
|
m = 4;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// add regatta to each sailor
|
||||||
|
for (var r in results) {
|
||||||
|
var result = results[r];
|
||||||
|
|
||||||
|
if (result.rlp == 0) continue;
|
||||||
|
|
||||||
|
// check if crew is youth
|
||||||
|
// TODO: not used
|
||||||
|
|
||||||
|
sailors[sailorIds[result.steuermann]].regattas[regatta.id] = {
|
||||||
|
regatta: regatta.id,
|
||||||
|
boat: result.boat,
|
||||||
|
crew: result.crew,
|
||||||
|
place: result.place,
|
||||||
|
fb: fb,
|
||||||
|
rlp: result.rlp,
|
||||||
|
used: 0,
|
||||||
|
m: m
|
||||||
|
};
|
||||||
|
for (var j = 0; j < m; j ++) {
|
||||||
|
sailors[sailorIds[result.steuermann]].tmp_rlp.push([regatta.id, result.rlp]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// remove not german or not youth sailors
|
||||||
|
for (var i = sailors.length - 1; i >= 0; i --) {
|
||||||
|
if (sailors[i].german == '0') {
|
||||||
|
sailors.splice(i, 1);
|
||||||
|
} else if (jugend) {
|
||||||
|
if (((sailors[i].year != null) && (sailors[i].year < (formatDate('Y', maxDate) - YOUTH_AGE))) ||
|
||||||
|
((sailors[i].year == null) && (jugstrict))) {
|
||||||
|
sailors.splice(i, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (var i = sailors.length - 1; i >= 0; i --) {
|
||||||
|
// sort rlps desc
|
||||||
|
sailors[i].tmp_rlp.sort(function (a,b) {
|
||||||
|
return b[1] - a[1];
|
||||||
|
});
|
||||||
|
|
||||||
|
// calc mean rlp
|
||||||
|
var sum = 0;
|
||||||
|
var cnt = 0;
|
||||||
|
for (var t in sailors[i].tmp_rlp) {
|
||||||
|
var r = sailors[i].tmp_rlp[t];
|
||||||
|
sum += parseFloat(r[1]);
|
||||||
|
sailors[i].regattas[r[0]].used ++;
|
||||||
|
cnt ++;
|
||||||
|
if (cnt >= 9) break;
|
||||||
|
}
|
||||||
|
delete sailors[i].tmp_rlp;
|
||||||
|
if (cnt > 0) {
|
||||||
|
var rlp = sum / cnt;
|
||||||
|
sailors[i].rlp = rlp;
|
||||||
|
sailors[i].m = cnt;
|
||||||
|
} else {
|
||||||
|
sailors.splice(i, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
sailors.sort(function (a,b) {
|
||||||
|
if (a.m != b.m) return b.m - a.m;
|
||||||
|
return b.rlp - a.rlp;
|
||||||
|
});
|
||||||
|
|
||||||
|
for (var i = 0; i < sailors.length; i ++) {
|
||||||
|
sailors[i].rank = (i + 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
resolve([sailors, rankNoResults]);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
async function updateSyncStatus() { // TODO
|
async function updateSyncStatus() { // TODO
|
||||||
// var syncStatus = document.getElementById('syncstatus');
|
// var syncStatus = document.getElementById('syncstatus');
|
||||||
// var lastSync = await dbGetData('update_times', 'last_sync');
|
// var lastSync = await dbGetData('update_times', 'last_sync');
|
||||||
@@ -283,6 +424,14 @@ async function updateSyncStatus() { // TODO
|
|||||||
|
|
||||||
async function runPageScript() {
|
async function runPageScript() {
|
||||||
if (canUseLocalDB) {
|
if (canUseLocalDB) {
|
||||||
|
var osUpdateTimes = db.transaction('update_times').objectStore('update_times');
|
||||||
|
osUpdateTimes.get('loggedin').onsuccess = function (event) {
|
||||||
|
var status = event.target.result.status;
|
||||||
|
if (status != isLoggedIn()) {
|
||||||
|
resetDb();
|
||||||
|
location.reload();
|
||||||
|
}
|
||||||
|
};
|
||||||
updateSyncStatus();
|
updateSyncStatus();
|
||||||
}
|
}
|
||||||
if (typeof updateSyncStatusTimer == 'undefined') { // TODO
|
if (typeof updateSyncStatusTimer == 'undefined') { // TODO
|
||||||
@@ -291,6 +440,7 @@ async function runPageScript() {
|
|||||||
updateSyncStatusTimer = window.setInterval(updateSyncStatus, 10000);
|
updateSyncStatusTimer = window.setInterval(updateSyncStatus, 10000);
|
||||||
} else {
|
} else {
|
||||||
// syncStatus.innerHTML = 'Keine Offline-Nutzung möglich.';
|
// syncStatus.innerHTML = 'Keine Offline-Nutzung möglich.';
|
||||||
|
$('#i-sync').parent().hide();
|
||||||
updateSyncStatusTimer = null;
|
updateSyncStatusTimer = null;
|
||||||
}
|
}
|
||||||
// syncStatus.style.display = 'block';
|
// syncStatus.style.display = 'block';
|
||||||
@@ -341,7 +491,7 @@ function sync() {
|
|||||||
|
|
||||||
// CLUBS
|
// CLUBS
|
||||||
if (localTimes['clubs'] < serverTimes['clubs']) {
|
if (localTimes['clubs'] < serverTimes['clubs']) {
|
||||||
getJSON(QUERY_URL + 'get_clubs?changer-after=' + localTimes['clubs'], function (code, data) {
|
getJSON(QUERY_URL + 'get_clubs?changed-after=' + localTimes['clubs'], function (code, data) {
|
||||||
if (code == 200) {
|
if (code == 200) {
|
||||||
var os = db.transaction('clubs', 'readwrite').objectStore('clubs');
|
var os = db.transaction('clubs', 'readwrite').objectStore('clubs');
|
||||||
console.log(data);
|
console.log(data);
|
||||||
@@ -373,7 +523,7 @@ function sync() {
|
|||||||
|
|
||||||
// BOATS
|
// BOATS
|
||||||
if (localTimes['boats'] < serverTimes['boats']) {
|
if (localTimes['boats'] < serverTimes['boats']) {
|
||||||
getJSON(QUERY_URL + 'get_boats?changer-after=' + localTimes['boats'], function (code, data) {
|
getJSON(QUERY_URL + 'get_boats?changed-after=' + localTimes['boats'], function (code, data) {
|
||||||
if (code == 200) {
|
if (code == 200) {
|
||||||
var os = db.transaction('boats', 'readwrite').objectStore('boats');
|
var os = db.transaction('boats', 'readwrite').objectStore('boats');
|
||||||
console.log(data);
|
console.log(data);
|
||||||
@@ -405,7 +555,7 @@ function sync() {
|
|||||||
|
|
||||||
// SAILORS
|
// SAILORS
|
||||||
if (localTimes['sailors'] < serverTimes['sailors']) {
|
if (localTimes['sailors'] < serverTimes['sailors']) {
|
||||||
getJSON(QUERY_URL + 'get_sailors?changer-after=' + localTimes['sailors'], function (code, data) {
|
getJSON(QUERY_URL + 'get_sailors?changed-after=' + localTimes['sailors'], function (code, data) {
|
||||||
if (code == 200) {
|
if (code == 200) {
|
||||||
var os = db.transaction('sailors', 'readwrite').objectStore('sailors');
|
var os = db.transaction('sailors', 'readwrite').objectStore('sailors');
|
||||||
console.log(data);
|
console.log(data);
|
||||||
@@ -437,7 +587,7 @@ function sync() {
|
|||||||
|
|
||||||
// REGATTAS
|
// REGATTAS
|
||||||
if (localTimes['regattas'] < serverTimes['regattas']) {
|
if (localTimes['regattas'] < serverTimes['regattas']) {
|
||||||
getJSON(QUERY_URL + 'get_regattas?changer-after=' + localTimes['regattas'], function (code, data) {
|
getJSON(QUERY_URL + 'get_regattas?changed-after=' + localTimes['regattas'], function (code, data) {
|
||||||
if (code == 200) {
|
if (code == 200) {
|
||||||
var os = db.transaction('regattas', 'readwrite').objectStore('regattas');
|
var os = db.transaction('regattas', 'readwrite').objectStore('regattas');
|
||||||
console.log(data);
|
console.log(data);
|
||||||
@@ -485,7 +635,7 @@ function sync() {
|
|||||||
|
|
||||||
// RESULTS
|
// RESULTS
|
||||||
if (localTimes['results'] < serverTimes['results']) {
|
if (localTimes['results'] < serverTimes['results']) {
|
||||||
getJSON(QUERY_URL + 'get_results?changer-after=' + localTimes['results'], function (code, data) {
|
getJSON(QUERY_URL + 'get_results?changed-after=' + localTimes['results'], function (code, data) {
|
||||||
if (code == 200) {
|
if (code == 200) {
|
||||||
var os = db.transaction('results', 'readwrite').objectStore('results');
|
var os = db.transaction('results', 'readwrite').objectStore('results');
|
||||||
console.log(data);
|
console.log(data);
|
||||||
@@ -517,7 +667,7 @@ function sync() {
|
|||||||
|
|
||||||
// PLANNINGS
|
// PLANNINGS
|
||||||
if (localTimes['plannings'] < serverTimes['plannings']) {
|
if (localTimes['plannings'] < serverTimes['plannings']) {
|
||||||
getJSON(QUERY_URL + 'get_plannings?changer-after=' + localTimes['plannings'], function (code, data) {
|
getJSON(QUERY_URL + 'get_plannings?changed-after=' + localTimes['plannings'], function (code, data) {
|
||||||
if (code == 200) {
|
if (code == 200) {
|
||||||
var os = db.transaction('plannings', 'readwrite').objectStore('plannings');
|
var os = db.transaction('plannings', 'readwrite').objectStore('plannings');
|
||||||
console.log(data);
|
console.log(data);
|
||||||
@@ -550,7 +700,7 @@ function sync() {
|
|||||||
if (isLoggedIn()) {
|
if (isLoggedIn()) {
|
||||||
// TRIM_BOATS
|
// TRIM_BOATS
|
||||||
if (localTimes['trim_boats'] < serverTimes['trim_boats']) {
|
if (localTimes['trim_boats'] < serverTimes['trim_boats']) {
|
||||||
getJSON(QUERY_URL + 'get_trim_boats?changer-after=' + localTimes['trim_boats'], function (code, data) {
|
getJSON(QUERY_URL + 'get_trim_boats?changed-after=' + localTimes['trim_boats'], function (code, data) {
|
||||||
if (code == 200) {
|
if (code == 200) {
|
||||||
var os = db.transaction('trim_boats', 'readwrite').objectStore('trim_boats');
|
var os = db.transaction('trim_boats', 'readwrite').objectStore('trim_boats');
|
||||||
console.log(data);
|
console.log(data);
|
||||||
@@ -582,7 +732,7 @@ function sync() {
|
|||||||
|
|
||||||
// TRIM_USERS
|
// TRIM_USERS
|
||||||
if (localTimes['trim_users'] < serverTimes['trim_users']) {
|
if (localTimes['trim_users'] < serverTimes['trim_users']) {
|
||||||
getJSON(QUERY_URL + 'get_trim_users?changer-after=' + localTimes['trim_users'], function (code, data) {
|
getJSON(QUERY_URL + 'get_trim_users?changed-after=' + localTimes['trim_users'], function (code, data) {
|
||||||
if (code == 200) {
|
if (code == 200) {
|
||||||
var os = db.transaction('trim_users', 'readwrite').objectStore('trim_users');
|
var os = db.transaction('trim_users', 'readwrite').objectStore('trim_users');
|
||||||
console.log(data);
|
console.log(data);
|
||||||
@@ -614,7 +764,7 @@ function sync() {
|
|||||||
|
|
||||||
// TRIM_TRIMS
|
// TRIM_TRIMS
|
||||||
if (localTimes['trim_trims'] < serverTimes['trim_trims']) {
|
if (localTimes['trim_trims'] < serverTimes['trim_trims']) {
|
||||||
getJSON(QUERY_URL + 'get_trim_trims?changer-after=' + localTimes['trim_trims'], function (code, data) {
|
getJSON(QUERY_URL + 'get_trim_trims?changed-after=' + localTimes['trim_trims'], function (code, data) {
|
||||||
if (code == 200) {
|
if (code == 200) {
|
||||||
var os = db.transaction('trim_trims', 'readwrite').objectStore('trim_trims');
|
var os = db.transaction('trim_trims', 'readwrite').objectStore('trim_trims');
|
||||||
console.log(data);
|
console.log(data);
|
||||||
@@ -650,7 +800,7 @@ function sync() {
|
|||||||
|
|
||||||
// USERS
|
// USERS
|
||||||
if (localTimes['users'] < serverTimes['users']) {
|
if (localTimes['users'] < serverTimes['users']) {
|
||||||
getJSON(QUERY_URL + 'get_users?changer-after=' + localTimes['users'], function (code, data) {
|
getJSON(QUERY_URL + 'get_users?changed-after=' + localTimes['users'], function (code, data) {
|
||||||
if (code == 200) {
|
if (code == 200) {
|
||||||
var os = db.transaction('users', 'readwrite').objectStore('users');
|
var os = db.transaction('users', 'readwrite').objectStore('users');
|
||||||
console.log(data);
|
console.log(data);
|
||||||
@@ -732,6 +882,8 @@ function initDatabase() {
|
|||||||
var lastSync = event.target.result.time;
|
var lastSync = event.target.result.time;
|
||||||
if (lastSync > 0) {
|
if (lastSync > 0) {
|
||||||
runPageScript();
|
runPageScript();
|
||||||
|
} else {
|
||||||
|
db.transaction('update_times', 'readwrite').objectStore('update_times').put({ table: 'loggedin', status: isLoggedIn() });
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -795,6 +947,12 @@ function initDatabase() {
|
|||||||
osUpdateTimes.put({ table: 'regattas', time: 0 });
|
osUpdateTimes.put({ table: 'regattas', time: 0 });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((oldVersion < 4) && (newVersion >= 4)) {
|
||||||
|
console.log('to version 4');
|
||||||
|
var osUpdateTimes = upgradeTransaction.objectStore('update_times');
|
||||||
|
osUpdateTimes.add({ table: 'loggedin', status: isLoggedIn() });
|
||||||
|
}
|
||||||
|
|
||||||
var osUpdateTimes = upgradeTransaction.objectStore('update_times');
|
var osUpdateTimes = upgradeTransaction.objectStore('update_times');
|
||||||
osUpdateTimes.put({ table: 'last_sync', time: 0 });
|
osUpdateTimes.put({ table: 'last_sync', time: 0 });
|
||||||
}
|
}
|
||||||
@@ -802,3 +960,29 @@ function initDatabase() {
|
|||||||
runPageScript();
|
runPageScript();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function resetDb(silent = true) {
|
||||||
|
$('#menu-developer').hideMenu();
|
||||||
|
if (canUseLocalDB) {
|
||||||
|
showLoader();
|
||||||
|
var osUpdateTimes = db.transaction('update_times', 'readwrite').objectStore('update_times');
|
||||||
|
osUpdateTimes.put({ table: 'last_sync', time: 0 });
|
||||||
|
osUpdateTimes.put({ table: 'clubs', time: 0 });
|
||||||
|
osUpdateTimes.put({ table: 'boats', time: 0 });
|
||||||
|
osUpdateTimes.put({ table: 'sailors', time: 0 });
|
||||||
|
osUpdateTimes.put({ table: 'regattas', time: 0 });
|
||||||
|
osUpdateTimes.put({ table: 'results', time: 0 });
|
||||||
|
osUpdateTimes.put({ table: 'plannings', time: 0 });
|
||||||
|
osUpdateTimes.put({ table: 'trim_boats', time: 0 });
|
||||||
|
osUpdateTimes.put({ table: 'trim_users', time: 0 });
|
||||||
|
osUpdateTimes.put({ table: 'trim_trims', time: 0 });
|
||||||
|
osUpdateTimes.put({ table: 'users', time: 0 });
|
||||||
|
console.log('DB update times reset');
|
||||||
|
if (!silent)
|
||||||
|
toastInfo('The database was reset. Please reload or close this tab.<br>At the next visit, a full sync will be performed.');
|
||||||
|
hideLoader();
|
||||||
|
} else {
|
||||||
|
if (!silent)
|
||||||
|
toastWarn('Your device does not support storing data locally. All data is fetched directly from our server.<br>As a result, you can not reset your database.');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
header('Content-Type: text/javascript');
|
header('Content-Type: text/javascript');
|
||||||
|
|
||||||
|
require_once(__DIR__ . '/../../server/version.php');
|
||||||
require_once(__DIR__ . '/../../server/config.php');
|
require_once(__DIR__ . '/../../server/config.php');
|
||||||
|
|
||||||
?>
|
?>
|
||||||
@@ -25,7 +26,7 @@ $(document).ready(function(){
|
|||||||
|
|
||||||
|
|
||||||
//Creating Cookie System for PWA Hide
|
//Creating Cookie System for PWA Hide
|
||||||
function createCookie(e, t, n) {if (n) {var o = new Date;o.setTime(o.getTime() + 48 * n * 60 * 60 * 1e3);var r = "; expires=" + o.toGMTString()} else var r = "";document.cookie = e + "=" + t + r + "; path=/"}
|
function createCookie(e, t, n) {if (n) {var o = new Date;o.setTime(o.getTime() + n * 365 * 24 * 3600 * 1e3);var r = "; expires=" + o.toGMTString()} else var r = "";document.cookie = e + "=" + t + r + "; path=/"}
|
||||||
function readCookie(e) {for (var t = e + "=", n = document.cookie.split(";"), o = 0; o < n.length; o++) {for (var r = n[o];" " == r.charAt(0);) r = r.substring(1, r.length);if (0 == r.indexOf(t)) return r.substring(t.length, r.length)}return null}
|
function readCookie(e) {for (var t = e + "=", n = document.cookie.split(";"), o = 0; o < n.length; o++) {for (var r = n[o];" " == r.charAt(0);) r = r.substring(1, r.length);if (0 == r.indexOf(t)) return r.substring(t.length, r.length)}return null}
|
||||||
function eraseCookie(e) {createCookie(e, "", -1)}
|
function eraseCookie(e) {createCookie(e, "", -1)}
|
||||||
|
|
||||||
|
|||||||
@@ -9,6 +9,8 @@
|
|||||||
const QUERY_URL = '<?php echo SERVER_ADDR; ?>/api/';
|
const QUERY_URL = '<?php echo SERVER_ADDR; ?>/api/';
|
||||||
const BOATCLASS = '<?php echo BOATCLASS; ?>';
|
const BOATCLASS = '<?php echo BOATCLASS; ?>';
|
||||||
const LINK_PRE = '<?php echo SERVER_ADDR; ?>/';
|
const LINK_PRE = '<?php echo SERVER_ADDR; ?>/';
|
||||||
|
const YOUTH_AGE = '<?php echo $_CLASS['youth-age']; ?>';
|
||||||
|
const YOUTH_GERMAN_NAME = '<?php echo $_CLASS['youth-german-name']; ?>';
|
||||||
|
|
||||||
var randomId = function() { return '_' + Math.random().toString(36).substr(2, 9); }
|
var randomId = function() { return '_' + Math.random().toString(36).substr(2, 9); }
|
||||||
|
|
||||||
@@ -67,7 +69,7 @@ var updateBadge = function (name, val) {
|
|||||||
var makeToast = function (color, icon, text, time) {
|
var makeToast = function (color, icon, text, time) {
|
||||||
var id = 'snackbar' + randomId();
|
var id = 'snackbar' + randomId();
|
||||||
var delay = (time > 0 ? 'data-delay="' + time + '" data-autohide="true"' : 'data-autohide="false"');
|
var delay = (time > 0 ? 'data-delay="' + time + '" data-autohide="true"' : 'data-autohide="false"');
|
||||||
var div = '<div id="' + id + '" class="snackbar-toast ' + color + '" ' + delay + '>';
|
var div = '<div id="' + id + '" class="snackbar-toast pt-3 pb-3 ' + color + '" ' + delay + ' style="line-height: 2em;">';
|
||||||
div += '<i class="fa ' + icon + ' mr-3"></i>' + text + '</div>';
|
div += '<i class="fa ' + icon + ' mr-3"></i>' + text + '</div>';
|
||||||
$('#page').append(div);
|
$('#page').append(div);
|
||||||
$('#' + id).toast('show');
|
$('#' + id).toast('show');
|
||||||
@@ -200,26 +202,6 @@ var logout = function() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function resetDb() {
|
|
||||||
$('#menu-developer').hideMenu();
|
|
||||||
if (canUseLocalDB) {
|
|
||||||
showLoader();
|
|
||||||
var request = window.indexedDB.deleteDatabase('regatten_app_db_' + BOATCLASS);
|
|
||||||
request.onerror = function (event) {
|
|
||||||
console.log("Cannot open DB: " + event.target.errorCode);
|
|
||||||
toastError('There was an error deleting your database.<br>Please report this to <a href="mailto:dev@regatten.net">dev@regatten.net</a>');
|
|
||||||
hideLoader();
|
|
||||||
};
|
|
||||||
request.onsuccess = function (event) {
|
|
||||||
console.log('DB deleted');
|
|
||||||
toastInfo('The database was deleted. Please reload or close this tab.<br>At the next visit, a new database will be created.');
|
|
||||||
hideLoader();
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
toastWarn('Your device does not support storing data locally. All data is fetched directly from our server.<br>As a result, you can not reset your database.');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function resetCache() {
|
function resetCache() {
|
||||||
$('#menu-developer').hideMenu();
|
$('#menu-developer').hideMenu();
|
||||||
navigator.serviceWorker.getRegistrations().then(function (registrations) {
|
navigator.serviceWorker.getRegistrations().then(function (registrations) {
|
||||||
|
|||||||
@@ -43,6 +43,136 @@
|
|||||||
text-align: right;
|
text-align: right;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*** RANKING LIST ***/
|
||||||
|
.ranking-list > div {
|
||||||
|
padding-top: 1rem;
|
||||||
|
padding-bottom: 1rem;
|
||||||
|
border-bottom: 1px solid #dee2e6;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ranking-list > div:last-child {
|
||||||
|
border: 0;
|
||||||
|
padding-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ranking-list div {
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ranking-list > div > div > div {
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ranking-list > div > div:nth-child(1) > div:nth-child(1) {
|
||||||
|
width: 25%;
|
||||||
|
}
|
||||||
|
.ranking-list > div > div:nth-child(1) > div:nth-child(2) {
|
||||||
|
width: 50%;
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
.ranking-list > div > div:nth-child(1) > div:nth-child(3) {
|
||||||
|
width: 25%;
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ranking-list > div > div:nth-child(2) > div:nth-child(1) {
|
||||||
|
width: 75%;
|
||||||
|
}
|
||||||
|
.ranking-list > div > div:nth-child(2) > div:nth-child(2) {
|
||||||
|
width: 25%;
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*** RANKING DETAIL LIST ***/
|
||||||
|
.ranking-detail-list > div {
|
||||||
|
padding-top: 1rem;
|
||||||
|
padding-bottom: 1rem;
|
||||||
|
border-bottom: 1px solid #dee2e6;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ranking-detail-list > div:last-child {
|
||||||
|
border: 0;
|
||||||
|
padding-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ranking-detail-list div {
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ranking-detail-list > div > div > div {
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ranking-detail-list > div > div:nth-child(2) > div:nth-child(1) {
|
||||||
|
width: 50%;
|
||||||
|
}
|
||||||
|
.ranking-detail-list > div > div:nth-child(2) > div:nth-child(2) {
|
||||||
|
width: 25%;
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
.ranking-detail-list > div > div:nth-child(2) > div:nth-child(3) {
|
||||||
|
width: 25%;
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ranking-detail-list > div > div:nth-child(3) {
|
||||||
|
border-bottom: 1px dashed #dee2e6;
|
||||||
|
}
|
||||||
|
.ranking-detail-list > div > div:nth-child(3) > div:nth-child(1) {
|
||||||
|
width: 50%;
|
||||||
|
}
|
||||||
|
.ranking-detail-list > div > div:nth-child(3) > div:nth-child(2) {
|
||||||
|
width: 50%;
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ranking-detail-list > div > div:nth-child(4) > div:nth-child(1) {
|
||||||
|
width: 50%;
|
||||||
|
}
|
||||||
|
.ranking-detail-list > div > div:nth-child(4) > div:nth-child(2) {
|
||||||
|
width: 50%;
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ranking-detail-list > div > div:nth-child(n+5) > div:nth-child(1) {
|
||||||
|
width: 75%;
|
||||||
|
}
|
||||||
|
.ranking-detail-list > div > div:nth-child(n+5) > div:nth-child(2) {
|
||||||
|
width: 25%;
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*** NORMAL LIST ***/
|
||||||
|
.normal-list > div {
|
||||||
|
padding-top: 1rem;
|
||||||
|
padding-bottom: 1rem;
|
||||||
|
border-bottom: 1px solid #dee2e6;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.normal-list > div:last-child {
|
||||||
|
border: 0;
|
||||||
|
padding-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.normal-list div {
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.normal-list > div > div > div {
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.normal-list > div > div:nth-child(2) > div:nth-child(1) {
|
||||||
|
width: 50%;
|
||||||
|
}
|
||||||
|
.normal-list > div > div:nth-child(2) > div:nth-child(2) {
|
||||||
|
width: 50%;
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
|
||||||
/*** BLINKING ICONS ***/
|
/*** BLINKING ICONS ***/
|
||||||
@keyframes fa-blink {
|
@keyframes fa-blink {
|
||||||
0% { opacity: 1; }
|
0% { opacity: 1; }
|
||||||
|
|||||||
@@ -1220,6 +1220,7 @@ img.mx-auto {
|
|||||||
bottom: 0px;
|
bottom: 0px;
|
||||||
z-index: 99999;
|
z-index: 99999;
|
||||||
transition: all 150ms ease;
|
transition: all 150ms ease;
|
||||||
|
background-color: #0f1117;
|
||||||
}
|
}
|
||||||
|
|
||||||
#preloader .spinner-border {
|
#preloader .spinner-border {
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
require_once(__DIR__ . '/server/version.php');
|
||||||
require_once(__DIR__ . '/server/config.php');
|
require_once(__DIR__ . '/server/config.php');
|
||||||
require_once(__DIR__ . '/server/log.php');
|
require_once(__DIR__ . '/server/log.php');
|
||||||
require_once(__DIR__ . '/server/templates.php');
|
require_once(__DIR__ . '/server/templates.php');
|
||||||
@@ -24,7 +25,7 @@
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!file_exists(__DIR__ . '/content/' . $site . '.php')) {
|
if (!file_exists(__DIR__ . '/server/content/' . $site . '.php')) {
|
||||||
$site = '404';
|
$site = '404';
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -40,7 +41,7 @@
|
|||||||
$tpl = new Templates(__DIR__ . '/server/templates/');
|
$tpl = new Templates(__DIR__ . '/server/templates/');
|
||||||
$scripts = new Scripts(__DIR__ . '/server/scripts/');
|
$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');
|
require_once(__DIR__ . '/server/buildpage.php');
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
header('Content-Type: application/json');
|
header('Content-Type: application/json');
|
||||||
|
|
||||||
|
require_once(__DIR__ . '/server/version.php');
|
||||||
require_once(__DIR__ . '/server/config.php');
|
require_once(__DIR__ . '/server/config.php');
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -9,8 +9,6 @@
|
|||||||
define('SERVER_ADDR', 'https://' . $_SERVER['SERVER_NAME'] . SERVER_PATH); // path to root directory
|
define('SERVER_ADDR', 'https://' . $_SERVER['SERVER_NAME'] . SERVER_PATH); // path to root directory
|
||||||
define('LOGGING_APIKEY', 'xxx'); // Apikey for Logging API -> get from ostertun.net/logging
|
define('LOGGING_APIKEY', 'xxx'); // Apikey for Logging API -> get from ostertun.net/logging
|
||||||
|
|
||||||
define('PWA_VERSION', '1.0');
|
|
||||||
|
|
||||||
// PUSH SERVER
|
// PUSH SERVER
|
||||||
define('PUSH_AUTH', 'xxxxxxx'); // auth string for push.ostertun.net
|
define('PUSH_AUTH', 'xxxxxxx'); // auth string for push.ostertun.net
|
||||||
define('PUSH_SERVERKEY', 'xxxxxxx'); // server key from push.ostertun.net
|
define('PUSH_SERVERKEY', 'xxxxxxx'); // server key from push.ostertun.net
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
$sp['title'] = 'Fehler 404 - Regatten.net Pirat';
|
$sp['title'] = 'Fehler 404 - Regatten.net ' . $_CLASS['name'];
|
||||||
$sp['backbutton'] = true;
|
$sp['backbutton'] = true;
|
||||||
|
|
||||||
$content = $tpl->load('error', ['404', 'Seite nicht gefunden']);
|
$content = $tpl->load('error', ['404', 'Seite nicht gefunden']);
|
||||||
19
server/content/account.php
Normal file
19
server/content/account.php
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
// TODO: Create site
|
||||||
|
|
||||||
|
$sp['title'] = 'Seite noch nicht unterstuuml;tzt - Regatten.net ' . $_CLASS['name'];
|
||||||
|
$sp['backbutton'] = true;
|
||||||
|
|
||||||
|
$content = $tpl->load('error', ['404', 'Seite existiert noch nicht']);
|
||||||
|
$content .= '<p>';
|
||||||
|
$content .= 'Die gesuchte Seite ist leider noch nicht verfügbar.<br>';
|
||||||
|
$content .= 'Wir arbeiten daran, sie schnellstmöglich zur Verfügung zu stellen.<br>';
|
||||||
|
$content .= 'Wie wäre es mit der Homepage?';
|
||||||
|
$content .= '</p>';
|
||||||
|
$content .= $tpl->load('button', ['Zur Startseite', LINK_PRE . 'index', 'css-class' => 'mb-3']);
|
||||||
|
$content .= $tpl->load('button', ['Kontakt', LINK_PRE . 'contact']);
|
||||||
|
|
||||||
|
$sp['output'] = $tpl->load('card', [$content, 'css-class' => 'text-center pt-3']);
|
||||||
|
|
||||||
|
?>
|
||||||
41
server/content/boats.php
Normal file
41
server/content/boats.php
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
$sp['title'] = 'Boote - Regatten.net ' . $_CLASS['name'];
|
||||||
|
$sp['backbutton'] = 'index';
|
||||||
|
$sp['activenav'] = 4;
|
||||||
|
|
||||||
|
// Title
|
||||||
|
$content = "<h1>Boote</h1>";
|
||||||
|
|
||||||
|
$sp['output'] .= $tpl->load('card', [$content]);
|
||||||
|
|
||||||
|
// Info Years
|
||||||
|
$content = '<h2>Bootsnamen</h2>';
|
||||||
|
$content .= '<p>';
|
||||||
|
$content .= 'Genauso wie bei den Jahrgängen der Segler fehlen uns auch viele Bootsnamen.<br>';
|
||||||
|
$content .= 'Kennst Du ein Boot, dessen Name hier noch nicht hinterlegt ist oder das vielleicht umgetauft wurde, <b>hilf uns bitte</b>, indem Du den Namen einträgst!<br>';
|
||||||
|
$content .= 'Klicke dazu einfach auf das entsprechende Boot und wähle Bootsnamen bearbeiten aus.<br>';
|
||||||
|
$content .= 'Vielen Dank für Deine Unterstützung!';
|
||||||
|
$content .= '</p>';
|
||||||
|
|
||||||
|
$sp['output'] .= $tpl->load('card', [$content]);
|
||||||
|
|
||||||
|
// List
|
||||||
|
$content = '<p id="p-count" class="mb-0"></p>';
|
||||||
|
$content .= $tpl->load('input', ['html-id' => 'input-search', 'placeholder' => 'Suche', 'type' => 'text', 'css-class' => 'mt-2']);
|
||||||
|
$content .= '<div id="div-list" class="normal-list mb-0"></div>';
|
||||||
|
|
||||||
|
$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-boatname', '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-boat', 'title' => 'Boots-Details', 'height' => 200]);
|
||||||
|
|
||||||
|
$sp['scripts'] .= $scripts->load('pagination', ['pageChange', 'page', 'pageCount', 'pagination']);
|
||||||
|
$sp['scripts'] .= $scripts->load('boats');
|
||||||
|
|
||||||
|
?>
|
||||||
65
server/content/calc.php
Normal file
65
server/content/calc.php
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
$sp['title'] = 'RLP Rechner - Regatten.net ' . $_CLASS['name'];
|
||||||
|
$sp['backbutton'] = 'index';
|
||||||
|
$sp['activenav'] = 5;
|
||||||
|
|
||||||
|
// Title
|
||||||
|
$content = "<h1>RLP Rechner</h1>";
|
||||||
|
$content .= '<p>Einfach Ranglistenpunkte berechnen</p>';
|
||||||
|
|
||||||
|
$sp['output'] .= $tpl->load('card', [$content]);
|
||||||
|
|
||||||
|
// Inputs
|
||||||
|
$content = $tpl->load('input', ['html-id' => 'input-rlf', 'placeholder' => 'Ranglistenfaktor (rlf)', 'type' => 'number']);
|
||||||
|
$content .= $tpl->load('input', ['html-id' => 'input-m', 'placeholder' => 'Multiplikator (m)', 'type' => 'number']);
|
||||||
|
$content .= $tpl->load('input', ['html-id' => 'input-fb', 'placeholder' => 'Gezeitete Boote (fb)', 'type' => 'number']);
|
||||||
|
$content .= $tpl->load('input', ['html-id' => 'input-pl', 'placeholder' => 'Platzierung (pl)', 'type' => 'number']);
|
||||||
|
$content .= $tpl->load('button', ['Hinzufügen', '#', 'html-id' => 'button-add']);
|
||||||
|
|
||||||
|
$sp['output'] .= $tpl->load('card', [$content]);
|
||||||
|
|
||||||
|
// Table
|
||||||
|
$thead = '<tr><th>RLF</th><th>m</th><th>fb</th><th>pl</th><th>RLP</th><th></th></tr>';
|
||||||
|
$content = $tpl->load('table', [$thead, 'html-id' => 'table-races']);
|
||||||
|
$content .= '<p id="p-result"></p>';
|
||||||
|
|
||||||
|
$sp['output'] .= $tpl->load('card', [$content, 'html-id' => 'card-races']);
|
||||||
|
|
||||||
|
// Infos
|
||||||
|
$content = '<h2>Hinweise zum Ausfüllen</h2>';
|
||||||
|
$content .= '<p><b>Ranglistenfaktor (RLF)</b><br>';
|
||||||
|
$content .= 'Der Ranglistenfaktor ist ein von der KV vorgegebener Faktor zwischen 1,0 und 1,6 zur Gewichtung der Regatten.<br>';
|
||||||
|
$content .= 'Du findest ihn in der <a href="' . LINK_PRE . 'regattas">Regatten-Liste</a>.';
|
||||||
|
$content .= '</p>';
|
||||||
|
$content .= '<p><b>Multiplikator (m)</b><br>';
|
||||||
|
$content .= 'Der Multiplikator gibt an, wie oft eine Regatta in die Wertung eingeht.<br>';
|
||||||
|
$content .= 'Er ist abhängig von den tatsächlich gesegelten Wettfahrten. Dabei gilt:<br>';
|
||||||
|
$content .= '<b>1</b> Wettfahrt => <b>m = 1</b><br>';
|
||||||
|
$content .= '<b>2</b> Wettfahrten => <b>m = 2</b><br>';
|
||||||
|
$content .= '<b>3</b> Wettfahrten => <b>m = 3</b><br>';
|
||||||
|
$content .= '<b>4 oder mehr</b> Wettfahrten => <b>m = 4</b><br>';
|
||||||
|
$content .= 'Ist die Regatta für mehr als 2 Tage ausgeschrieben, gilt außerdem:<br>';
|
||||||
|
$content .= '<b>6 oder mehr</b> Wettfahrten => <b>m = 5</b>';
|
||||||
|
$content .= '</p>';
|
||||||
|
$content .= '<p><b>Gezeitete Boote (fb)</b><br>';
|
||||||
|
$content .= 'Die Anzahl der Boote, die in mindestens einer Wettfahrt ins Ziel gefahren sind.';
|
||||||
|
$content .= '</p>';
|
||||||
|
$content .= '<p><b>Platzierung (pl)</b><br>';
|
||||||
|
$content .= 'Deine Platzierung in den Endergebnissen';
|
||||||
|
$content .= '</p>';
|
||||||
|
|
||||||
|
$sp['output'] .= $tpl->load('card', [$content]);
|
||||||
|
|
||||||
|
$content = '<h2>Berechnung</h2>';
|
||||||
|
$content .= '<p>Die Ranglistenpunkte (RLP) für eine Regatta berechnen sich nach folgender Formel:<br>';
|
||||||
|
$content .= '<i>RLP = RLF * 100 * ((fb + 1 - pl) / fb)</i><br>';
|
||||||
|
$content .= 'Diese Ranglistenpunkte können je nach Multiplikator bis zu 5 mal in die Wertung eingehen.<br>';
|
||||||
|
$content .= 'Der Mittelwert der 9 besten Wertungen ergibt die Ranglistenpunkte.';
|
||||||
|
$content .= '</p>';
|
||||||
|
|
||||||
|
$sp['output'] .= $tpl->load('card', [$content]);
|
||||||
|
|
||||||
|
$sp['scripts'] .= $scripts->load('calc');
|
||||||
|
|
||||||
|
?>
|
||||||
29
server/content/clubs.php
Normal file
29
server/content/clubs.php
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
$sp['title'] = 'Vereine - Regatten.net ' . $_CLASS['name'];
|
||||||
|
$sp['backbutton'] = 'index';
|
||||||
|
$sp['activenav'] = 4;
|
||||||
|
|
||||||
|
// Title
|
||||||
|
$content = "<h1>Vereine</h1>";
|
||||||
|
|
||||||
|
$sp['output'] .= $tpl->load('card', [$content]);
|
||||||
|
|
||||||
|
// List
|
||||||
|
$content = '<p id="p-count" class="mb-0"></p>';
|
||||||
|
$content .= $tpl->load('input', ['html-id' => 'input-search', 'placeholder' => 'Suche', 'type' => 'text', 'css-class' => 'mt-2']);
|
||||||
|
$content .= '<div id="div-list" class="normal-list mb-0"></div>';
|
||||||
|
|
||||||
|
$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', ['Vereins-Website', '', 'html-id' => 'menu-item-clubwebsite', 'icon' => 'fa-globe', 'css-class' => 'border-0']);
|
||||||
|
$sp['menus'] .= $tpl->load('menu/bottom', [$items, 'html-id' => 'menu-club', 'title' => 'Vereins-Details', 'height' => 160]);
|
||||||
|
|
||||||
|
$sp['scripts'] .= $scripts->load('pagination', ['pageChange', 'page', 'pageCount', 'pagination']);
|
||||||
|
$sp['scripts'] .= $scripts->load('clubs');
|
||||||
|
|
||||||
|
?>
|
||||||
19
server/content/contact.php
Normal file
19
server/content/contact.php
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
// TODO: Create site
|
||||||
|
|
||||||
|
$sp['title'] = 'Seite noch nicht unterstuuml;tzt - Regatten.net ' . $_CLASS['name'];
|
||||||
|
$sp['backbutton'] = true;
|
||||||
|
|
||||||
|
$content = $tpl->load('error', ['404', 'Seite existiert noch nicht']);
|
||||||
|
$content .= '<p>';
|
||||||
|
$content .= 'Die gesuchte Seite ist leider noch nicht verfügbar.<br>';
|
||||||
|
$content .= 'Wir arbeiten daran, sie schnellstmöglich zur Verfügung zu stellen.<br>';
|
||||||
|
$content .= 'Wie wäre es mit der Homepage?';
|
||||||
|
$content .= '</p>';
|
||||||
|
$content .= $tpl->load('button', ['Zur Startseite', LINK_PRE . 'index', 'css-class' => 'mb-3']);
|
||||||
|
$content .= $tpl->load('button', ['Kontakt', LINK_PRE . 'contact']);
|
||||||
|
|
||||||
|
$sp['output'] = $tpl->load('card', [$content, 'css-class' => 'text-center pt-3']);
|
||||||
|
|
||||||
|
?>
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
$sp['title'] = 'Startseite - Regatten.net Pirat';
|
$sp['title'] = 'Startseite - Regatten.net ' . $_CLASS['name'];
|
||||||
$sp['activenav'] = 1;
|
$sp['activenav'] = 1;
|
||||||
|
|
||||||
// Title
|
// Title
|
||||||
@@ -22,8 +22,7 @@
|
|||||||
|
|
||||||
// Planning next
|
// Planning next
|
||||||
$content = '<h2>Deine nächsten Regatten</h2>';
|
$content = '<h2>Deine nächsten Regatten</h2>';
|
||||||
$thead = '<tr><th>Datum</th><th>Regatta</th><th>Informationen</th><th>RLF</th><th>Segler</th></tr>';
|
$content .= '<div id="div-yournext" class="regattas-list mb-0"></div>';
|
||||||
$content .= $tpl->load('table', [$thead, 'html-id' => 'table-yournext', 'css-class' => 'mb-0 mt-3']);
|
|
||||||
$content .= '<p id="p-yournext" class="mt-3">';
|
$content .= '<p id="p-yournext" class="mt-3">';
|
||||||
$content .= 'Du fährst in den nächsten vier Wochen auf keine Regatta!';
|
$content .= 'Du fährst in den nächsten vier Wochen auf keine Regatta!';
|
||||||
$content .= '</p>';
|
$content .= '</p>';
|
||||||
@@ -41,8 +40,7 @@
|
|||||||
|
|
||||||
// Next
|
// Next
|
||||||
$content = '<h2>Nächste Regatten</h2>';
|
$content = '<h2>Nächste Regatten</h2>';
|
||||||
$thead = '<tr><th>Datum</th><th>Regatta</th><th>Informationen</th><th>RLF</th></tr>';
|
$content .= '<div id="div-next" class="regattas-list mb-0"></div>';
|
||||||
$content .= $tpl->load('table', [$thead, 'html-id' => 'table-next', 'css-class' => 'mb-0 mt-3']);
|
|
||||||
$content .= '<p id="p-next" class="mt-3">';
|
$content .= '<p id="p-next" class="mt-3">';
|
||||||
$content .= 'Keine Regatten in den nächsten zwei Wochen!';
|
$content .= 'Keine Regatten in den nächsten zwei Wochen!';
|
||||||
$content .= '</p>';
|
$content .= '</p>';
|
||||||
@@ -51,8 +49,7 @@
|
|||||||
|
|
||||||
// Last
|
// Last
|
||||||
$content = '<h2>Letzte Regatten</h2>';
|
$content = '<h2>Letzte Regatten</h2>';
|
||||||
$thead = '<tr><th>Datum</th><th>Regatta</th><th>Ergebnisse</th><th>RLF</th></tr>';
|
$content .= '<div id="div-last" class="regattas-list mb-0"></div>';
|
||||||
$content .= $tpl->load('table', [$thead, 'html-id' => 'table-last', 'css-class' => 'mb-0 mt-3']);
|
|
||||||
$content .= '<p id="p-last" class="mt-3">';
|
$content .= '<p id="p-last" class="mt-3">';
|
||||||
$content .= 'Keine Regatten in den letzten zwei Wochen!';
|
$content .= 'Keine Regatten in den letzten zwei Wochen!';
|
||||||
$content .= '</p>';
|
$content .= '</p>';
|
||||||
@@ -63,14 +60,26 @@
|
|||||||
$content = '<h2>Regatta-Kalender</h2>';
|
$content = '<h2>Regatta-Kalender</h2>';
|
||||||
$content .= '<p>Du willst alle Regatta-Termine in deinem Kalender, aber nicht alles abtippen?<br>Kein Problem! Abonniere einfach unseren ics-Kalender.</p>';
|
$content .= '<p>Du willst alle Regatta-Termine in deinem Kalender, aber nicht alles abtippen?<br>Kein Problem! Abonniere einfach unseren ics-Kalender.</p>';
|
||||||
$content .= '<p><b>Nur die Regatten, zu denen Du gehst?</b><br>Auch kein Problem! ';
|
$content .= '<p><b>Nur die Regatten, zu denen Du gehst?</b><br>Auch kein Problem! ';
|
||||||
$content .= '<span class="show-loggedin">Erstelle einfach eine <a href="' . LINK_PRE . 'planning">Saison-Planung</a> und abonniere Deinen persönlichen Kalender.</span>';
|
$content .= '<font class="show-loggedin">Erstelle einfach eine <a href="' . LINK_PRE . 'planning">Saison-Planung</a> und abonniere Deinen persönlichen Kalender.</font>';
|
||||||
$content .= '<span class="show-notloggedin"><a href="#" data-menu="menu-signup">Registriere Dich einfach kostenlos</a>, erstelle eine Saison-Planung und wir erstellen Dir einen persönlichen Kalender.</span>';
|
$content .= '<font class="show-notloggedin"><a href="#" data-menu="menu-signup">Registriere Dich einfach kostenlos</a>, erstelle eine Saison-Planung und wir erstellen Dir einen persönlichen Kalender.</font>';
|
||||||
$content .= '</p>';
|
$content .= '</p>';
|
||||||
$content .= $tpl->load('button', ['<i class="fas fa-calendar-alt"></i> Regatta-Kalender', 'https://regatten.net/client/calendar/' . BOATCLASS . '/everything.ics', 'css-class' => 'mb-2']);
|
$content .= $tpl->load('button', ['<i class="fas fa-calendar-alt"></i> Regatta-Kalender', 'https://regatten.net/client/calendar/' . BOATCLASS . '/everything.ics', 'css-class' => 'mb-2']);
|
||||||
$content .= $tpl->load('button', ['<i class="fas fa-calendar-alt"></i> Kalender für <span class="replace-username"></span>', 'https://regatten.net/client/calendar/' . BOATCLASS . '/user_%USERID%.ics', 'css-class' => 'show-loggedin replace-userid-href']);
|
$content .= $tpl->load('button', ['<i class="fas fa-calendar-alt"></i> Kalender für <font class="replace-username"></font>', 'https://regatten.net/client/calendar/' . BOATCLASS . '/user_%USERID%.ics', 'css-class' => 'show-loggedin replace-userid-href']);
|
||||||
|
|
||||||
$sp['output'] .= $tpl->load('card', [$content]);
|
$sp['output'] .= $tpl->load('card', [$content]);
|
||||||
|
|
||||||
$sp['scripts'] = $scripts->load('index');
|
// Regattas Menu
|
||||||
|
$items = '<p id="menu-item-yourplanning" class="mb-2 mt-1" style="line-height: 1.5em;"></p>';
|
||||||
|
$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');
|
||||||
|
|
||||||
?>
|
?>
|
||||||
19
server/content/news.php
Normal file
19
server/content/news.php
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
// TODO: Create site
|
||||||
|
|
||||||
|
$sp['title'] = 'Seite noch nicht unterstuuml;tzt - Regatten.net ' . $_CLASS['name'];
|
||||||
|
$sp['backbutton'] = true;
|
||||||
|
|
||||||
|
$content = $tpl->load('error', ['404', 'Seite existiert noch nicht']);
|
||||||
|
$content .= '<p>';
|
||||||
|
$content .= 'Die gesuchte Seite ist leider noch nicht verfügbar.<br>';
|
||||||
|
$content .= 'Wir arbeiten daran, sie schnellstmöglich zur Verfügung zu stellen.<br>';
|
||||||
|
$content .= 'Wie wäre es mit der Homepage?';
|
||||||
|
$content .= '</p>';
|
||||||
|
$content .= $tpl->load('button', ['Zur Startseite', LINK_PRE . 'index', 'css-class' => 'mb-3']);
|
||||||
|
$content .= $tpl->load('button', ['Kontakt', LINK_PRE . 'contact']);
|
||||||
|
|
||||||
|
$sp['output'] = $tpl->load('card', [$content, 'css-class' => 'text-center pt-3']);
|
||||||
|
|
||||||
|
?>
|
||||||
19
server/content/planning.php
Normal file
19
server/content/planning.php
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
// TODO: Create site
|
||||||
|
|
||||||
|
$sp['title'] = 'Seite noch nicht unterstuuml;tzt - Regatten.net ' . $_CLASS['name'];
|
||||||
|
$sp['backbutton'] = true;
|
||||||
|
|
||||||
|
$content = $tpl->load('error', ['404', 'Seite existiert noch nicht']);
|
||||||
|
$content .= '<p>';
|
||||||
|
$content .= 'Die gesuchte Seite ist leider noch nicht verfügbar.<br>';
|
||||||
|
$content .= 'Wir arbeiten daran, sie schnellstmöglich zur Verfügung zu stellen.<br>';
|
||||||
|
$content .= 'Wie wäre es mit der Homepage?';
|
||||||
|
$content .= '</p>';
|
||||||
|
$content .= $tpl->load('button', ['Zur Startseite', LINK_PRE . 'index', 'css-class' => 'mb-3']);
|
||||||
|
$content .= $tpl->load('button', ['Kontakt', LINK_PRE . 'contact']);
|
||||||
|
|
||||||
|
$sp['output'] = $tpl->load('card', [$content, 'css-class' => 'text-center pt-3']);
|
||||||
|
|
||||||
|
?>
|
||||||
19
server/content/planning_edit.php
Normal file
19
server/content/planning_edit.php
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
// TODO: Create site
|
||||||
|
|
||||||
|
$sp['title'] = 'Seite noch nicht unterstuuml;tzt - Regatten.net ' . $_CLASS['name'];
|
||||||
|
$sp['backbutton'] = true;
|
||||||
|
|
||||||
|
$content = $tpl->load('error', ['404', 'Seite existiert noch nicht']);
|
||||||
|
$content .= '<p>';
|
||||||
|
$content .= 'Die gesuchte Seite ist leider noch nicht verfügbar.<br>';
|
||||||
|
$content .= 'Wir arbeiten daran, sie schnellstmöglich zur Verfügung zu stellen.<br>';
|
||||||
|
$content .= 'Wie wäre es mit der Homepage?';
|
||||||
|
$content .= '</p>';
|
||||||
|
$content .= $tpl->load('button', ['Zur Startseite', LINK_PRE . 'index', 'css-class' => 'mb-3']);
|
||||||
|
$content .= $tpl->load('button', ['Kontakt', LINK_PRE . 'contact']);
|
||||||
|
|
||||||
|
$sp['output'] = $tpl->load('card', [$content, 'css-class' => 'text-center pt-3']);
|
||||||
|
|
||||||
|
?>
|
||||||
19
server/content/planning_list.php
Normal file
19
server/content/planning_list.php
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
// TODO: Create site
|
||||||
|
|
||||||
|
$sp['title'] = 'Seite noch nicht unterstuuml;tzt - Regatten.net ' . $_CLASS['name'];
|
||||||
|
$sp['backbutton'] = true;
|
||||||
|
|
||||||
|
$content = $tpl->load('error', ['404', 'Seite existiert noch nicht']);
|
||||||
|
$content .= '<p>';
|
||||||
|
$content .= 'Die gesuchte Seite ist leider noch nicht verfügbar.<br>';
|
||||||
|
$content .= 'Wir arbeiten daran, sie schnellstmöglich zur Verfügung zu stellen.<br>';
|
||||||
|
$content .= 'Wie wäre es mit der Homepage?';
|
||||||
|
$content .= '</p>';
|
||||||
|
$content .= $tpl->load('button', ['Zur Startseite', LINK_PRE . 'index', 'css-class' => 'mb-3']);
|
||||||
|
$content .= $tpl->load('button', ['Kontakt', LINK_PRE . 'contact']);
|
||||||
|
|
||||||
|
$sp['output'] = $tpl->load('card', [$content, 'css-class' => 'text-center pt-3']);
|
||||||
|
|
||||||
|
?>
|
||||||
19
server/content/planning_view.php
Normal file
19
server/content/planning_view.php
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
// TODO: Create site
|
||||||
|
|
||||||
|
$sp['title'] = 'Seite noch nicht unterstuuml;tzt - Regatten.net ' . $_CLASS['name'];
|
||||||
|
$sp['backbutton'] = true;
|
||||||
|
|
||||||
|
$content = $tpl->load('error', ['404', 'Seite existiert noch nicht']);
|
||||||
|
$content .= '<p>';
|
||||||
|
$content .= 'Die gesuchte Seite ist leider noch nicht verfügbar.<br>';
|
||||||
|
$content .= 'Wir arbeiten daran, sie schnellstmöglich zur Verfügung zu stellen.<br>';
|
||||||
|
$content .= 'Wie wäre es mit der Homepage?';
|
||||||
|
$content .= '</p>';
|
||||||
|
$content .= $tpl->load('button', ['Zur Startseite', LINK_PRE . 'index', 'css-class' => 'mb-3']);
|
||||||
|
$content .= $tpl->load('button', ['Kontakt', LINK_PRE . 'contact']);
|
||||||
|
|
||||||
|
$sp['output'] = $tpl->load('card', [$content, 'css-class' => 'text-center pt-3']);
|
||||||
|
|
||||||
|
?>
|
||||||
46
server/content/rank.php
Normal file
46
server/content/rank.php
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
$sp['title'] = 'Ranglisten - Regatten.net ' . $_CLASS['name'];
|
||||||
|
$sp['backbutton'] = 'index';
|
||||||
|
$sp['activenav'] = 3;
|
||||||
|
|
||||||
|
// Title, Inputs
|
||||||
|
$content = "<h1>Ranglisten</h1>";
|
||||||
|
|
||||||
|
$options = '<option value="year">Jahres-Rangliste</option>';
|
||||||
|
$options .= '<option value="youth">Jugend-Rangliste</option>';
|
||||||
|
$options .= '<option value="idjm">' . $_CLASS['youth-german-name'] . '-Rangliste</option>';
|
||||||
|
$options .= '<option value="user">Benutzerdefiniert</option>';
|
||||||
|
$content .= $tpl->load('select', ['html-id' => 'select-type', 'placeholder' => 'Rangliste', 'options' => $options, 'css-class' => 'mt-3 mb-0']);
|
||||||
|
$content .= $tpl->load('select', ['html-id' => 'select-year', 'placeholder' => 'Jahr', 'css-class' => 'mt-3 mb-0']);
|
||||||
|
$content .= $tpl->load('input', ['html-id' => 'input-from', 'placeholder' => 'Von', 'type' => 'date', 'css-class' => 'mt-3']);
|
||||||
|
$content .= $tpl->load('input', ['html-id' => 'input-to', 'placeholder' => 'Bis', 'type' => 'date']);
|
||||||
|
$chbox = $tpl->load('checkbox', ['html-id' => 'input-jugend', 'placeholder' => 'Jugend']);
|
||||||
|
$content .= '<div class="mb-3" style="display:inline-block; width:50%;">' . $chbox . '</div>';
|
||||||
|
$chbox = $tpl->load('checkbox', ['html-id' => 'input-jugstrict', 'placeholder' => 'Streng']);
|
||||||
|
$content .= '<div class="mb-3" style="display:inline-block; width:50%;">' . $chbox . '</div>';
|
||||||
|
$content .= $tpl->load('button', ['Anzeigen', '#', 'html-id' => 'button-show']);
|
||||||
|
|
||||||
|
$sp['output'] .= $tpl->load('card', [$content]);
|
||||||
|
|
||||||
|
// No Results
|
||||||
|
$content = '<h2 class="color-white">ACHTUNG</h2>';
|
||||||
|
$content .= '<p class="color-white">Zu folgenden Regatten wurden noch keine Ergebnisse hinterlegt:</p>';
|
||||||
|
$content .= '<ul id="ul-noresults"></ul>';
|
||||||
|
|
||||||
|
$sp['output'] .= $tpl->load('card', [$content, 'html-id' => 'card-noresults', 'css-class' => 'bg-red2-dark']);
|
||||||
|
|
||||||
|
// Ranking
|
||||||
|
$content = $tpl->load('input', ['html-id' => 'input-search', 'placeholder' => 'Suche', 'type' => 'text']);
|
||||||
|
$content .= '<div id="div-rank" class="ranking-list mb-0"></div>';
|
||||||
|
|
||||||
|
$sp['output'] .= $tpl->load('card', [$content, 'html-id' => 'card-rank']);
|
||||||
|
|
||||||
|
// Menu
|
||||||
|
$items = '<p id="menu-item-text" class="mb-2 mt-1" style="line-height: 1.5em;"></p>';
|
||||||
|
$items .= '<div id="div-details" class="ranking-detail-list mb-3" style="line-height: 2em;"></div>';
|
||||||
|
$sp['menus'] .= $tpl->load('menu/bottom', [$items, 'html-id' => 'menu-rank', 'title' => 'Ranglisten-Details', 'height' => 500]);
|
||||||
|
|
||||||
|
$sp['scripts'] .= $scripts->load('rank');
|
||||||
|
|
||||||
|
?>
|
||||||
31
server/content/regatta_plan.php
Normal file
31
server/content/regatta_plan.php
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
$sp['title'] = 'Saison-Planung - Regatten.net ' . $_CLASS['name'];
|
||||||
|
$sp['backbutton'] = 'regattas';
|
||||||
|
$sp['activenav'] = 2;
|
||||||
|
|
||||||
|
// Title, Inputs
|
||||||
|
$content = '<h1 id="h1-title"></h1>';
|
||||||
|
$content .= '<p id="p-title"></p>';
|
||||||
|
|
||||||
|
$sp['output'] .= $tpl->load('card', [$content]);
|
||||||
|
|
||||||
|
// Plannings
|
||||||
|
$content = '<p id="p-info" class="mb-0"></p>';
|
||||||
|
$thead = '<tr><th>Benutzer</th><th>Steuermann/-frau</th><th>Crew</th></tr>';
|
||||||
|
$content .= $tpl->load('table', [$thead, 'html-id' => 'table-plannings', 'css-class' => 'mb-0 text-nowrap']);
|
||||||
|
|
||||||
|
$sp['output'] .= $tpl->load('card', [$content, 'html-id' => 'card-plannings']);
|
||||||
|
|
||||||
|
// Info
|
||||||
|
$content = '<p>Du planst, hier hinzufahren, aber stehst nicht auf dieser Liste?<br>';
|
||||||
|
$content .= 'Das kannst Du ändern! ';
|
||||||
|
$content .= '<font class="show-loggedin">Erstelle einfach <a href="' . LINK_PRE . 'planning">hier</a> Deine eigene Saison-Planung.</font>';
|
||||||
|
$content .= '<font class="show-notloggedin"><a href="#" data-menu="menu-login">Melde Dich an</a> oder <a href="#" data-menu="menu-signup">registriere Dich kostenlos</a> und erstelle Deine eigene Saison-Planung.</font>';
|
||||||
|
$content .= '</p>';
|
||||||
|
|
||||||
|
$sp['output'] .= $tpl->load('card', [$content]);
|
||||||
|
|
||||||
|
$sp['scripts'] .= $scripts->load('regatta_plan');
|
||||||
|
|
||||||
|
?>
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
$sp['title'] = 'Regatten - Regatten.net Pirat';
|
$sp['title'] = 'Regatten - Regatten.net ' . $_CLASS['name'];
|
||||||
$sp['backbutton'] = 'index';
|
$sp['backbutton'] = 'index';
|
||||||
$sp['activenav'] = 2;
|
$sp['activenav'] = 2;
|
||||||
|
|
||||||
@@ -22,7 +22,9 @@
|
|||||||
$sp['output'] .= $tpl->load('card', [$content, 'html-id' => 'card-regattas']);
|
$sp['output'] .= $tpl->load('card', [$content, 'html-id' => 'card-regattas']);
|
||||||
|
|
||||||
// Menu
|
// Menu
|
||||||
$items = $tpl->load('menu/item-icon', ['Ergebnisse', '', 'html-id' => 'menu-item-results', 'icon' => 'fa-poll']);
|
$items = '<p id="menu-item-yourplanning" class="mb-2 mt-1" style="line-height: 1.5em;"></p>';
|
||||||
|
$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', ['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', ['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-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']);
|
$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['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');
|
$sp['scripts'] .= $scripts->load('regattas');
|
||||||
|
|
||||||
?>
|
?>
|
||||||
21
server/content/result.php
Normal file
21
server/content/result.php
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
$sp['title'] = 'Ergebnisse - Regatten.net ' . $_CLASS['name'];
|
||||||
|
$sp['backbutton'] = true;
|
||||||
|
$sp['activenav'] = 2;
|
||||||
|
|
||||||
|
// Title, Inputs
|
||||||
|
$content = '<h1 id="h1-title"></h1>';
|
||||||
|
$content .= '<p id="p-title"></p>';
|
||||||
|
|
||||||
|
$sp['output'] .= $tpl->load('card', [$content]);
|
||||||
|
|
||||||
|
// Results
|
||||||
|
$content = '<p id="p-info" class="mb-0"></p>';
|
||||||
|
$content .= $tpl->load('table', ['html-id' => 'table-results', 'css-class' => 'mb-0 text-nowrap']);
|
||||||
|
|
||||||
|
$sp['output'] .= $tpl->load('card', [$content, 'html-id' => 'card-results']);
|
||||||
|
|
||||||
|
$sp['scripts'] .= $scripts->load('result');
|
||||||
|
|
||||||
|
?>
|
||||||
41
server/content/sailors.php
Normal file
41
server/content/sailors.php
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
$sp['title'] = 'Segler - Regatten.net ' . $_CLASS['name'];
|
||||||
|
$sp['backbutton'] = 'index';
|
||||||
|
$sp['activenav'] = 4;
|
||||||
|
|
||||||
|
// Title
|
||||||
|
$content = "<h1>Segler</h1>";
|
||||||
|
|
||||||
|
$sp['output'] .= $tpl->load('card', [$content]);
|
||||||
|
|
||||||
|
// Info Years
|
||||||
|
$content = '<h2>Jahrgänge</h2>';
|
||||||
|
$content .= '<p>';
|
||||||
|
$content .= 'Zu vielen Seglern fehlen uns leider noch die Jahrgänge. Diese benötigen wir jedoch, um die Ranglisten vernünftig zu erstellen.<br>';
|
||||||
|
$content .= 'Solltest Du jemanden kennen, dessen Jahrgang hier in der Liste noch nicht hinterlegt ist oder der womöglich falsch ist, <b>hilf uns bitte</b>, indem Du diesen einträgst!<br>';
|
||||||
|
$content .= 'Klicke dazu einfach auf den entsprechenden Segler und wähle Jahrgang bearbeiten aus.<br>';
|
||||||
|
$content .= 'Vielen Dank für Deine Unterstützung!';
|
||||||
|
$content .= '</p>';
|
||||||
|
|
||||||
|
$sp['output'] .= $tpl->load('card', [$content]);
|
||||||
|
|
||||||
|
// List
|
||||||
|
$content = '<p id="p-count" class="mb-0"></p>';
|
||||||
|
$content .= $tpl->load('input', ['html-id' => 'input-search', 'placeholder' => 'Suche', 'type' => 'text', 'css-class' => 'mt-2']);
|
||||||
|
$content .= '<div id="div-list" class="normal-list mb-0"></div>';
|
||||||
|
|
||||||
|
$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-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['scripts'] .= $scripts->load('pagination', ['pageChange', 'page', 'pageCount', 'pagination']);
|
||||||
|
$sp['scripts'] .= $scripts->load('sailors');
|
||||||
|
|
||||||
|
?>
|
||||||
19
server/content/trim_boat.php
Normal file
19
server/content/trim_boat.php
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
// TODO: Create site
|
||||||
|
|
||||||
|
$sp['title'] = 'Seite noch nicht unterstuuml;tzt - Regatten.net ' . $_CLASS['name'];
|
||||||
|
$sp['backbutton'] = true;
|
||||||
|
|
||||||
|
$content = $tpl->load('error', ['404', 'Seite existiert noch nicht']);
|
||||||
|
$content .= '<p>';
|
||||||
|
$content .= 'Die gesuchte Seite ist leider noch nicht verfügbar.<br>';
|
||||||
|
$content .= 'Wir arbeiten daran, sie schnellstmöglich zur Verfügung zu stellen.<br>';
|
||||||
|
$content .= 'Wie wäre es mit der Homepage?';
|
||||||
|
$content .= '</p>';
|
||||||
|
$content .= $tpl->load('button', ['Zur Startseite', LINK_PRE . 'index', 'css-class' => 'mb-3']);
|
||||||
|
$content .= $tpl->load('button', ['Kontakt', LINK_PRE . 'contact']);
|
||||||
|
|
||||||
|
$sp['output'] = $tpl->load('card', [$content, 'css-class' => 'text-center pt-3']);
|
||||||
|
|
||||||
|
?>
|
||||||
19
server/content/trim_boat_edit.php
Normal file
19
server/content/trim_boat_edit.php
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
// TODO: Create site
|
||||||
|
|
||||||
|
$sp['title'] = 'Seite noch nicht unterstuuml;tzt - Regatten.net ' . $_CLASS['name'];
|
||||||
|
$sp['backbutton'] = true;
|
||||||
|
|
||||||
|
$content = $tpl->load('error', ['404', 'Seite existiert noch nicht']);
|
||||||
|
$content .= '<p>';
|
||||||
|
$content .= 'Die gesuchte Seite ist leider noch nicht verfügbar.<br>';
|
||||||
|
$content .= 'Wir arbeiten daran, sie schnellstmöglich zur Verfügung zu stellen.<br>';
|
||||||
|
$content .= 'Wie wäre es mit der Homepage?';
|
||||||
|
$content .= '</p>';
|
||||||
|
$content .= $tpl->load('button', ['Zur Startseite', LINK_PRE . 'index', 'css-class' => 'mb-3']);
|
||||||
|
$content .= $tpl->load('button', ['Kontakt', LINK_PRE . 'contact']);
|
||||||
|
|
||||||
|
$sp['output'] = $tpl->load('card', [$content, 'css-class' => 'text-center pt-3']);
|
||||||
|
|
||||||
|
?>
|
||||||
19
server/content/trim_list.php
Normal file
19
server/content/trim_list.php
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
// TODO: Create site
|
||||||
|
|
||||||
|
$sp['title'] = 'Seite noch nicht unterstuuml;tzt - Regatten.net ' . $_CLASS['name'];
|
||||||
|
$sp['backbutton'] = true;
|
||||||
|
|
||||||
|
$content = $tpl->load('error', ['404', 'Seite existiert noch nicht']);
|
||||||
|
$content .= '<p>';
|
||||||
|
$content .= 'Die gesuchte Seite ist leider noch nicht verfügbar.<br>';
|
||||||
|
$content .= 'Wir arbeiten daran, sie schnellstmöglich zur Verfügung zu stellen.<br>';
|
||||||
|
$content .= 'Wie wäre es mit der Homepage?';
|
||||||
|
$content .= '</p>';
|
||||||
|
$content .= $tpl->load('button', ['Zur Startseite', LINK_PRE . 'index', 'css-class' => 'mb-3']);
|
||||||
|
$content .= $tpl->load('button', ['Kontakt', LINK_PRE . 'contact']);
|
||||||
|
|
||||||
|
$sp['output'] = $tpl->load('card', [$content, 'css-class' => 'text-center pt-3']);
|
||||||
|
|
||||||
|
?>
|
||||||
19
server/content/trim_trim_add.php
Normal file
19
server/content/trim_trim_add.php
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
// TODO: Create site
|
||||||
|
|
||||||
|
$sp['title'] = 'Seite noch nicht unterstuuml;tzt - Regatten.net ' . $_CLASS['name'];
|
||||||
|
$sp['backbutton'] = true;
|
||||||
|
|
||||||
|
$content = $tpl->load('error', ['404', 'Seite existiert noch nicht']);
|
||||||
|
$content .= '<p>';
|
||||||
|
$content .= 'Die gesuchte Seite ist leider noch nicht verfügbar.<br>';
|
||||||
|
$content .= 'Wir arbeiten daran, sie schnellstmöglich zur Verfügung zu stellen.<br>';
|
||||||
|
$content .= 'Wie wäre es mit der Homepage?';
|
||||||
|
$content .= '</p>';
|
||||||
|
$content .= $tpl->load('button', ['Zur Startseite', LINK_PRE . 'index', 'css-class' => 'mb-3']);
|
||||||
|
$content .= $tpl->load('button', ['Kontakt', LINK_PRE . 'contact']);
|
||||||
|
|
||||||
|
$sp['output'] = $tpl->load('card', [$content, 'css-class' => 'text-center pt-3']);
|
||||||
|
|
||||||
|
?>
|
||||||
19
server/content/trim_trim_edit.php
Normal file
19
server/content/trim_trim_edit.php
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
// TODO: Create site
|
||||||
|
|
||||||
|
$sp['title'] = 'Seite noch nicht unterstuuml;tzt - Regatten.net ' . $_CLASS['name'];
|
||||||
|
$sp['backbutton'] = true;
|
||||||
|
|
||||||
|
$content = $tpl->load('error', ['404', 'Seite existiert noch nicht']);
|
||||||
|
$content .= '<p>';
|
||||||
|
$content .= 'Die gesuchte Seite ist leider noch nicht verfügbar.<br>';
|
||||||
|
$content .= 'Wir arbeiten daran, sie schnellstmöglich zur Verfügung zu stellen.<br>';
|
||||||
|
$content .= 'Wie wäre es mit der Homepage?';
|
||||||
|
$content .= '</p>';
|
||||||
|
$content .= $tpl->load('button', ['Zur Startseite', LINK_PRE . 'index', 'css-class' => 'mb-3']);
|
||||||
|
$content .= $tpl->load('button', ['Kontakt', LINK_PRE . 'contact']);
|
||||||
|
|
||||||
|
$sp['output'] = $tpl->load('card', [$content, 'css-class' => 'text-center pt-3']);
|
||||||
|
|
||||||
|
?>
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
<!-- Install Prompt for Android -->
|
<!-- Install Prompt for Android -->
|
||||||
<div id="menu-install-pwa-android" class="menu menu-box-bottom menu-box-detached rounded-l"
|
<div id="menu-install-pwa-android" class="menu menu-box-bottom menu-box-detached rounded-l"
|
||||||
data-menu-height="350"
|
data-menu-height="400"
|
||||||
data-menu-effect="menu-parallax">
|
data-menu-effect="menu-parallax">
|
||||||
<div class="boxed-text-l mt-4">
|
<div class="boxed-text-l mt-4">
|
||||||
<img class="rounded-l mb-3" src="<?php echo SERVER_ADDR; ?>/client/app/icons/icon-128x128.png" alt="img" width="90">
|
<img class="rounded-l mb-3" src="<?php echo SERVER_ADDR; ?>/client/app/icons/icon-128x128.png" alt="img" width="90">
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
<!-- Install instructions for iOS -->
|
<!-- Install instructions for iOS -->
|
||||||
<div id="menu-install-pwa-ios"
|
<div id="menu-install-pwa-ios"
|
||||||
class="menu menu-box-bottom menu-box-detached rounded-l"
|
class="menu menu-box-bottom menu-box-detached rounded-l"
|
||||||
data-menu-height="320"
|
data-menu-height="360"
|
||||||
data-menu-effect="menu-parallax">
|
data-menu-effect="menu-parallax">
|
||||||
<div class="boxed-text-xl mt-4">
|
<div class="boxed-text-xl mt-4">
|
||||||
<img class="rounded-l mb-3" src="<?php echo SERVER_ADDR; ?>/client/app/icons/icon-128x128.png" alt="img" width="90">
|
<img class="rounded-l mb-3" src="<?php echo SERVER_ADDR; ?>/client/app/icons/icon-128x128.png" alt="img" width="90">
|
||||||
@@ -26,7 +26,6 @@
|
|||||||
Installiere Regatten.net auf Deinem Startbildschirm und greife wie bei einer normalen App darauf zu. Öffne Dein Safari-Menü und tippe auf "Zum Startbildschirm hinzufügen".
|
Installiere Regatten.net auf Deinem Startbildschirm und greife wie bei einer normalen App darauf zu. Öffne Dein Safari-Menü und tippe auf "Zum Startbildschirm hinzufügen".
|
||||||
</p>
|
</p>
|
||||||
<div class="clear"></div>
|
<div class="clear"></div>
|
||||||
<a href="#" class="pwa-dismiss close-menu color-highlight uppercase ultrabold opacity-80 top-25">Vielleicht später</a>
|
<a href="#" class="pwa-dismiss close-menu color-highlight text-uppercase font-900 opacity-60 font-10">Vielleicht später</a>
|
||||||
<i class="fa-ios-arrow fa fa-caret-down font-40"></i>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -130,7 +130,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="menu-developer" class="menu menu-box-bottom menu-box-detached rounded-m" data-menu-height="310">
|
<div id="menu-developer" class="menu menu-box-bottom menu-box-detached rounded-m" data-menu-height="310">
|
||||||
<div class="menu-title"><h1>Entwickler-Optionen</h1><p class="color-highlight"> </p><a href="#" class="close-menu"><i class="fa fa-times"></i></a></div>
|
<div class="menu-title"><h1>Entwickler-Optionen</h1><p class="color-highlight">Version <?php echo PWA_VERSION; ?></p><a href="#" class="close-menu"><i class="fa fa-times"></i></a></div>
|
||||||
<div class="divider divider-margins mb-n2"></div>
|
<div class="divider divider-margins mb-n2"></div>
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<div class="list-group list-custom-small">
|
<div class="list-group list-custom-small">
|
||||||
@@ -139,7 +139,7 @@
|
|||||||
<span>Infos zur BETA</span>
|
<span>Infos zur BETA</span>
|
||||||
<i class="fa fa-angle-right"></i>
|
<i class="fa fa-angle-right"></i>
|
||||||
</a>
|
</a>
|
||||||
<a href="javascript:resetDb();">
|
<a href="javascript:resetDb(false);">
|
||||||
<i class="fa font-14 fa-database rounded-s bg-highlight color-white"></i>
|
<i class="fa font-14 fa-database rounded-s bg-highlight color-white"></i>
|
||||||
<span>Reset Database</span>
|
<span>Reset Database</span>
|
||||||
<i class="fa fa-angle-right"></i>
|
<i class="fa fa-angle-right"></i>
|
||||||
@@ -187,6 +187,25 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div id="menu-welcome" class="menu menu-box-bottom" style="height: 70vh">
|
||||||
|
<div class="content bottom-0">
|
||||||
|
<h1 class="text-center font-900">Willkommen</h1>
|
||||||
|
<p>
|
||||||
|
Diese App befindet sich zur Zeit noch in der Entwicklungs-Phase.<br>
|
||||||
|
Dadurch kann es vorkommen, dass bestimmte Funktionen noch nicht richtig funktionieren.<br>
|
||||||
|
Wenn Dir etwas ungewöhnlich vorkommt, melde uns dies bitte. Klicke dazu auf das Entwickler-Icon oben links und wähle "Problem melden".<br>
|
||||||
|
Vielen Dank für Deine Unterstützung!
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
Mehr Informationen findest <a href="https://info.ostertun.net/regatten/beta">hier</a>.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
Mit der Nutzung dieser App erklärst Du Dich außerdem damit einverstanden, dass wir Cookies einsetzen.
|
||||||
|
</p>
|
||||||
|
<a id="menu-welcome-a-okay" class="btn btn-m mt-2 mb-3 btn-full bg-green2-dark text-uppercase font-900" href="#">Alles klar</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div id="menu-update">
|
<div id="menu-update">
|
||||||
<div class="content bottom-0">
|
<div class="content bottom-0">
|
||||||
<p class="text-center mt-5"><i class="fa fa-sync-alt fa-7x color-highlight fa-spin"></i></p>
|
<p class="text-center mt-5"><i class="fa fa-sync-alt fa-7x color-highlight fa-spin"></i></p>
|
||||||
|
|||||||
149
server/scripts/boats.js
Normal file
149
server/scripts/boats.js
Normal file
@@ -0,0 +1,149 @@
|
|||||||
|
var firstCall = true;
|
||||||
|
var rows = [];
|
||||||
|
var displayed = [];
|
||||||
|
var page = 1;
|
||||||
|
var pageCount = 0;
|
||||||
|
const showCount = 25;
|
||||||
|
|
||||||
|
async function onListClicked(id) {
|
||||||
|
var boat = await dbGetData('boats', id);
|
||||||
|
|
||||||
|
$('#menu-boat').find('.menu-title').find('p').text(boat.sailnumber);
|
||||||
|
|
||||||
|
// Edit Boatname
|
||||||
|
// TODO: create menu for edit boatname
|
||||||
|
if (boat['name'] == '') {
|
||||||
|
$('#menu-item-boatname').find('span').text('Bootsnamen hinzufügen');
|
||||||
|
} else {
|
||||||
|
$('#menu-item-boatname').find('span').text('Bootsnamen bearbeiten');
|
||||||
|
}
|
||||||
|
|
||||||
|
// club website
|
||||||
|
var clubwebsite = '';
|
||||||
|
if (boat['club'] != null) {
|
||||||
|
clubwebsite = (await dbGetData('clubs', boat['club'])).website;
|
||||||
|
}
|
||||||
|
if (clubwebsite != '') {
|
||||||
|
$('#menu-item-clubwebsite').show();
|
||||||
|
$('#menu-item-clubwebsite').attr('href', clubwebsite);
|
||||||
|
$('#menu-item-clubwebsite').attr('target', '_blank');
|
||||||
|
} else {
|
||||||
|
$('#menu-item-clubwebsite').hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
$('#menu-boat').showMenu();
|
||||||
|
$('#menu-boat').scrollTop(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
function pageChange() {
|
||||||
|
$('#p-count')[0].scrollIntoView({ behavior: "smooth" });
|
||||||
|
drawList();
|
||||||
|
}
|
||||||
|
|
||||||
|
async function drawList() {
|
||||||
|
window.setTimeout(function () {
|
||||||
|
var list = '';
|
||||||
|
|
||||||
|
if (displayed.length > 0) {
|
||||||
|
var offset = (page - 1) * showCount;
|
||||||
|
var count = (page == pageCount ? (displayed.length % showCount) : showCount);
|
||||||
|
if (count == 0) count = showCount;
|
||||||
|
|
||||||
|
for (i = 0; i < count; i ++) {
|
||||||
|
list += displayed[i + offset];
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
list = '<div><div>Keine Ergebnisse, die der Suche entsprechen</div></div>';
|
||||||
|
}
|
||||||
|
|
||||||
|
$('#div-list').html(list);
|
||||||
|
}, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
async function reSearch() {
|
||||||
|
window.setTimeout(function () {
|
||||||
|
displayed = [];
|
||||||
|
rows.forEach(function (entry) {
|
||||||
|
if (search($('#input-search').val(), entry.keywords)) {
|
||||||
|
displayed.push(entry.content);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
pageCount = Math.ceil(displayed.length / showCount);
|
||||||
|
if ((page < 1) || (page > pageCount)) {
|
||||||
|
if (page < 1) {
|
||||||
|
page = 1;
|
||||||
|
} else {
|
||||||
|
page = pageCount;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
drawPagination();
|
||||||
|
drawList();
|
||||||
|
}, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
var siteScript = async function() {
|
||||||
|
if (firstCall) {
|
||||||
|
firstCall = false;
|
||||||
|
initPagination();
|
||||||
|
$('#input-search').on('input', reSearch);
|
||||||
|
}
|
||||||
|
|
||||||
|
var results = await dbGetData('boats');
|
||||||
|
|
||||||
|
var count = results.length;
|
||||||
|
if (count > 0) {
|
||||||
|
if (count == 1) {
|
||||||
|
$('#p-count').html('Es wurde 1 Boot gefunden!');
|
||||||
|
} else {
|
||||||
|
$('#p-count').html('Es wurden ' + count + ' Boote gefunden!');
|
||||||
|
}
|
||||||
|
$('#div-list').show();
|
||||||
|
$('#input-search').parent().show();
|
||||||
|
|
||||||
|
results.sort(function (a, b) {
|
||||||
|
return a.sailnumber.localeCompare(b.sailnumber);
|
||||||
|
});
|
||||||
|
|
||||||
|
rows = [];
|
||||||
|
|
||||||
|
for (id in results) {
|
||||||
|
var entry = results[id];
|
||||||
|
var club = null;
|
||||||
|
if (entry['club'] != null)
|
||||||
|
club = await dbGetData('clubs', entry['club']);
|
||||||
|
|
||||||
|
var row = { keywords: [], content: '' };
|
||||||
|
row.keywords.push(entry['sailnumber']);
|
||||||
|
if (entry['name'] != '') row.keywords.push(entry['name']);
|
||||||
|
if (club != null) row.keywords.push(club['kurz'], club['name']);
|
||||||
|
|
||||||
|
row.content += '<div onclick="onListClicked(' + entry['id'] + ');">';
|
||||||
|
|
||||||
|
// ZEILE 1
|
||||||
|
// Sailnumber
|
||||||
|
row.content += '<div><b>' + entry['sailnumber'] + '</b></div>';
|
||||||
|
|
||||||
|
// ZEILE 2
|
||||||
|
row.content += '<div>';
|
||||||
|
|
||||||
|
// Name
|
||||||
|
row.content += '<div>' + entry['name'] + '</div>';
|
||||||
|
|
||||||
|
// Club
|
||||||
|
row.content += '<div>' + ((club != null) ? club['kurz'] : '') + '</div>';
|
||||||
|
|
||||||
|
row.content += '</div></div>';
|
||||||
|
|
||||||
|
rows.push(row);
|
||||||
|
}
|
||||||
|
|
||||||
|
reSearch();
|
||||||
|
|
||||||
|
} else {
|
||||||
|
$('#p-count').html('Keine Boote gefunden!');
|
||||||
|
$('#div-list').hide();
|
||||||
|
$('#input-search').parent().hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
hideLoader();
|
||||||
|
}
|
||||||
92
server/scripts/calc.js
Normal file
92
server/scripts/calc.js
Normal file
@@ -0,0 +1,92 @@
|
|||||||
|
var races = [];
|
||||||
|
var firstCall = true;
|
||||||
|
|
||||||
|
function reCalc() {
|
||||||
|
setTimeout(function(){
|
||||||
|
if (races.length > 0) {
|
||||||
|
$('#card-races').show();
|
||||||
|
$('#p-result').text('Berechne...');
|
||||||
|
var rlps = [];
|
||||||
|
var tbody = '';
|
||||||
|
for (var i = 0; i < races.length; i ++) {
|
||||||
|
tbody += '<tr>';
|
||||||
|
tbody += '<td>' + races[i].rlf + '</td>';
|
||||||
|
tbody += '<td>' + races[i].m + '</td>';
|
||||||
|
tbody += '<td>' + races[i].fb + '</td>';
|
||||||
|
tbody += '<td>' + races[i].pl + '</td>';
|
||||||
|
tbody += '<td>' + races[i].rlp.toFixed(3) + '</td>';
|
||||||
|
tbody += '<td><a href="#" onclick="removeRace(' + i + ')" class="btn rounded-s text-uppercase font-900 shadow-m bg-highlight"><i class="fas fa-times"></i></a></td>';
|
||||||
|
tbody += '</tr>';
|
||||||
|
for (var j = 0; j < races[i].m; j ++) {
|
||||||
|
rlps.push(races[i].rlp);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$('#table-races').find('tbody').html(tbody);
|
||||||
|
rlps.sort(function (a,b) {
|
||||||
|
return b-a;
|
||||||
|
});
|
||||||
|
var sum = 0;
|
||||||
|
var cnt = Math.min(rlps.length, 9);
|
||||||
|
for (var i = 0; i < cnt; i ++) {
|
||||||
|
sum += rlps[i];
|
||||||
|
}
|
||||||
|
$('#p-result').html('<b>' + (sum / cnt).toFixed(3) + '</b> Punkte aus <b>' + cnt + '</b> Wertungen.');
|
||||||
|
} else {
|
||||||
|
$('#card-races').hide();
|
||||||
|
}
|
||||||
|
}, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
function addRace() {
|
||||||
|
var rlf = parseFloat($('#input-rlf').val().replace(',', '.'));
|
||||||
|
var m = parseFloat($('#input-m').val());
|
||||||
|
var fb = parseFloat($('#input-fb').val());
|
||||||
|
var pl = parseFloat($('#input-pl').val().replace(',', '.'));
|
||||||
|
|
||||||
|
if (isNaN(rlf) || (rlf < 1) || (rlf > 1.6)) {
|
||||||
|
toastError('RLF ungültig');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (isNaN(m) || (m < 1) || (m > 5)) {
|
||||||
|
toastError('m ungültig');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (isNaN(fb) || (fb < 1)) {
|
||||||
|
toastError('fb ungültig');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (isNaN(pl) || (pl < 1) || (pl > (fb + 1))) {
|
||||||
|
toastError('pl ungültig');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var race = {
|
||||||
|
rlf: rlf,
|
||||||
|
m: m,
|
||||||
|
fb: fb,
|
||||||
|
pl: pl,
|
||||||
|
rlp: (100 * rlf * ((fb + 1 - pl) / fb))
|
||||||
|
};
|
||||||
|
|
||||||
|
$('#input-rlf').val('');
|
||||||
|
$('#input-m').val('');
|
||||||
|
$('#input-fb').val('');
|
||||||
|
$('#input-pl').val('');
|
||||||
|
|
||||||
|
races.push(race);
|
||||||
|
reCalc();
|
||||||
|
}
|
||||||
|
|
||||||
|
function removeRace(id) {
|
||||||
|
if ((id >= 0) && (id < races.length)) races.splice(id, 1);
|
||||||
|
reCalc();
|
||||||
|
}
|
||||||
|
|
||||||
|
var siteScript = async function () {
|
||||||
|
if (firstCall) {
|
||||||
|
firstCall = false;
|
||||||
|
$('#button-add').click(addRace);
|
||||||
|
}
|
||||||
|
reCalc();
|
||||||
|
hideLoader();
|
||||||
|
}
|
||||||
136
server/scripts/clubs.js
Normal file
136
server/scripts/clubs.js
Normal file
@@ -0,0 +1,136 @@
|
|||||||
|
var firstCall = true;
|
||||||
|
var rows = [];
|
||||||
|
var displayed = [];
|
||||||
|
var page = 1;
|
||||||
|
var pageCount = 0;
|
||||||
|
const showCount = 25;
|
||||||
|
|
||||||
|
async function onListClicked(id) {
|
||||||
|
var club = await dbGetData('clubs', id);
|
||||||
|
|
||||||
|
$('#menu-club').find('.menu-title').find('p').text(club.name);
|
||||||
|
|
||||||
|
// club website
|
||||||
|
if (club.website != '') {
|
||||||
|
$('#menu-item-clubwebsite').show();
|
||||||
|
$('#menu-item-clubwebsite').attr('href', club.website);
|
||||||
|
$('#menu-item-clubwebsite').attr('target', '_blank');
|
||||||
|
} else {
|
||||||
|
$('#menu-item-clubwebsite').hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
$('#menu-club').showMenu();
|
||||||
|
$('#menu-club').scrollTop(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
function pageChange() {
|
||||||
|
$('#p-count')[0].scrollIntoView({ behavior: "smooth" });
|
||||||
|
drawList();
|
||||||
|
}
|
||||||
|
|
||||||
|
async function drawList() {
|
||||||
|
window.setTimeout(function () {
|
||||||
|
var list = '';
|
||||||
|
|
||||||
|
if (displayed.length > 0) {
|
||||||
|
var offset = (page - 1) * showCount;
|
||||||
|
var count = (page == pageCount ? (displayed.length % showCount) : showCount);
|
||||||
|
if (count == 0) count = showCount;
|
||||||
|
|
||||||
|
for (i = 0; i < count; i ++) {
|
||||||
|
list += displayed[i + offset];
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
list = '<div><div>Keine Ergebnisse, die der Suche entsprechen</div></div>';
|
||||||
|
}
|
||||||
|
|
||||||
|
$('#div-list').html(list);
|
||||||
|
}, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
async function reSearch() {
|
||||||
|
window.setTimeout(function () {
|
||||||
|
displayed = [];
|
||||||
|
rows.forEach(function (entry) {
|
||||||
|
if (search($('#input-search').val(), entry.keywords)) {
|
||||||
|
displayed.push(entry.content);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
pageCount = Math.ceil(displayed.length / showCount);
|
||||||
|
if ((page < 1) || (page > pageCount)) {
|
||||||
|
if (page < 1) {
|
||||||
|
page = 1;
|
||||||
|
} else {
|
||||||
|
page = pageCount;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
drawPagination();
|
||||||
|
drawList();
|
||||||
|
}, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
var siteScript = async function() {
|
||||||
|
if (firstCall) {
|
||||||
|
firstCall = false;
|
||||||
|
initPagination();
|
||||||
|
$('#input-search').on('input', reSearch);
|
||||||
|
}
|
||||||
|
|
||||||
|
var results = await dbGetData('clubs');
|
||||||
|
|
||||||
|
var count = results.length;
|
||||||
|
if (count > 0) {
|
||||||
|
if (count == 1) {
|
||||||
|
$('#p-count').html('Es wurde 1 Verein gefunden!');
|
||||||
|
} else {
|
||||||
|
$('#p-count').html('Es wurden ' + count + ' Vereine gefunden!');
|
||||||
|
}
|
||||||
|
$('#div-list').show();
|
||||||
|
$('#input-search').parent().show();
|
||||||
|
|
||||||
|
results.sort(function (a, b) {
|
||||||
|
var comp = a.kurz.localeCompare(b.kurz);
|
||||||
|
if (comp == 0)
|
||||||
|
comp = a.name.localeCompare(b.name);
|
||||||
|
return comp;
|
||||||
|
});
|
||||||
|
|
||||||
|
rows = [];
|
||||||
|
|
||||||
|
for (id in results) {
|
||||||
|
var entry = results[id];
|
||||||
|
|
||||||
|
var row = { keywords: [], content: '' };
|
||||||
|
row.keywords.push(entry['dsv'], entry['kurz'], entry['name']);
|
||||||
|
if (entry['website'] != '') row.keywords.push(entry['website']);
|
||||||
|
|
||||||
|
row.content += '<div onclick="onListClicked(' + entry['id'] + ');">';
|
||||||
|
|
||||||
|
// ZEILE 1
|
||||||
|
// Name
|
||||||
|
row.content += '<div><b>' + entry['name'] + '</b></div>';
|
||||||
|
|
||||||
|
// ZEILE 2
|
||||||
|
row.content += '<div>';
|
||||||
|
|
||||||
|
// DSV
|
||||||
|
row.content += '<div>' + entry['dsv'] + '</div>';
|
||||||
|
|
||||||
|
// Kurz
|
||||||
|
row.content += '<div>' + entry['kurz'] + '</div>';
|
||||||
|
|
||||||
|
row.content += '</div></div>';
|
||||||
|
|
||||||
|
rows.push(row);
|
||||||
|
}
|
||||||
|
|
||||||
|
reSearch();
|
||||||
|
|
||||||
|
} else {
|
||||||
|
$('#p-count').html('Keine Vereine gefunden!');
|
||||||
|
$('#div-list').hide();
|
||||||
|
$('#input-search').parent().hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
hideLoader();
|
||||||
|
}
|
||||||
@@ -1,9 +1,12 @@
|
|||||||
|
var today;
|
||||||
|
|
||||||
var siteScript = async function() {
|
var siteScript = async function() {
|
||||||
|
today = getToday();
|
||||||
|
|
||||||
if (isLoggedIn()) {
|
if (isLoggedIn()) {
|
||||||
$('#card-notloggedin').hide();
|
$('#card-notloggedin').hide();
|
||||||
|
|
||||||
var user = await dbGetData('users', localStorage.getItem('auth_user'));
|
var user = await dbGetData('users', localStorage.getItem('auth_user'));
|
||||||
var today = getToday();
|
|
||||||
|
|
||||||
// Favorites
|
// Favorites
|
||||||
var watched = [];
|
var watched = [];
|
||||||
@@ -16,14 +19,23 @@ var siteScript = async function() {
|
|||||||
if (watched.length > 0) {
|
if (watched.length > 0) {
|
||||||
var year = (new Date()).getFullYear();
|
var year = (new Date()).getFullYear();
|
||||||
$('#th-ranking').html('Rangliste ' + year);
|
$('#th-ranking').html('Rangliste ' + year);
|
||||||
// TODO: get ranking
|
var ranking = (await dbGetRanking(parseDate('01.12.' + (year - 1)), parseDate('30.11.' + year), false, false))[0];
|
||||||
tbody = '';
|
tbody = '';
|
||||||
for (i in watched) {
|
for (i in watched) {
|
||||||
sailor = watched[i];
|
sailor = watched[i];
|
||||||
tbody += '<tr><td>' + sailor.name + '</td><td>';
|
tbody += '<tr><td>' + sailor.name + '</td><td>';
|
||||||
// TODO: check if ranking and output
|
var rank = null;
|
||||||
//tbody += '<i>nicht in der Rangliste</i>';
|
for (r in ranking) {
|
||||||
tbody += '<i>Ranglisten werden aktuell noch nicht unterstützt</i>';
|
if (ranking[r].id == sailor.id) {
|
||||||
|
rank = ranking[r].rank;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (rank == null) {
|
||||||
|
tbody += '<i>nicht in der Rangliste</i>';
|
||||||
|
} else {
|
||||||
|
tbody += '<b>' + rank + '.</b> Platz';
|
||||||
|
}
|
||||||
tbody += '</td></tr>';
|
tbody += '</td></tr>';
|
||||||
}
|
}
|
||||||
$('#table-favorites').find('tbody').html(tbody);
|
$('#table-favorites').find('tbody').html(tbody);
|
||||||
@@ -59,100 +71,88 @@ var siteScript = async function() {
|
|||||||
return 0;
|
return 0;
|
||||||
});
|
});
|
||||||
if (plannings.length > 0) {
|
if (plannings.length > 0) {
|
||||||
tbody = '';
|
list = '';
|
||||||
for (i in plannings) {
|
for (i in plannings) {
|
||||||
var planning = plannings[i];
|
var planning = plannings[i];
|
||||||
var regatta = planning.regatta;
|
var regatta = planning.regatta;
|
||||||
|
|
||||||
|
if (regatta['length'] < 1) continue;
|
||||||
|
|
||||||
var club = null;
|
var club = null;
|
||||||
if (regatta['club'] != null)
|
if (regatta['club'] != null)
|
||||||
club = await dbGetData('clubs', regatta['club']);
|
club = await dbGetData('clubs', regatta['club']);
|
||||||
var dateFrom = regatta['dateFrom'];
|
var dateFrom = regatta['dateFrom'];
|
||||||
var dateTo = regatta['dateTo'];
|
var dateTo = regatta['dateTo'];
|
||||||
// TODO: get steuermann and crew
|
|
||||||
var steuermann = '<i>noch unklar</i>';
|
|
||||||
if (planning.steuermann !== null) {
|
|
||||||
steuermann = (await dbGetData('sailors', planning.steuermann)).name;
|
|
||||||
}
|
|
||||||
var crew = [];
|
|
||||||
if (planning.crew !== '') {
|
|
||||||
crewIds = planning.crew.split(',');
|
|
||||||
for (j in crewIds) {
|
|
||||||
crew.push((await dbGetData('sailors', crewIds[j])).name);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// output
|
// output
|
||||||
tbody += '<tr>';
|
|
||||||
|
|
||||||
tbody += '<td><span style="white-space:nowrap;">' + formatDate("j. M 'y", dateFrom) + '<br>' + formatDate("j. M 'y", dateTo) + '</span></td>';
|
list += '<div onclick="onRegattaClicked(' + regatta['id'] + ');">';
|
||||||
|
|
||||||
var content = '';
|
// ZEILE 1
|
||||||
if (club != null) {
|
// Name
|
||||||
content = club['kurz'];
|
list += '<div><b>' + (regatta['canceled'] == 1 ? '<s>' : '') + regatta['name'] + (regatta['canceled'] == 1 ? '</s>' : '') + '</b></div>';
|
||||||
if (club['website'] != '') {
|
|
||||||
content = '<a href="' + club['website'] + '" target="_blank">' + content + '</a>';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
tbody += '<td>' + content + '<br>' + (regatta['canceled'] == 1 ? '<s>' : '') + regatta['name'] + (regatta['canceled'] == 1 ? '</s>' : '') + '</td>';
|
|
||||||
|
|
||||||
var buf = '';
|
// ZEILE 2
|
||||||
if (regatta['info'] != '') {
|
list += '<div>';
|
||||||
buf += '<a target="_blank" href="' + regatta['info'] + '">Informationen</a>';
|
|
||||||
}
|
|
||||||
if ((regatta['meldung'] != '') && (dateTo >= today)) {
|
|
||||||
buf += '<br><a target="_blank" href="' + regatta['meldung'] + '">Meldung</a>';
|
|
||||||
|
|
||||||
if ((planning != null) && (planning['gemeldet'] == "1")) {
|
// Number
|
||||||
buf += ' <i>(du hast gemeldet)</i>';
|
list += '<div>' + ((regatta['number'] != null) ? ('# ' + regatta['number']) : '') + '</div>';
|
||||||
} else if (regatta['meldungOffen'] == "0") {
|
|
||||||
buf += ' <i>(geschlossen)</i>';
|
// Club
|
||||||
} else if (regatta['meldungSchluss'] != null) {
|
list += '<div>' + ((club != null) ? club['kurz'] : '') + '</div>';
|
||||||
early = false;
|
|
||||||
|
// Special
|
||||||
|
list += '<div>' + regatta['special'] + '</div>';
|
||||||
|
|
||||||
|
// Icons
|
||||||
|
var icons = [];
|
||||||
|
if (regatta['info'] != '')
|
||||||
|
icons.push('<i class="fas fa-info"></i>');
|
||||||
|
if ((regatta['meldung'] != '') && (dateTo >= today) && (regatta['meldungOffen'] == '1')) {
|
||||||
|
var color = '';
|
||||||
|
if (regatta['meldungSchluss'] != null) {
|
||||||
|
if (planning['gemeldet'] == '0') {
|
||||||
|
var ms = 0;
|
||||||
if (regatta['meldungEarly'] != null) {
|
if (regatta['meldungEarly'] != null) {
|
||||||
ms = parseDate(regatta['meldungEarly']);
|
ms = parseDate(regatta['meldungEarly']);
|
||||||
if (ms >= today) {
|
|
||||||
early = true;
|
|
||||||
}
|
}
|
||||||
}
|
if (ms < today) {
|
||||||
if (!early)
|
|
||||||
ms = parseDate(regatta['meldungSchluss']);
|
ms = parseDate(regatta['meldungSchluss']);
|
||||||
if (ms >= today) {
|
|
||||||
diff = Math.round((ms - today) / 86400000);
|
|
||||||
red = (diff < 7);
|
|
||||||
if (diff <= 14) {
|
|
||||||
txt = 'noch ' + diff + ' Tag' + (diff != 1 ? 'e' : '');
|
|
||||||
} else if (diff < 35) {
|
|
||||||
diff = Math.floor(diff / 7);
|
|
||||||
txt = 'noch ' + diff + ' Woche' + (diff != 1 ? 'n' : '');
|
|
||||||
} else {
|
|
||||||
diff = Math.floor(diff / 30.5);
|
|
||||||
txt = 'noch ' + diff + ' Monat' + (diff != 1 ? 'e' : '');
|
|
||||||
}
|
}
|
||||||
buf += ' <i>' + (red ? '<b><font style="color:red;">(' : '(') + txt + (early ? ' vergünstigt' : '') + (red ? ')</font></b>' : ')') + '</i>';
|
var diff = Math.round((ms - today) / 86400000);
|
||||||
} else {
|
if ((ms >= today) && (diff < 7)) {
|
||||||
buf += ' <i>(Meldeschluss abgelaufen)</i>';
|
color = ' color-red2-dark';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (regatta['bericht'] != '') {
|
if (planning['gemeldet'] == '0') {
|
||||||
buf += '<br><a target="_blank" href="' + regatta['bericht'] + '">Bericht</a>';
|
color += ' fa-blink';
|
||||||
}
|
}
|
||||||
if (regatta['oresults'] != '') {
|
icons.push('<i class="fas fa-file-signature' + color + '"></i>');
|
||||||
buf += '<br><a target="_blank" href="' + regatta['oresults'] + '">off. Ergebnisse</a>';
|
|
||||||
}
|
}
|
||||||
tbody += '<td>' + buf + '</td>';
|
if (regatta['canceled'] == '1') {
|
||||||
|
icons.push('<i class="fas fa-times color-red2-dark"></i>');
|
||||||
|
}
|
||||||
|
list += '<div class="color-green2-dark">' + icons.join(' ') + '</div>';
|
||||||
|
|
||||||
tbody += '<td><span style="white-space:nowrap;">' + parseFloat(regatta['rlf']).toFixed(2) + '</span></td>';
|
list += '</div>';
|
||||||
|
|
||||||
tbody += '<td>' + steuermann + '<br>' + crew.join('<br>') + '</td>';
|
// ZEILE 3
|
||||||
|
list += '<div>';
|
||||||
|
|
||||||
tbody += '</tr>';
|
// Date
|
||||||
|
list += '<div>' + formatDate("d.m.Y", dateFrom) + ' - ' + formatDate("d.m.Y", dateTo) + '</div>';
|
||||||
|
|
||||||
|
// RLF
|
||||||
|
list += '<div>' + parseFloat(regatta['rlf']).toFixed(2) + '</div>';
|
||||||
|
|
||||||
|
list += '</div></div>';
|
||||||
}
|
}
|
||||||
$('#table-yournext').find('tbody').html(tbody);
|
$('#div-yournext').html(list);
|
||||||
$('#p-yournext').hide();
|
$('#p-yournext').hide();
|
||||||
$('#table_yournext').show();
|
$('#div-yournext').show();
|
||||||
} else {
|
} else {
|
||||||
$('#table-yournext').hide();
|
$('#div-yournext').hide();
|
||||||
$('#p-yournext').show();
|
$('#p-yournext').show();
|
||||||
}
|
}
|
||||||
$('#card-yournext').show();
|
$('#card-yournext').show();
|
||||||
@@ -169,9 +169,12 @@ var siteScript = async function() {
|
|||||||
maxDate.setDate(maxDate.getDate() + 14);
|
maxDate.setDate(maxDate.getDate() + 14);
|
||||||
var regattas = await dbGetRegattasRange(minDate, maxDate);
|
var regattas = await dbGetRegattasRange(minDate, maxDate);
|
||||||
if (regattas.length > 0) {
|
if (regattas.length > 0) {
|
||||||
tbody = '';
|
list = '';
|
||||||
for (i in regattas) {
|
for (i in regattas) {
|
||||||
var regatta = regattas[i];
|
var regatta = regattas[i];
|
||||||
|
|
||||||
|
if (regatta['length'] < 1) continue;
|
||||||
|
|
||||||
var club = null;
|
var club = null;
|
||||||
if (regatta['club'] != null)
|
if (regatta['club'] != null)
|
||||||
club = await dbGetData('clubs', regatta['club']);
|
club = await dbGetData('clubs', regatta['club']);
|
||||||
@@ -180,27 +183,33 @@ var siteScript = async function() {
|
|||||||
var dateTo = regatta['dateTo'];
|
var dateTo = regatta['dateTo'];
|
||||||
|
|
||||||
// output
|
// output
|
||||||
tbody += '<tr>';
|
list += '<div onclick="onRegattaClicked(' + regatta['id'] + ');">';
|
||||||
|
|
||||||
tbody += '<td><span style="white-space:nowrap;">' + formatDate("j. M 'y", dateFrom) + '<br>' + formatDate("j. M 'y", dateTo) + '</span></td>';
|
// ZEILE 1
|
||||||
|
// Name
|
||||||
|
list += '<div><b>' + (regatta['canceled'] == 1 ? '<s>' : '') + regatta['name'] + (regatta['canceled'] == 1 ? '</s>' : '') + '</b></div>';
|
||||||
|
|
||||||
var content = '';
|
// ZEILE 2
|
||||||
if (club != null) {
|
list += '<div>';
|
||||||
content = club['kurz'];
|
|
||||||
if (club['website'] != '') {
|
|
||||||
content = '<a href="' + club['website'] + '" target="_blank">' + content + '</a>';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
tbody += '<td>' + content + '<br>' + (regatta['canceled'] == 1 ? '<s>' : '') + regatta['name'] + (regatta['canceled'] == 1 ? '</s>' : '') + '</td>';
|
|
||||||
|
|
||||||
var buf = '';
|
// Number
|
||||||
if (regatta['info'] != '') {
|
list += '<div>' + ((regatta['number'] != null) ? ('# ' + regatta['number']) : '') + '</div>';
|
||||||
buf += '<a target="_blank" href="' + regatta['info'] + '">Informationen</a>';
|
|
||||||
}
|
// Club
|
||||||
if ((regatta['meldung'] != '') && (dateTo >= today)) {
|
list += '<div>' + ((club != null) ? club['kurz'] : '') + '</div>';
|
||||||
buf += '<br><a target="_blank" href="' + regatta['meldung'] + '">Meldung</a>';
|
|
||||||
|
// Special
|
||||||
|
list += '<div>' + regatta['special'] + '</div>';
|
||||||
|
|
||||||
|
// Icons
|
||||||
|
var icons = [];
|
||||||
|
if (regatta['info'] != '')
|
||||||
|
icons.push('<i class="fas fa-info"></i>');
|
||||||
|
if ((regatta['meldung'] != '') && (dateTo >= today) && (regatta['meldungOffen'] == '1')) {
|
||||||
|
var color = '';
|
||||||
var planning = null;
|
var planning = null;
|
||||||
if (isLoggedIn()) {
|
if (isLoggedIn()) {
|
||||||
|
var plannings = await dbGetDataIndex('plannings', 'regatta', regatta['id']);
|
||||||
for (id in plannings) {
|
for (id in plannings) {
|
||||||
if (plannings[id]['user'] == USER_ID) {
|
if (plannings[id]['user'] == USER_ID) {
|
||||||
planning = plannings[id];
|
planning = plannings[id];
|
||||||
@@ -208,56 +217,49 @@ var siteScript = async function() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (regatta['meldungSchluss'] != null) {
|
||||||
if ((planning != null) && (planning['gemeldet'] == "1")) {
|
if ((planning == null) || (planning['gemeldet'] == '0')) {
|
||||||
buf += ' <i>(du hast gemeldet)</i>';
|
var ms = 0;
|
||||||
} else if (regatta['meldungOffen'] == "0") {
|
|
||||||
buf += ' <i>(geschlossen)</i>';
|
|
||||||
} else if (regatta['meldungSchluss'] != null) {
|
|
||||||
early = false;
|
|
||||||
if (regatta['meldungEarly'] != null) {
|
if (regatta['meldungEarly'] != null) {
|
||||||
ms = parseDate(regatta['meldungEarly']);
|
ms = parseDate(regatta['meldungEarly']);
|
||||||
if (ms >= today) {
|
|
||||||
early = true;
|
|
||||||
}
|
}
|
||||||
}
|
if (ms < today) {
|
||||||
if (!early)
|
|
||||||
ms = parseDate(regatta['meldungSchluss']);
|
ms = parseDate(regatta['meldungSchluss']);
|
||||||
if (ms >= today) {
|
|
||||||
diff = Math.round((ms - today) / 86400000);
|
|
||||||
red = (diff < 7);
|
|
||||||
if (diff <= 14) {
|
|
||||||
txt = 'noch ' + diff + ' Tag' + (diff != 1 ? 'e' : '');
|
|
||||||
} else if (diff < 35) {
|
|
||||||
diff = Math.floor(diff / 7);
|
|
||||||
txt = 'noch ' + diff + ' Woche' + (diff != 1 ? 'n' : '');
|
|
||||||
} else {
|
|
||||||
diff = Math.floor(diff / 30.5);
|
|
||||||
txt = 'noch ' + diff + ' Monat' + (diff != 1 ? 'e' : '');
|
|
||||||
}
|
}
|
||||||
buf += ' <i>' + (red ? '<b><font style="color:red;">(' : '(') + txt + (early ? ' vergünstigt' : '') + (red ? ')</font></b>' : ')') + '</i>';
|
var diff = Math.round((ms - today) / 86400000);
|
||||||
} else {
|
if ((ms >= today) && (diff < 7)) {
|
||||||
buf += ' <i>(Meldeschluss abgelaufen)</i>';
|
color = ' color-red2-dark';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (regatta['bericht'] != '') {
|
if ((planning != null) && (planning['gemeldet'] == '0')) {
|
||||||
buf += '<br><a target="_blank" href="' + regatta['bericht'] + '">Bericht</a>';
|
color += ' fa-blink';
|
||||||
}
|
}
|
||||||
if (regatta['oresults'] != '') {
|
icons.push('<i class="fas fa-file-signature' + color + '"></i>');
|
||||||
buf += '<br><a target="_blank" href="' + regatta['oresults'] + '">off. Ergebnisse</a>';
|
|
||||||
}
|
}
|
||||||
tbody += '<td>' + buf + '</td>';
|
if (regatta['canceled'] == '1') {
|
||||||
|
icons.push('<i class="fas fa-times color-red2-dark"></i>');
|
||||||
|
}
|
||||||
|
list += '<div class="color-green2-dark">' + icons.join(' ') + '</div>';
|
||||||
|
|
||||||
tbody += '<td><span style="white-space:nowrap;">' + parseFloat(regatta['rlf']).toFixed(2) + '</span></td>';
|
list += '</div>';
|
||||||
|
|
||||||
tbody += '</tr>';
|
// ZEILE 3
|
||||||
|
list += '<div>';
|
||||||
|
|
||||||
|
// Date
|
||||||
|
list += '<div>' + formatDate("d.m.Y", dateFrom) + ' - ' + formatDate("d.m.Y", dateTo) + '</div>';
|
||||||
|
|
||||||
|
// RLF
|
||||||
|
list += '<div>' + parseFloat(regatta['rlf']).toFixed(2) + '</div>';
|
||||||
|
|
||||||
|
list += '</div></div>';
|
||||||
}
|
}
|
||||||
$('#table-next').find('tbody').html(tbody);
|
$('#div-next').html(list);
|
||||||
$('#p-next').hide();
|
$('#p-next').hide();
|
||||||
$('#table-next').show();
|
$('#div-next').show();
|
||||||
} else {
|
} else {
|
||||||
$('#table-next').hide();
|
$('#div-next').hide();
|
||||||
$('#p-next').show();
|
$('#p-next').show();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -274,9 +276,12 @@ var siteScript = async function() {
|
|||||||
regattaResults[entry['id']] = (results.length > 0);
|
regattaResults[entry['id']] = (results.length > 0);
|
||||||
}
|
}
|
||||||
if (regattas.length > 0) {
|
if (regattas.length > 0) {
|
||||||
tbody = '';
|
list = '';
|
||||||
for (i in regattas) {
|
for (i in regattas) {
|
||||||
var regatta = regattas[i];
|
var regatta = regattas[i];
|
||||||
|
|
||||||
|
if (regatta['length'] < 1) continue;
|
||||||
|
|
||||||
var club = null;
|
var club = null;
|
||||||
if (regatta['club'] != null)
|
if (regatta['club'] != null)
|
||||||
club = await dbGetData('clubs', regatta['club']);
|
club = await dbGetData('clubs', regatta['club']);
|
||||||
@@ -284,40 +289,56 @@ var siteScript = async function() {
|
|||||||
var dateTo = regatta['dateTo'];
|
var dateTo = regatta['dateTo'];
|
||||||
|
|
||||||
// output
|
// output
|
||||||
tbody += '<tr>';
|
|
||||||
|
|
||||||
tbody += '<td><span style="white-space:nowrap;">' + formatDate("j. M 'y", dateFrom) + '<br>' + formatDate("j. M 'y", dateTo) + '</span></td>';
|
list += '<div onclick="onRegattaClicked(' + regatta['id'] + ');">';
|
||||||
|
|
||||||
var content = '';
|
// ZEILE 1
|
||||||
if (club != null) {
|
// Name
|
||||||
content = club['kurz'];
|
list += '<div><b>' + (regatta['canceled'] == 1 ? '<s>' : '') + regatta['name'] + (regatta['canceled'] == 1 ? '</s>' : '') + '</b></div>';
|
||||||
if (club['website'] != '') {
|
|
||||||
content = '<a href="' + club['website'] + '" target="_blank">' + content + '</a>';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
tbody += '<td>' + content + '<br>' + (regatta['canceled'] == 1 ? '<s>' : '') + regatta['name'] + (regatta['canceled'] == 1 ? '</s>' : '') + '</td>';
|
|
||||||
|
|
||||||
var buf = '';
|
// ZEILE 2
|
||||||
if (regatta['canceled'] == "1") {
|
list += '<div>';
|
||||||
buf = '<i style="color:red;" class="fas fa-times"></i> Ausgefallen</td>';
|
|
||||||
} else {
|
|
||||||
if (regattaResults[regatta['id']]) {
|
|
||||||
buf = '<i style="color:green;" class="fas fa-check"></i> <a href="' + LINK_PRE + 'result?regatta=' + regatta['id'] + '">Ergebnisse</a></td>';
|
|
||||||
} else {
|
|
||||||
buf = 'Nicht verfügbar';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
tbody += '<td>' + buf + '</td>';
|
|
||||||
|
|
||||||
tbody += '<td><span style="white-space:nowrap;">' + parseFloat(regatta['rlf']).toFixed(2) + '</span></td>';
|
// Number
|
||||||
|
list += '<div>' + ((regatta['number'] != null) ? ('# ' + regatta['number']) : '') + '</div>';
|
||||||
|
|
||||||
tbody += '</tr>';
|
// Club
|
||||||
|
list += '<div>' + ((club != null) ? club['kurz'] : '') + '</div>';
|
||||||
|
|
||||||
|
// Special
|
||||||
|
list += '<div>' + regatta['special'] + '</div>';
|
||||||
|
|
||||||
|
// Icons
|
||||||
|
var icons = [];
|
||||||
|
if (regatta['info'] != '')
|
||||||
|
icons.push('<i class="fas fa-info"></i>');
|
||||||
|
if (regatta['bericht'] != '')
|
||||||
|
icons.push('<i class="fas fa-book"></i>');
|
||||||
|
if (regatta['canceled'] == '1') {
|
||||||
|
icons.push('<i class="fas fa-times color-red2-dark"></i>');
|
||||||
|
} else if (regattaResults[regatta['id']]) {
|
||||||
|
icons.push('<i class="fas fa-poll"></i>');
|
||||||
}
|
}
|
||||||
$('#table-last').find('tbody').html(tbody);
|
list += '<div class="color-green2-dark">' + icons.join(' ') + '</div>';
|
||||||
|
|
||||||
|
list += '</div>';
|
||||||
|
|
||||||
|
// ZEILE 3
|
||||||
|
list += '<div>';
|
||||||
|
|
||||||
|
// Date
|
||||||
|
list += '<div>' + formatDate("d.m.Y", dateFrom) + ' - ' + formatDate("d.m.Y", dateTo) + '</div>';
|
||||||
|
|
||||||
|
// RLF
|
||||||
|
list += '<div>' + parseFloat(regatta['rlf']).toFixed(2) + '</div>';
|
||||||
|
|
||||||
|
list += '</div></div>';
|
||||||
|
}
|
||||||
|
$('#div-last').html(list);
|
||||||
$('#p-last').hide();
|
$('#p-last').hide();
|
||||||
$('#table-last').show();
|
$('#div-last').show();
|
||||||
} else {
|
} else {
|
||||||
$('#table-last').hide();
|
$('#div-last').hide();
|
||||||
$('#p-last').show();
|
$('#p-last').show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
157
server/scripts/onRegattaClicked.js
Normal file
157
server/scripts/onRegattaClicked.js
Normal file
@@ -0,0 +1,157 @@
|
|||||||
|
async function onRegattaClicked(id) {
|
||||||
|
var regatta = await dbGetData('regattas', id);
|
||||||
|
|
||||||
|
$('#menu-regatta').find('.menu-title').find('p').text(regatta.name);
|
||||||
|
|
||||||
|
var dateTo = parseDate(regatta['date']);
|
||||||
|
dateTo.setDate(dateTo.getDate() + Math.max(parseInt(regatta['length']) - 1, 0));
|
||||||
|
|
||||||
|
var plannings = await dbGetDataIndex('plannings', 'regatta', regatta['id']);
|
||||||
|
var planning = null;
|
||||||
|
if (isLoggedIn()) {
|
||||||
|
for (id in plannings) {
|
||||||
|
if (plannings[id]['user'] == USER_ID) {
|
||||||
|
planning = plannings[id];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Your Planning
|
||||||
|
if (planning != null) {
|
||||||
|
$('#menu-item-yourplanning').show();
|
||||||
|
var steuermann = null;
|
||||||
|
if (planning.steuermann != null) {
|
||||||
|
steuermann = (await dbGetData('sailors', planning.steuermann)).name;
|
||||||
|
}
|
||||||
|
var crew = [steuermann == null ? '[noch unklar]' : steuermann];
|
||||||
|
crewA = planning.crew.split(',');
|
||||||
|
for (i in crewA) {
|
||||||
|
var sailor = await dbGetData('sailors', crewA[i]);
|
||||||
|
if (sailor != null) {
|
||||||
|
crew.push(sailor.name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$('#menu-item-yourplanning').html(crew.join('<br>'));
|
||||||
|
} else {
|
||||||
|
$('#menu-item-yourplanning').hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Planning
|
||||||
|
if ((plannings.length > 0) && (dateTo >= today)) {
|
||||||
|
$('#menu-item-plannings').show();
|
||||||
|
$('#menu-item-plannings').attr('href', LINK_PRE + 'regatta_plan?regatta=' + regatta['id']);
|
||||||
|
} else {
|
||||||
|
$('#menu-item-plannings').hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Results
|
||||||
|
var results = await dbGetDataIndex('results', 'regatta', regatta['id']);
|
||||||
|
if (results.length > 0) {
|
||||||
|
$('#menu-item-results').show();
|
||||||
|
$('#menu-item-results').attr('href', LINK_PRE + 'result?regatta=' + regatta['id']);
|
||||||
|
} else {
|
||||||
|
$('#menu-item-results').hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Bericht
|
||||||
|
if (regatta['bericht'] != '') {
|
||||||
|
$('#menu-item-bericht').show();
|
||||||
|
$('#menu-item-bericht').attr('href', regatta['bericht']);
|
||||||
|
$('#menu-item-bericht').attr('target', '_blank');
|
||||||
|
} else {
|
||||||
|
$('#menu-item-bericht').hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Info
|
||||||
|
if (regatta['info'] != '') {
|
||||||
|
$('#menu-item-info').show();
|
||||||
|
$('#menu-item-info').attr('href', regatta['info']);
|
||||||
|
$('#menu-item-info').attr('target', '_blank');
|
||||||
|
} else {
|
||||||
|
$('#menu-item-info').hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Meldung
|
||||||
|
if ((regatta['meldung'] != '') && (dateTo >= today)) {
|
||||||
|
$('#menu-item-meldung').show();
|
||||||
|
$('#menu-item-meldung').attr('href', regatta['meldung']);
|
||||||
|
$('#menu-item-meldung').attr('target', '_blank');
|
||||||
|
if ((planning != null) && (planning['gemeldet'] == '1')) {
|
||||||
|
$('#badge-regatta-meldung').text('schon gemeldet');
|
||||||
|
$('#badge-regatta-meldung').addClass('bg-green2-dark').removeClass('bg-highlight bg-red2-dark bg-yellow2-dark');
|
||||||
|
} else if (regatta['meldungOffen'] == '0') {
|
||||||
|
$('#badge-regatta-meldung').text('geschlossen');
|
||||||
|
$('#badge-regatta-meldung').addClass('bg-highlight').removeClass('bg-green2-dark bg-red2-dark bg-yellow2-dark');
|
||||||
|
} else if (regatta['meldungSchluss'] != null) {
|
||||||
|
var early = false;
|
||||||
|
var ms;
|
||||||
|
if (regatta['meldungEarly'] != null) {
|
||||||
|
ms = parseDate(regatta['meldungEarly']);
|
||||||
|
if (ms >= today) {
|
||||||
|
early = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!early)
|
||||||
|
ms = parseDate(regatta['meldungSchluss']);
|
||||||
|
if (ms >= today) {
|
||||||
|
var diff = Math.round((ms - today) / 86400000);
|
||||||
|
var red = (diff < 7);
|
||||||
|
var txt;
|
||||||
|
if (diff <= 14) {
|
||||||
|
txt = diff + ' Tag' + (diff != 1 ? 'e' : '');
|
||||||
|
} else if (diff < 35) {
|
||||||
|
diff = Math.floor(diff / 7);
|
||||||
|
txt = diff + ' Woche' + (diff != 1 ? 'n' : '');
|
||||||
|
} else {
|
||||||
|
diff = Math.floor(diff / 30.5);
|
||||||
|
txt = diff + ' Monat' + (diff != 1 ? 'e' : '');
|
||||||
|
}
|
||||||
|
if (early)
|
||||||
|
txt += ' vergünstigt';
|
||||||
|
$('#badge-regatta-meldung').text(txt);
|
||||||
|
if (red) {
|
||||||
|
if (early) {
|
||||||
|
$('#badge-regatta-meldung').addClass('bg-yellow2-dark').removeClass('bg-highlight bg-green2-dark bg-red2-dark');
|
||||||
|
} else {
|
||||||
|
$('#badge-regatta-meldung').addClass('bg-red2-dark').removeClass('bg-highlight bg-green2-dark bg-yellow2-dark');
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$('#badge-regatta-meldung').addClass('bg-highlight').removeClass('bg-green2-dark bg-red2-dark bg-yellow2-dark');
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$('#badge-regatta-meldung').text('Meldeschluss abgelaufen');
|
||||||
|
$('#badge-regatta-meldung').addClass('bg-highlight').removeClass('bg-green2-dark bg-red2-dark bg-yellow2-dark');
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$('#badge-regatta-meldung').text('');
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$('#menu-item-meldung').hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
// off. results
|
||||||
|
if (regatta['oresults'] != '') {
|
||||||
|
$('#menu-item-oresults').show();
|
||||||
|
$('#menu-item-oresults').attr('href', regatta['oresults']);
|
||||||
|
$('#menu-item-oresults').attr('target', '_blank');
|
||||||
|
} else {
|
||||||
|
$('#menu-item-oresults').hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
// club website
|
||||||
|
var clubwebsite = '';
|
||||||
|
if (regatta['club'] != null) {
|
||||||
|
clubwebsite = (await dbGetData('clubs', regatta['club'])).website;
|
||||||
|
}
|
||||||
|
if (clubwebsite != '') {
|
||||||
|
$('#menu-item-clubwebsite').show();
|
||||||
|
$('#menu-item-clubwebsite').attr('href', clubwebsite);
|
||||||
|
$('#menu-item-clubwebsite').attr('target', '_blank');
|
||||||
|
} else {
|
||||||
|
$('#menu-item-clubwebsite').hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
$('#menu-regatta').showMenu();
|
||||||
|
$('#menu-regatta').scrollTop(0);
|
||||||
|
}
|
||||||
75
server/scripts/pagination.js
Normal file
75
server/scripts/pagination.js
Normal file
@@ -0,0 +1,75 @@
|
|||||||
|
// $$0; - site script for redraw content
|
||||||
|
// $$1; - current page
|
||||||
|
// $$2; - count of pages
|
||||||
|
// $$3; - pagination id
|
||||||
|
|
||||||
|
var paginationButtons = [];
|
||||||
|
|
||||||
|
function paginationSetActive() {
|
||||||
|
for (i = 1; i <= 7; i ++) {
|
||||||
|
if ($$1; == $('#$$3;-' + i).text()) {
|
||||||
|
$('#$$3;-' + i).addClass('active');
|
||||||
|
} else {
|
||||||
|
$('#$$3;-' + i).removeClass('active');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function drawPagination() {
|
||||||
|
if ($$2; > 1) {
|
||||||
|
$('#$$3;').show();
|
||||||
|
paginationButtons[6].text($$2;);
|
||||||
|
if ($$2; <= 7) {
|
||||||
|
for (i = 2; i <= $$2; - 1; i ++) {
|
||||||
|
paginationButtons[i-1].text(i);
|
||||||
|
$('#$$3;-' + i).show();
|
||||||
|
}
|
||||||
|
for (i = $$2;; i < 7; i ++) {
|
||||||
|
$('#$$3;-' + i).hide();
|
||||||
|
}
|
||||||
|
} else if ($$1; <= 4) {
|
||||||
|
for (i = 2; i <= 5; i ++) {
|
||||||
|
paginationButtons[i-1].text(i);
|
||||||
|
$('#$$3;-' + i).show();
|
||||||
|
}
|
||||||
|
paginationButtons[5].text('...');
|
||||||
|
$('#$$3;-6').show();
|
||||||
|
} else if ($$1; > $$2; - 4) {
|
||||||
|
paginationButtons[1].text('...');
|
||||||
|
$('#$$3;-2').show();
|
||||||
|
for (i = 3; i <= 6; i ++) {
|
||||||
|
paginationButtons[i-1].text($$2; + i - 7);
|
||||||
|
$('#$$3;-' + i).show();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
paginationButtons[1].text('...');
|
||||||
|
$('#$$3;-2').show();
|
||||||
|
for (i = 3; i <= 5; i ++) {
|
||||||
|
paginationButtons[i-1].text($$1; + i - 4);
|
||||||
|
$('#$$3;-' + i).show();
|
||||||
|
}
|
||||||
|
paginationButtons[5].text('...');
|
||||||
|
$('#$$3;-6').show();
|
||||||
|
}
|
||||||
|
paginationSetActive();
|
||||||
|
} else {
|
||||||
|
$('#$$3;').hide();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function onPaginationClick(paginationButton) {
|
||||||
|
var newPage = parseInt($(paginationButton).text());
|
||||||
|
if (!isNaN(newPage)) {
|
||||||
|
$$1; = newPage;
|
||||||
|
drawPagination();
|
||||||
|
$$0;();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function initPagination() {
|
||||||
|
paginationButtons = [];
|
||||||
|
for (i = 1; i <= 7; i ++) {
|
||||||
|
paginationButtons.push($('#$$3;-' + i).find('a'));
|
||||||
|
}
|
||||||
|
drawPagination();
|
||||||
|
}
|
||||||
359
server/scripts/rank.js
Normal file
359
server/scripts/rank.js
Normal file
@@ -0,0 +1,359 @@
|
|||||||
|
function onDetailClicked(regatta) {
|
||||||
|
location.href = LINK_PRE + 'result?regatta=' + regatta;
|
||||||
|
}
|
||||||
|
|
||||||
|
async function onRankingClicked(id) {
|
||||||
|
var sailor = null;
|
||||||
|
for (var i in ranking) {
|
||||||
|
if (ranking[i].id == id) {
|
||||||
|
sailor = ranking[i];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (sailor == null) return;
|
||||||
|
|
||||||
|
$('#menu-rank').find('.menu-title').find('p').text(sailor.name);
|
||||||
|
if (lastRanking != null) {
|
||||||
|
var lastRank;
|
||||||
|
if (sailor.id in lastRanking) {
|
||||||
|
lastRank = lastRanking[sailor.id] + '.';
|
||||||
|
} else {
|
||||||
|
lastRank = 'nicht in der Rangliste';
|
||||||
|
}
|
||||||
|
$('#menu-item-text').text('Vorheriges Jahr: ' + lastRank);
|
||||||
|
$('#menu-item-text').show();
|
||||||
|
} else {
|
||||||
|
$('#menu-item-text').hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
list = '';
|
||||||
|
for (var i in sailor.regattas) {
|
||||||
|
var entry = sailor.regattas[i];
|
||||||
|
var regatta = entry.regatta;
|
||||||
|
var boat = await dbGetData('boats', entry.boat);
|
||||||
|
|
||||||
|
var dateFrom = parseDate(regatta.date);
|
||||||
|
var dateTo = parseDate(regatta.date);
|
||||||
|
dateTo.setDate(dateTo.getDate() + Math.max(parseInt(regatta.length) - 1, 0));
|
||||||
|
|
||||||
|
list += '<div onclick="onDetailClicked(' + regatta.id + ')">';
|
||||||
|
|
||||||
|
// ZEILE 1
|
||||||
|
list += '<div><b>' + regatta.name + '</b></div>';
|
||||||
|
|
||||||
|
// ZEILE 2
|
||||||
|
list += '<div>';
|
||||||
|
|
||||||
|
// DATE
|
||||||
|
list += '<div>' + formatDate('d.m.Y', dateFrom) + ' - ' + formatDate('d.m.Y', dateTo) + '</div>';
|
||||||
|
|
||||||
|
// m
|
||||||
|
list += '<div>m: ' + entry.m + '</div>';
|
||||||
|
|
||||||
|
// rlf
|
||||||
|
list += '<div>RLF: ' + parseFloat(regatta.rlf).toFixed(2) + '</div>';
|
||||||
|
|
||||||
|
list += '</div>';
|
||||||
|
|
||||||
|
// ZEILE 3
|
||||||
|
list += '<div>';
|
||||||
|
|
||||||
|
// Place
|
||||||
|
list += '<div>Platz ' + entry.place + ' / ' + entry.fb + '</div>';
|
||||||
|
|
||||||
|
// rlp
|
||||||
|
var color;
|
||||||
|
if (entry.used == 0) { color = 'color-red2-dark'; }
|
||||||
|
else if (entry.used == entry.m) { color = 'color-green2-dark'; }
|
||||||
|
else { color = 'color-yellow2-dark'; }
|
||||||
|
list += '<div>Punkte: ' + entry.used + ' x <b class="' + color + '">' + parseFloat(entry.rlp).toFixed(2) + '</b></div>';
|
||||||
|
|
||||||
|
list += '</div>';
|
||||||
|
|
||||||
|
// ZEILE 4
|
||||||
|
list += '<div>';
|
||||||
|
|
||||||
|
// Sailnumber
|
||||||
|
list += '<div>' + boat.sailnumber + '</div>';
|
||||||
|
|
||||||
|
// Boatname
|
||||||
|
list += '<div>' + boat.name + '</div>';
|
||||||
|
|
||||||
|
list += '</div>';
|
||||||
|
|
||||||
|
// ZEILE 5...
|
||||||
|
var crew = entry.crew.split(',');
|
||||||
|
for (var c in crew) {
|
||||||
|
var cr = await dbGetData('sailors', crew[c]);
|
||||||
|
if (cr != null) {
|
||||||
|
list += '<div>';
|
||||||
|
|
||||||
|
// Name
|
||||||
|
list += '<div>' + cr.name + '</div>';
|
||||||
|
|
||||||
|
// Year
|
||||||
|
list += '<div>' + ((cr.year != null) ? ('(' + cr.year + ')') : '') + '</div>';
|
||||||
|
|
||||||
|
list += '</div>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
list += '</div>';
|
||||||
|
}
|
||||||
|
$('#div-details').html(list);
|
||||||
|
|
||||||
|
$('#menu-rank').showMenu();
|
||||||
|
$('#menu-rank').scrollTop(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
async function selectChange(callSiteScript = true) {
|
||||||
|
var type = $('#select-type').val();
|
||||||
|
var year = parseInt($('#select-year').val());
|
||||||
|
if (type == "user") {
|
||||||
|
$('#select-year').parent().hide();
|
||||||
|
$('#input-from').parent().show();
|
||||||
|
$('#input-to').parent().show();
|
||||||
|
$('#input-jugend').parent().parent().show();
|
||||||
|
$('#input-jugstrict').parent().parent().show();
|
||||||
|
$('#button-show').show();
|
||||||
|
} else {
|
||||||
|
$('#select-year').parent().show();
|
||||||
|
$('#input-from').parent().hide();
|
||||||
|
$('#input-to').parent().hide();
|
||||||
|
$('#input-jugend').parent().parent().hide();
|
||||||
|
$('#input-jugstrict').parent().parent().hide();
|
||||||
|
$('#button-show').hide();
|
||||||
|
|
||||||
|
var from, to, jugend, jugstrict;
|
||||||
|
switch (type) {
|
||||||
|
case 'year':
|
||||||
|
from = (year - 1) + '-12-01';
|
||||||
|
to = year + '-11-30';
|
||||||
|
jugend = jugstrict = false;
|
||||||
|
break;
|
||||||
|
case 'youth':
|
||||||
|
from = (year - 1) + '-12-01';
|
||||||
|
to = year + '-11-30';
|
||||||
|
jugend = jugstrict = true;
|
||||||
|
break;
|
||||||
|
case 'idjm':
|
||||||
|
var beginn = null;
|
||||||
|
var regattas = await dbGetData('regattas');
|
||||||
|
regattas.sort(function(a,b){ return b.date.localeCompare(a.date); });
|
||||||
|
for (var r in regattas) {
|
||||||
|
var regatta = regattas[r];
|
||||||
|
var date = parseDate(regatta.date);
|
||||||
|
if ((date < parseDate('01.01.' + year)) || (date > parseDate('31.12.' + year))) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (regatta.name.indexOf(YOUTH_GERMAN_NAME) >= 0) {
|
||||||
|
beginn = ((regatta.meldungSchluss != null) ? parseDate(regatta.meldungSchluss) : date);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (beginn != null) {
|
||||||
|
from = new Date(beginn);
|
||||||
|
from.setFullYear(from.getFullYear() - 1);
|
||||||
|
from.setDate(from.getDate() - 13);
|
||||||
|
from = formatDate('Y-m-d', from);
|
||||||
|
to = new Date(beginn);
|
||||||
|
to.setDate(to.getDate() - 14);
|
||||||
|
to = formatDate('Y-m-d', to);
|
||||||
|
jugend = true;
|
||||||
|
jugstrict = false;
|
||||||
|
} else {
|
||||||
|
$('#div-rank').html('Keine ' + YOUTH_GERMAN_NAME + ' gefunden!');
|
||||||
|
$('#input-search').parent().hide();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
$('#input-from').val(from);
|
||||||
|
$('#input-to').val(to);
|
||||||
|
$('#input-jugend').prop('checked', jugend);
|
||||||
|
$('#input-jugstrict').prop('checked', jugstrict);
|
||||||
|
|
||||||
|
if (callSiteScript && (typeof siteScript === 'function'))
|
||||||
|
siteScript();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function initSelects() {
|
||||||
|
var type = findGetParameter('type');
|
||||||
|
var year = findGetParameter('year');
|
||||||
|
if (type === null) type = 'year';
|
||||||
|
if (year === null) year = new Date().getFullYear();
|
||||||
|
|
||||||
|
$('#select-type').val(type);
|
||||||
|
|
||||||
|
$('#select-year').html('<option value="' + year + '">' + year + '</option>');
|
||||||
|
$('#select-year').val(year);
|
||||||
|
|
||||||
|
selectChange(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
var firstCall = true;
|
||||||
|
var rows = [];
|
||||||
|
var ranking;
|
||||||
|
var lastRanking;
|
||||||
|
|
||||||
|
async function drawList () {
|
||||||
|
window.setTimeout(function () {
|
||||||
|
var list = '';
|
||||||
|
rows.forEach(function (entry) {
|
||||||
|
if (entry == null) {
|
||||||
|
list += '<div><div align="center" class="color-highlight" style="white-space:normal;"><b>Ende der Rangliste gemäß DSV-Ranglistenverordnung (min. m = 9 Wertungen)</b></div></div>';
|
||||||
|
} else if (search($('#input-search').val(), entry.keywords)) {
|
||||||
|
list += entry.content;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
$('#div-rank').html(list);
|
||||||
|
}, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
var siteScript = async function() {
|
||||||
|
if (firstCall) {
|
||||||
|
firstCall = false;
|
||||||
|
initSelects();
|
||||||
|
$('#select-type').change(selectChange);
|
||||||
|
$('#select-year').change(selectChange);
|
||||||
|
$('#button-show').click(siteScript);
|
||||||
|
$('#input-search').on('input', drawList);
|
||||||
|
}
|
||||||
|
|
||||||
|
var minDate = parseDate($('#input-from').val());
|
||||||
|
var maxDate = parseDate($('#input-to').val());
|
||||||
|
var jugend = $('#input-jugend').prop('checked');
|
||||||
|
var jugstrict = $('#input-jugstrict').prop('checked');
|
||||||
|
var dbRanking = await dbGetRanking(minDate, maxDate, jugend, jugstrict);
|
||||||
|
ranking = dbRanking[0];
|
||||||
|
|
||||||
|
lastRanking = null;
|
||||||
|
if (($('#select-type').val() == 'year') || ($('#select-type').val() == 'youth')) {
|
||||||
|
lastRanking = {};
|
||||||
|
var lYear = parseInt($('#select-year').val()) - 1;
|
||||||
|
var lMinDate = parseDate((lYear - 1) + '-12-01');
|
||||||
|
var lMaxDate = parseDate(lYear + '-11-30');
|
||||||
|
var lDbRanking = (await dbGetRanking(lMinDate, lMaxDate, jugend, jugstrict))[0];
|
||||||
|
for (var i in lDbRanking) {
|
||||||
|
lastRanking[lDbRanking[i].id] = lDbRanking[i].rank;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var selectedYear = $('#select-year').val();
|
||||||
|
|
||||||
|
var years = await dbGetData('years');
|
||||||
|
years.sort(function (a, b) {
|
||||||
|
if (a['year'] > b['year']) return -1;
|
||||||
|
if (a['year'] < b['year']) return 1;
|
||||||
|
return 0;
|
||||||
|
});
|
||||||
|
var options = '';
|
||||||
|
for (id in years) {
|
||||||
|
var year = years[id]['year'];
|
||||||
|
options += '<option value="' + year + '">' + year + '</option>';
|
||||||
|
}
|
||||||
|
$('#select-year').html(options);
|
||||||
|
$('#select-year').val(selectedYear);
|
||||||
|
|
||||||
|
if (dbRanking[1].length > 0) {
|
||||||
|
$('#card-noresults').show();
|
||||||
|
list = '';
|
||||||
|
for (id in dbRanking[1]) {
|
||||||
|
list += '<li>';
|
||||||
|
list += dbRanking[1][id].name;
|
||||||
|
list += '</li>';
|
||||||
|
}
|
||||||
|
$('#ul-noresults').html(list);
|
||||||
|
} else {
|
||||||
|
$('#card-noresults').hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
var count = ranking.length;
|
||||||
|
if (count > 0) {
|
||||||
|
$('#input-search').parent().show();
|
||||||
|
|
||||||
|
var dsvEnd = false;
|
||||||
|
|
||||||
|
rows = [];
|
||||||
|
|
||||||
|
for (id in ranking) {
|
||||||
|
var entry = ranking[id];
|
||||||
|
|
||||||
|
for (var i in entry.regattas) {
|
||||||
|
entry.regattas[i].regatta = await dbGetData('regattas', entry.regattas[i].regatta);
|
||||||
|
}
|
||||||
|
entry.regattas = Object.values(entry.regattas);
|
||||||
|
entry.regattas.sort(function (a,b) {
|
||||||
|
return a.regatta.date.localeCompare(b.regatta.date);
|
||||||
|
});
|
||||||
|
|
||||||
|
var club = null;
|
||||||
|
if (entry['club'] != null)
|
||||||
|
club = await dbGetData('clubs', entry['club']);
|
||||||
|
|
||||||
|
var row = { keywords: [], content: '' };
|
||||||
|
row.keywords.push(entry['name']);
|
||||||
|
if (entry['year'] != null) row.keywords.push(entry['year']);
|
||||||
|
if (club != null) row.keywords.push(club['kurz'], club['name']);
|
||||||
|
|
||||||
|
if (!dsvEnd && (entry.m < 9)) {
|
||||||
|
rows.push(null);
|
||||||
|
dsvEnd = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
row.content += '<div onclick="onRankingClicked(' + entry['id'] + ');">';
|
||||||
|
|
||||||
|
// ZEILE 1
|
||||||
|
row.content += '<div>';
|
||||||
|
|
||||||
|
// Rank
|
||||||
|
var icon = '';
|
||||||
|
if (lastRanking != null) {
|
||||||
|
if (entry.id in lastRanking) {
|
||||||
|
if (entry.rank < lastRanking[entry.id]) { icon = 'color-green2-dark fa-caret-up'; }
|
||||||
|
else if (entry.rank > lastRanking[entry.id]) { icon = 'color-red2-dark fa-caret-down'; }
|
||||||
|
else { icon = 'color-yellow2-dark fa-minus'; }
|
||||||
|
} else {
|
||||||
|
icon = 'color-green2-dark fa-caret-up';
|
||||||
|
}
|
||||||
|
icon = '<i class="font-16 fas ' + icon + '" style="width: 1.1em; text-align: center;"></i> ';
|
||||||
|
}
|
||||||
|
row.content += '<div>' + icon + '<b>' + entry.rank + '.</b></div>';
|
||||||
|
|
||||||
|
// m
|
||||||
|
row.content += '<div>m = ' + entry.m + '</div>';
|
||||||
|
|
||||||
|
// rlp
|
||||||
|
row.content += '<div>' + entry.rlp.toFixed(3) + '</div>';
|
||||||
|
|
||||||
|
row.content += '</div>';
|
||||||
|
|
||||||
|
// ZEILE 2
|
||||||
|
row.content += '<div>';
|
||||||
|
|
||||||
|
// Name
|
||||||
|
row.content += '<div><b>' + entry.name + '</b></div>';
|
||||||
|
|
||||||
|
// Year
|
||||||
|
row.content += '<div>' + ((entry.year != null) ? ('(' + entry.year + ')') : '') + '</div>';
|
||||||
|
|
||||||
|
row.content += '</div></div>';
|
||||||
|
|
||||||
|
rows.push(row);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!dsvEnd) {
|
||||||
|
rows.push(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
drawList();
|
||||||
|
|
||||||
|
} else {
|
||||||
|
$('#div-rank').html('Keine Ergebnisse gefunden!');
|
||||||
|
$('#input-search').parent().hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
hideLoader();
|
||||||
|
}
|
||||||
65
server/scripts/regatta_plan.js
Normal file
65
server/scripts/regatta_plan.js
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
var siteScript = async function() {
|
||||||
|
var regattaId = findGetParameter('regatta');
|
||||||
|
if (regattaId == null) {
|
||||||
|
$('#h1-title').text('Regatta nicht gefunden');
|
||||||
|
hideLoader();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var regatta = await dbGetData('regattas', regattaId);
|
||||||
|
if (regatta == null) {
|
||||||
|
$('#h1-title').text('Regatta nicht gefunden');
|
||||||
|
hideLoader();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var dateFrom = parseDate(regatta['date']);
|
||||||
|
var dateTo = parseDate(regatta['date']);
|
||||||
|
dateTo.setDate(dateTo.getDate() + Math.max(parseInt(regatta['length']) - 1, 0));
|
||||||
|
|
||||||
|
$('#h1-title').text(regatta.name);
|
||||||
|
if (regatta.length < 1) {
|
||||||
|
if (formatDate('d.m', dateFrom) == '01.01') {
|
||||||
|
$('#p-title').html('<font class="color-red2-dark">Datum noch unklar</font>');
|
||||||
|
} else {
|
||||||
|
$('#p-title').html(formatDate('d.m.Y', dateFrom) + ' - <font class="color-red2-dark">Datum nicht final</font>');
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$('#p-title').html(formatDate('d.m.Y', dateFrom) + ' - ' + formatDate('d.m.Y', dateTo));
|
||||||
|
}
|
||||||
|
|
||||||
|
var plannings = await dbGetDataIndex('plannings', 'regatta', regatta.id);
|
||||||
|
if (plannings.length > 0) {
|
||||||
|
$('#table-plannings').show();
|
||||||
|
$('#p-info').hide();
|
||||||
|
var tbody = '';
|
||||||
|
for (var p in plannings) {
|
||||||
|
var planning = plannings[p];
|
||||||
|
|
||||||
|
tbody += '<tr>';
|
||||||
|
|
||||||
|
tbody += '<td>' + (await dbGetData('users', planning.user)).username + '</td>';
|
||||||
|
|
||||||
|
if (planning.steuermann != null) {
|
||||||
|
tbody += '<td>' + (await dbGetData('users', planning.user)).username + '</td>';
|
||||||
|
} else {
|
||||||
|
tbody += '<td>(noch unklar)</td>';
|
||||||
|
}
|
||||||
|
|
||||||
|
var crew = [];
|
||||||
|
var cr = planning.crew.split(',');
|
||||||
|
for (c in cr) {
|
||||||
|
var s = await dbGetData('sailors', cr[c]);
|
||||||
|
if (s != null) crew.push(s.name);
|
||||||
|
}
|
||||||
|
tbody += '<td>' + crew.join('<br>') + '</td>';
|
||||||
|
|
||||||
|
tbody += '</tr>';
|
||||||
|
}
|
||||||
|
$('#table-plannings').find('tbody').html(tbody);
|
||||||
|
} else {
|
||||||
|
$('#p-info').text('Niemand plant bisher, hier hinzufahren!');
|
||||||
|
$('#p-info').show();
|
||||||
|
$('#table-plannings').hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
hideLoader();
|
||||||
|
}
|
||||||
@@ -31,7 +31,7 @@ var firstCall = true;
|
|||||||
var rows = [];
|
var rows = [];
|
||||||
var today;
|
var today;
|
||||||
|
|
||||||
async function drawTable () {
|
async function drawList () {
|
||||||
window.setTimeout(function () {
|
window.setTimeout(function () {
|
||||||
var list = '';
|
var list = '';
|
||||||
rows.forEach(function (entry) {
|
rows.forEach(function (entry) {
|
||||||
@@ -45,141 +45,13 @@ async function drawTable () {
|
|||||||
}, 0);
|
}, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
async function regattaClicked(id) {
|
|
||||||
var regatta = await dbGetData('regattas', id);
|
|
||||||
|
|
||||||
$('#menu-regatta').find('.menu-title').find('p').text(regatta.name);
|
|
||||||
|
|
||||||
// Results
|
|
||||||
var results = await dbGetDataIndex('results', 'regatta', regatta['id']);
|
|
||||||
if (results.length > 0) {
|
|
||||||
$('#menu-item-results').show();
|
|
||||||
$('#menu-item-results').attr('href', LINK_PRE + 'result/' + regatta['id']);
|
|
||||||
} else {
|
|
||||||
$('#menu-item-results').hide();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Bericht
|
|
||||||
if (regatta['bericht'] != '') {
|
|
||||||
$('#menu-item-bericht').show();
|
|
||||||
$('#menu-item-bericht').attr('href', regatta['bericht']);
|
|
||||||
$('#menu-item-bericht').attr('target', '_blank');
|
|
||||||
} else {
|
|
||||||
$('#menu-item-bericht').hide();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Info
|
|
||||||
if (regatta['info'] != '') {
|
|
||||||
$('#menu-item-info').show();
|
|
||||||
$('#menu-item-info').attr('href', regatta['info']);
|
|
||||||
$('#menu-item-info').attr('target', '_blank');
|
|
||||||
} else {
|
|
||||||
$('#menu-item-info').hide();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Meldung
|
|
||||||
var dateTo = parseDate(regatta['date']);
|
|
||||||
dateTo.setDate(dateTo.getDate() + Math.max(parseInt(regatta['length']) - 1, 0));
|
|
||||||
if ((regatta['meldung'] != '') && (dateTo >= today)) {
|
|
||||||
$('#menu-item-meldung').show();
|
|
||||||
$('#menu-item-meldung').attr('href', regatta['meldung']);
|
|
||||||
$('#menu-item-meldung').attr('target', '_blank');
|
|
||||||
var planning = null;
|
|
||||||
if (isLoggedIn()) {
|
|
||||||
var plannings = await dbGetDataIndex('plannings', 'regatta', regatta['id']);
|
|
||||||
for (id in plannings) {
|
|
||||||
if (plannings[id]['user'] == USER_ID) {
|
|
||||||
planning = plannings[id];
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ((planning != null) && (planning['gemeldet'] == '1')) {
|
|
||||||
$('#badge-regatta-meldung').text('schon gemeldet');
|
|
||||||
$('#badge-regatta-meldung').addClass('bg-green2-dark').removeClass('bg-highlight bg-red2-dark bg-yellow2-dark');
|
|
||||||
} else if (regatta['meldungOffen'] == '0') {
|
|
||||||
$('#badge-regatta-meldung').text('geschlossen');
|
|
||||||
$('#badge-regatta-meldung').addClass('bg-highlight').removeClass('bg-green2-dark bg-red2-dark bg-yellow2-dark');
|
|
||||||
} else if (regatta['meldungSchluss'] != null) {
|
|
||||||
var early = false;
|
|
||||||
var ms;
|
|
||||||
if (regatta['meldungEarly'] != null) {
|
|
||||||
ms = parseDate(regatta['meldungEarly']);
|
|
||||||
if (ms >= today) {
|
|
||||||
early = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!early)
|
|
||||||
ms = parseDate(regatta['meldungSchluss']);
|
|
||||||
if (ms >= today) {
|
|
||||||
var diff = Math.round((ms - today) / 86400000);
|
|
||||||
var red = (diff < 7);
|
|
||||||
var txt;
|
|
||||||
if (diff <= 14) {
|
|
||||||
txt = diff + ' Tag' + (diff != 1 ? 'e' : '');
|
|
||||||
} else if (diff < 35) {
|
|
||||||
diff = Math.floor(diff / 7);
|
|
||||||
txt = diff + ' Woche' + (diff != 1 ? 'n' : '');
|
|
||||||
} else {
|
|
||||||
diff = Math.floor(diff / 30.5);
|
|
||||||
txt = diff + ' Monat' + (diff != 1 ? 'e' : '');
|
|
||||||
}
|
|
||||||
if (early)
|
|
||||||
txt += ' vergünstigt';
|
|
||||||
$('#badge-regatta-meldung').text(txt);
|
|
||||||
if (red) {
|
|
||||||
if (early) {
|
|
||||||
$('#badge-regatta-meldung').addClass('bg-yellow2-dark').removeClass('bg-highlight bg-green2-dark bg-red2-dark');
|
|
||||||
} else {
|
|
||||||
$('#badge-regatta-meldung').addClass('bg-red2-dark').removeClass('bg-highlight bg-green2-dark bg-yellow2-dark');
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$('#badge-regatta-meldung').addClass('bg-highlight').removeClass('bg-green2-dark bg-red2-dark bg-yellow2-dark');
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$('#badge-regatta-meldung').text('Meldeschluss abgelaufen');
|
|
||||||
$('#badge-regatta-meldung').addClass('bg-highlight').removeClass('bg-green2-dark bg-red2-dark bg-yellow2-dark');
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$('#badge-regatta-meldung').text('');
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$('#menu-item-meldung').hide();
|
|
||||||
}
|
|
||||||
|
|
||||||
// off. results
|
|
||||||
if (regatta['oresults'] != '') {
|
|
||||||
$('#menu-item-oresults').show();
|
|
||||||
$('#menu-item-oresults').attr('href', regatta['oresults']);
|
|
||||||
$('#menu-item-oresults').attr('target', '_blank');
|
|
||||||
} else {
|
|
||||||
$('#menu-item-oresults').hide();
|
|
||||||
}
|
|
||||||
|
|
||||||
// club website
|
|
||||||
var clubwebsite = '';
|
|
||||||
if (regatta['club'] != null) {
|
|
||||||
clubwebsite = (await dbGetData('clubs', regatta['club'])).website;
|
|
||||||
}
|
|
||||||
if (clubwebsite != '') {
|
|
||||||
$('#menu-item-clubwebsite').show();
|
|
||||||
$('#menu-item-clubwebsite').attr('href', clubwebsite);
|
|
||||||
$('#menu-item-clubwebsite').attr('target', '_blank');
|
|
||||||
} else {
|
|
||||||
$('#menu-item-clubwebsite').hide();
|
|
||||||
}
|
|
||||||
|
|
||||||
$('#menu-regatta').showMenu();
|
|
||||||
$('#menu-regatta').scrollTop(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
var siteScript = async function() {
|
var siteScript = async function() {
|
||||||
if (firstCall) {
|
if (firstCall) {
|
||||||
firstCall = false;
|
firstCall = false;
|
||||||
initYear();
|
initYear();
|
||||||
$('#select-year').change(selectChange);
|
$('#select-year').change(selectChange);
|
||||||
$('#button-show').click(siteScript);
|
$('#button-show').click(siteScript);
|
||||||
$('#input-search').on('input', drawTable);
|
$('#input-search').on('input', drawList);
|
||||||
}
|
}
|
||||||
|
|
||||||
today = getToday();
|
today = getToday();
|
||||||
@@ -244,7 +116,7 @@ var siteScript = async function() {
|
|||||||
heute = true;
|
heute = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
row.content += '<div onclick="regattaClicked(' + entry['id'] + ');">';
|
row.content += '<div onclick="onRegattaClicked(' + entry['id'] + ');">';
|
||||||
|
|
||||||
// ZEILE 1
|
// ZEILE 1
|
||||||
// Name
|
// Name
|
||||||
@@ -268,7 +140,6 @@ var siteScript = async function() {
|
|||||||
icons.push('<i class="fas fa-info"></i>');
|
icons.push('<i class="fas fa-info"></i>');
|
||||||
if ((entry['meldung'] != '') && (dateTo >= today) && (entry['meldungOffen'] == '1')) {
|
if ((entry['meldung'] != '') && (dateTo >= today) && (entry['meldungOffen'] == '1')) {
|
||||||
var color = '';
|
var color = '';
|
||||||
if (entry['meldungSchluss'] != null) {
|
|
||||||
var planning = null;
|
var planning = null;
|
||||||
if (isLoggedIn()) {
|
if (isLoggedIn()) {
|
||||||
var plannings = await dbGetDataIndex('plannings', 'regatta', entry['id']);
|
var plannings = await dbGetDataIndex('plannings', 'regatta', entry['id']);
|
||||||
@@ -279,6 +150,7 @@ var siteScript = async function() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (entry['meldungSchluss'] != null) {
|
||||||
if ((planning == null) || (planning['gemeldet'] == '0')) {
|
if ((planning == null) || (planning['gemeldet'] == '0')) {
|
||||||
var ms = 0;
|
var ms = 0;
|
||||||
if (entry['meldungEarly'] != null) {
|
if (entry['meldungEarly'] != null) {
|
||||||
@@ -290,12 +162,12 @@ var siteScript = async function() {
|
|||||||
var diff = Math.round((ms - today) / 86400000);
|
var diff = Math.round((ms - today) / 86400000);
|
||||||
if ((ms >= today) && (diff < 7)) {
|
if ((ms >= today) && (diff < 7)) {
|
||||||
color = ' color-red2-dark';
|
color = ' color-red2-dark';
|
||||||
if (planning != null) {
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ((planning != null) && (planning['gemeldet'] == '0')) {
|
||||||
color += ' fa-blink';
|
color += ' fa-blink';
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
icons.push('<i class="fas fa-file-signature' + color + '"></i>');
|
icons.push('<i class="fas fa-file-signature' + color + '"></i>');
|
||||||
}
|
}
|
||||||
if (entry['bericht'] != '')
|
if (entry['bericht'] != '')
|
||||||
@@ -335,7 +207,7 @@ var siteScript = async function() {
|
|||||||
rows.push(null);
|
rows.push(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
drawTable();
|
drawList();
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
$('#p-count').html('Keine Regatten gefunden!');
|
$('#p-count').html('Keine Regatten gefunden!');
|
||||||
|
|||||||
77
server/scripts/result.js
Normal file
77
server/scripts/result.js
Normal file
@@ -0,0 +1,77 @@
|
|||||||
|
var siteScript = async function() {
|
||||||
|
var regattaId = findGetParameter('regatta');
|
||||||
|
if (regattaId == null) {
|
||||||
|
$('#h1-title').text('Regatta nicht gefunden');
|
||||||
|
hideLoader();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var regatta = await dbGetData('regattas', regattaId);
|
||||||
|
if (regatta == null) {
|
||||||
|
$('#h1-title').text('Regatta nicht gefunden');
|
||||||
|
hideLoader();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var dateFrom = parseDate(regatta['date']);
|
||||||
|
var dateTo = parseDate(regatta['date']);
|
||||||
|
dateTo.setDate(dateTo.getDate() + Math.max(parseInt(regatta['length']) - 1, 0));
|
||||||
|
|
||||||
|
$('#h1-title').text(regatta.name);
|
||||||
|
$('#p-title').text(formatDate('d.m.Y', dateFrom) + ' - ' + formatDate('d.m.Y', dateTo));
|
||||||
|
|
||||||
|
var results = await dbGetResultCalculated(regatta);
|
||||||
|
if (results.length > 0) {
|
||||||
|
var m;
|
||||||
|
if (regatta.m > 0) {
|
||||||
|
m = regatta.m;
|
||||||
|
} else if (regatta.races <= 4) {
|
||||||
|
m = regatta.races;
|
||||||
|
} else {
|
||||||
|
if ((regatta.length > 2) && (regatta.races >= 6)) {
|
||||||
|
m = 5;
|
||||||
|
} else {
|
||||||
|
m = 4;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$('#p-info').text(regatta.races + ' Wettfahrten, ' + regatta.streicher + ' Streicher, m = ' + m);
|
||||||
|
|
||||||
|
$('#table-results').show();
|
||||||
|
var thead = '<tr><th>#</th><th>Boot</th><th>Crew</th><th></th>';
|
||||||
|
for (var i = 1; i <= regatta.races; i ++) thead += '<th>WF ' + i + '</th>';
|
||||||
|
thead += '<th></th><th>Summe</th><th>Netto</th><th>#</th><th>RLP</th></tr>';
|
||||||
|
$('#table-results').find('thead').html(thead);
|
||||||
|
|
||||||
|
var tbody = '';
|
||||||
|
for (var r in results) {
|
||||||
|
var result = results[r];
|
||||||
|
var boat = await dbGetData('boats', result.boat);
|
||||||
|
var steuermann = (await dbGetData('sailors', result.steuermann)).name;
|
||||||
|
var cr = result.crew.split(',');
|
||||||
|
var crew = [];
|
||||||
|
for (c in cr) {
|
||||||
|
var s = await dbGetData('sailors', cr[c]);
|
||||||
|
if (s != null) crew.push(s.name);
|
||||||
|
}
|
||||||
|
|
||||||
|
tbody += '<tr>';
|
||||||
|
tbody += '<td>' + result.place + '.</td>';
|
||||||
|
tbody += '<td>' + boat.sailnumber + '<br>' + boat.name + '</td>';
|
||||||
|
tbody += '<td>' + steuermann + '<br>' + crew.join('<br>') + '</td>';
|
||||||
|
tbody += '<td></td>';
|
||||||
|
for (var i = 0; i < regatta.races; i ++) {
|
||||||
|
tbody += '<td>' + result.texts[i] + '</td>';
|
||||||
|
}
|
||||||
|
tbody += '<td></td>';
|
||||||
|
tbody += '<td>' + result.brutto + '</td>';
|
||||||
|
tbody += '<td>' + result.netto + '</td>';
|
||||||
|
tbody += '<td>' + result.place + '.</td>';
|
||||||
|
tbody += '<td>' + parseFloat(result.rlp).toFixed(2) + '</td>';
|
||||||
|
tbody += '</tr>';
|
||||||
|
}
|
||||||
|
$('#table-results').find('tbody').html(tbody);
|
||||||
|
} else {
|
||||||
|
$('#p-info').text('Keine Ergebnisse gefunden.');
|
||||||
|
$('#table-results').hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
hideLoader();
|
||||||
|
}
|
||||||
149
server/scripts/sailors.js
Normal file
149
server/scripts/sailors.js
Normal file
@@ -0,0 +1,149 @@
|
|||||||
|
var firstCall = true;
|
||||||
|
var rows = [];
|
||||||
|
var displayed = [];
|
||||||
|
var page = 1;
|
||||||
|
var pageCount = 0;
|
||||||
|
const showCount = 25;
|
||||||
|
|
||||||
|
async function onListClicked(id) {
|
||||||
|
var sailor = await dbGetData('sailors', id);
|
||||||
|
|
||||||
|
$('#menu-sailor').find('.menu-title').find('p').text(sailor.name);
|
||||||
|
|
||||||
|
// Edit Year
|
||||||
|
// TODO: create menu for edit year
|
||||||
|
if (sailor['year'] == null) {
|
||||||
|
$('#menu-item-year').find('span').text('Jahrgang hinzufügen');
|
||||||
|
} else {
|
||||||
|
$('#menu-item-year').find('span').text('Jahrgang bearbeiten');
|
||||||
|
}
|
||||||
|
|
||||||
|
// club website
|
||||||
|
var clubwebsite = '';
|
||||||
|
if (sailor['club'] != null) {
|
||||||
|
clubwebsite = (await dbGetData('clubs', sailor['club'])).website;
|
||||||
|
}
|
||||||
|
if (clubwebsite != '') {
|
||||||
|
$('#menu-item-clubwebsite').show();
|
||||||
|
$('#menu-item-clubwebsite').attr('href', clubwebsite);
|
||||||
|
$('#menu-item-clubwebsite').attr('target', '_blank');
|
||||||
|
} else {
|
||||||
|
$('#menu-item-clubwebsite').hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
$('#menu-sailor').showMenu();
|
||||||
|
$('#menu-sailor').scrollTop(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
function pageChange() {
|
||||||
|
$('#p-count')[0].scrollIntoView({ behavior: "smooth" });
|
||||||
|
drawList();
|
||||||
|
}
|
||||||
|
|
||||||
|
async function drawList() {
|
||||||
|
window.setTimeout(function () {
|
||||||
|
var list = '';
|
||||||
|
|
||||||
|
if (displayed.length > 0) {
|
||||||
|
var offset = (page - 1) * showCount;
|
||||||
|
var count = (page == pageCount ? (displayed.length % showCount) : showCount);
|
||||||
|
if (count == 0) count = showCount;
|
||||||
|
|
||||||
|
for (i = 0; i < count; i ++) {
|
||||||
|
list += displayed[i + offset];
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
list = '<div><div>Keine Ergebnisse, die der Suche entsprechen</div></div>';
|
||||||
|
}
|
||||||
|
|
||||||
|
$('#div-list').html(list);
|
||||||
|
}, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
async function reSearch() {
|
||||||
|
window.setTimeout(function () {
|
||||||
|
displayed = [];
|
||||||
|
rows.forEach(function (entry) {
|
||||||
|
if (search($('#input-search').val(), entry.keywords)) {
|
||||||
|
displayed.push(entry.content);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
pageCount = Math.ceil(displayed.length / showCount);
|
||||||
|
if ((page < 1) || (page > pageCount)) {
|
||||||
|
if (page < 1) {
|
||||||
|
page = 1;
|
||||||
|
} else {
|
||||||
|
page = pageCount;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
drawPagination();
|
||||||
|
drawList();
|
||||||
|
}, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
var siteScript = async function() {
|
||||||
|
if (firstCall) {
|
||||||
|
firstCall = false;
|
||||||
|
initPagination();
|
||||||
|
$('#input-search').on('input', reSearch);
|
||||||
|
}
|
||||||
|
|
||||||
|
var results = await dbGetData('sailors');
|
||||||
|
|
||||||
|
var count = results.length;
|
||||||
|
if (count > 0) {
|
||||||
|
if (count == 1) {
|
||||||
|
$('#p-count').html('Es wurde 1 Segler gefunden!');
|
||||||
|
} else {
|
||||||
|
$('#p-count').html('Es wurden ' + count + ' Segler gefunden!');
|
||||||
|
}
|
||||||
|
$('#div-list').show();
|
||||||
|
$('#input-search').parent().show();
|
||||||
|
|
||||||
|
results.sort(function (a, b) {
|
||||||
|
return a.name.localeCompare(b.name);
|
||||||
|
});
|
||||||
|
|
||||||
|
rows = [];
|
||||||
|
|
||||||
|
for (id in results) {
|
||||||
|
var entry = results[id];
|
||||||
|
var club = null;
|
||||||
|
if (entry['club'] != null)
|
||||||
|
club = await dbGetData('clubs', entry['club']);
|
||||||
|
|
||||||
|
var row = { keywords: [], content: '' };
|
||||||
|
row.keywords.push(entry['name']);
|
||||||
|
if (entry['year'] != null) row.keywords.push(entry['year']);
|
||||||
|
if (club != null) row.keywords.push(club['kurz'], club['name']);
|
||||||
|
|
||||||
|
row.content += '<div onclick="onListClicked(' + entry['id'] + ');">';
|
||||||
|
|
||||||
|
// ZEILE 1
|
||||||
|
// Name
|
||||||
|
row.content += '<div><b>' + entry['name'] + '</b></div>';
|
||||||
|
|
||||||
|
// ZEILE 2
|
||||||
|
row.content += '<div>';
|
||||||
|
|
||||||
|
// Year
|
||||||
|
row.content += '<div>' + ((entry['year'] != null) ? (entry['year']) : '') + '</div>';
|
||||||
|
|
||||||
|
// Club
|
||||||
|
row.content += '<div>' + ((club != null) ? club['kurz'] : '') + '</div>';
|
||||||
|
|
||||||
|
row.content += '</div></div>';
|
||||||
|
|
||||||
|
rows.push(row);
|
||||||
|
}
|
||||||
|
|
||||||
|
reSearch();
|
||||||
|
|
||||||
|
} else {
|
||||||
|
$('#p-count').html('Keine Segler gefunden!');
|
||||||
|
$('#div-list').hide();
|
||||||
|
$('#input-search').parent().hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
hideLoader();
|
||||||
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
<div id="$$html-id;" class="card card-style">
|
<div id="$$html-id;" class="card card-style $$css-class;">
|
||||||
<div class="content $$css-class;">
|
<div class="content">
|
||||||
$$0;
|
$$0;
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
5
server/templates/checkbox.html
Normal file
5
server/templates/checkbox.html
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
<div class="fac fac-checkbox fac-blue $$css-class;">
|
||||||
|
<span></span>
|
||||||
|
<input id="$$html-id;" type="checkbox" $$checked; />
|
||||||
|
<label for="$$html-id;">$$placeholder;</label>
|
||||||
|
</div>
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
<div class="input-style input-style-2 input-required">
|
<div class="input-style input-style-2 input-required $$css-class;">
|
||||||
<span class="color-highlight">$$placeholder;</span>
|
<span class="color-highlight">$$placeholder;</span>
|
||||||
<input id="$$html-id;" class="form-control $$css-class;" type="$$type;" placeholder="$$placeholder;" value="$$value;" />
|
<input id="$$html-id;" class="form-control" type="$$type;" placeholder="$$placeholder;" value="$$value;" />
|
||||||
</div>
|
</div>
|
||||||
11
server/templates/pagination.html
Normal file
11
server/templates/pagination.html
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
<nav id="$$html-id;">
|
||||||
|
<ul class="pagination justify-content-center">
|
||||||
|
<li id="$$html-id;-1" class="page-item"><a onclick="onPaginationClick(this)" class="page-link color-black bg-theme rounded-xs shadow-x1 border-0" style="cursor: pointer;">1</a></li>
|
||||||
|
<li id="$$html-id;-2" class="page-item"><a onclick="onPaginationClick(this)" class="page-link color-black bg-theme rounded-xs shadow-x1 border-0" style="cursor: pointer;">2</a></li>
|
||||||
|
<li id="$$html-id;-3" class="page-item"><a onclick="onPaginationClick(this)" class="page-link color-black bg-theme rounded-xs shadow-x1 border-0" style="cursor: pointer;">3</a></li>
|
||||||
|
<li id="$$html-id;-4" class="page-item"><a onclick="onPaginationClick(this)" class="page-link color-black bg-theme rounded-xs shadow-x1 border-0" style="cursor: pointer;">4</a></li>
|
||||||
|
<li id="$$html-id;-5" class="page-item"><a onclick="onPaginationClick(this)" class="page-link color-black bg-theme rounded-xs shadow-x1 border-0" style="cursor: pointer;">5</a></li>
|
||||||
|
<li id="$$html-id;-6" class="page-item"><a onclick="onPaginationClick(this)" class="page-link color-black bg-theme rounded-xs shadow-x1 border-0" style="cursor: pointer;">6</a></li>
|
||||||
|
<li id="$$html-id;-7" class="page-item"><a onclick="onPaginationClick(this)" class="page-link color-black bg-theme rounded-xs shadow-x1 border-0" style="cursor: pointer;">7</a></li>
|
||||||
|
</ul>
|
||||||
|
</nav>
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
<div class="input-style input-style-2 input-required">
|
<div class="input-style input-style-2 input-required $$css-class;">
|
||||||
<span class="color-highlight input-style-1-active">$$placeholder;</span>
|
<span class="color-highlight input-style-1-active">$$placeholder;</span>
|
||||||
<select id="$$html-id;" class="form-control $$css-class;">
|
<select id="$$html-id;" class="form-control">
|
||||||
$$options;
|
$$options;
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
<div class="input-style input-style-2 input-required">
|
<div class="input-style input-style-2 input-required $$css-class;">
|
||||||
<span class="color-highlight">$$placeholder;</span>
|
<span class="color-highlight">$$placeholder;</span>
|
||||||
<textarea id="$$html-id;" class="form-control $$css-class;" placeholder="$$placeholder;">$$value;</textarea>
|
<textarea id="$$html-id;" class="form-control" placeholder="$$placeholder;">$$value;</textarea>
|
||||||
</div>
|
</div>
|
||||||
5
server/version.php
Normal file
5
server/version.php
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
define('PWA_VERSION', '1.4');
|
||||||
|
|
||||||
|
?>
|
||||||
@@ -42,7 +42,7 @@ workbox.precaching.precacheAndRoute([
|
|||||||
}
|
}
|
||||||
$hash = md5(getDirHash(__DIR__));
|
$hash = md5(getDirHash(__DIR__));
|
||||||
|
|
||||||
$path = __DIR__ . '/content/';
|
$path = __DIR__ . '/server/content/';
|
||||||
$dir = opendir($path);
|
$dir = opendir($path);
|
||||||
while ($file = readdir($dir)) {
|
while ($file = readdir($dir)) {
|
||||||
if (($file == '.') or ($file == '..') or (pathinfo($file, PATHINFO_EXTENSION) != 'php')) continue;
|
if (($file == '.') or ($file == '..') or (pathinfo($file, PATHINFO_EXTENSION) != 'php')) continue;
|
||||||
|
|||||||
Reference in New Issue
Block a user