diff options
| author | David Siegfried <david.siegfried@uni-vechta.de> | 2022-08-16 17:00:46 +0000 |
|---|---|---|
| committer | Elmar Ludwig <elmar.ludwig@uni-osnabrueck.de> | 2022-08-16 17:00:46 +0000 |
| commit | f652b37426ddaf58d8de412aaf3215d4d5f35131 (patch) | |
| tree | 2829c059897bb053f340b5bef06562ff7bf5de7d /templates/sidebar | |
| parent | 4306e0461a9f8c1d9ebcad9857e9c6f98735a459 (diff) | |
don't show room-type-filter if no room types exists, closes #1423
Closes #1423
Merge request studip/studip!897
Diffstat (limited to 'templates/sidebar')
| -rw-r--r-- | templates/sidebar/room-search-widget.php | 45 |
1 files changed, 20 insertions, 25 deletions
diff --git a/templates/sidebar/room-search-widget.php b/templates/sidebar/room-search-widget.php index 6a0fb91..5663c11 100644 --- a/templates/sidebar/room-search-widget.php +++ b/templates/sidebar/room-search-widget.php @@ -6,31 +6,30 @@ 'sidebar/room-search-criteria.php', [ 'criteria' => ( - $selected_criteria['special__room_name'] - ? $selected_criteria['special__room_name'] - : $criteria['special__room_name'] - ), - 'removable' => false - ] - ) ?> - <?= $this->render_partial( - 'sidebar/room-search-criteria.php', - [ - 'criteria' => ( - $selected_criteria['room_type'] - ? $selected_criteria['room_type'] - : $criteria['room_type'] - ), + $selected_criteria['special__room_name'] + ?: $criteria['special__room_name'] + ), 'removable' => false ] ) ?> + <? if (isset($criteria['room_type'])): ?> + <?= $this->render_partial( + 'sidebar/room-search-criteria.php', + [ + 'criteria' => ( + $selected_criteria['room_type'] + ?: $criteria['room_type'] + ), + 'removable' => false + ] + ) ?> + <? endif ?> <?= $this->render_partial( 'sidebar/room-search-criteria.php', [ 'criteria' => ( $selected_criteria['room_category_id'] - ? $selected_criteria['room_category_id'] - : $criteria['room_category_id'] + ?: $criteria['room_category_id'] ), 'removable' => false ] @@ -40,8 +39,7 @@ [ 'criteria' => ( $selected_criteria['special__building_location'] - ? $selected_criteria['special__building_location'] - : $criteria['special__building_location'] + ?: $criteria['special__building_location'] ), 'removable' => false ] @@ -52,8 +50,7 @@ [ 'criteria' => ( $selected_criteria['special__building_location_label'] - ? $selected_criteria['special__building_location_label'] - : $criteria['special__building_location_label'] + ?: $criteria['special__building_location_label'] ), 'removable' => false ] @@ -64,16 +61,14 @@ [ 'criteria' => $selected_criteria['special__seats'] - ? $selected_criteria['special__seats'] - : $criteria['special__seats'] + ?: $criteria['special__seats'] ] ) ?> <?= $this->render_partial( 'sidebar/room-search-criteria-available-range.php', [ 'criteria' => $selected_criteria['special__time_range'] - ? $selected_criteria['special__time_range'] - : $criteria['special__time_range'] + ?: $criteria['special__time_range'] ] ) ?> |
