user();
$assignNotice = '';
if (config('signup_requires_arrival') && !$user->state->arrived) {
$assignNotice = info(render_user_arrived_hint(), true);
}
$description = '';
if ($room->description) {
$description = '
' . __('general.description') . '
';
$parsedown = new Parsedown();
$description .= $parsedown->parse($room->description);
}
$dect = '';
if (config('enable_dect') && $room->dect) {
$dect = heading(__('Contact'), 3)
. description([__('general.dect') => sprintf('%1$s', $room->dect)]);
}
$tabs = [];
if ($room->map_url) {
$tabs[__('room.map_url')] = sprintf(
''
. ''
. '
',
$room->map_url
);
}
$tabs[__('Shifts')] = div('first', [
$shiftsFilterRenderer->render(page_link_to('rooms', [
'action' => 'view',
'room_id' => $room->id,
]), ['rooms' => [$room->id]]),
$shiftCalendarRenderer->render(),
]);
$selected_tab = 0;
$request = request();
if ($request->has('shifts_filter_day')) {
$selected_tab = count($tabs) - 1;
}
$link = button(page_link_to('admin/rooms'), icon('chevron-left'), 'btn-sm');
return page_with_title(
(auth()->can('admin_rooms') ? $link . ' ' : '') .
icon('pin-map-fill') . $room->name,
[
$assignNotice,
auth()->can('admin_rooms') ? buttons([
button(
page_link_to('admin/rooms/edit/' . $room->id),
icon('pencil') . __('edit')
),
]) : '',
$dect,
$description,
tabs($tabs, $selected_tab),
],
true
);
}
/**
*
* @param Room $room
* @return string
*/
function Room_name_render(Room $room)
{
if (auth()->can('view_rooms')) {
return '' . icon('pin-map-fill') . $room->name . '';
}
return icon('pin-map-fill') . $room->name;
}