From 9a1c2b6a114dee0f594dc10f29ba408283a6b653 Mon Sep 17 00:00:00 2001 From: Francis Lachapelle Date: Mon, 30 Mar 2015 17:38:41 -0400 Subject: [PATCH] New ng directives for Calendar module - sgCalendarDayTable - sgCalendarDayBlock --- UI/WebServerResources/js/Common/ui-desktop.js | 64 +++++++++++++++++++ 1 file changed, 64 insertions(+) diff --git a/UI/WebServerResources/js/Common/ui-desktop.js b/UI/WebServerResources/js/Common/ui-desktop.js index ba3505cab..04be0a941 100644 --- a/UI/WebServerResources/js/Common/ui-desktop.js +++ b/UI/WebServerResources/js/Common/ui-desktop.js @@ -652,6 +652,70 @@ } } }; + }]) + + /* + * sgCalendarDayTable - Build list of blocks for a specific day + * @memberof SOGo.UIDesktop + * @restrict element + * @param {object} sgBlocks - the events blocks definitions for the current view + * @param {string} sgDay - the day of the events to display + * @example: + + + */ + .directive('sgCalendarDayTable', [function() { + return { + restrict: 'E', + scope: { + blocks: '=sgBlocks', + day: '@sgDay' + }, + template: + '', + }; + }]) + + /* + * sgCalendarDayBlock - An event block to be displayed in a week + * @memberof SOGo.UIDesktop + * @restrict element + * @param {object} sgBlock - the event block definition + * @example: + + + */ + .directive('sgCalendarDayBlock', [function() { + return { + restrict: 'E', + scope: { + block: '=sgBlock' + }, + replace: true, + template: + '
' + + '
' + + '
' + + '
' + + '
{{ block.component.c_title }}
' + + '
' + + '
' + + '
' + + '
', + link: link + }; + + function link(scope, iElement, attrs) { + iElement.addClass('starts' + scope.block.start); + iElement.addClass('lasts' + scope.block.length); + } }]); })();