From 8ff9b8b9b92ef0003ff775bd28ebaf83f82895ac Mon Sep 17 00:00:00 2001 From: Igor Scheller Date: Sat, 12 Sep 2020 23:14:38 +0200 Subject: [PATCH] Room page: Add edit/delete buttons --- includes/view/Rooms_view.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/includes/view/Rooms_view.php b/includes/view/Rooms_view.php index 51e651ee..44327c79 100644 --- a/includes/view/Rooms_view.php +++ b/includes/view/Rooms_view.php @@ -53,7 +53,19 @@ function Room_view($room, ShiftsFilterRenderer $shiftsFilterRenderer, ShiftCalen return page_with_title(glyph('map-marker') . $room['Name'], [ $assignNotice, $description, - tabs($tabs, $selected_tab) + 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); }