(feat) show all/only this calendar

pull/189/merge
Ludovic Marcotte 2016-02-10 13:47:17 -05:00
parent 37f4b11834
commit 6876ba8709
4 changed files with 34 additions and 0 deletions

1
NEWS
View File

@ -8,6 +8,7 @@ Enhancements
- [web] mail filters are now sortable
- [web] now supports RFC6154 and NoInferiors IMAP flag
- [web] improved confirm dialogs for deletions
- [web] show all/only this calendar
Bug fixes
- [web] handle birthday dates before 1970

View File

@ -437,6 +437,13 @@ vtodo_class2 = "(Confidential task)";
"When I modify my calendar, send a mail to" = "When I modify my calendar, send a mail to";
"Email Address" = "Email Address";
"Export" = "Export";
/* Show only the calendar for which the menu is displayed */
"Show Only This Calendar" = Show Only This Calendar";
/* Show all calendar (personal, subscriptions and web) */
"Show All Calendars" = "Show All Calendars";
"Links to this Calendar" = "Links to this Calendar";
"Authenticated User Access" = "Authenticated User Access";
"CalDAV URL" = "CalDAV URL ";

View File

@ -188,6 +188,17 @@
</md-button>
</md-menu-item>
<md-menu-divider><!-- divider --></md-menu-divider>
<md-menu-item>
<md-button ng-click="app.showOnly(calendar)">
<var:string label:value="Show Only This Calendar"/>
</md-button>
</md-menu-item>
<md-menu-item>
<md-button ng-click="app.showAll()">
<var:string label:value="Show All Calendars"/>
</md-button>
</md-menu-item>
<md-menu-divider><!-- divider --></md-menu-divider>
<md-menu-item>
<md-button ng-click="app.showLinks(calendar)">
<var:string label:value="Links to this Calendar"/>

View File

@ -21,6 +21,8 @@
vm.share = share;
vm.importCalendar = importCalendar;
vm.exportCalendar = exportCalendar;
vm.showOnly = showOnly;
vm.showAll = showAll;
vm.showLinks = showLinks;
vm.showProperties = showProperties;
vm.subscribeToFolder = subscribeToFolder;
@ -202,6 +204,19 @@
window.location.href = ApplicationBaseURL + '/' + calendar.id + '.ics' + '/export';
}
function showOnly(calendar) {
_.forEach(Calendar.$findAll(), function(o) {
if (calendar.id == o.id)
o.active = 1;
else
o.active = 0;
});
}
function showAll() {
_.forEach(Calendar.$findAll(), function(o) { o.active = 1; });
}
function showLinks(calendar) {
$mdDialog.show({
parent: angular.element(document.body),