rebuild login page

This commit is contained in:
msquare 2016-11-18 15:36:02 +01:00
parent 9098b8e80d
commit 409761ce4b
8 changed files with 98 additions and 30 deletions

View File

@ -212,7 +212,7 @@ function guest_register() {
]), ]),
div('col-sm-8', [ div('col-sm-8', [
form_email('mail', _("E-Mail") . ' ' . entry_required(), $mail), form_email('mail', _("E-Mail") . ' ' . entry_required(), $mail),
form_checkbox('email_shiftinfo', _("The engelsystem is allowed to send me an email (e.g. when my shifts change)"), $email_shiftinfo), form_checkbox('email_shiftinfo', _("The engelsystem is allowed to send me an email (e.g. when my shifts change)"), $email_shiftinfo),
form_checkbox('email_by_human_allowed', _("Humans are allowed to send me an email (e.g. for ticket vouchers)"), $email_by_human_allowed) form_checkbox('email_by_human_allowed', _("Humans are allowed to send me an email (e.g. for ticket vouchers)"), $email_by_human_allowed)
]) ])
]), ]),
@ -286,9 +286,9 @@ function guest_login() {
$nick = ""; $nick = "";
unset($_SESSION['uid']); unset($_SESSION['uid']);
$valid = true;
if (isset($_REQUEST['submit'])) { if (isset($_REQUEST['submit'])) {
$valid = true;
if (isset($_REQUEST['nick']) && strlen(User_validate_Nick($_REQUEST['nick'])) > 0) { if (isset($_REQUEST['nick']) && strlen(User_validate_Nick($_REQUEST['nick'])) > 0) {
$nick = User_validate_Nick($_REQUEST['nick']); $nick = User_validate_Nick($_REQUEST['nick']);
@ -326,25 +326,36 @@ function guest_login() {
return page([ return page([
div('col-md-12', [ div('col-md-12', [
div('row', [ div('row', [
div('col-md-4', [ EventConfig_countdown_page($event_config)
EventConfig_countdown_page($event_config) ]),
div('row', []),
div('row', [
div('col-md-4 text-center', [
heading(register_title(), 2),
get_register_hint()
]), ]),
div('col-md-4', [ div('col-md-4', [
heading(login_title(), 2), div('panel panel-primary first', [
msg(), div('panel-heading', [
form([ '<span class="icon-icon_angel"></span> ' . _("Login")
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('panel-body', [
msg(),
form([
form_text_placeholder('nick', _("Nick"), $nick),
form_password_placeholder('password', _("Password")),
form_submit('submit', _("Login")),
! $valid ? buttons([
button(page_link_to('user_password_recovery'), _("I forgot my password"))
]) : ''
])
]),
div('panel-footer', [
glyph('info-sign') . _("Please note: You have to activate cookies!")
])
]) ])
]), ]),
div('col-md-4', [ div('col-md-4 text-center', [
heading(register_title(), 2),
get_register_hint(),
heading(_("What can I do?"), 2), heading(_("What can I do?"), 2),
'<p>' . _("Please read about the jobs you can do to help us.") . '</p>', '<p>' . _("Please read about the jobs you can do to help us.") . '</p>',
buttons([ buttons([

View File

@ -175,6 +175,23 @@ function form_text($name, $label, $value, $disabled = false) {
return form_element($label, '<input class="form-control" id="form_' . $name . '" type="text" name="' . $name . '" value="' . htmlspecialchars($value) . '" ' . $disabled . '/>', 'form_' . $name); return form_element($label, '<input class="form-control" id="form_' . $name . '" type="text" name="' . $name . '" value="' . htmlspecialchars($value) . '" ' . $disabled . '/>', 'form_' . $name);
} }
/**
* Renders a text input with placeholder instead of label.
*
* @param String $name
* Input name
* @param String $placeholder
* Placeholder
* @param String $value
* The value
* @param Boolean $disabled
* Is the field enabled?
*/
function form_text_placeholder($name, $placeholder, $value, $disabled = false) {
$disabled = $disabled ? ' disabled="disabled"' : '';
return form_element('', '<input class="form-control" id="form_' . $name . '" type="text" name="' . $name . '" value="' . htmlspecialchars($value) . '" placeholder="' . $placeholder . '" ' . $disabled . '/>');
}
/** /**
* Rendert ein Formular-Emailfeld * Rendert ein Formular-Emailfeld
*/ */
@ -198,6 +215,14 @@ function form_password($name, $label, $disabled = false) {
return form_element($label, '<input class="form-control" id="form_' . $name . '" type="password" name="' . $name . '" value="" ' . $disabled . '/>', 'form_' . $name); return form_element($label, '<input class="form-control" id="form_' . $name . '" type="password" name="' . $name . '" value="" ' . $disabled . '/>', 'form_' . $name);
} }
/**
* Renders a password input with placeholder instead of label.
*/
function form_password_placeholder($name, $placeholder, $disabled = false) {
$disabled = $disabled ? ' disabled="disabled"' : '';
return form_element('', '<input class="form-control" id="form_' . $name . '" type="password" name="' . $name . '" value="" placeholder="' . $placeholder . '" ' . $disabled . '/>', 'form_' . $name);
}
/** /**
* Rendert ein Formular-Textfeld * Rendert ein Formular-Textfeld
*/ */

View File

@ -6,33 +6,49 @@
*/ */
function EventConfig_countdown_page($event_config) { function EventConfig_countdown_page($event_config) {
if ($event_config == null) { if ($event_config == null) {
return info(_("We got no information about the event right now."), true); return div('col-md-12 text-center', [
heading(sprintf(_("Welcome to the %s!"), '<span class="icon-icon_angel"></span> ENGELSYSTEM'), 2)
]);
} }
$elements = []; $elements = [];
if ($event_config['event_name'] != null) { if ($event_config['event_name'] != null) {
$elements[] = heading($event_config['event_name'], 2); $elements[] = div('col-md-12 text-center', [
heading(sprintf(_("Welcome to the %s!"), $event_config['event_name'] . ' <span class="icon-icon_angel"></span> ENGELSYSTEM'), 2)
]);
} }
if ($event_config['event_start_date'] != null && $event_config['event_end_date'] != null) { if ($event_config['buildup_start_date'] != null) {
$elements[] = sprintf(_("from %s to %s"), date("Y-m-d", $event_config['event_start_date']), date("Y-m-d", $event_config['event_end_date'])); $elements[] = div('col-md-3 text-center', [
heading(_("Buildup starts"), 3),
'<h2 class="moment-countdown" data-timestamp="' . $event_config['buildup_start_date'] . '">%c</h2>',
'<small>' . date(_("Y-m-d"), $event_config['buildup_start_date']) . '</small>'
]);
} }
if ($event_config['buildup_start_date'] != null && time() < $event_config['buildup_start_date']) { if ($event_config['event_start_date'] != null) {
$elements[] = '<h2 class="moment-countdown" data-timestamp="' . $event_config['buildup_start_date'] . '">' . _("Buildup starts in %c") . '</h2>'; $elements[] = div('col-md-3 text-center', [
heading(_("Event starts"), 3),
'<h2 class="moment-countdown" data-timestamp="' . $event_config['event_start_date'] . '">%c</h2>',
'<small>' . date(_("Y-m-d"), $event_config['event_start_date']) . '</small>'
]);
} }
if ($event_config['event_start_date'] != null && time() < $event_config['event_start_date']) { if ($event_config['event_end_date'] != null) {
$elements[] = '<h2 class="moment-countdown" data-timestamp="' . $event_config['event_start_date'] . '">' . _("Event starts in %c") . '</h2>'; $elements[] = div('col-md-3 text-center', [
heading(_("Event ends"), 3),
'<h2 class="moment-countdown" data-timestamp="' . $event_config['event_end_date'] . '">%c</h2>',
'<small>' . date(_("Y-m-d"), $event_config['event_end_date']) . '</small>'
]);
} }
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'])) { if ($event_config['teardown_end_date'] != null) {
$elements[] = '<h2 class="moment-countdown" data-timestamp="' . $event_config['event_end_date'] . '">' . _("Event ends in %c") . '</h2>'; $elements[] = div('col-md-3 text-center', [
} heading(_("Teardown ends"), 3),
'<h2 class="moment-countdown" data-timestamp="' . $event_config['teardown_end_date'] . '">%c</h2>',
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'])) { '<small>' . date(_("Y-m-d"), $event_config['teardown_end_date']) . '</small>'
$elements[] = '<h2 class="moment-countdown" data-timestamp="' . $event_config['teardown_end_date'] . '">' . _("Teardown ends in %c") . '</h2>'; ]);
} }
return join("", $elements); return join("", $elements);

View File

@ -6730,6 +6730,9 @@ body {
.footer a { .footer a {
color: #777777; color: #777777;
} }
.first {
margin-top: 20px;
}
.panel-primary .panel-heading a { .panel-primary .panel-heading a {
color: #ffffff; color: #ffffff;
} }

View File

@ -6753,6 +6753,9 @@ body {
.footer a { .footer a {
color: #888888; color: #888888;
} }
.first {
margin-top: 20px;
}
.panel-primary .panel-heading a { .panel-primary .panel-heading a {
color: #ffffff; color: #ffffff;
} }

View File

@ -6730,6 +6730,9 @@ body {
.footer a { .footer a {
color: #777777; color: #777777;
} }
.first {
margin-top: 20px;
}
.panel-primary .panel-heading a { .panel-primary .panel-heading a {
color: #ffffff; color: #ffffff;
} }

View File

@ -6739,6 +6739,9 @@ body {
.footer a { .footer a {
color: #777777; color: #777777;
} }
.first {
margin-top: 20px;
}
.panel-primary .panel-heading a { .panel-primary .panel-heading a {
color: #ffffff; color: #ffffff;
} }

View File

@ -10,6 +10,10 @@ body {
color: @text-muted; color: @text-muted;
} }
.first {
margin-top: 20px;
}
.panel-primary .panel-heading a { .panel-primary .panel-heading a {
color: @panel-primary-text; color: @panel-primary-text;
} }