Skip to content

Commit

Permalink
Merge pull request #514 from felixhahnweilheim/enh-listview
Browse files Browse the repository at this point in the history
Replace listWeek with listMonth
  • Loading branch information
luke- authored Jan 28, 2025
2 parents 4f6569a + 0fe8ab3 commit 0fa8440
Show file tree
Hide file tree
Showing 4 changed files with 11 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 @@ -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.

0 comments on commit 0fa8440

Please sign in to comment.