Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #447: Global calendar header redesign #448

Merged
merged 1 commit into from
Jan 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@ Changelog
1.5.9 (Unreleased)
------------------------
- Fix #443: Fix email subject on invite/add users
- Fix #447: Global calendar header redesign

1.5.8 (January 19, 2024)
------------------------
- Fix #437: Hide the profile calendar if the module is not available for users
- Fix #439: Attach ICS files to "forced invites"
-Fix #441: Send event update notification to invitees
-Fix #441: Send event update notification to invitees
- Fix #434: Fix adding of all space members with status

1.5.7 (January 12, 2024)
Expand Down
48 changes: 29 additions & 19 deletions views/global/index.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<?php

use humhub\modules\calendar\helpers\Url;
use humhub\modules\calendar\widgets\CalendarControls;
use humhub\modules\calendar\widgets\CalendarFilterBar;
use humhub\modules\calendar\widgets\ConfigureButton;
use humhub\modules\calendar\widgets\FullCalendar;
use humhub\modules\calendar\helpers\Url;
use humhub\modules\ui\view\helpers\ThemeHelper;

/* @var $this \humhub\modules\ui\view\components\View */
Expand All @@ -12,28 +14,36 @@
$isFluid = ThemeHelper::isFluid();
$containerClass = $isFluid ? 'container-fluid' : 'container';
$aspectRatio = $isFluid ? 1.9 : 1.5;

?>

