diff options
author | msquare <msquare@notrademark.de> | 2017-12-13 16:51:38 +0100 |
---|---|---|
committer | msquare <msquare@notrademark.de> | 2017-12-13 16:51:38 +0100 |
commit | cf7eb80a921f0f8a007587d192a9f57a239f64a8 (patch) | |
tree | 78c2fbbdce346937a5993e595eee5a44494bdce7 /includes/view | |
parent | 42779067684d8b5bd66af5ae1ba6ba1f858c1bec (diff) |
fix dashboard ajax reload
Diffstat (limited to 'includes/view')
-rw-r--r-- | includes/view/PublicDashboard_view.php | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/includes/view/PublicDashboard_view.php b/includes/view/PublicDashboard_view.php index d1543229..fc639ce9 100644 --- a/includes/view/PublicDashboard_view.php +++ b/includes/view/PublicDashboard_view.php @@ -19,15 +19,24 @@ function public_dashboard_view($stats, $free_shifts) ]); } return page([ - div('first container-fluid', [ - 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'), - stats(_('Hours to be worked'), $stats['hours-to-work'], 'default'), - '<script>$(function(){setTimeout(function(){$(\'#statistics\').load(window.location.href + \' #statistics\');}, 60000)})</script>' - ], 'statistics'), - $needed_angels - ]); + div('public-dashboard', [ + div('first container-fluid', [ + 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'), + stats(_('Hours to be worked'), $stats['hours-to-work'], 'default'), + '<script> + $(function() { + setInterval(function() { + $(\'#public-dashboard\').parent().load(window.location.href + \' #public-dashboard\'); + }, 60000); + }) + </script>' + ], 'statistics'), + $needed_angels + ], 'public-dashboard') + ] + ); } /** @@ -56,11 +65,7 @@ function public_dashborad_shift_render($shift) foreach ($shift['NeedAngels'] as $needed_angels) { $need = $needed_angels['count'] - $needed_angels['taken']; if ($need > 0) { - $panel_body .= - '<br>' . glyph('user') . - '<span class="text-' . $style . '">' . - $need . ' × ' . AngelType($needed_angels['TID'])['name'] . - '</span>'; + $panel_body .= '<br>' . glyph('user') . '<span class="text-' . $style . '">' . $need . ' × ' . AngelType($needed_angels['TID'])['name'] . '</span>'; } } |