Skip to content

Commit

Permalink
Revert missed controls on space calendar
Browse files Browse the repository at this point in the history
  • Loading branch information
yurabakhtin committed May 27, 2024
1 parent 6b29cec commit 683654f
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 7 deletions.
1 change: 1 addition & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Changelog
-----------------------
- Enh #473: Add footer to global calendar
- Fix #474: Fix checking for past event when it is created from different time zone
- Fix #478: Revert missed controls on space calendar

1.5.10 (March 19, 2024)
-----------------------
Expand Down
7 changes: 4 additions & 3 deletions views/global/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,16 @@
<div class="calendar-option-buttons pull-right">
<?= CalendarControls::widget([
'widgets' => [
[ConfigureButton::class, [], ['sortOrder' => 100]]
]
[ConfigureButton::class, [], ['sortOrder' => 100]],
],
]) ?>
</div>
</div>
<div class="panel-body">
<?= CalendarFilterBar::widget([
'selectors' => $selectors,
'filters' => $filters
'filters' => $filters,
'showControls' => false,
]) ?>
</div>
<div class="panel-body">
Expand Down
10 changes: 6 additions & 4 deletions widgets/CalendarFilterBar.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class CalendarFilterBar extends Widget
public $filters = [];
public $selectors = [];

public $showControls = true;
public $showFilter = true;
public $showSelectors = true;
public $showTypes = true;
Expand All @@ -29,8 +30,8 @@ class CalendarFilterBar extends Widget

public function run()
{
if(Yii::$app->user->isGuest) {
return;
if (Yii::$app->user->isGuest) {
return '';
}

return $this->render('calendarFilterBar', [
Expand All @@ -39,7 +40,8 @@ public function run()
'selectors' => $this->selectors,
'showFilters' => $this->showFilter,
'showSelectors' => $this->showSelectors,
'showTypes' => $this->showTypes
'showTypes' => $this->showTypes,
'showControls' => $this->showControls,
]);
}
}
}
12 changes: 12 additions & 0 deletions widgets/views/calendarFilterBar.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<?php

use humhub\modules\calendar\models\CalendarEntry;
use humhub\modules\calendar\widgets\CalendarControls;
use humhub\modules\calendar\widgets\ConfigureButton;
use humhub\modules\calendar\widgets\FilterType;
use humhub\modules\content\components\ActiveQueryContent;
use humhub\widgets\FadeIn;
Expand All @@ -9,6 +11,7 @@
/* @var $canAddEntries bool */
/* @var $selectors array */
/* @var $filters array */
/* @var $showControls bool */
/* @var $showSelectors bool */
/* @var $showFilters bool */
/* @var $showTypes bool */
Expand All @@ -18,6 +21,15 @@
<div class="row calendar-options">
<div class="col-md-12">
<div id="calendar-overview-loader"></div>
<?php if ($showControls) : ?>
<div class="calendar-option-buttons">
<?= CalendarControls::widget([
'widgets' => [
[ConfigureButton::class, [], ['sortOrder' => 100]],
],
]) ?>
</div>
<?php endif; ?>
<?php if ($showSelectors) : ?>
<div class="calendar-selectors">
<div class="help-block" style="padding-left:10px;">
Expand Down

0 comments on commit 683654f

Please sign in to comment.