From 4143680297808dd23fe03b121f28ad5183601b8b Mon Sep 17 00:00:00 2001 From: msquare Date: Sun, 10 Dec 2017 15:02:37 +0100 Subject: remove room number and visible flag, rename pentabarf to frab and introduce map/c3nav integration as well as markdown description for rooms --- includes/view/Rooms_view.php | 49 +++++++++++++++++++++++++++++++++----------- 1 file changed, 37 insertions(+), 12 deletions(-) (limited to 'includes/view') diff --git a/includes/view/Rooms_view.php b/includes/view/Rooms_view.php index bd6138e1..1f0f9954 100644 --- a/includes/view/Rooms_view.php +++ b/includes/view/Rooms_view.php @@ -1,35 +1,60 @@ ' . _('Description') . ''; + $parsedown = new Parsedown(); + $description .= '
' . $parsedown->parse($room['description']) . '
'; + } + + $tabs = []; + $selected = 0; + if (! empty($room['map_url'])) { + $tabs[_('Map')] = '
'; + } + + $tabs[_('Shifts')] = div('first', [ $shiftsFilterRenderer->render(page_link_to('rooms', [ - 'action' => 'view', - 'room_id' => $room['RID'] + 'action' => 'view', + 'room_id' => $room['RID'] ])), - $assignNotice, $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, + tabs($tabs, $selected_tab) + ]); } /** - * @param array $room + * + * @param array $room * @return string */ function Room_name_render($room) -- cgit v1.2.3-54-g00ecf