<div class="<?= $containerClass ?>">
<div class="panel panel-default">
<div class="panel-body" style="background-color:<?= $this->theme->variable('background-color-secondary'); ?>border-radius:4px;">
<?= CalendarFilterBar::widget([
'selectors' => $selectors,
'filters' => $filters
])?>
</div>
<div class="panel panel-default" style="margin-bottom:0px">
<div class="panel-body">
<?= FullCalendar::widget([
'canWrite' => !Yii::$app->user->isGuest,
'aspectRatio' => $aspectRatio,
'selectors' => $selectors,
'filters' => $filters,
'loadUrl' => Url::toAjaxLoad(),
'editUrl' => $editUrl,
<div class="panel-heading">
<strong><?= Yii::t('CalendarModule.base', 'Calendar') ?></strong>

<div class="calendar-option-buttons pull-right">
<?= CalendarControls::widget([
'widgets' => [
[ConfigureButton::class, [], ['sortOrder' => 100]]
]
]) ?>
</div>
</div>

<div class="panel-body">
<?= CalendarFilterBar::widget([
'selectors' => $selectors,
'filters' => $filters
]) ?>
</div>
<div class="panel-body">
<?= FullCalendar::widget([
'canWrite' => !Yii::$app->user->isGuest,
'aspectRatio' => $aspectRatio,
'selectors' => $selectors,
'filters' => $filters,
'loadUrl' => Url::toAjaxLoad(),
'editUrl' => $editUrl,
]) ?>
</div>
</div>
</div>
</div>
89 changes: 42 additions & 47 deletions widgets/views/calendarFilterBar.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
<?php

use humhub\modules\calendar\widgets\CalendarControls;
use humhub\modules\calendar\widgets\ConfigureButton;
use humhub\modules\calendar\models\CalendarEntry;
use humhub\modules\calendar\widgets\FilterType;
use humhub\modules\content\components\ActiveQueryContent;
use humhub\modules\calendar\models\CalendarEntry;
use humhub\widgets\FadeIn;

/* @var $canConfigure bool */
Expand All @@ -20,30 +18,24 @@
<div class="row calendar-options">
<div class="col-md-12">
<div id="calendar-overview-loader"></div>
<div class="calendar-option-buttons">
<?= CalendarControls::widget([
'widgets' => [
[ConfigureButton::class, [], ['sortOrder' => 100]]
]
])?>
</div>
<?php if ($showSelectors) : ?>
<div class="calendar-selectors">
<strong style="padding-left:10px;">
<?= Yii::t('CalendarModule.views_global_index', '<strong>Select</strong> calendars'); ?>
</strong>
<br>
<div class="help-block" style="padding-left:10px;">
<?= Yii::t('CalendarModule.views_global_index', 'Select calendars') ?>
</div>
<div style="display:inline-block; float:left;margin-right:10px;">
<div class="checkbox">
<label class="calendar_my_profile">
<input type="checkbox" name="selector" class="selectorCheckbox" value="<?= ActiveQueryContent::USER_RELATED_SCOPE_OWN_PROFILE; ?>"
<input type="checkbox" name="selector" class="selectorCheckbox"
value="<?= ActiveQueryContent::USER_RELATED_SCOPE_OWN_PROFILE; ?>"
<?php if (in_array(ActiveQueryContent::USER_RELATED_SCOPE_OWN_PROFILE, $selectors)): ?>checked="checked"<?php endif; ?>>
<?= Yii::t('CalendarModule.views_global_index', 'My profile'); ?>
</label>
</div>
<div class="checkbox">
<label class="calendar_my_spaces">
<input type="checkbox" name="selector" class="selectorCheckbox" value="<?= ActiveQueryContent::USER_RELATED_SCOPE_SPACES; ?>"
<input type="checkbox" name="selector" class="selectorCheckbox"
value="<?= ActiveQueryContent::USER_RELATED_SCOPE_SPACES; ?>"
<?php if (in_array(ActiveQueryContent::USER_RELATED_SCOPE_SPACES, $selectors)): ?>checked="checked"<?php endif; ?>>
<?= Yii::t('CalendarModule.views_global_index', 'My spaces'); ?>
</label>
Expand All @@ -54,14 +46,16 @@
<div style="display:inline-block;">
<div class="checkbox">
<label class="calendar_followed_spaces">
<input type="checkbox" name="selector" class="selectorCheckbox" value="<?= ActiveQueryContent::USER_RELATED_SCOPE_FOLLOWED_SPACES; ?>"
<input type="checkbox" name="selector" class="selectorCheckbox"
value="<?= ActiveQueryContent::USER_RELATED_SCOPE_FOLLOWED_SPACES; ?>"
<?php if (in_array(ActiveQueryContent::USER_RELATED_SCOPE_FOLLOWED_SPACES, $selectors)): ?>checked="checked"<?php endif; ?>>
<?= Yii::t('CalendarModule.views_global_index', 'Followed spaces'); ?>
</label>
</div>
<div class="checkbox">
<label class="calendar_followed_users">
<input type="checkbox" name="selector" class="selectorCheckbox" value="<?= ActiveQueryContent::USER_RELATED_SCOPE_FOLLOWED_USERS; ?>"
<input type="checkbox" name="selector" class="selectorCheckbox"
value="<?= ActiveQueryContent::USER_RELATED_SCOPE_FOLLOWED_USERS; ?>"
<?php if (in_array(ActiveQueryContent::USER_RELATED_SCOPE_FOLLOWED_USERS, $selectors)): ?>checked="checked"<?php endif; ?>>
<?= Yii::t('CalendarModule.views_global_index', 'Followed users'); ?>
</label>
Expand All @@ -71,41 +65,42 @@
</div>
<?php endif ?>
<?php if ($showFilters) : ?>
<div class="calendar-filters" style="<?= ($showSelectors) ? 'border-left:2px solid ' . $this->theme->variable('default') : '' ?>">
<strong style="padding-left:10px;">
<?= Yii::t('CalendarModule.views_global_index', '<strong>Filter</strong> events'); ?>
</strong>
<br>

<div style="display:inline-block;margin-right:10px;">
<div class="checkbox">
<label class="calendar_filter_participate">
<input type="checkbox" name="filter" class="filterCheckbox" value="<?= CalendarEntry::FILTER_PARTICIPATE; ?>"
<?php if (in_array(CalendarEntry::FILTER_PARTICIPATE, $filters)): ?>checked="checked"<?php endif; ?>>
<?= Yii::t('CalendarModule.views_global_index', 'I\'m attending'); ?>
</label>
<div class="calendar-filters"
style="<?= ($showSelectors) ? 'border-left:2px solid ' . $this->theme->variable('default') : '' ?>">
<div class="help-block" style="padding-left:10px;">
<?= Yii::t('CalendarModule.views_global_index', 'Filter events') ?>
</div>
<div class="checkbox">
<label class="calendar_filter_mine">
<input type="checkbox" name="filter" class="filterCheckbox" value="<?= CalendarEntry::FILTER_MINE; ?>"
<?php if (in_array(CalendarEntry::FILTER_MINE, $filters)): ?>checked="checked"<?php endif; ?>>
<?= Yii::t('CalendarModule.views_global_index', 'My events'); ?>
</label>
<div style="display:inline-block;margin-right:10px;">
<div class="checkbox">
<label class="calendar_filter_participate">
<input type="checkbox" name="filter" class="filterCheckbox"
value="<?= CalendarEntry::FILTER_PARTICIPATE; ?>"
<?php if (in_array(CalendarEntry::FILTER_PARTICIPATE, $filters)): ?>checked="checked"<?php endif; ?>>
<?= Yii::t('CalendarModule.views_global_index', 'I\'m attending'); ?>
</label>
</div>
<div class="checkbox">
<label class="calendar_filter_mine">
<input type="checkbox" name="filter" class="filterCheckbox"
value="<?= CalendarEntry::FILTER_MINE; ?>"
<?php if (in_array(CalendarEntry::FILTER_MINE, $filters)): ?>checked="checked"<?php endif; ?>>
<?= Yii::t('CalendarModule.views_global_index', 'My events'); ?>
</label>
</div>
</div>
</div>
</div>
<?php endif ?>
<?php if ($showTypes) : ?>
<div class="calendar-types" style="<?= $showSelectors || $showFilters ? 'border-left:2px solid ' . $this->theme->variable('default') : '' ?>">
<strong style="padding-left:10px;">
<?= Yii::t('CalendarModule.base', 'Filter by types'); ?>
</strong>
<br>
<div style="padding: 0 0 10px 10px">
<?= FilterType::widget(['name' => 'filterType']) ?>
<div class="calendar-types"
style="<?= $showSelectors || $showFilters ? 'border-left:2px solid ' . $this->theme->variable('default') : '' ?>">
<div class="help-block" style="padding-left:10px;">
<?= Yii::t('CalendarModule.base', 'Filter by types') ?>
</div>
<div style="padding: 0 0 10px 10px">
<?= FilterType::widget(['name' => 'filterType']) ?>
</div>
</div>
</div>
<?php endif ?>
</div>
</div>
<?php FadeIn::end() ?>
<?php FadeIn::end() ?>