summaryrefslogtreecommitdiff
path: root/includes/view/PublicDashboard_view.php
diff options
context:
space:
mode:
authormsquare <msquare@notrademark.de>2017-12-26 10:29:16 +0100
committerGitHub <noreply@github.com>2017-12-26 10:29:16 +0100
commitde61c88d6de67d12d5de5b6dd0ab6b8c82e5a290 (patch)
treeaac6a43cb88e3d803da5809ab37885b41bc811c6 /includes/view/PublicDashboard_view.php
parent879918864a9c6da0fe9be1aca6c443ec8df0afc3 (diff)
parentf8d0a7c5b00a58c646871e355b5876dcc5890be5 (diff)
Merge pull request #388 from MyIgel/master
Formatting, Docstrings, and fixup
Diffstat (limited to 'includes/view/PublicDashboard_view.php')
-rw-r--r--includes/view/PublicDashboard_view.php28
1 files changed, 19 insertions, 9 deletions
diff --git a/includes/view/PublicDashboard_view.php b/includes/view/PublicDashboard_view.php
index 30f63d63..b4064294 100644
--- a/includes/view/PublicDashboard_view.php
+++ b/includes/view/PublicDashboard_view.php
@@ -2,6 +2,10 @@
/**
* Public dashboard (formerly known as angel news hub)
+ *
+ * @param array $stats
+ * @param array[] $free_shifts
+ * @return string
*/
function public_dashboard_view($stats, $free_shifts)
{
@@ -9,7 +13,7 @@ function public_dashboard_view($stats, $free_shifts)
if (count($free_shifts) > 0) {
$shift_panels = [];
foreach ($free_shifts as $shift) {
- $shift_panels[] = public_dashborad_shift_render($shift);
+ $shift_panels[] = public_dashboard_shift_render($shift);
}
$needed_angels = div('first', [
div('col-md-12', [
@@ -18,6 +22,7 @@ function public_dashboard_view($stats, $free_shifts)
join($shift_panels)
]);
}
+
return page([
div('public-dashboard', [
div('first', [
@@ -48,23 +53,29 @@ function public_dashboard_view($stats, $free_shifts)
/**
* Renders a single shift panel for a dashboard shift with needed angels
+ *
+ * @param array $shift
+ * @return string
*/
-function public_dashborad_shift_render($shift)
+function public_dashboard_shift_render($shift)
{
$panel_body = glyph('time') . $shift['start'] . ' - ' . $shift['end'];
$panel_body .= ' (' . $shift['duration'] . ' h)';
-
+
$panel_body .= '<br>' . glyph('tasks') . $shift['shifttype_name'];
- if (! empty($shift['title'])) {
+ if (!empty($shift['title'])) {
$panel_body .= ' (' . $shift['title'] . ')';
}
-
+
$panel_body .= '<br>' . glyph('map-marker') . $shift['room_name'];
-
+
foreach ($shift['needed_angels'] as $needed_angels) {
- $panel_body .= '<br>' . glyph('user') . '<span class="text-' . $shift['style'] . '">' . $needed_angels['need'] . ' &times; ' . $needed_angels['angeltype_name'] . '</span>';
+ $panel_body .= '<br>' . glyph('user')
+ . '<span class="text-' . $shift['style'] . '">'
+ . $needed_angels['need'] . ' &times; ' . $needed_angels['angeltype_name']
+ . '</span>';
}
-
+
return div('col-md-3', [
div('dashboard-panel panel panel-' . $shift['style'], [
div('panel-body', [
@@ -74,4 +85,3 @@ function public_dashborad_shift_render($shift)
])
]);
}
-?>