diff --git a/css/style.css b/css/style.css index 543a31a7..1e87806b 100644 --- a/css/style.css +++ b/css/style.css @@ -47,10 +47,21 @@ #app-navigation .app-navigation-entry-menu li { float: inherit; width: auto !important; - padding: 10px; opacity: 0.5; cursor: pointer; + height: 38px; } +#app-navigation .app-navigation-entry-menu li>a, +#app-navigation .app-navigation-entry-menu li>span { + width: 100%; + padding: 10px; + display: inline-block; + line-height: normal; + height: auto; + min-height: auto; + box-sizing: border-box; +} + #app-navigation .app-navigation-entry-menu li img, #app-navigation .app-navigation-entry-menu li span{ cursor: pointer; @@ -65,11 +76,13 @@ #app-navigation .app-navigation-entry-menu li button{ float: inherit; } -#app-navigation li.edit .app-navigation-entry-edit { +#app-navigation li.edit .app-navigation-entry-edit.name, +#app-navigation li.caldav .app-navigation-entry-edit.caldav { display: inline-block; height: auto; } -#app-navigation li .app-navigation-entry-edit { +#app-navigation li .app-navigation-entry-edit.name, +#app-navigation li .app-navigation-entry-edit.caldav { display: none; } #app-navigation li a > span.icon { @@ -1541,9 +1554,14 @@ ol[dnd-list] .dndPlaceholder { background-color: white; } -#app-navigation .app-navigation-entry-edit input[type="text"] { +#app-navigation .app-navigation-entry-edit.name input[type="text"] { width: calc(100% - 72px); } + +#app-navigation .app-navigation-entry-edit.caldav input[type="text"] { + width: calc(100% - 36px); +} + .error input.edit { color: #e9322d; border-color: #e9322d !important; diff --git a/js/app/controllers/listcontroller.js b/js/app/controllers/listcontroller.js index 57c30961..e8501535 100644 --- a/js/app/controllers/listcontroller.js +++ b/js/app/controllers/listcontroller.js @@ -100,6 +100,29 @@ angular.module('Tasks').controller('ListController', [ }, 50); }; + this._$scope.showCalDAVUrl = function(calendar) { + _$scope.status.addingList = false; + _$scope.nameError = false; + $location.path('/calendars/' + _$scope.route.calendarID + '/edit/caldav'); + _$timeout(function() { + $('#list_' + calendar.uri + ' input.caldav').focus(); + }, 50); + }; + + this._$scope.hideCalDAVUrl = function() { + $location.path('/calendars/' + _$scope.route.calendarID); + }; + + this._$scope.download = function (calendar) { + var url = calendar.url; + // cut off last slash to have a fancy name for the ics + if (url.slice(url.length - 1) === '/') { + url = url.slice(0, url.length - 1); + } + url += '?export'; + $window.open(url); + }; + this._$scope.checkNew = function(event,name) { _$scope.checkName(event,name); }; diff --git a/js/app/services/models/calendar.js b/js/app/services/models/calendar.js index 2d1c92a5..14dfb17a 100644 --- a/js/app/services/models/calendar.js +++ b/js/app/services/models/calendar.js @@ -23,7 +23,7 @@ * */ -angular.module('Tasks').factory('Calendar', ['$rootScope', '$filter', function($rootScope, $filter) { +angular.module('Tasks').factory('Calendar', ['$rootScope', '$filter', '$window', function($rootScope, $filter, $window) { 'use strict'; function Calendar(url, props, uri) { @@ -155,6 +155,18 @@ angular.module('Tasks').factory('Calendar', ['$rootScope', '$filter', function($ get url() { return this._properties.url; }, + get caldav() { + return $window.location.origin + this.url; + }, + get exportUrl() { + var url = this.url; + // cut off last slash to have a fancy name for the ics + if (url.slice(url.length - 1) === '/') { + url = url.slice(0, url.length - 1); + } + url += '?export'; + return url; + }, get enabled() { return this._properties.enabled; }, diff --git a/js/public/app.js b/js/public/app.js index 2f8221ec..03bb6209 100644 --- a/js/public/app.js +++ b/js/public/app.js @@ -658,6 +658,29 @@ angular.module('Tasks').controller('ListController', [ }, 50); }; + this._$scope.showCalDAVUrl = function(calendar) { + _$scope.status.addingList = false; + _$scope.nameError = false; + $location.path('/calendars/' + _$scope.route.calendarID + '/edit/caldav'); + _$timeout(function() { + $('#list_' + calendar.uri + ' input.caldav').focus(); + }, 50); + }; + + this._$scope.hideCalDAVUrl = function() { + $location.path('/calendars/' + _$scope.route.calendarID); + }; + + this._$scope.download = function (calendar) { + var url = calendar.url; + // cut off last slash to have a fancy name for the ics + if (url.slice(url.length - 1) === '/') { + url = url.slice(0, url.length - 1); + } + url += '?export'; + $window.open(url); + }; + this._$scope.checkNew = function(event,name) { _$scope.checkName(event,name); }; @@ -3033,7 +3056,7 @@ angular.module('Tasks').factory('Loading', [ }).call(this); -angular.module('Tasks').factory('Calendar', ['$rootScope', '$filter', function($rootScope, $filter) { +angular.module('Tasks').factory('Calendar', ['$rootScope', '$filter', '$window', function($rootScope, $filter, $window) { 'use strict'; function Calendar(url, props, uri) { @@ -3165,6 +3188,18 @@ angular.module('Tasks').factory('Calendar', ['$rootScope', '$filter', function($ get url() { return this._properties.url; }, + get caldav() { + return $window.location.origin + this.url; + }, + get exportUrl() { + var url = this.url; + // cut off last slash to have a fancy name for the ics + if (url.slice(url.length - 1) === '/') { + url = url.slice(0, url.length - 1); + } + url += '?export'; + return url; + }, get enabled() { return this._properties.enabled; }, diff --git a/templates/main.php b/templates/main.php index c590553e..4cf8fb7c 100644 --- a/templates/main.php +++ b/templates/main.php @@ -41,7 +41,8 @@ id="list_{{ calendar.uri }}" calendarID="{{calendar.uri}}" ng-repeat="calendar in calendars" - ng-class="{active: calendar.uri==route.calendarID, edit:route.listparameter == 'name' && route.calendarID == calendar.uri}" + ng-class="{ active: calendar.uri==route.calendarID, edit:route.listparameter == 'name' && route.calendarID == calendar.uri, + caldav: route.listparameter == 'caldav' && route.calendarID == calendar.uri}" dnd-list="draggedTasks" dnd-drop="dropList(event, index, item)" dnd-dragover="dragoverList(event, index)"> @@ -57,17 +58,33 @@
-
+
@@ -77,13 +94,19 @@ selected="calendar.color">
+
+ + + + +
  • t('Add List...')); ?> -
    +