Skip to content

Commit

Permalink
Merge pull request #605 from asmaNode/#603
Browse files Browse the repository at this point in the history
  • Loading branch information
fabienmoyon authored Oct 25, 2021
2 parents 6280409 + 6e32efc commit 51d6635
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
require('../../app.constants.js');

angular.module('esn.calendar.libs')
.controller('CalEventPreviewPopoverController', CalEventPreviewPopoverController);

Expand All @@ -16,7 +18,8 @@ function CalEventPreviewPopoverController(
calPartstatUpdateNotificationService,
calUIAuthorizationService,
urlUtils,
notificationFactory
notificationFactory,
CAL_ATTENDEE_LIST_LIMIT
) {
const self = this;

Expand All @@ -25,6 +28,13 @@ function CalEventPreviewPopoverController(
self.duplicateEvent = duplicateEvent;
self.changeParticipation = changeParticipation;
self.closeEventPreviewPopover = closeEventPreviewPopover;
self.$onInit = $onInit;
self.showAll = showAll;

function $onInit() {
self.limit = CAL_ATTENDEE_LIST_LIMIT;
self.shouldShowMoreAttendees = true;
}

function openEventForm() {
closeEventPreviewPopover();
Expand Down Expand Up @@ -205,4 +215,9 @@ function CalEventPreviewPopoverController(
self.isReadOnly = self.calendar.readOnly;
});
}

function showAll() {
self.limit = (self.shouldShowMoreAttendees ? self.attendees.length : CAL_ATTENDEE_LIST_LIMIT);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@
span {{ $ctrl.attendees.length }} {{ 'attendees' | translate }}
span.secondary-description-text {{ $ctrl.attendees | attendeePartStatText }}
.attendee-list
.attendee-item(ng-repeat="attendee in $ctrl.attendees | limitTo: 5")
.attendee-item(ng-repeat="attendee in $ctrl.attendees | limitTo: $ctrl.limit track by $index")
cal-attendee-avatar(attendee='attendee')
.attendee-item-meta
.name
span {{ ::attendee.displayName }}
.details(ng-if="attendee.email === $ctrl.event.organizer.email")
span.organizer {{ 'Organizer' | translate }}
span.secondary-description-text(ng-if="$ctrl.attendees.length > 5") {{ $ctrl.attendees.length - 5 }} {{ 'more attendees...' | translate }}
a.clickable(ng-href="", ng-click="$ctrl.showAll(); $ctrl.shouldShowMoreAttendees = !$ctrl.shouldShowMoreAttendees" , ng-if="$ctrl.attendees.length>=$ctrl.limit") {{ $ctrl.shouldShowMoreAttendees ? 'Show more...' : 'Show less...' | translate }}
.info-row(ng-if="$ctrl.resources.length > 0")
i.mdi.mdi-monitor-multiple
span {{ $ctrl.resources | commaSeparatedResourceList }}
Expand Down
2 changes: 2 additions & 0 deletions src/esn.calendar.libs/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,8 @@
"Shared calendar": "Shared calendar",
"Shared calendars": "Shared calendars",
"Show all...": "Show all...",
"Show more...": "Show more...",
"Show less...": "Show less...",
"Show calendar": "Show calendar",
"Show planning": "Show planning",
"Show secret address": "Show secret address",
Expand Down
2 changes: 2 additions & 0 deletions src/esn.calendar.libs/i18n/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,8 @@
"Shared calendar": "Calendrier partagé",
"Shared calendars": "Calendriers partagés",
"Show all...": "Afficher tous les participants...",
"Show more...": "Afficher plus...",
"Show less...": "Afficher moins...",
"Show calendar": "Afficher le calendrier",
"Show planning": "Afficher le planning",
"Show secret address": "Afficher l'adresse secrète",
Expand Down
2 changes: 2 additions & 0 deletions src/esn.calendar.libs/i18n/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,8 @@
"Shared calendar": "Общий календарь",
"Shared calendars": "Общие календари",
"Show all...": "Показать все...",
"Show more...": "показать больше...",
"Show less...": "показывай меньше...",
"Show calendar": "Показать календарь",
"Show planning": "Показать планирование",
"Show secret address": "Показать секретный адрес",
Expand Down
2 changes: 2 additions & 0 deletions src/esn.calendar.libs/i18n/vi.json
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,8 @@
"Shared calendar": "Lịch được chia sẻ",
"Shared calendars": "Lịch được chia sẻ",
"Show all...": "Hiển thị tất cả...",
"Show more...": "Hiện nhiều hơn...",
"Show less...": "Hiện ít hơn...",
"Show calendar": "Hiển thị lịch",
"Show planning": "Hiển thị kế hoạch",
"Show secret address": "Hiển thị địa chỉ bí mật",
Expand Down
2 changes: 2 additions & 0 deletions src/esn.calendar.libs/i18n/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,8 @@
"Shared calendar": "共享日历",
"Shared calendars": "共享日历组",
"Show all...": "显示所有…",
"Show more...": "展示更多...",
"Show less...": "显示较少...",
"Show calendar": "显示日历",
"Show planning": "显示日程",
"Show secret address": "显示秘密地址",
Expand Down

0 comments on commit 51d6635

Please sign in to comment.