user();
$assignNotice = '';
if (config('signup_requires_arrival') && !$user->state->arrived) {
$assignNotice = info(render_user_arrived_hint(), true);
}
$description = '';
if (!empty($room['description'])) {
$description = '
' . __('Description') . '
';
$parsedown = new Parsedown();
$description .= '' . $parsedown->parse($room['description']) . '
';
}
$tabs = [];
if (!empty($room['map_url'])) {
$tabs[__('Map')] = sprintf(
''
. ''
. '
',
$room['map_url']
);
}
$tabs[__('Shifts')] = div('first', [
$shiftsFilterRenderer->render(page_link_to('rooms', [
'action' => 'view',
'room_id' => $room['RID']
])),
$shiftCalendarRenderer->render()
]);
$selected_tab = 0;
$request = request();
if ($request->has('shifts_filter_day')) {
$selected_tab = count($tabs) - 1;
}
return page_with_title(glyph('map-marker') . $room['Name'], [
$assignNotice,
$description,
auth()->can('admin_rooms') ? buttons([
button(
page_link_to('admin_rooms', ['show' => 'edit', 'id' => $room->id]),
__('edit'),
'btn'
),
button(
page_link_to('admin_rooms', ['show' => 'delete', 'id' => $room->id]),
__('delete'),
'btn'
)
]) : '',
tabs($tabs, $selected_tab),
], true);
}
/**
*
* @param array $room
* @return string
*/
function Room_name_render($room)
{
if (auth()->can('view_rooms')) {
return '' . glyph('map-marker') . $room['Name'] . '';
}
return glyph('map-marker') . $room['Name'];
}