diff options
author | msquare <msquare@notrademark.de> | 2017-12-13 17:50:52 +0100 |
---|---|---|
committer | msquare <msquare@notrademark.de> | 2017-12-13 17:50:52 +0100 |
commit | c70e268a2e25855391a53240a9ca783c3a7a94dd (patch) | |
tree | 8e8386044cf6d0baadaf55882538da603c6628ec /includes | |
parent | a8cf4b9ddf1b9ac68866db97372c14f6ceca1b12 (diff) |
add fullscreen button to dashboard and update translation to german
Diffstat (limited to 'includes')
-rw-r--r-- | includes/controller/public_dashboard_controller.php | 2 | ||||
-rw-r--r-- | includes/sys_template.php | 13 | ||||
-rw-r--r-- | includes/view/PublicDashboard_view.php | 17 |
3 files changed, 26 insertions, 6 deletions
diff --git a/includes/controller/public_dashboard_controller.php b/includes/controller/public_dashboard_controller.php index 311db22d..3cd85a50 100644 --- a/includes/controller/public_dashboard_controller.php +++ b/includes/controller/public_dashboard_controller.php @@ -15,7 +15,7 @@ function public_dashboard_controller() $free_shifts = Shifts_free(time(), time() + 12 * 60 * 60); return [ - _('Engelsystem Public Dashboard'), + _('Public Dashboard'), public_dashboard_view($stats, $free_shifts) ]; } diff --git a/includes/sys_template.php b/includes/sys_template.php index b5846e9b..48ec7e8c 100644 --- a/includes/sys_template.php +++ b/includes/sys_template.php @@ -355,6 +355,19 @@ function button($href, $label, $class = '') } /** + * Rendert einen Knopf mit JavaScript onclick Handler + * + * @param string $javascript + * @param string $label + * @param string $class + * @return string + */ +function button_js($javascript, $label, $class = '') +{ + return '<a onclick="' . $javascript . '" href="#" class="btn btn-default ' . $class . '">' . $label . '</a>'; +} + +/** * Rendert einen Knopf mit Glyph * * @param string $href diff --git a/includes/view/PublicDashboard_view.php b/includes/view/PublicDashboard_view.php index fc639ce9..c49f3715 100644 --- a/includes/view/PublicDashboard_view.php +++ b/includes/view/PublicDashboard_view.php @@ -11,7 +11,7 @@ function public_dashboard_view($stats, $free_shifts) foreach ($free_shifts as $shift) { $shift_panels[] = public_dashborad_shift_render($shift); } - $needed_angels = div('container-fluid first', [ + $needed_angels = div('first', [ div('col-md-12', [ heading(_('Needed angels:'), 1) ]), @@ -20,7 +20,7 @@ function public_dashboard_view($stats, $free_shifts) } return page([ div('public-dashboard', [ - div('first container-fluid', [ + div('first', [ stats(_('Angels needed in the next 3 hrs'), $stats['needed-3-hours']), stats(_('Angels needed for nightshifts'), $stats['needed-night']), stats(_('Angels currently working'), $stats['angels-working'], 'default'), @@ -33,10 +33,17 @@ function public_dashboard_view($stats, $free_shifts) }) </script>' ], 'statistics'), - $needed_angels + $needed_angels, + div('col-md-12', [ + buttons([ + button_js(' + $(\'#navbar-collapse-1,#footer,#fullscreen-button\').remove(); + $(\'.navbar-brand\').append(\' ' . _('Public Dashboard') . '\'); + ', glyph('fullscreen') . _('Fullscreen')) + ]) + ], 'fullscreen-button') ], 'public-dashboard') - ] - ); + ]); } /** |