diff --git a/includes/pages/guest_login.php b/includes/pages/guest_login.php index d3eb1916..dfda3306 100644 --- a/includes/pages/guest_login.php +++ b/includes/pages/guest_login.php @@ -306,27 +306,38 @@ function guest_login() { } } - return page_with_title(login_title(), [ - msg(), - div('row', [ - div('col-md-6', [ - form([ - form_text('nick', _("Nick"), $nick), - form_password('password', _("Password")), - form_submit('submit', _("Login")), + $event_config = EventConfig(); + if ($event_config === false) { + engelsystem_error("Unable to load event config."); + } + + return page([ + div('col-md-12', [ + msg(), + div('row', [ + div('col-md-4', [ + EventConfig_countdown_page($event_config) + ]), + div('col-md-4', [ + heading(login_title(), 2), + form([ + form_text('nick', _("Nick"), $nick), + form_password('password', _("Password")), + form_submit('submit', _("Login")), + buttons([ + button(page_link_to('user_password_recovery'), _("I forgot my password")) + ]), + info(_("Please note: You have to activate cookies!"), true) + ]) + ]), + div('col-md-4', [ + heading(register_title(), 2), + get_register_hint(), + heading(_("What can I do?"), 2), + '

' . _("Please read about the jobs you can do to help us.") . '

', buttons([ - button(page_link_to('user_password_recovery'), _("I forgot my password")) - ]), - info(_("Please note: You have to activate cookies!"), true) - ]) - ]), - div('col-md-6', [ - '

' . register_title() . '

', - get_register_hint(), - '

' . _("What can I do?") . '

', - '

' . _("Please read about the jobs you can do to help us.") . '

', - buttons([ - button(page_link_to('angeltypes') . '&action=about', _("Teams/Job description") . ' »') + button(page_link_to('angeltypes') . '&action=about', _("Teams/Job description") . ' »') + ]) ]) ]) ]) diff --git a/includes/view/EventConfig_view.php b/includes/view/EventConfig_view.php index 429b6a86..682477ff 100644 --- a/includes/view/EventConfig_view.php +++ b/includes/view/EventConfig_view.php @@ -1,12 +1,49 @@ ' . _("Buildup starts in %c") . ''; + } + + if ($event_config['event_start_date'] != null && time() < $event_config['event_start_date']) { + $elements[] = '

' . _("Event starts in %c") . '

'; + } + + if ($event_config['event_end_date'] != null && time() < $event_config['event_end_date'] && ($event_config['event_start_date'] == null || time() > $event_config['event_start_date'])) { + $elements[] = '

' . _("Event ends in %c") . '

'; + } + + if ($event_config['teardown_end_date'] != null && time() < $event_config['teardown_end_date'] && ($event_config['event_start_date'] == null || time() > $event_config['event_start_date'])) { + $elements[] = '

' . _("Teardown ends in %c") . '

'; + } + + return join("", $elements); +} + /** * Converts event name and start+end date into a line of text. */ -function EventConfig_info() { - $event_config = EventConfig(); - if ($event_config === false) { - engelsystem_error("Unable to load event config."); +function EventConfig_info($event_config) { + if ($event_config == null) { + return ""; } // Event name, start+end date are set diff --git a/public/index.php b/public/index.php index e8cb1e2f..7915e8a6 100644 --- a/public/index.php +++ b/public/index.php @@ -155,6 +155,11 @@ if (isset($_REQUEST['p']) && preg_match("/^[a-z0-9_]*$/i", $_REQUEST['p']) && (i } } +$event_config = EventConfig(); +if ($event_config === false) { + engelsystem_error("Unable to load event config."); +} + echo template_render('../templates/layout.html', array( 'theme' => isset($user) ? $user['color'] : $default_theme, 'title' => $title, @@ -165,7 +170,7 @@ echo template_render('../templates/layout.html', array( 'faq_url' => $faq_url, 'contact_email' => $contact_email, 'locale' => locale(), - 'event_info' => EventConfig_info() . '
' + 'event_info' => EventConfig_info($event_config) . '
' )); ?>