(js) Show calendar names in events blocks

Only for subscriptions
This commit is contained in:
Francis Lachapelle
2019-03-15 16:57:16 -04:00
parent 33adb88d5c
commit 90de396646
2 changed files with 10 additions and 2 deletions
+3
View File
@@ -1,6 +1,9 @@
4.0.8 (YYYY-MM-DD)
------------------
Enhancements
- [web] show calendar names of subscriptions in events blocks
Bug fixes
- [web] fixed wrong translation of custom calendar categories
- [web] fixed wrong colors assigned to default calendar categories
@@ -19,8 +19,8 @@
sg-block="block"
sg-click="open(clickEvent, clickComponent)" />
*/
sgCalendarDayBlock.$inject = ['CalendarSettings'];
function sgCalendarDayBlock(CalendarSettings) {
sgCalendarDayBlock.$inject = ['Calendar'];
function sgCalendarDayBlock(Calendar) {
return {
restrict: 'E',
scope: {
@@ -50,6 +50,7 @@
' <span ng-show="'+p+'block.component.c_priority" class="sg-priority">{{'+p+'block.component.c_priority}}</span>',
// Summary
' {{ '+p+'block.component.summary }}',
' <div class="secondary md-truncate" ng-show="'+p+'showCalendarName" ng-bind="'+p+'block.component.calendarName"></div>',
' <span class="icons">',
// Component is reccurent
' <md-icon ng-if="'+p+'block.component.occurrenceId" class="material-icons icon-repeat"></md-icon>',
@@ -75,6 +76,7 @@
function link(scope, iElement, attrs) {
var pc, left, right;
if (!_.has(attrs, 'sgCalendarGhost')) {
// Compute position
@@ -99,6 +101,9 @@
iElement.addClass('sg-event--' + scope.block.userState);
if (scope.block.component) {
// Show calendar name for subscriptions only
scope.showCalendarName = Calendar.activeUser.login !== scope.block.component.c_owner;
// Set background color
iElement.addClass('bg-folder' + scope.block.component.pid);
iElement.addClass('contrast-bdr-folder' + scope.block.component.pid);