summaryrefslogtreecommitdiff
path: root/includes/view/ShiftCalendarRenderer.php
diff options
context:
space:
mode:
authormsquare <msquare@notrademark.de>2016-11-14 17:58:15 +0100
committermsquare <msquare@notrademark.de>2016-11-14 17:58:15 +0100
commitf5681411642b7da1b175fa153d3c234ba97b472a (patch)
tree3d474aff97498c834706024b6e0d88be1540c275 /includes/view/ShiftCalendarRenderer.php
parent0ab9f4f9886ca61fe0711ba1ee551394ceda877a (diff)
add shift legend and fix dark theme
Diffstat (limited to 'includes/view/ShiftCalendarRenderer.php')
-rw-r--r--includes/view/ShiftCalendarRenderer.php19
1 files changed, 16 insertions, 3 deletions
diff --git a/includes/view/ShiftCalendarRenderer.php b/includes/view/ShiftCalendarRenderer.php
index 989bd890..89c1be4c 100644
--- a/includes/view/ShiftCalendarRenderer.php
+++ b/includes/view/ShiftCalendarRenderer.php
@@ -25,7 +25,7 @@ class ShiftCalendarRenderer {
private $shiftsFilter;
private $firstBlockStartTime = null;
-
+
private $lastBlockEndTime = null;
private $blocksPerSlot = null;
@@ -85,7 +85,7 @@ class ShiftCalendarRenderer {
public function getFirstBlockStartTime() {
return $this->firstBlockStartTime;
}
-
+
public function getLastBlockEndTime() {
return $this->lastBlockEndTime;
}
@@ -106,7 +106,7 @@ class ShiftCalendarRenderer {
return div('shift-calendar', [
$this->renderTimeLane(),
$this->renderShiftLanes()
- ]);
+ ]) . $this->renderLegend();
}
/**
@@ -222,6 +222,19 @@ class ShiftCalendarRenderer {
private function calcBlocksPerSlot() {
return ceil(($this->getLastBlockEndTime() - $this->getFirstBlockStartTime()) / ShiftCalendarRenderer::SECONDS_PER_ROW);
}
+
+ /**
+ * Renders a legend explaining the shift coloring
+ */
+ private function renderLegend() {
+ return div('legend', [
+ label(_('Your shift'), 'primary'),
+ label(_('Help needed'), 'danger'),
+ label(_('Other angeltype needed / collides with my shifts'), 'warning'),
+ label(_('Shift is full'), 'success'),
+ label(_('Shift running/ended'), 'default')
+ ]);
+ }
}
?> \ No newline at end of file