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

Replace listWeek with listMonth #514

Merged
merged 8 commits into from
Jan 28, 2025
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
1 change: 1 addition & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Changelog
------------------------
- Fix #509: Fix event type visibility
- Enh #512: Surround the widget wall entry links with a dedicated HTML class
- Enh #514: Replace the view modes listWeek and listYear with listMonth
- Enh #516: Improved calendar page URLs
- Fix #519: Fix issue where `IntlDateFormatter::parse()` failed to parse Bulgarian dates.
- Fix #520: Fix global calendar url when prettyUrl is disabled
Expand Down
11 changes: 7 additions & 4 deletions models/participation/FullCalendarSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@

class FullCalendarSettings extends Model
{
public const SETTING_LIST_WEEK = 'listWeek';
public const SETTING_GRID_DAY = 'timeGridDay';
public const SETTING_GRID_WEEK = 'timeGridWeek';
public const SETTING_GRID_MONTH = 'dayGridMonth';
public const SETTING_LIST_YEAR = 'listYear';
public const SETTING_LIST_MONTH = 'listMonth';
public const SETTING_VIEW_MODE_KEY = 'defaults.fullCalendarViewMode';

/**
Expand Down Expand Up @@ -42,6 +41,11 @@ public function init()
private function initSettings()
{
$this->viewMode = $this->getSetting(self::SETTING_VIEW_MODE_KEY, static::SETTING_GRID_MONTH);

// Handle removed view modes
if ($this->viewMode === 'listWeek' || $this->viewMode === 'listYear') {
$this->viewMode = 'listMonth';
}
}

/**
Expand Down Expand Up @@ -110,11 +114,10 @@ public function isGlobal()
public function getViewModeItems()
{
return [
self::SETTING_LIST_YEAR => Yii::t('CalendarModule.base', 'Year'),
self::SETTING_GRID_MONTH => Yii::t('CalendarModule.base', 'Month'),
self::SETTING_GRID_WEEK => Yii::t('CalendarModule.base', 'Week'),
self::SETTING_GRID_DAY => Yii::t('CalendarModule.base', 'Day'),
self::SETTING_LIST_WEEK => Yii::t('CalendarModule.base', 'List'),
self::SETTING_LIST_MONTH => Yii::t('CalendarModule.base', 'List'),
];
}
}
4 changes: 2 additions & 2 deletions resources/js/humhub.calendar.Calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ humhub.module('calendar.Calendar', function (module, require, $) {
header: {
left: 'prev,next today',
center: 'title',
right: 'create dayGridMonth,timeGridWeek,timeGridDay,listWeek'
right: 'create dayGridMonth,timeGridWeek,timeGridDay,listMonth'
},
buttonText: buttonText,
plugins: ['dayGrid', 'timeGrid', 'list', 'interaction', 'bootstrap', 'moment', 'momentTimezone'],
Expand All @@ -197,7 +197,7 @@ humhub.module('calendar.Calendar', function (module, require, $) {
right: 'today'
};
options.footer = {
center: 'dayGridMonth,timeGridWeek,timeGridDay,listWeek',
center: 'dayGridMonth,timeGridWeek,timeGridDay,listMonth',
right: 'create'
};
}
Expand Down
2 changes: 1 addition & 1 deletion resources/js/humhub.calendar.Calendar.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.