rebuild login page

main
msquare 8 years ago
parent 9098b8e80d
commit 409761ce4b

@ -212,7 +212,7 @@ function guest_register() {
]),
div('col-sm-8', [
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)
])
]),
@ -286,9 +286,9 @@ function guest_login() {
$nick = "";
unset($_SESSION['uid']);
$valid = true;
if (isset($_REQUEST['submit'])) {
$valid = true;
if (isset($_REQUEST['nick']) && strlen(User_validate_Nick($_REQUEST['nick'])) > 0) {
$nick = User_validate_Nick($_REQUEST['nick']);
@ -326,25 +326,36 @@ function guest_login() {
return page([
div('col-md-12', [
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', [
heading(login_title(), 2),
msg(),
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"))
div('panel panel-primary first', [
div('panel-heading', [
'<span class="icon-icon_angel"></span> ' . _("Login")
]),
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', [
heading(register_title(), 2),
get_register_hint(),
div('col-md-4 text-center', [
heading(_("What can I do?"), 2),
'<p>' . _("Please read about the jobs you can do to help us.") . '</p>',
buttons([

@ -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);
}
/**
* 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
*/
@ -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);
}
/**
* 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
*/

@ -6,33 +6,49 @@
*/
function EventConfig_countdown_page($event_config) {
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 = [];
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) {
$elements[] = sprintf(_("from %s to %s"), date("Y-m-d", $event_config['event_start_date']), date("Y-m-d", $event_config['event_end_date']));
}
if ($event_config['buildup_start_date'] != null && time() < $event_config['buildup_start_date']) {
$elements[] = '<h2 class="moment-countdown" data-timestamp="' . $event_config['buildup_start_date'] . '">' . _("Buildup starts in %c") . '</h2>';
if ($event_config['buildup_start_date'] != null) {
$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['event_start_date'] != null && time() < $event_config['event_start_date']) {
$elements[] = '<h2 class="moment-countdown" data-timestamp="' . $event_config['event_start_date'] . '">' . _("Event starts in %c") . '</h2>';
if ($event_config['event_start_date'] != null) {
$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_end_date'] != null && time() < $event_config['event_end_date'] && ($event_config['event_start_date'] == null || time() > $event_config['event_start_date'])) {
$elements[] = '<h2 class="moment-countdown" data-timestamp="' . $event_config['event_end_date'] . '">' . _("Event ends in %c") . '</h2>';
if ($event_config['event_end_date'] != null) {
$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['teardown_end_date'] != null && time() < $event_config['teardown_end_date'] && ($event_config['event_start_date'] == null || time() > $event_config['event_start_date'])) {
$elements[] = '<h2 class="moment-countdown" data-timestamp="' . $event_config['teardown_end_date'] . '">' . _("Teardown ends in %c") . '</h2>';
if ($event_config['teardown_end_date'] != null) {
$elements[] = div('col-md-3 text-center', [
heading(_("Teardown ends"), 3),
'<h2 class="moment-countdown" data-timestamp="' . $event_config['teardown_end_date'] . '">%c</h2>',
'<small>' . date(_("Y-m-d"), $event_config['teardown_end_date']) . '</small>'
]);
}
return join("", $elements);

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

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

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

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

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

Loading…
Cancel
Save