summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authormsquare <msquare@notrademark.de>2019-11-03 12:08:46 +0100
committermsquare <msquare@notrademark.de>2019-11-03 12:08:46 +0100
commit613d258c87fb3d8e6f221f4c416e3054583dcc79 (patch)
treede23fa902d9630853580dcd822ad6632a01c62e3 /includes
parentdc3de33a4b03cbbb17acb565ba6826ac42f2d189 (diff)
fix #345 by adding a badge to shift view wich contains number of missing angels
Diffstat (limited to 'includes')
-rw-r--r--includes/view/ShiftCalendarShiftRenderer.php9
1 files changed, 7 insertions, 2 deletions
diff --git a/includes/view/ShiftCalendarShiftRenderer.php b/includes/view/ShiftCalendarShiftRenderer.php
index 4911979f..9e634b90 100644
--- a/includes/view/ShiftCalendarShiftRenderer.php
+++ b/includes/view/ShiftCalendarShiftRenderer.php
@@ -44,7 +44,7 @@ class ShiftCalendarShiftRenderer
div(
'shift panel panel-' . $class,
[
- $this->renderShiftHead($shift, $class),
+ $this->renderShiftHead($shift, $class, $shift_signup_state->getFreeEntries()),
div('panel-body', [
$info_text,
Room_name_render([
@@ -254,7 +254,7 @@ class ShiftCalendarShiftRenderer
* @param string $class The shift state class
* @return string
*/
- private function renderShiftHead($shift, $class)
+ private function renderShiftHead($shift, $class, $needed_angeltypes_count)
{
$header_buttons = '';
if (auth()->can('admin_shifts')) {
@@ -274,6 +274,11 @@ class ShiftCalendarShiftRenderer
$shift_heading = date('H:i', $shift['start']) . ' &dash; '
. date('H:i', $shift['end']) . ' &mdash; '
. $shift['name'];
+
+ if($needed_angeltypes_count > 0) {
+ $shift_heading = '<span class="badge">' . $needed_angeltypes_count . '</span> ' . $shift_heading;
+ }
+
return div('panel-heading', [
'<a href="' . shift_link($shift) . '">' . $shift_heading . '</a>',
$header_buttons