From 742065b4c721290e66128e626523ddede7bf5799 Mon Sep 17 00:00:00 2001 From: Yuriy Bakhtin Date: Thu, 27 Jun 2024 20:32:50 +0200 Subject: [PATCH 1/4] Add colors for event types in pickers --- widgets/FilterType.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/widgets/FilterType.php b/widgets/FilterType.php index cb1c14ef..b75c6f15 100644 --- a/widgets/FilterType.php +++ b/widgets/FilterType.php @@ -43,4 +43,13 @@ public function init() parent::init(); } + + /** + * @inheritdoc + * @param CalendarEntryType $item + */ + protected function getItemImage($item) + { + return $item->color; + } } From 37a189cbab4f7b4d0448d6e6154dd7fd86ae8611 Mon Sep 17 00:00:00 2001 From: Yuriy Bakhtin Date: Fri, 28 Jun 2024 13:26:55 +0200 Subject: [PATCH 2/4] Update data color attribute --- .github/workflows/php-cs-fixer.yml | 2 +- docs/CHANGELOG.md | 3 ++- module.json | 4 ++-- resources/css/calendar.min.css | 2 +- resources/js/humhub.calendar.Calendar.min.js | 2 +- resources/js/humhub.calendar.js | 4 ++-- resources/js/humhub.calendar.min.js | 2 +- 7 files changed, 10 insertions(+), 9 deletions(-) diff --git a/.github/workflows/php-cs-fixer.yml b/.github/workflows/php-cs-fixer.yml index 2144827b..2d37e137 100644 --- a/.github/workflows/php-cs-fixer.yml +++ b/.github/workflows/php-cs-fixer.yml @@ -3,5 +3,5 @@ name: PHP CS Fixer on: push jobs: - tests: + fixers: uses: humhub/actions/.github/workflows/module-php-cs-fixer.yml@main diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index b2289080..b5e86770 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -1,9 +1,10 @@ Changelog ========= -1.5.13 (Unreleased) +1.6.0 (Unreleased) ---------------------- - Enh #489: Use PHP CS Fixer +- Enh #492: Add colors for event types in pickers 1.5.12 (June 25, 2024) ---------------------- diff --git a/module.json b/module.json index 7a1d0d8e..b9343de8 100644 --- a/module.json +++ b/module.json @@ -3,9 +3,9 @@ "name": "Calendar", "description": "Create one-time or recurring events, invite and manage attendees, and keep track of all your events with the Calendar module.", "keywords": ["calendar"], - "version": "1.5.13", + "version": "1.6.0", "humhub": { - "minVersion": "1.14" + "minVersion": "1.16.1" }, "homepage": "https://github.com/humhub/calendar", "authors": [ diff --git a/resources/css/calendar.min.css b/resources/css/calendar.min.css index 3641d19d..e7c353fa 100644 --- a/resources/css/calendar.min.css +++ b/resources/css/calendar.min.css @@ -2,4 +2,4 @@ * FullCalendar v2.0.2 Stylesheet * Docs & License: http://arshaw.com/fullcalendar/ * (c) 2013 Adam Shaw - */.fc-button,.fc-content,.fc-view{position:relative}.fc-agenda-slots .fc-agenda-axis,.fc-button,.fc-header td,.fc-header-toolbar h2{white-space:nowrap}.calendar-entry-new-participants-form .form-group.field-calendarentryparticipationform-newforcestatus,.fc-button,.fc-header-title{display:inline-block}.fc{direction:ltr;text-align:left}.fc table{border-collapse:collapse;border-spacing:0}.fc table,html .fc{font-size:1em}.fc td,.fc th{padding:0;vertical-align:top}.fc-header-left{width:25%;text-align:left}.fc-agenda-days th,.fc-grid th,.fc-header-center{text-align:center}.fc-header-right,.fc-rtl .fc-event{text-align:right}.fc-header-right{width:25%}.fc-content,.fc-view{width:100%;overflow:hidden}.fc-header-title{vertical-align:top;color:red!important}.fc-header-toolbar h2{margin-top:0;font-size:20px;font-weight:600;color:#555}.fc .fc-header-space{padding-left:10px}.fc-header .fc-button{margin-bottom:1em;vertical-align:top;margin-right:-1px}.fc-header .fc-corner-right,.fc-header .ui-corner-right{margin-right:0}.fc-header .fc-state-hover,.fc-header .ui-state-hover{z-index:2}.fc-header .fc-state-down{z-index:3}.fc-header .fc-state-active,.fc-header .ui-state-active{z-index:4}.fc-day-header{border:1px solid #eee!important}#calendar[data-can-create="0"] .fc-create-button{display:none}.fc-content{z-index:1;clear:both;zoom:1}.fc-content .fa{margin:0 2px}.fc-widget-content,.fc-widget-header{border:1px solid #eee}td.fc-today{background:var(--background-color-highlight)}.fc-state-highlight,.fc-unthemed td.fc-today{background:#f6fdfc!important}.fc-cell-overlay{background:#bce8f1;opacity:.3}.fc-state-default,.fc-state-hover{background-color:#ededed;color:#777}.fc-button{padding:0 .6em;overflow:hidden;height:1.9em;line-height:1.9em;cursor:pointer}.fc-state-default{border:1px solid #ededed;background-image:none!important}.fc-state-default.fc-corner-left{border-top-left-radius:4px;border-bottom-left-radius:4px}.fc-state-default.fc-corner-right{border-top-right-radius:4px;border-bottom-right-radius:4px}.fc-disabled-cursor:hover{cursor:not-allowed}.fc-button .fc-icon{margin:0 .1em;font-family:"Courier New",Courier,monospace;vertical-align:baseline}.fc-icon-left-single-arrow:after{content:"\02039";font-weight:700}.fc-icon-right-single-arrow:after{content:"\0203A";font-weight:700}.fc-icon-left-double-arrow:after{content:"\000AB"}.fc-icon-right-double-arrow:after{content:"\000BB"}.fc-button .ui-icon{position:relative;top:50%;float:left;margin-top:-8px}.fc-state-active,.fc-state-down{background-color:#d7d7d7;border-color:#d7d7d7;color:#777}.fc-content,.fc-day-grid-event{border:none}.calendar-entry-participants .pagination>.active>a,.fc-event{color:#fff}.fc-state-disabled{cursor:default;background-image:none;opacity:.65;box-shadow:none}#calendar-entry-form .ProseMirror-menubar-wrapper,.fc-event-container>*{z-index:8}.fc-event-container>.ui-draggable-dragging,.fc-event-container>.ui-resizable-resizing{z-index:9}.fc-event{background-color:#6fdbe8;font-size:.85em;cursor:default}a.fc-event{text-decoration:none}.calendar-wall-entry [data-action-click],.fc-event-draggable,.fc-list-item,a.fc-event{cursor:pointer}.fc-content{height:100%;padding:2px}.fc-event-time,.fc-event-title{padding:0 1px;font-size:13px}.fc .ui-resizable-handle{display:block;position:absolute;z-index:99999;overflow:hidden;font-size:300%;line-height:50%}.fc-view .canceled .fc-content,.fc-view .canceled .fc-content div,.fc-view .canceled.fc-list-item{text-decoration:line-through}.fc-event-hori{border-width:1px 0;margin-bottom:1px}.fc-ltr .fc-event-hori.fc-event-start,.fc-rtl .fc-event-hori.fc-event-end{border-left-width:1px;border-top-left-radius:3px;border-bottom-left-radius:3px}.fc-ltr .fc-event-hori.fc-event-end,.fc-rtl .fc-event-hori.fc-event-start{border-right-width:1px;border-top-right-radius:3px;border-bottom-right-radius:3px}.fc-event-hori .ui-resizable-e{top:0!important;right:-3px!important;width:7px!important;height:100%!important;cursor:e-resize}.fc-event-hori .ui-resizable-w{top:0!important;left:-3px!important;width:7px!important;height:100%!important;cursor:w-resize}.fc-agenda table,table.fc-border-separate{border-collapse:separate}.fc-border-separate td,.fc-border-separate th{border-width:1px 0 0 1px}.fc-agenda-days .fc-agenda-axis,.fc-border-separate td.fc-last,.fc-border-separate th.fc-last{border-right-width:1px}.fc-border-separate tr.fc-last td,.fc-border-separate tr.fc-last th{border-bottom-width:1px}.fc-agenda-slots tr.fc-slot0 td,.fc-agenda-slots tr.fc-slot0 th,.fc-border-separate tbody tr.fc-first td,.fc-border-separate tbody tr.fc-first th{border-top-width:0}.fc .fc-week-number{width:22px;text-align:center}.fc .fc-week-number div{padding:0 2px}.fc-grid .fc-day-number{float:right;padding:0 2px}.fc-grid .fc-other-month .fc-day-number{opacity:.3}.fc-grid .fc-day-content{clear:both;padding:2px 2px 1px}.fc-agenda .fc-week-number,.fc-grid .fc-event-time{font-weight:700}.fc-rtl .fc-grid .fc-day-number{float:left}.calendar-option-buttons,.fc-rtl .fc-grid .fc-event-time{float:right}.fc-agenda .fc-agenda-axis{width:50px;padding:0 4px;vertical-align:middle;text-align:right;font-weight:400}.fc-agenda .fc-day-content{padding:2px 2px 1px}.fc-agenda-days .fc-col0{border-left-width:0}.fc-agenda-allday th,.fc-event-vert{border-width:0 1px}.fc-agenda-allday .fc-day-content{min-height:34px}.fc-agenda-divider-inner{height:2px;overflow:hidden}.fc-widget-header .fc-agenda-divider-inner{background:#eee}.fc-agenda-slots th{border-width:1px 1px 0}.fc-agenda-slots td{border-width:1px 0 0;background:0 0}.fc-agenda-slots td div{height:20px}.fc-agenda-slots tr.fc-minor td,.fc-agenda-slots tr.fc-minor th{border-top-style:dotted}.fc-event-vert.fc-event-start{border-top-width:1px;border-top-left-radius:3px;border-top-right-radius:3px}.fc-event-vert.fc-event-end{border-bottom-width:1px;border-bottom-left-radius:3px;border-bottom-right-radius:3px}.fc-event-vert .fc-event-time{white-space:nowrap;font-size:13px;font-weight:700}.fc-event-vert .fc-event-inner{position:relative;z-index:2}.fc-event-vert .fc-event-bg{position:absolute;z-index:1;top:0;left:0;width:100%;height:100%;background:#fff;opacity:.25}.fc-event-vert .ui-resizable-s{bottom:0!important;width:100%!important;height:8px!important;overflow:hidden!important;line-height:8px!important;font-size:11px!important;font-family:monospace;text-align:center;cursor:s-resize}.fc-content,.fc-divider,.fc-list-heading td,.fc-list-view,.fc-popover,.fc-row,tbody,td,th,thead{border-color:#eee}.fc-list-view{width:auto!important}.fc-event-dot{margin-right:2px}.fc-list-heading{background-color:#eee}.fc-view-container .table>tbody>tr>td,.fc-view-container .table>tbody>tr>th,.fc-view-container .table>tfoot>tr>td,.fc-view-container .table>tfoot>tr>th,.fc-view-container .table>thead>tr>td,.fc-view-container .table>thead>tr>th{padding:10px}.calendar-options .calendar-filters,.calendar-options .calendar-selectors,.calendar-options .calendar-types{float:left;margin-right:10px}#calendar-entry-form .tab-menu,.timeField .form-group{margin-bottom:0}.timeField .help-block{margin:0}#calendar-entry-form{padding-top:0}#calendar-entry-form .bootstrap-timepicker-widget{min-width:140px}#calendar-entry-form .ProseMirror{min-height:150px!important}.calendar-entry-participants.modal-body{padding:0 0 20px}.calendar-entry-participants button.btn-participants-action{margin:10px 0 0 12px}.calendar-entry-participants .pagination{margin:10px 0 0}.calendar-entry-participants .media-list{margin:0 11px}.calendar-entry-participants .media-body{width:1%;word-break:initial}.calendar-entry-participants .media-body:first-child{width:auto}.calendar-entry-participants .media-body:first-child .media-object{float:left;margin-right:5px}.calendar-entry-participants .media-body:not(:first-child){padding-left:5px}.calendar-entry-participants select.form-control{width:auto;height:40px;padding-right:24px}.calendar-entry-new-participants-form button.btn,.calendar-entry-participants .media-list button.btn{height:32px;margin-top:3px}.calendar-entry-participants-count{padding:18px 18px 36px;margin:0}#calendar-entry-participants-list{position:relative}.calendar-entry-participants-export-button{margin:18px 18px 0}.calendar-entry-new-participants-form{padding:18px 18px 4px}.calendar-entry-new-participants-form .form-group.field-calendarentryparticipationform-newparticipantstatus{padding:0;margin:0}.calendar-entry-new-participants-form .form-group .checkbox label{padding-left:0}.calendar-entry-participants-filters{padding:10px 18px 0}.calendar-entry-participants-filter-title{font-size:80%}.calendar-entry-participants-filters .btn.btn-info{margin:10px 8px 0 0;padding:3px 14px}.calendar-entry-participants-filters .btn.btn-info.active{background:#0397a8!important;color:#fff!important}.calendar-entry-participants-filters .btn.btn-info:not(.active){border:1px solid #435f6f;color:#435f6f!important;background:#fff}.calendar-entry-participants-filters .btn.btn-info:not(.active):hover{background:#0397a8!important;border:1px solid #0397a8;color:#fff!important}.calendar-entry-participants .pagination-container{margin-top:25px}.calendar-entry-participants .pagination>li>a{color:#000}#calendar-overview-loader{position:absolute;right:10px;top:60px}.calendar-wall-entry .calendar-wall-entry-section,.calendar-wall-entry .event-info-section{margin-bottom:10px}.calendar-wall-entry .event-info-section-content{padding-left:25px}.calendar-wall-entry .event-participation-buttons{margin:32px 0 15px}.calendar-wall-entry .event-participation-buttons button{margin-right:8px}.calendar-wall-entry .event-participation-buttons button .fa{font-size:130%;position:relative;top:1px;margin-right:3px}.calendar-wall-entry .event-info-section-content h1{margin:0 0 5px;font-weight:600;font-size:14px}@media (max-width:767px){.calendar-option-buttons{float:none;text-align:right}#calendar-overview-loader{position:inherit;float:left}} \ No newline at end of file + */.fc{direction:ltr;text-align:left}.fc table{border-collapse:collapse;border-spacing:0}.fc table,html .fc{font-size:1em}.fc td,.fc th{padding:0;vertical-align:top}.fc-header td{white-space:nowrap}.fc-header-left{width:25%;text-align:left}.fc-header-center{text-align:center}.fc-header-right{width:25%;text-align:right}.fc-header-title{display:inline-block;vertical-align:top;color:red!important}.fc-header-toolbar h2{margin-top:0;white-space:nowrap;font-size:20px;font-weight:600;color:#555}.fc .fc-header-space{padding-left:10px}.fc-header .fc-button{margin-bottom:1em;vertical-align:top}.fc-header .fc-button{margin-right:-1px}.fc-header .fc-corner-right,.fc-header .ui-corner-right{margin-right:0}.fc-header .fc-state-hover,.fc-header .ui-state-hover{z-index:2}.fc-header .fc-state-down{z-index:3}.fc-header .fc-state-active,.fc-header .ui-state-active{z-index:4}.fc-day-header{border:1px solid #eee!important}#calendar[data-can-create="0"] .fc-create-button{display:none}.fc-content{position:relative;z-index:1;clear:both;zoom:1}.fc-content .fa{margin:0 2px}.fc-view{position:relative;width:100%;overflow:hidden}.fc-widget-content,.fc-widget-header{border:1px solid #eee}td.fc-today{background:var(--background-color-highlight)}.fc-state-highlight,.fc-unthemed td.fc-today{background:#f6fdfc!important}.fc-cell-overlay{background:#bce8f1;opacity:.3}.fc-button{position:relative;display:inline-block;padding:0 .6em;overflow:hidden;height:1.9em;line-height:1.9em;white-space:nowrap;cursor:pointer}.fc-state-default{border:1px solid;background-image:none!important}.fc-state-default.fc-corner-left{border-top-left-radius:4px;border-bottom-left-radius:4px}.fc-state-default.fc-corner-right{border-top-right-radius:4px;border-bottom-right-radius:4px}.fc-disabled-cursor:hover{cursor:not-allowed}.fc-button .fc-icon{margin:0 .1em;font-family:"Courier New",Courier,monospace;vertical-align:baseline}.fc-icon-left-single-arrow:after{content:"\02039";font-weight:700}.fc-icon-right-single-arrow:after{content:"\0203A";font-weight:700}.fc-icon-left-double-arrow:after{content:"\000AB"}.fc-icon-right-double-arrow:after{content:"\000BB"}.fc-button .ui-icon{position:relative;top:50%;float:left;margin-top:-8px}.fc-state-default{background-color:#ededed;color:#777;border-color:#ededed}.fc-state-hover{background-color:#ededed;color:#777}.fc-state-active,.fc-state-down{background-color:#d7d7d7;border-color:#d7d7d7;color:#777}.fc-state-disabled{cursor:default;background-image:none;opacity:.65;box-shadow:none}.fc-event-container>*{z-index:8}.fc-event-container>.ui-draggable-dragging,.fc-event-container>.ui-resizable-resizing{z-index:9}.fc-event{background-color:#6fdbe8;color:#fff;font-size:.85em;cursor:default}a.fc-event{text-decoration:none}.fc-event-draggable,a.fc-event{cursor:pointer}.fc-rtl .fc-event{text-align:right}.fc-day-grid-event{border:none}.fc-content{width:100%;height:100%;overflow:hidden;padding:2px;border:none}.fc-event-time,.fc-event-title{padding:0 1px;font-size:13px}.fc .ui-resizable-handle{display:block;position:absolute;z-index:99999;overflow:hidden;font-size:300%;line-height:50%}.fc-view .canceled .fc-content,.fc-view .canceled .fc-content div,.fc-view .canceled.fc-list-item{text-decoration:line-through}.fc-event-hori{border-width:1px 0;margin-bottom:1px}.fc-ltr .fc-event-hori.fc-event-start,.fc-rtl .fc-event-hori.fc-event-end{border-left-width:1px;border-top-left-radius:3px;border-bottom-left-radius:3px}.fc-ltr .fc-event-hori.fc-event-end,.fc-rtl .fc-event-hori.fc-event-start{border-right-width:1px;border-top-right-radius:3px;border-bottom-right-radius:3px}.fc-event-hori .ui-resizable-e{top:0!important;right:-3px!important;width:7px!important;height:100%!important;cursor:e-resize}.fc-event-hori .ui-resizable-w{top:0!important;left:-3px!important;width:7px!important;height:100%!important;cursor:w-resize}table.fc-border-separate{border-collapse:separate}.fc-border-separate td,.fc-border-separate th{border-width:1px 0 0 1px}.fc-border-separate td.fc-last,.fc-border-separate th.fc-last{border-right-width:1px}.fc-border-separate tr.fc-last td,.fc-border-separate tr.fc-last th{border-bottom-width:1px}.fc-border-separate tbody tr.fc-first td,.fc-border-separate tbody tr.fc-first th{border-top-width:0}.fc-grid th{text-align:center}.fc .fc-week-number{width:22px;text-align:center}.fc .fc-week-number div{padding:0 2px}.fc-grid .fc-day-number{float:right;padding:0 2px}.fc-grid .fc-other-month .fc-day-number{opacity:.3}.fc-grid .fc-day-content{clear:both;padding:2px 2px 1px}.fc-grid .fc-event-time{font-weight:700}.fc-rtl .fc-grid .fc-day-number{float:left}.fc-rtl .fc-grid .fc-event-time{float:right}.fc-agenda table{border-collapse:separate}.fc-agenda-days th{text-align:center}.fc-agenda .fc-agenda-axis{width:50px;padding:0 4px;vertical-align:middle;text-align:right;font-weight:400}.fc-agenda-slots .fc-agenda-axis{white-space:nowrap}.fc-agenda .fc-week-number{font-weight:700}.fc-agenda .fc-day-content{padding:2px 2px 1px}.fc-agenda-days .fc-agenda-axis{border-right-width:1px}.fc-agenda-days .fc-col0{border-left-width:0}.fc-agenda-allday th{border-width:0 1px}.fc-agenda-allday .fc-day-content{min-height:34px}.fc-agenda-divider-inner{height:2px;overflow:hidden}.fc-widget-header .fc-agenda-divider-inner{background:#eee}.fc-agenda-slots th{border-width:1px 1px 0}.fc-agenda-slots td{border-width:1px 0 0;background:0 0}.fc-agenda-slots td div{height:20px}.fc-agenda-slots tr.fc-slot0 td,.fc-agenda-slots tr.fc-slot0 th{border-top-width:0}.fc-agenda-slots tr.fc-minor td,.fc-agenda-slots tr.fc-minor th{border-top-style:dotted}.fc-event-vert{border-width:0 1px}.fc-event-vert.fc-event-start{border-top-width:1px;border-top-left-radius:3px;border-top-right-radius:3px}.fc-event-vert.fc-event-end{border-bottom-width:1px;border-bottom-left-radius:3px;border-bottom-right-radius:3px}.fc-event-vert .fc-event-time{white-space:nowrap;font-size:13px;font-weight:700}.fc-event-vert .fc-event-inner{position:relative;z-index:2}.fc-event-vert .fc-event-bg{position:absolute;z-index:1;top:0;left:0;width:100%;height:100%;background:#fff;opacity:.25}.fc-event-vert .ui-resizable-s{bottom:0!important;width:100%!important;height:8px!important;overflow:hidden!important;line-height:8px!important;font-size:11px!important;font-family:monospace;text-align:center;cursor:s-resize}.fc-content,.fc-divider,.fc-list-heading td,.fc-list-view,.fc-popover,.fc-row,tbody,td,th,thead{border-color:#eee}.fc-list-view{width:auto!important}.fc-event-dot{margin-right:2px}.fc-list-item{cursor:pointer}.fc-list-heading{background-color:#eee}.fc-view-container .table>tbody>tr>td,.fc-view-container .table>tbody>tr>th,.fc-view-container .table>tfoot>tr>td,.fc-view-container .table>tfoot>tr>th,.fc-view-container .table>thead>tr>td,.fc-view-container .table>thead>tr>th{padding:10px}.calendar-options .calendar-filters,.calendar-options .calendar-selectors,.calendar-options .calendar-types{float:left;margin-right:10px}.timeField .form-group{margin-bottom:0}.timeField .help-block{margin:0}#calendar-entry-form{padding-top:0}#calendar-entry-form .tab-menu{margin-bottom:0}#calendar-entry-form .bootstrap-timepicker-widget{min-width:140px}#calendar-entry-form .ProseMirror-menubar-wrapper{z-index:8}#calendar-entry-form .ProseMirror{min-height:150px!important}.calendar-entry-participants.modal-body{padding:0 0 20px 0}.calendar-entry-participants button.btn-participants-action{margin:10px 0 0 12px}.calendar-entry-participants .pagination{margin:10px 0 0}.calendar-entry-participants .media-list{margin:0 11px}.calendar-entry-participants .media-body{width:1%;word-break:initial}.calendar-entry-participants .media-body:first-child{width:auto}.calendar-entry-participants .media-body:first-child .media-object{float:left;margin-right:5px}.calendar-entry-participants .media-body:not(:first-child){padding-left:5px}.calendar-entry-participants select.form-control{width:auto;height:40px;padding-right:24px}.calendar-entry-new-participants-form button.btn,.calendar-entry-participants .media-list button.btn{height:32px;margin-top:3px}.calendar-entry-participants-count{padding:18px 18px 36px;margin:0}#calendar-entry-participants-list{position:relative}.calendar-entry-participants-export-button{margin:18px 18px 0}.calendar-entry-new-participants-form{padding:18px 18px 4px}.calendar-entry-new-participants-form .form-group.field-calendarentryparticipationform-newparticipantstatus{padding:0;margin:0}.calendar-entry-new-participants-form .form-group .checkbox label{padding-left:0}.calendar-entry-new-participants-form .form-group.field-calendarentryparticipationform-newforcestatus{display:inline-block}.calendar-entry-participants-filters{padding:10px 18px 0}.calendar-entry-participants-filter-title{font-size:80%}.calendar-entry-participants-filters .btn.btn-info{margin:10px 8px 0 0;padding:3px 14px}.calendar-entry-participants-filters .btn.btn-info.active{background:#0397a8!important;color:#fff!important}.calendar-entry-participants-filters .btn.btn-info:not(.active){border:1px solid #435f6f;color:#435f6f!important;background:#fff}.calendar-entry-participants-filters .btn.btn-info:not(.active):hover{background:#0397a8!important;border:1px solid #0397a8;color:#fff!important}.calendar-entry-participants .pagination-container{margin-top:25px}.calendar-entry-participants .pagination>li>a{color:#000}.calendar-entry-participants .pagination>.active>a{color:#fff}.calendar-option-buttons{float:right}#calendar-overview-loader{position:absolute;right:10px;top:60px}.calendar-wall-entry .calendar-wall-entry-section{margin-bottom:10px}.calendar-wall-entry .event-info-section{margin-bottom:10px}.calendar-wall-entry .event-info-section-content{padding-left:25px}.calendar-wall-entry .event-participation-buttons{margin:32px 0 15px}.calendar-wall-entry .event-participation-buttons button{margin-right:8px}.calendar-wall-entry .event-participation-buttons button .fa{font-size:130%;position:relative;top:1px;margin-right:3px}.calendar-wall-entry [data-action-click]{cursor:pointer}.calendar-wall-entry .event-info-section-content h1{margin:0 0 5px;font-weight:600;font-size:14px}@media (max-width:767px){.calendar-option-buttons{float:none;text-align:right}#calendar-overview-loader{position:inherit;float:left}} \ No newline at end of file diff --git a/resources/js/humhub.calendar.Calendar.min.js b/resources/js/humhub.calendar.Calendar.min.js index e8fc8189..fd71acfd 100644 --- a/resources/js/humhub.calendar.Calendar.min.js +++ b/resources/js/humhub.calendar.Calendar.min.js @@ -1 +1 @@ -humhub.module("calendar.Calendar",function(a,t,i){var e=t("ui.widget").Widget,l=t("client"),o=t("util").string,n=t("ui.loader"),r=t("ui.view"),s=t("ui.modal"),e=e.extend();e.prototype.init=function(){var n=this;this.options.events=function(t,e,o){i.ajax({url:n.options.loadUrl,type:"GET",data:{start:moment(t.start.valueOf()).format("YYYY-MM-DD"),end:moment(t.end.valueOf()).format("YYYY-MM-DD"),selectors:n.options.selectors,filters:n.options.filters,types:n.options.types},success:function(t){e(t)}})},a.log.debug("Init calendar: ",this.options),this.initCalendarFilter(),this.updateCalendarFilters()},e.prototype.initCalendarFilter=function(){var t=this;i(".selectorCheckbox").click(function(){t.updateCalendarFilters(!0)}),i(".filterCheckbox").click(function(){"3"==i(this).val()&&i(":checkbox[value=4][name='filter']").attr("checked",!1),"4"==i(this).val()&&i(":checkbox[value=3][name='filter']").attr("checked",!1),t.updateCalendarFilters(!0)}),i('select[name="filterType[]"]').on("change.select2",function(){t.updateCalendarFilters(!0)})},e.prototype.updateCalendarFilters=function(t){var e=this;this.options.selectors=[],this.options.filters=[],this.options.types=[],i(".selectorCheckbox").each(function(){i(this).prop("checked")&&e.options.selectors.push(i(this).val())}),i(".filterCheckbox").each(function(){i(this).prop("checked")&&e.options.filters.push(i(this).val())}),e.options.types=i('select[name="filterType[]"]').val(),this.initFullCalendar(t)},e.prototype.initFullCalendar=function(t){this.fullCalendar&&t?(this.fullCalendar.removeAllEventSources(),this.fullCalendar.addEventSource(this.options.events)):(this.fullCalendar=new FullCalendar.Calendar(this.$[0],this.options),this.fullCalendar.render())},e.prototype.getDefaultOptions=function(){var t={};"today"!==a.text("button.today")&&(t.today=a.text("button.today")),"month"!==a.text("button.month")&&(t.month=a.text("button.month")),"week"!==a.text("button.week")&&(t.week=a.text("button.week")),"day"!==a.text("button.day")&&(t.day=a.text("button.day")),"list"!==a.text("button.list")&&(t.list=a.text("button.list"));var o=this,t={customButtons:{create:{click:function(){var t=new Date;t.setHours(t.getHours()+1),t.setMinutes(0,0,0);var e=new Date;e.setHours(e.getHours()+2),e.setMinutes(0,0,0);t={data:{start:o.toJsonDateFormat(t,!1),end:o.toJsonDateFormat(e,!1),cal:1}},e=o.options.global?o.options.globalCreateUrl:o.options.editUrl;s.global.load(e,t).then(function(){s.global.$.one("hidden.bs.modal submitted",function(){o.fetch()})}).catch(function(t){s.global.close(),a.log.error(t,!0)}),o.fullCalendar.unselect()},bootstrapFontAwesome:"fa-plus"}},header:{left:"prev,next today",center:"title",right:"create dayGridMonth,timeGridWeek,timeGridDay,listWeek"},buttonText:t,plugins:["dayGrid","timeGrid","list","interaction","bootstrap","moment","momentTimezone"],defaultView:"dayGridMonth",canCreate:!0,selectable:!0,select:i.proxy(this.select,this),eventAllow:function(){return!0},themeSystem:"bootstrap",loading:i.proxy(this.loader,this),eventResize:i.proxy(this.updateEvent,this),eventDrop:i.proxy(this.updateEvent,this),eventClick:i.proxy(this.clickEvent,this),eventRender:i.proxy(this.renderEvent,this)};return r.isSmall()&&(t.header={left:"prev,next",center:"title",right:"today"},t.footer={center:"dayGridMonth,timeGridWeek,timeGridDay,listWeek",right:"create"}),t},e.prototype.renderEvent=function(t,e){e=i(e);e.attr({title:e.text()}),t.icon&&o.startsWith(t.icon,"fa-")&&e.find(".fc-content").prepend(i(''))},e.prototype.toJsonDateFormat=function(t,e){return e?FullCalendarMoment.toMoment(t,this.fullCalendar).format("YYYY-MM-DD"):FullCalendarMoment.toMoment(t,this.fullCalendar).format()},e.prototype.select=function(t){var e=this,o={data:{start:this.toJsonDateFormat(t.start,!1),end:this.toJsonDateFormat(t.end,!1),cal:1}};"dayGridMonth"===t.view.type&&(o.data.view="month");t=this.options.global?this.options.globalCreateUrl:this.options.editUrl;s.global.load(t,o).then(function(){s.global.$.one("hidden.bs.modal submitted",function(){e.fetch()})}).catch(function(t){s.global.close(),a.log.error(t,!0)}),this.fullCalendar.unselect()},e.prototype.fetch=function(){this.fullCalendar.refetchEvents()},e.prototype.updateEvent=function(e){var o=this,t=e.event,n=t.extendedProps,t={data:{id:t.id,start:this.toJsonDateFormat(t.start,t.allDay),end:this.toJsonDateFormat(t.end,t.allDay)}};this.loader(),l.post(n.updateUrl,t).then(function(t){t.success?a.log.success("saved"):a.log.error(t,!0),n.refreshAfterUpdate&&o.fetch()}).catch(function(t){a.log.error(t,!0),e.revert()}).finally(function(){o.loader(!1)})},e.prototype.clickEvent=function(t){var e,t=t.event.extendedProps;t.viewUrl&&(e=this,"modal"===t.viewMode?s.global.load(t.viewUrl,{viewContext:"fullCalendar"}).then(function(){s.global.set({backdrop:!0}),s.global.$.one("hidden.bs.modal",function(){e.fetch()})}).catch(function(t){a.log.error(t,!0),s.global.close()}):l.pjax.redirect(t.viewUrl))},e.prototype.loader=function(t){!1===t?n.reset(i("#calendar-overview-loader")):n.set(i("#calendar-overview-loader"),{size:"8px",css:{padding:"2px ",width:"60px"}})},a.export=e}); \ No newline at end of file +humhub.module("calendar.Calendar",function(i,t,r){var e=t("ui.widget").Widget,l=t("client"),n=t("util").string,o=t("ui.loader"),s=t("ui.view"),d=t("ui.modal"),a=e.extend();a.prototype.init=function(){var n=this;this.options.events=function(t,e,o){r.ajax({url:n.options.loadUrl,type:"GET",data:{start:moment(t.start.valueOf()).format("YYYY-MM-DD"),end:moment(t.end.valueOf()).format("YYYY-MM-DD"),selectors:n.options.selectors,filters:n.options.filters,types:n.options.types},success:function(t){e(t)}})},i.log.debug("Init calendar: ",this.options),this.initCalendarFilter(),this.updateCalendarFilters()},a.prototype.initCalendarFilter=function(){var t=this;r(".selectorCheckbox").click(function(){t.updateCalendarFilters(!0)}),r(".filterCheckbox").click(function(){"3"==r(this).val()&&r(":checkbox[value=4][name='filter']").attr("checked",!1),"4"==r(this).val()&&r(":checkbox[value=3][name='filter']").attr("checked",!1),t.updateCalendarFilters(!0)}),r('select[name="filterType[]"]').on("change.select2",function(){t.updateCalendarFilters(!0)})},a.prototype.updateCalendarFilters=function(t){var e=this;this.options.selectors=[],this.options.filters=[],this.options.types=[],r(".selectorCheckbox").each(function(){r(this).prop("checked")&&e.options.selectors.push(r(this).val())}),r(".filterCheckbox").each(function(){r(this).prop("checked")&&e.options.filters.push(r(this).val())}),e.options.types=r('select[name="filterType[]"]').val(),this.initFullCalendar(t)},a.prototype.initFullCalendar=function(t){this.fullCalendar&&t?(this.fullCalendar.removeAllEventSources(),this.fullCalendar.addEventSource(this.options.events)):(this.fullCalendar=new FullCalendar.Calendar(this.$[0],this.options),this.fullCalendar.render())},a.prototype.getDefaultOptions=function(){var t={};"today"!==i.text("button.today")&&(t.today=i.text("button.today")),"month"!==i.text("button.month")&&(t.month=i.text("button.month")),"week"!==i.text("button.week")&&(t.week=i.text("button.week")),"day"!==i.text("button.day")&&(t.day=i.text("button.day")),"list"!==i.text("button.list")&&(t.list=i.text("button.list"));var a=this,e={customButtons:{create:{click:function(){var t=new Date;t.setHours(t.getHours()+1),t.setMinutes(0,0,0);var e=new Date;e.setHours(e.getHours()+2),e.setMinutes(0,0,0);var o={data:{start:a.toJsonDateFormat(t,!1),end:a.toJsonDateFormat(e,!1),cal:1}},n=a.options.global?a.options.globalCreateUrl:a.options.editUrl;d.global.load(n,o).then(function(){d.global.$.one("hidden.bs.modal submitted",function(){a.fetch()})}).catch(function(t){d.global.close(),i.log.error(t,!0)}),a.fullCalendar.unselect()},bootstrapFontAwesome:"fa-plus"}},header:{left:"prev,next today",center:"title",right:"create dayGridMonth,timeGridWeek,timeGridDay,listWeek"},buttonText:t,plugins:["dayGrid","timeGrid","list","interaction","bootstrap","moment","momentTimezone"],defaultView:"dayGridMonth",canCreate:!0,selectable:!0,select:r.proxy(this.select,this),eventAllow:function(){return!0},themeSystem:"bootstrap",loading:r.proxy(this.loader,this),eventResize:r.proxy(this.updateEvent,this),eventDrop:r.proxy(this.updateEvent,this),eventClick:r.proxy(this.clickEvent,this),eventRender:r.proxy(this.renderEvent,this)};return s.isSmall()&&(e.header={left:"prev,next",center:"title",right:"today"},e.footer={center:"dayGridMonth,timeGridWeek,timeGridDay,listWeek",right:"create"}),e},a.prototype.renderEvent=function(t,e){var o=r(e);o.attr({title:o.text()}),t.icon&&n.startsWith(t.icon,"fa-")&&o.find(".fc-content").prepend(r(''))},a.prototype.toJsonDateFormat=function(t,e){return e?FullCalendarMoment.toMoment(t,this.fullCalendar).format("YYYY-MM-DD"):FullCalendarMoment.toMoment(t,this.fullCalendar).format()},a.prototype.select=function(t){var e=this,o={data:{start:this.toJsonDateFormat(t.start,!1),end:this.toJsonDateFormat(t.end,!1),cal:1}};"dayGridMonth"===t.view.type&&(o.data.view="month");var n=this.options.global?this.options.globalCreateUrl:this.options.editUrl;d.global.load(n,o).then(function(){d.global.$.one("hidden.bs.modal submitted",function(){e.fetch()})}).catch(function(t){d.global.close(),i.log.error(t,!0)}),this.fullCalendar.unselect()},a.prototype.fetch=function(){this.fullCalendar.refetchEvents()},a.prototype.updateEvent=function(e){var o=this,t=e.event,n=t.extendedProps,a={data:{id:t.id,start:this.toJsonDateFormat(t.start,t.allDay),end:this.toJsonDateFormat(t.end,t.allDay)}};this.loader(),l.post(n.updateUrl,a).then(function(t){t.success?i.log.success("saved"):i.log.error(t,!0),n.refreshAfterUpdate&&o.fetch()}).catch(function(t){i.log.error(t,!0),e.revert()}).finally(function(){o.loader(!1)})},a.prototype.clickEvent=function(t){var e=t.event.extendedProps;if(e.viewUrl){var o=this;"modal"===e.viewMode?d.global.load(e.viewUrl,{viewContext:"fullCalendar"}).then(function(){d.global.set({backdrop:!0}),d.global.$.one("hidden.bs.modal",function(){o.fetch()})}).catch(function(t){i.log.error(t,!0),d.global.close()}):l.pjax.redirect(e.viewUrl)}},a.prototype.loader=function(t){!1===t?o.reset(r("#calendar-overview-loader")):o.set(r("#calendar-overview-loader"),{size:"8px",css:{padding:"2px ",width:"60px"}})},i.export=a}); \ No newline at end of file diff --git a/resources/js/humhub.calendar.js b/resources/js/humhub.calendar.js index a1c24463..b20e0ee6 100644 --- a/resources/js/humhub.calendar.js +++ b/resources/js/humhub.calendar.js @@ -231,8 +231,8 @@ humhub.module('calendar', function (module, require, $) { Form.prototype.changeEventType = function (evt) { var $selected = evt.$trigger.find(':selected'); - if ($selected.data('type-color')) { - $('.colorpicker-element').data('colorpicker').color.setColor($selected.data('type-color')); + if ($selected.data('color')) { + $('.colorpicker-element').data('colorpicker').color.setColor($selected.data('color')); $('.colorpicker-element').data('colorpicker').update(); } }; diff --git a/resources/js/humhub.calendar.min.js b/resources/js/humhub.calendar.min.js index 16593cca..935f1cb8 100644 --- a/resources/js/humhub.calendar.min.js +++ b/resources/js/humhub.calendar.min.js @@ -1 +1 @@ -humhub.module("calendar",function(o,t,l){var i=t("ui.widget").Widget,r=t("client"),a=t("ui.modal"),d=t("action"),n=t("content").Content,c=t("event"),s=t("stream").StreamEntry,u=i.extend(),f=i.extend();f.RECUR_EDIT_MODE_CREATE=0,f.RECUR_EDIT_MODE_THIS=1,f.RECUR_EDIT_MODE_FOLLOWING=2,f.RECUR_EDIT_MODE_ALL=3,f.prototype.init=function(){a.global.$.find(".tab-basic").on("shown.bs.tab",function(t){l("#calendarentry-title").focus()}),a.global.$.find(".tab-participation").on("shown.bs.tab",function(t){l("#calendarentry-participation_mode").focus()}),this.initDateTimeCorrector(),this.initTimeInput(),this.initSubmitAction()},f.prototype.initDateTimeCorrector=function(){function n(t){t=t.split(":");var e=parseInt(t[0]);return 12===e&&t[1].includes("AM")?e=0:e+=t[1].includes("PM")&&e<12?12:0,60*e+parseInt(t[1])}function o(){return{start:l(r+"date").datepicker("getDate").getTime(),end:l(a+"date").datepicker("getDate").getTime()}}function e(t,e,n){var o,i,r,a,d=1440;if(e<0||d<=e){var c=new Date(l(t+"date").datepicker("getDate"));c.setDate(c.getDate()+(e<0?-1:1)),l(t+"date").datepicker("setDate",c),e+=e<0?d:-d}l(t+"time").val((r=((o=e)-(i=o%60))/60,a="","12h"===n&&(a=r<12?" AM":" PM",0===r?r=12:12 Date: Fri, 28 Jun 2024 16:35:43 +0200 Subject: [PATCH 3/4] Content type legend --- resources/css/calendar.css | 23 +++++++++++++++ resources/css/calendar.min.css | 2 +- views/global/index.php | 4 +++ views/view/index.php | 12 ++++---- widgets/CalendarTypeLegend.php | 42 ++++++++++++++++++++++++++++ widgets/CalendarTypeListView.php | 27 ------------------ widgets/views/calendarTypeLegend.php | 24 ++++++++++++++++ 7 files changed, 101 insertions(+), 33 deletions(-) create mode 100644 widgets/CalendarTypeLegend.php delete mode 100644 widgets/CalendarTypeListView.php create mode 100644 widgets/views/calendarTypeLegend.php diff --git a/resources/css/calendar.css b/resources/css/calendar.css index 6d4588d4..26a81e8b 100644 --- a/resources/css/calendar.css +++ b/resources/css/calendar.css @@ -834,3 +834,26 @@ tbody, float: left; } } + +/* Calendar type legend */ +.calendar-type-legend .calendar-type-item { + display: inline-block; + background: var(--background-color-secondary); + color: var(--text-color-main); + border-radius: 4px; + padding: 4px 16px; + margin-right: 8px; + margin-bottom: 8px; + font-size: 14px; + font-weight: 500; +} +.calendar-type-legend .calendar-type-color { + display: inline-block; + width: 16px; + height: 16px; + border: 1px solid var(--text-color-soft3); + border-radius: 4px; + margin-right: 6px; + position: relative; + top: 2px; +} diff --git a/resources/css/calendar.min.css b/resources/css/calendar.min.css index e7c353fa..21b80104 100644 --- a/resources/css/calendar.min.css +++ b/resources/css/calendar.min.css @@ -2,4 +2,4 @@ * FullCalendar v2.0.2 Stylesheet * Docs & License: http://arshaw.com/fullcalendar/ * (c) 2013 Adam Shaw - */.fc{direction:ltr;text-align:left}.fc table{border-collapse:collapse;border-spacing:0}.fc table,html .fc{font-size:1em}.fc td,.fc th{padding:0;vertical-align:top}.fc-header td{white-space:nowrap}.fc-header-left{width:25%;text-align:left}.fc-header-center{text-align:center}.fc-header-right{width:25%;text-align:right}.fc-header-title{display:inline-block;vertical-align:top;color:red!important}.fc-header-toolbar h2{margin-top:0;white-space:nowrap;font-size:20px;font-weight:600;color:#555}.fc .fc-header-space{padding-left:10px}.fc-header .fc-button{margin-bottom:1em;vertical-align:top}.fc-header .fc-button{margin-right:-1px}.fc-header .fc-corner-right,.fc-header .ui-corner-right{margin-right:0}.fc-header .fc-state-hover,.fc-header .ui-state-hover{z-index:2}.fc-header .fc-state-down{z-index:3}.fc-header .fc-state-active,.fc-header .ui-state-active{z-index:4}.fc-day-header{border:1px solid #eee!important}#calendar[data-can-create="0"] .fc-create-button{display:none}.fc-content{position:relative;z-index:1;clear:both;zoom:1}.fc-content .fa{margin:0 2px}.fc-view{position:relative;width:100%;overflow:hidden}.fc-widget-content,.fc-widget-header{border:1px solid #eee}td.fc-today{background:var(--background-color-highlight)}.fc-state-highlight,.fc-unthemed td.fc-today{background:#f6fdfc!important}.fc-cell-overlay{background:#bce8f1;opacity:.3}.fc-button{position:relative;display:inline-block;padding:0 .6em;overflow:hidden;height:1.9em;line-height:1.9em;white-space:nowrap;cursor:pointer}.fc-state-default{border:1px solid;background-image:none!important}.fc-state-default.fc-corner-left{border-top-left-radius:4px;border-bottom-left-radius:4px}.fc-state-default.fc-corner-right{border-top-right-radius:4px;border-bottom-right-radius:4px}.fc-disabled-cursor:hover{cursor:not-allowed}.fc-button .fc-icon{margin:0 .1em;font-family:"Courier New",Courier,monospace;vertical-align:baseline}.fc-icon-left-single-arrow:after{content:"\02039";font-weight:700}.fc-icon-right-single-arrow:after{content:"\0203A";font-weight:700}.fc-icon-left-double-arrow:after{content:"\000AB"}.fc-icon-right-double-arrow:after{content:"\000BB"}.fc-button .ui-icon{position:relative;top:50%;float:left;margin-top:-8px}.fc-state-default{background-color:#ededed;color:#777;border-color:#ededed}.fc-state-hover{background-color:#ededed;color:#777}.fc-state-active,.fc-state-down{background-color:#d7d7d7;border-color:#d7d7d7;color:#777}.fc-state-disabled{cursor:default;background-image:none;opacity:.65;box-shadow:none}.fc-event-container>*{z-index:8}.fc-event-container>.ui-draggable-dragging,.fc-event-container>.ui-resizable-resizing{z-index:9}.fc-event{background-color:#6fdbe8;color:#fff;font-size:.85em;cursor:default}a.fc-event{text-decoration:none}.fc-event-draggable,a.fc-event{cursor:pointer}.fc-rtl .fc-event{text-align:right}.fc-day-grid-event{border:none}.fc-content{width:100%;height:100%;overflow:hidden;padding:2px;border:none}.fc-event-time,.fc-event-title{padding:0 1px;font-size:13px}.fc .ui-resizable-handle{display:block;position:absolute;z-index:99999;overflow:hidden;font-size:300%;line-height:50%}.fc-view .canceled .fc-content,.fc-view .canceled .fc-content div,.fc-view .canceled.fc-list-item{text-decoration:line-through}.fc-event-hori{border-width:1px 0;margin-bottom:1px}.fc-ltr .fc-event-hori.fc-event-start,.fc-rtl .fc-event-hori.fc-event-end{border-left-width:1px;border-top-left-radius:3px;border-bottom-left-radius:3px}.fc-ltr .fc-event-hori.fc-event-end,.fc-rtl .fc-event-hori.fc-event-start{border-right-width:1px;border-top-right-radius:3px;border-bottom-right-radius:3px}.fc-event-hori .ui-resizable-e{top:0!important;right:-3px!important;width:7px!important;height:100%!important;cursor:e-resize}.fc-event-hori .ui-resizable-w{top:0!important;left:-3px!important;width:7px!important;height:100%!important;cursor:w-resize}table.fc-border-separate{border-collapse:separate}.fc-border-separate td,.fc-border-separate th{border-width:1px 0 0 1px}.fc-border-separate td.fc-last,.fc-border-separate th.fc-last{border-right-width:1px}.fc-border-separate tr.fc-last td,.fc-border-separate tr.fc-last th{border-bottom-width:1px}.fc-border-separate tbody tr.fc-first td,.fc-border-separate tbody tr.fc-first th{border-top-width:0}.fc-grid th{text-align:center}.fc .fc-week-number{width:22px;text-align:center}.fc .fc-week-number div{padding:0 2px}.fc-grid .fc-day-number{float:right;padding:0 2px}.fc-grid .fc-other-month .fc-day-number{opacity:.3}.fc-grid .fc-day-content{clear:both;padding:2px 2px 1px}.fc-grid .fc-event-time{font-weight:700}.fc-rtl .fc-grid .fc-day-number{float:left}.fc-rtl .fc-grid .fc-event-time{float:right}.fc-agenda table{border-collapse:separate}.fc-agenda-days th{text-align:center}.fc-agenda .fc-agenda-axis{width:50px;padding:0 4px;vertical-align:middle;text-align:right;font-weight:400}.fc-agenda-slots .fc-agenda-axis{white-space:nowrap}.fc-agenda .fc-week-number{font-weight:700}.fc-agenda .fc-day-content{padding:2px 2px 1px}.fc-agenda-days .fc-agenda-axis{border-right-width:1px}.fc-agenda-days .fc-col0{border-left-width:0}.fc-agenda-allday th{border-width:0 1px}.fc-agenda-allday .fc-day-content{min-height:34px}.fc-agenda-divider-inner{height:2px;overflow:hidden}.fc-widget-header .fc-agenda-divider-inner{background:#eee}.fc-agenda-slots th{border-width:1px 1px 0}.fc-agenda-slots td{border-width:1px 0 0;background:0 0}.fc-agenda-slots td div{height:20px}.fc-agenda-slots tr.fc-slot0 td,.fc-agenda-slots tr.fc-slot0 th{border-top-width:0}.fc-agenda-slots tr.fc-minor td,.fc-agenda-slots tr.fc-minor th{border-top-style:dotted}.fc-event-vert{border-width:0 1px}.fc-event-vert.fc-event-start{border-top-width:1px;border-top-left-radius:3px;border-top-right-radius:3px}.fc-event-vert.fc-event-end{border-bottom-width:1px;border-bottom-left-radius:3px;border-bottom-right-radius:3px}.fc-event-vert .fc-event-time{white-space:nowrap;font-size:13px;font-weight:700}.fc-event-vert .fc-event-inner{position:relative;z-index:2}.fc-event-vert .fc-event-bg{position:absolute;z-index:1;top:0;left:0;width:100%;height:100%;background:#fff;opacity:.25}.fc-event-vert .ui-resizable-s{bottom:0!important;width:100%!important;height:8px!important;overflow:hidden!important;line-height:8px!important;font-size:11px!important;font-family:monospace;text-align:center;cursor:s-resize}.fc-content,.fc-divider,.fc-list-heading td,.fc-list-view,.fc-popover,.fc-row,tbody,td,th,thead{border-color:#eee}.fc-list-view{width:auto!important}.fc-event-dot{margin-right:2px}.fc-list-item{cursor:pointer}.fc-list-heading{background-color:#eee}.fc-view-container .table>tbody>tr>td,.fc-view-container .table>tbody>tr>th,.fc-view-container .table>tfoot>tr>td,.fc-view-container .table>tfoot>tr>th,.fc-view-container .table>thead>tr>td,.fc-view-container .table>thead>tr>th{padding:10px}.calendar-options .calendar-filters,.calendar-options .calendar-selectors,.calendar-options .calendar-types{float:left;margin-right:10px}.timeField .form-group{margin-bottom:0}.timeField .help-block{margin:0}#calendar-entry-form{padding-top:0}#calendar-entry-form .tab-menu{margin-bottom:0}#calendar-entry-form .bootstrap-timepicker-widget{min-width:140px}#calendar-entry-form .ProseMirror-menubar-wrapper{z-index:8}#calendar-entry-form .ProseMirror{min-height:150px!important}.calendar-entry-participants.modal-body{padding:0 0 20px 0}.calendar-entry-participants button.btn-participants-action{margin:10px 0 0 12px}.calendar-entry-participants .pagination{margin:10px 0 0}.calendar-entry-participants .media-list{margin:0 11px}.calendar-entry-participants .media-body{width:1%;word-break:initial}.calendar-entry-participants .media-body:first-child{width:auto}.calendar-entry-participants .media-body:first-child .media-object{float:left;margin-right:5px}.calendar-entry-participants .media-body:not(:first-child){padding-left:5px}.calendar-entry-participants select.form-control{width:auto;height:40px;padding-right:24px}.calendar-entry-new-participants-form button.btn,.calendar-entry-participants .media-list button.btn{height:32px;margin-top:3px}.calendar-entry-participants-count{padding:18px 18px 36px;margin:0}#calendar-entry-participants-list{position:relative}.calendar-entry-participants-export-button{margin:18px 18px 0}.calendar-entry-new-participants-form{padding:18px 18px 4px}.calendar-entry-new-participants-form .form-group.field-calendarentryparticipationform-newparticipantstatus{padding:0;margin:0}.calendar-entry-new-participants-form .form-group .checkbox label{padding-left:0}.calendar-entry-new-participants-form .form-group.field-calendarentryparticipationform-newforcestatus{display:inline-block}.calendar-entry-participants-filters{padding:10px 18px 0}.calendar-entry-participants-filter-title{font-size:80%}.calendar-entry-participants-filters .btn.btn-info{margin:10px 8px 0 0;padding:3px 14px}.calendar-entry-participants-filters .btn.btn-info.active{background:#0397a8!important;color:#fff!important}.calendar-entry-participants-filters .btn.btn-info:not(.active){border:1px solid #435f6f;color:#435f6f!important;background:#fff}.calendar-entry-participants-filters .btn.btn-info:not(.active):hover{background:#0397a8!important;border:1px solid #0397a8;color:#fff!important}.calendar-entry-participants .pagination-container{margin-top:25px}.calendar-entry-participants .pagination>li>a{color:#000}.calendar-entry-participants .pagination>.active>a{color:#fff}.calendar-option-buttons{float:right}#calendar-overview-loader{position:absolute;right:10px;top:60px}.calendar-wall-entry .calendar-wall-entry-section{margin-bottom:10px}.calendar-wall-entry .event-info-section{margin-bottom:10px}.calendar-wall-entry .event-info-section-content{padding-left:25px}.calendar-wall-entry .event-participation-buttons{margin:32px 0 15px}.calendar-wall-entry .event-participation-buttons button{margin-right:8px}.calendar-wall-entry .event-participation-buttons button .fa{font-size:130%;position:relative;top:1px;margin-right:3px}.calendar-wall-entry [data-action-click]{cursor:pointer}.calendar-wall-entry .event-info-section-content h1{margin:0 0 5px;font-weight:600;font-size:14px}@media (max-width:767px){.calendar-option-buttons{float:none;text-align:right}#calendar-overview-loader{position:inherit;float:left}} \ No newline at end of file + */.fc{direction:ltr;text-align:left}.fc table{border-collapse:collapse;border-spacing:0}.fc table,html .fc{font-size:1em}.fc td,.fc th{padding:0;vertical-align:top}.fc-header td{white-space:nowrap}.fc-header-left{width:25%;text-align:left}.fc-header-center{text-align:center}.fc-header-right{width:25%;text-align:right}.fc-header-title{display:inline-block;vertical-align:top;color:red!important}.fc-header-toolbar h2{margin-top:0;white-space:nowrap;font-size:20px;font-weight:600;color:#555}.fc .fc-header-space{padding-left:10px}.fc-header .fc-button{margin-bottom:1em;vertical-align:top}.fc-header .fc-button{margin-right:-1px}.fc-header .fc-corner-right,.fc-header .ui-corner-right{margin-right:0}.fc-header .fc-state-hover,.fc-header .ui-state-hover{z-index:2}.fc-header .fc-state-down{z-index:3}.fc-header .fc-state-active,.fc-header .ui-state-active{z-index:4}.fc-day-header{border:1px solid #eee!important}#calendar[data-can-create="0"] .fc-create-button{display:none}.fc-content{position:relative;z-index:1;clear:both;zoom:1}.fc-content .fa{margin:0 2px}.fc-view{position:relative;width:100%;overflow:hidden}.fc-widget-content,.fc-widget-header{border:1px solid #eee}td.fc-today{background:var(--background-color-highlight)}.fc-state-highlight,.fc-unthemed td.fc-today{background:#f6fdfc!important}.fc-cell-overlay{background:#bce8f1;opacity:.3}.fc-button{position:relative;display:inline-block;padding:0 .6em;overflow:hidden;height:1.9em;line-height:1.9em;white-space:nowrap;cursor:pointer}.fc-state-default{border:1px solid;background-image:none!important}.fc-state-default.fc-corner-left{border-top-left-radius:4px;border-bottom-left-radius:4px}.fc-state-default.fc-corner-right{border-top-right-radius:4px;border-bottom-right-radius:4px}.fc-disabled-cursor:hover{cursor:not-allowed}.fc-button .fc-icon{margin:0 .1em;font-family:"Courier New",Courier,monospace;vertical-align:baseline}.fc-icon-left-single-arrow:after{content:"\02039";font-weight:700}.fc-icon-right-single-arrow:after{content:"\0203A";font-weight:700}.fc-icon-left-double-arrow:after{content:"\000AB"}.fc-icon-right-double-arrow:after{content:"\000BB"}.fc-button .ui-icon{position:relative;top:50%;float:left;margin-top:-8px}.fc-state-default{background-color:#ededed;color:#777;border-color:#ededed}.fc-state-hover{background-color:#ededed;color:#777}.fc-state-active,.fc-state-down{background-color:#d7d7d7;border-color:#d7d7d7;color:#777}.fc-state-disabled{cursor:default;background-image:none;opacity:.65;box-shadow:none}.fc-event-container>*{z-index:8}.fc-event-container>.ui-draggable-dragging,.fc-event-container>.ui-resizable-resizing{z-index:9}.fc-event{background-color:#6fdbe8;color:#fff;font-size:.85em;cursor:default}a.fc-event{text-decoration:none}.fc-event-draggable,a.fc-event{cursor:pointer}.fc-rtl .fc-event{text-align:right}.fc-day-grid-event{border:none}.fc-content{width:100%;height:100%;overflow:hidden;padding:2px;border:none}.fc-event-time,.fc-event-title{padding:0 1px;font-size:13px}.fc .ui-resizable-handle{display:block;position:absolute;z-index:99999;overflow:hidden;font-size:300%;line-height:50%}.fc-view .canceled .fc-content,.fc-view .canceled .fc-content div,.fc-view .canceled.fc-list-item{text-decoration:line-through}.fc-event-hori{border-width:1px 0;margin-bottom:1px}.fc-ltr .fc-event-hori.fc-event-start,.fc-rtl .fc-event-hori.fc-event-end{border-left-width:1px;border-top-left-radius:3px;border-bottom-left-radius:3px}.fc-ltr .fc-event-hori.fc-event-end,.fc-rtl .fc-event-hori.fc-event-start{border-right-width:1px;border-top-right-radius:3px;border-bottom-right-radius:3px}.fc-event-hori .ui-resizable-e{top:0!important;right:-3px!important;width:7px!important;height:100%!important;cursor:e-resize}.fc-event-hori .ui-resizable-w{top:0!important;left:-3px!important;width:7px!important;height:100%!important;cursor:w-resize}table.fc-border-separate{border-collapse:separate}.fc-border-separate td,.fc-border-separate th{border-width:1px 0 0 1px}.fc-border-separate td.fc-last,.fc-border-separate th.fc-last{border-right-width:1px}.fc-border-separate tr.fc-last td,.fc-border-separate tr.fc-last th{border-bottom-width:1px}.fc-border-separate tbody tr.fc-first td,.fc-border-separate tbody tr.fc-first th{border-top-width:0}.fc-grid th{text-align:center}.fc .fc-week-number{width:22px;text-align:center}.fc .fc-week-number div{padding:0 2px}.fc-grid .fc-day-number{float:right;padding:0 2px}.fc-grid .fc-other-month .fc-day-number{opacity:.3}.fc-grid .fc-day-content{clear:both;padding:2px 2px 1px}.fc-grid .fc-event-time{font-weight:700}.fc-rtl .fc-grid .fc-day-number{float:left}.fc-rtl .fc-grid .fc-event-time{float:right}.fc-agenda table{border-collapse:separate}.fc-agenda-days th{text-align:center}.fc-agenda .fc-agenda-axis{width:50px;padding:0 4px;vertical-align:middle;text-align:right;font-weight:400}.fc-agenda-slots .fc-agenda-axis{white-space:nowrap}.fc-agenda .fc-week-number{font-weight:700}.fc-agenda .fc-day-content{padding:2px 2px 1px}.fc-agenda-days .fc-agenda-axis{border-right-width:1px}.fc-agenda-days .fc-col0{border-left-width:0}.fc-agenda-allday th{border-width:0 1px}.fc-agenda-allday .fc-day-content{min-height:34px}.fc-agenda-divider-inner{height:2px;overflow:hidden}.fc-widget-header .fc-agenda-divider-inner{background:#eee}.fc-agenda-slots th{border-width:1px 1px 0}.fc-agenda-slots td{border-width:1px 0 0;background:0 0}.fc-agenda-slots td div{height:20px}.fc-agenda-slots tr.fc-slot0 td,.fc-agenda-slots tr.fc-slot0 th{border-top-width:0}.fc-agenda-slots tr.fc-minor td,.fc-agenda-slots tr.fc-minor th{border-top-style:dotted}.fc-event-vert{border-width:0 1px}.fc-event-vert.fc-event-start{border-top-width:1px;border-top-left-radius:3px;border-top-right-radius:3px}.fc-event-vert.fc-event-end{border-bottom-width:1px;border-bottom-left-radius:3px;border-bottom-right-radius:3px}.fc-event-vert .fc-event-time{white-space:nowrap;font-size:13px;font-weight:700}.fc-event-vert .fc-event-inner{position:relative;z-index:2}.fc-event-vert .fc-event-bg{position:absolute;z-index:1;top:0;left:0;width:100%;height:100%;background:#fff;opacity:.25}.fc-event-vert .ui-resizable-s{bottom:0!important;width:100%!important;height:8px!important;overflow:hidden!important;line-height:8px!important;font-size:11px!important;font-family:monospace;text-align:center;cursor:s-resize}.fc-content,.fc-divider,.fc-list-heading td,.fc-list-view,.fc-popover,.fc-row,tbody,td,th,thead{border-color:#eee}.fc-list-view{width:auto!important}.fc-event-dot{margin-right:2px}.fc-list-item{cursor:pointer}.fc-list-heading{background-color:#eee}.fc-view-container .table>tbody>tr>td,.fc-view-container .table>tbody>tr>th,.fc-view-container .table>tfoot>tr>td,.fc-view-container .table>tfoot>tr>th,.fc-view-container .table>thead>tr>td,.fc-view-container .table>thead>tr>th{padding:10px}.calendar-options .calendar-filters,.calendar-options .calendar-selectors,.calendar-options .calendar-types{float:left;margin-right:10px}.timeField .form-group{margin-bottom:0}.timeField .help-block{margin:0}#calendar-entry-form{padding-top:0}#calendar-entry-form .tab-menu{margin-bottom:0}#calendar-entry-form .bootstrap-timepicker-widget{min-width:140px}#calendar-entry-form .ProseMirror-menubar-wrapper{z-index:8}#calendar-entry-form .ProseMirror{min-height:150px!important}.calendar-entry-participants.modal-body{padding:0 0 20px 0}.calendar-entry-participants button.btn-participants-action{margin:10px 0 0 12px}.calendar-entry-participants .pagination{margin:10px 0 0}.calendar-entry-participants .media-list{margin:0 11px}.calendar-entry-participants .media-body{width:1%;word-break:initial}.calendar-entry-participants .media-body:first-child{width:auto}.calendar-entry-participants .media-body:first-child .media-object{float:left;margin-right:5px}.calendar-entry-participants .media-body:not(:first-child){padding-left:5px}.calendar-entry-participants select.form-control{width:auto;height:40px;padding-right:24px}.calendar-entry-new-participants-form button.btn,.calendar-entry-participants .media-list button.btn{height:32px;margin-top:3px}.calendar-entry-participants-count{padding:18px 18px 36px;margin:0}#calendar-entry-participants-list{position:relative}.calendar-entry-participants-export-button{margin:18px 18px 0}.calendar-entry-new-participants-form{padding:18px 18px 4px}.calendar-entry-new-participants-form .form-group.field-calendarentryparticipationform-newparticipantstatus{padding:0;margin:0}.calendar-entry-new-participants-form .form-group .checkbox label{padding-left:0}.calendar-entry-new-participants-form .form-group.field-calendarentryparticipationform-newforcestatus{display:inline-block}.calendar-entry-participants-filters{padding:10px 18px 0}.calendar-entry-participants-filter-title{font-size:80%}.calendar-entry-participants-filters .btn.btn-info{margin:10px 8px 0 0;padding:3px 14px}.calendar-entry-participants-filters .btn.btn-info.active{background:#0397a8!important;color:#fff!important}.calendar-entry-participants-filters .btn.btn-info:not(.active){border:1px solid #435f6f;color:#435f6f!important;background:#fff}.calendar-entry-participants-filters .btn.btn-info:not(.active):hover{background:#0397a8!important;border:1px solid #0397a8;color:#fff!important}.calendar-entry-participants .pagination-container{margin-top:25px}.calendar-entry-participants .pagination>li>a{color:#000}.calendar-entry-participants .pagination>.active>a{color:#fff}.calendar-option-buttons{float:right}#calendar-overview-loader{position:absolute;right:10px;top:60px}.calendar-wall-entry .calendar-wall-entry-section{margin-bottom:10px}.calendar-wall-entry .event-info-section{margin-bottom:10px}.calendar-wall-entry .event-info-section-content{padding-left:25px}.calendar-wall-entry .event-participation-buttons{margin:32px 0 15px}.calendar-wall-entry .event-participation-buttons button{margin-right:8px}.calendar-wall-entry .event-participation-buttons button .fa{font-size:130%;position:relative;top:1px;margin-right:3px}.calendar-wall-entry [data-action-click]{cursor:pointer}.calendar-wall-entry .event-info-section-content h1{margin:0 0 5px;font-weight:600;font-size:14px}@media (max-width:767px){.calendar-option-buttons{float:none;text-align:right}#calendar-overview-loader{position:inherit;float:left}}.calendar-type-legend .calendar-type-item{display:inline-block;background:var(--background-color-secondary);color:var(--text-color-main);border-radius:4px;padding:4px 16px;margin-right:8px;margin-bottom:8px;font-size:14px;font-weight:500}.calendar-type-legend .calendar-type-color{display:inline-block;width:16px;height:16px;border:1px solid var(--text-color-soft3);border-radius:4px;margin-right:6px;position:relative;top:2px} \ No newline at end of file diff --git a/views/global/index.php b/views/global/index.php index a2722aad..6f22d2f0 100644 --- a/views/global/index.php +++ b/views/global/index.php @@ -3,6 +3,7 @@ use humhub\modules\calendar\helpers\Url; use humhub\modules\calendar\widgets\CalendarControls; use humhub\modules\calendar\widgets\CalendarFilterBar; +use humhub\modules\calendar\widgets\CalendarTypeLegend; use humhub\modules\calendar\widgets\ConfigureButton; use humhub\modules\calendar\widgets\FullCalendar; use humhub\modules\ui\view\helpers\ThemeHelper; @@ -11,6 +12,7 @@ /* @var $this \humhub\modules\ui\view\components\View */ /* @var $selectors array */ /* @var $filters array */ +/* @var $editUrl string */ $isFluid = ThemeHelper::isFluid(); $containerClass = $isFluid ? 'container-fluid' : 'container'; @@ -48,6 +50,8 @@ ]) ?> + + FooterMenu::LOCATION_FULL_PAGE]) ?> diff --git a/views/view/index.php b/views/view/index.php index 5cf4d4d7..b06cd484 100644 --- a/views/view/index.php +++ b/views/view/index.php @@ -1,15 +1,15 @@
@@ -21,10 +21,12 @@
$canAddEntries, - 'loadUrl' => $loadAjaxUrl, + 'loadUrl' => Url::toAjaxLoad($contentContainer), 'contentContainer' => $contentContainer, 'aspectRatio' => ThemeHelper::isFluid() ? 2 : 1.7 ]); ?>
-
\ No newline at end of file +
+ + $contentContainer]) ?> diff --git a/widgets/CalendarTypeLegend.php b/widgets/CalendarTypeLegend.php new file mode 100644 index 00000000..b143fe6b --- /dev/null +++ b/widgets/CalendarTypeLegend.php @@ -0,0 +1,42 @@ +getCalendarTypes(); + + if (empty($calendarTypes)) { + return ''; + } + + return $this->render('calendarTypeLegend', [ + 'calendarTypes' => $calendarTypes, + ]); + } + + /** + * @return CalendarEntryType[] + */ + public function getCalendarTypes(): array + { + $query = $this->contentContainer + ? CalendarEntryType::findByContainer($this->contentContainer, true) + : CalendarEntryType::find(); + + return $query->all(); + } +} diff --git a/widgets/CalendarTypeListView.php b/widgets/CalendarTypeListView.php deleted file mode 100644 index d8c7fc7c..00000000 --- a/widgets/CalendarTypeListView.php +++ /dev/null @@ -1,27 +0,0 @@ - +
+
+ +
+
+ +
+ + name ?> +
+ +
+
From 3bcb4e8c08c595ae29f96891cbf8b5897b8f85ff Mon Sep 17 00:00:00 2001 From: Yuriy Bakhtin Date: Mon, 1 Jul 2024 11:06:55 +0200 Subject: [PATCH 4/4] Fix styles of calendar filters --- widgets/views/calendarFilterBar.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/widgets/views/calendarFilterBar.php b/widgets/views/calendarFilterBar.php index 80570f4d..ae1f8283 100644 --- a/widgets/views/calendarFilterBar.php +++ b/widgets/views/calendarFilterBar.php @@ -32,7 +32,7 @@
-
+
@@ -82,7 +82,7 @@
-
+