From ea034ecec665aff04fd74c81e11c34000a9b9492 Mon Sep 17 00:00:00 2001 From: Michael Weimann Date: Sat, 14 Dec 2019 10:35:42 +0100 Subject: Add the container class to some views --- includes/pages/admin_rooms.php | 6 +++--- includes/pages/user_news.php | 9 ++++++--- includes/sys_template.php | 10 ++++++++-- includes/view/AngelTypes_view.php | 8 ++++---- includes/view/Questions_view.php | 2 +- includes/view/Rooms_view.php | 2 +- includes/view/ShiftTypes_view.php | 8 ++++---- includes/view/UserAngelTypes_view.php | 2 +- 8 files changed, 28 insertions(+), 19 deletions(-) diff --git a/includes/pages/admin_rooms.php b/includes/pages/admin_rooms.php index 733e56af..348a5b6d 100644 --- a/includes/pages/admin_rooms.php +++ b/includes/pages/admin_rooms.php @@ -170,7 +170,7 @@ function admin_rooms() ]), form_submit('submit', __('Save')) ]) - ]); + ], true); } elseif ($request->input('show') == 'delete') { if ($request->hasPostData('ack')) { $shifts = Shifts_by_room($room_id); @@ -195,7 +195,7 @@ function admin_rooms() form([ form_submit('ack', __('Delete'), 'delete btn-danger'), ], page_link_to('admin_rooms', ['show' => 'delete', 'id' => $room_id])), - ]); + ], true); } } @@ -209,5 +209,5 @@ function admin_rooms() 'map_url' => __('Map'), 'actions' => '' ], $rooms) - ]); + ], true); } diff --git a/includes/pages/user_news.php b/includes/pages/user_news.php index 8b9c21ad..53d3bd90 100644 --- a/includes/pages/user_news.php +++ b/includes/pages/user_news.php @@ -32,7 +32,8 @@ function meetings_title() function user_meetings() { $display_news = config('display_news'); - $html = '

' . meetings_title() . '

' . msg(); + $html = '
'; + $html .= '

' . meetings_title() . '

' . msg(); $request = request(); if (preg_match('/^\d{1,}$/', $request->input('page', 0))) { @@ -128,7 +129,8 @@ function user_news_comments() $user = auth()->user(); $request = request(); - $html = '

' . user_news_comments_title() . '

'; + $html = '
'; + $html .= '

' . user_news_comments_title() . '

'; $nid = $request->input('nid'); if ( $request->has('nid') @@ -179,7 +181,8 @@ function user_news() $display_news = config('display_news'); $request = request(); - $html = '

' . news_title() . '

' . msg(); + $html = '
'; + $html .= '

' . news_title() . '

' . msg(); $isMeeting = $request->postData('treffen', false); if ($request->has('text') && $request->has('betreff') && auth()->can('admin_news')) { diff --git a/includes/sys_template.php b/includes/sys_template.php index cf4c64aa..33044fad 100644 --- a/includes/sys_template.php +++ b/includes/sys_template.php @@ -251,11 +251,17 @@ function page($elements) * * @param string $title * @param string[] $elements + * @param bool $container * @return string */ -function page_with_title($title, $elements) +function page_with_title($title, $elements, bool $container = false) { - return '

' . $title . '

' . join($elements) . '
'; + if ($container) { + $html = '
'; + } else { + $html = '
'; + } + return $html . '

' . $title . '

' . join($elements) . '
'; } /** diff --git a/includes/view/AngelTypes_view.php b/includes/view/AngelTypes_view.php index 9f9bd736..0eb8ef86 100644 --- a/includes/view/AngelTypes_view.php +++ b/includes/view/AngelTypes_view.php @@ -64,7 +64,7 @@ function AngelType_delete_view($angeltype) form_submit('delete', glyph('ok') . __('delete'), 'btn-danger', false), ]) ]), - ]); + ], true); } /** @@ -360,7 +360,7 @@ function AngelType_view( $shiftCalendarRenderer ) ], $tab) - ]); + ], true); } /** @@ -507,7 +507,7 @@ function AngelTypes_list_view($angeltypes, $admin_angeltypes) 'membership' => __('Membership'), 'actions' => '' ], $angeltypes) - ]); + ], true); } /** @@ -595,5 +595,5 @@ function AngelTypes_about_view($angeltypes, $user_logged_in) $content[] = AngelTypes_about_view_angeltype($angeltype); } - return page_with_title(__('Teams/Job description'), $content); + return page_with_title(__('Teams/Job description'), $content, true); } diff --git a/includes/view/Questions_view.php b/includes/view/Questions_view.php index a4c3a452..61f9f312 100644 --- a/includes/view/Questions_view.php +++ b/includes/view/Questions_view.php @@ -61,5 +61,5 @@ function Questions_view(array $open_questions, array $answered_questions, $ask_a form_textarea('question', __('Your Question:'), ''), form_submit('submit', __('Save')) ], $ask_action) - ]); + ], true); } diff --git a/includes/view/Rooms_view.php b/includes/view/Rooms_view.php index 4ea78e86..51e651ee 100644 --- a/includes/view/Rooms_view.php +++ b/includes/view/Rooms_view.php @@ -54,7 +54,7 @@ function Room_view($room, ShiftsFilterRenderer $shiftsFilterRenderer, ShiftCalen $assignNotice, $description, tabs($tabs, $selected_tab) - ]); + ], true); } /** diff --git a/includes/view/ShiftTypes_view.php b/includes/view/ShiftTypes_view.php index 634f9760..3e10be29 100644 --- a/includes/view/ShiftTypes_view.php +++ b/includes/view/ShiftTypes_view.php @@ -31,7 +31,7 @@ function ShiftType_delete_view($shifttype) ), ]), ]), - ]); + ], true); } /** @@ -63,7 +63,7 @@ function ShiftType_edit_view($name, $angeltype_id, $angeltypes, $description, $s form_info('', __('Please use markdown for the description.')), form_submit('submit', __('Save')) ]) - ]); + ], true); } /** @@ -99,7 +99,7 @@ function ShiftType_view($shifttype, $angeltype) ]), heading(__('Description'), 2), $parsedown->parse($shifttype['description']) - ]); + ], true); } /** @@ -140,5 +140,5 @@ function ShiftTypes_list_view($shifttypes) 'name' => __('Name'), 'actions' => '' ], $shifttypes) - ]); + ], true); } diff --git a/includes/view/UserAngelTypes_view.php b/includes/view/UserAngelTypes_view.php index d4d8aab6..8cba2060 100644 --- a/includes/view/UserAngelTypes_view.php +++ b/includes/view/UserAngelTypes_view.php @@ -123,7 +123,7 @@ function UserAngelType_delete_view($user_angeltype, $user, $angeltype) form_submit('delete', glyph('ok') . __('yes'), 'btn-primary', false), ]), ], page_link_to('user_angeltypes', ['action' => 'delete', 'user_angeltype_id' => $user_angeltype['id']])), - ]); + ], true); } /** -- cgit v1.2.3