summaryrefslogtreecommitdiff
path: root/includes/view
diff options
context:
space:
mode:
Diffstat (limited to 'includes/view')
-rw-r--r--includes/view/AngelTypes_view.php14
-rw-r--r--includes/view/PublicDashboard_view.php27
2 files changed, 15 insertions, 26 deletions
diff --git a/includes/view/AngelTypes_view.php b/includes/view/AngelTypes_view.php
index a8b34df8..a5c10a38 100644
--- a/includes/view/AngelTypes_view.php
+++ b/includes/view/AngelTypes_view.php
@@ -84,6 +84,10 @@ function AngelType_edit_view($angeltype, $supporter_mode)
$supporter_mode
? form_info(_('Restricted'), $angeltype['restricted'] ? _('Yes') : _('No'))
: form_checkbox('restricted', _('Restricted'), $angeltype['restricted']),
+ form_info(
+ '',
+ _('Restricted angel types can only be used by an angel if enabled by a supporter (double opt-in).')
+ ),
$supporter_mode
? form_info(_('No Self Sign Up'), $angeltype['no_self_signup'] ? _('Yes') : _('No'))
: form_checkbox('no_self_signup', _('No Self Sign Up'), $angeltype['no_self_signup']),
@@ -92,12 +96,10 @@ function AngelType_edit_view($angeltype, $supporter_mode)
: form_checkbox(
'requires_driver_license',
_('Requires driver license'),
- $angeltype['requires_driver_license']
- ),
- form_info(
- '',
- _('Restricted angel types can only be used by an angel if enabled by a supporter (double opt-in).')
- ),
+ $angeltype['requires_driver_license']),
+ $supporter_mode
+ ? form_info(_('Show on dashboard'), $angeltype['show_on_dashboard'] ? _('Yes') : _('No'))
+ : form_checkbox('show_on_dashboard', _('Show on dashboard'), $angeltype['show_on_dashboard']),
form_textarea('description', _('Description'), $angeltype['description']),
form_info('', _('Please use markdown for the description.')),
heading(_('Contact'), 3),
diff --git a/includes/view/PublicDashboard_view.php b/includes/view/PublicDashboard_view.php
index 7ae434a2..30f63d63 100644
--- a/includes/view/PublicDashboard_view.php
+++ b/includes/view/PublicDashboard_view.php
@@ -51,35 +51,22 @@ function public_dashboard_view($stats, $free_shifts)
*/
function public_dashborad_shift_render($shift)
{
- $style = 'default';
- if (time() + 3 * 60 * 60 > $shift['start']) {
- $style = 'warning';
- }
- if (time() > $shift['start']) {
- $style = 'danger';
- }
-
- $panel_body = glyph('time') . date('H:i', $shift['start']) . ' - ' . date('H:i', $shift['end']);
- $panel_body .= ' (' . round(($shift['end'] - $shift['start']) / 3600) . ' h)';
+ $panel_body = glyph('time') . $shift['start'] . ' - ' . $shift['end'];
+ $panel_body .= ' (' . $shift['duration'] . ' h)';
- $panel_body .= '<br>' . glyph('tasks') . ShiftType($shift['shifttype_id'])['name'];
+ $panel_body .= '<br>' . glyph('tasks') . $shift['shifttype_name'];
if (! empty($shift['title'])) {
$panel_body .= ' (' . $shift['title'] . ')';
}
- $panel_body .= '<br>' . glyph('map-marker') . Room($shift['RID'])['Name'];
+ $panel_body .= '<br>' . glyph('map-marker') . $shift['room_name'];
- 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 . ' &times; ' . AngelType($needed_angels['TID'])['name'] . '</span>';
- }
+ 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 = '<a href="' . shift_link($shift) . '">' . $panel_body . '</a>';
-
return div('col-md-3', [
- div('dashboard-panel panel panel-' . $style, [
+ div('dashboard-panel panel panel-' . $shift['style'], [
div('panel-body', [
'<a class="panel-link" href="' . shift_link($shift) . '"></a>',
$panel_body