From d71e7bbfad2f07f82df0c515608996d250fd4182 Mon Sep 17 00:00:00 2001 From: Bot Date: Mon, 2 Jan 2017 15:43:36 +0100 Subject: Formatting --- public/index.php | 47 +++++++++------- public/js/forms.js | 32 +++++------ public/js/moment-countdown.js | 28 ++++----- public/js/sticky-headers.js | 33 ++++++----- public/maintenance.html | 128 +++++++++++++++++++++++------------------- public/overwhelmed.html | 104 ++++++++++++++++++++-------------- 6 files changed, 206 insertions(+), 166 deletions(-) (limited to 'public') diff --git a/public/index.php b/public/index.php index 9e04c4c7..8c3d6913 100644 --- a/public/index.php +++ b/public/index.php @@ -21,16 +21,23 @@ $free_pages = [ // Gewünschte Seite/Funktion $page = ""; -if (! isset($_REQUEST['p'])) { +if (!isset($_REQUEST['p'])) { $_REQUEST['p'] = isset($user) ? "news" : "login"; } -if (isset($_REQUEST['p']) && preg_match("/^[a-z0-9_]*$/i", $_REQUEST['p']) && (in_array($_REQUEST['p'], $free_pages) || in_array($_REQUEST['p'], $privileges))) { +if ( + isset($_REQUEST['p']) + && preg_match("/^[a-z0-9_]*$/i", $_REQUEST['p']) + && ( + in_array($_REQUEST['p'], $free_pages) + || in_array($_REQUEST['p'], $privileges) + ) +) { $page = $_REQUEST['p']; - + $title = $page; $content = ""; - + if ($page == "api") { require_once realpath(__DIR__ . '/../includes/controller/api.php'); error("Api disabled temporily."); @@ -151,26 +158,26 @@ if (isset($_REQUEST['p']) && preg_match("/^[a-z0-9_]*$/i", $_REQUEST['p']) && (i } } else { // Wenn schon eingeloggt, keine-Berechtigung-Seite anzeigen - if (isset($user)) { - $title = _("No Access"); - $content = _("You don't have permission to view this page. You probably have to sign in or register in order to gain access!"); - } else { - // Sonst zur Loginseite leiten - redirect(page_link_to("login")); - } + if (isset($user)) { + $title = _("No Access"); + $content = _("You don't have permission to view this page. You probably have to sign in or register in order to gain access!"); + } else { + // Sonst zur Loginseite leiten + redirect(page_link_to("login")); + } } $event_config = EventConfig(); echo template_render(__DIR__ . '/../templates/layout.html', [ - 'theme' => isset($user) ? $user['color'] : $default_theme, - 'title' => $title, - 'atom_link' => ($page == 'news' || $page == 'user_meetings') ? '' : '', - 'menu' => make_menu(), - 'content' => msg() . $content, + 'theme' => isset($user) ? $user['color'] : $default_theme, + 'title' => $title, + 'atom_link' => ($page == 'news' || $page == 'user_meetings') ? '' : '', + 'menu' => make_menu(), + 'content' => msg() . $content, 'header_toolbar' => header_toolbar(), - 'faq_url' => $faq_url, - 'contact_email' => $contact_email, - 'locale' => locale(), - 'event_info' => EventConfig_info($event_config) . '
' + 'faq_url' => $faq_url, + 'contact_email' => $contact_email, + 'locale' => locale(), + 'event_info' => EventConfig_info($event_config) . '
' ]); diff --git a/public/js/forms.js b/public/js/forms.js index f4e2e042..c4eb68df 100644 --- a/public/js/forms.js +++ b/public/js/forms.js @@ -1,28 +1,28 @@ /** * Runs through the DOM under the element with the given id, finds all * checkboxes and sets them to the wanted state. - * + * * @param String * id Id of the element containing all the checkboxes * @param Boolean * checked True if the checkboxes should be checked */ function checkAll(id, checked) { - var obj = document.getElementById(id); - var boxes = obj.getElementsByTagName("input"); - for (var i = 0; i < boxes.length; i++) { - if (boxes[i].type === "checkbox" && !boxes[i].disabled) { - boxes[i].checked = checked; - } - } + var obj = document.getElementById(id); + var boxes = obj.getElementsByTagName("input"); + for (var i = 0; i < boxes.length; i++) { + if (boxes[i].type === "checkbox" && !boxes[i].disabled) { + boxes[i].checked = checked; + } + } } -$(function() { - /** - * Disable every submit button after clicking (to prevent double-clicking) - */ - $("form").submit(function(ev) { - $("input[type='submit']").prop("readonly", true).addClass("disabled"); - return true; - }); +$(function () { + /** + * Disable every submit button after clicking (to prevent double-clicking) + */ + $("form").submit(function (ev) { + $("input[type='submit']").prop("readonly", true).addClass("disabled"); + return true; + }); }); diff --git a/public/js/moment-countdown.js b/public/js/moment-countdown.js index 9d655038..0cc78210 100644 --- a/public/js/moment-countdown.js +++ b/public/js/moment-countdown.js @@ -3,17 +3,17 @@ * class "moment-countdown" and the attribute "data-timestamp" which defines the * countdown's time goal. */ -$(document).ready(function() { - if (typeof moment !== "undefined") { - $.each($(".moment-countdown"), function(i, e) { - var span = $(e); - var text = span.html(); - /* global moment */ - var timestamp = moment(parseInt(span.attr("data-timestamp") * 1000)); - span.html(text.replace("%c", timestamp.fromNow())); - setInterval(function() { - span.html(text.replace("%c", timestamp.fromNow())); - }, 1000); - }); - } -}); \ No newline at end of file +$(document).ready(function () { + if (typeof moment !== "undefined") { + $.each($(".moment-countdown"), function (i, e) { + var span = $(e); + var text = span.html(); + /* global moment */ + var timestamp = moment(parseInt(span.attr("data-timestamp") * 1000)); + span.html(text.replace("%c", timestamp.fromNow())); + setInterval(function () { + span.html(text.replace("%c", timestamp.fromNow())); + }, 1000); + }); + } +}); diff --git a/public/js/sticky-headers.js b/public/js/sticky-headers.js index 1d6e9402..60f294b3 100644 --- a/public/js/sticky-headers.js +++ b/public/js/sticky-headers.js @@ -1,32 +1,31 @@ /** * Enables the fixed headers and time lane for the shift-calendar and datatables */ -$(document).ready( - function() { - if ($(".shift-calendar").length) { +$(document).ready(function () { + if ($(".shift-calendar").length) { var timeLanes = $(".shift-calendar .time"); var headers = $(".shift-calendar .header"); var topReference = $(".container-fluid .row"); var top = headers.offset().top; var left = 15; timeLanes.css({ - "position" : "relative", - "z-index" : 999 + "position": "relative", + "z-index": 999 }); headers.css({ - "position" : "relative", - "z-index" : 900 + "position": "relative", + "z-index": 900 }); $(window).scroll( - function() { - timeLanes.css({ - "left" : Math.max(0, $(window).scrollLeft() - left) + "px" - }); - headers.css({ - "top" : Math.max(0, $(window).scrollTop() - top - + topReference.offset().top) + function () { + timeLanes.css({ + "left": Math.max(0, $(window).scrollLeft() - left) + "px" + }); + headers.css({ + "top": Math.max(0, $(window).scrollTop() - top + + topReference.offset().top) + "px" - }); + }); }); - } - }); \ No newline at end of file + } +}); diff --git a/public/maintenance.html b/public/maintenance.html index bbdee2af..3f7dae8a 100644 --- a/public/maintenance.html +++ b/public/maintenance.html @@ -1,72 +1,86 @@ -Maintenance - Engelsystem - - - - - - - + Maintenance - Engelsystem + + + + + + + -