From b72a9383a49a0273c61ad7bbe9782a0e050c1844 Mon Sep 17 00:00:00 2001 From: Ludovic Marcotte Date: Fri, 14 Aug 2015 12:14:15 -0400 Subject: [PATCH] (feat) major rework of the sidenav and top toolbars --- UI/Common/UIxPageFrame.m | 40 +-- UI/Templates/MailerUI/UIxMailMainFrame.wox | 32 +-- UI/Templates/PreferencesUI/UIxPreferences.wox | 5 - UI/Templates/UIxPageFrame.wox | 259 +++++------------- UI/Templates/UIxSidenavToolbarTemplate.wox | 33 +-- UI/Templates/UIxTopnavToolbarTemplate.wox | 53 +++- UI/WebServerResources/js/Common/Common.app.js | 11 +- .../js/Common/navController.js | 1 + 8 files changed, 164 insertions(+), 270 deletions(-) diff --git a/UI/Common/UIxPageFrame.m b/UI/Common/UIxPageFrame.m index ed07db744..1867b88c6 100644 --- a/UI/Common/UIxPageFrame.m +++ b/UI/Common/UIxPageFrame.m @@ -440,40 +440,6 @@ return ([[self productCSSURL] length] > 0); } -- (BOOL) _moduleIs: (NSString *) moduleName -{ - NSString *frameworkName; - - frameworkName = [[context page] frameworkName]; - - return [frameworkName isEqualToString: moduleName]; -} - -- (BOOL) isCalendar -{ - return [self _moduleIs: @"SchedulerUI"]; -} - -- (BOOL) isContacts -{ - return [self _moduleIs: @"ContactsUI"]; -} - -- (BOOL) isMail -{ - return [self _moduleIs: @"MailerUI"]; -} - -- (BOOL) isPreferences -{ - return [self _moduleIs: @"PreferencesUI"]; -} - -- (BOOL) isAdministration -{ - return [self _moduleIs: @"AdministrationUI"]; -} - - (void) setToolbar: (NSString *) newToolbar { ASSIGN (toolbar, newToolbar); @@ -509,6 +475,12 @@ return [[context activeUser] cn]; } +- (NSString *) userEmail +{ + return [[context activeUser] systemEmail]; +} + + - (BOOL) canLogoff { BOOL canLogoff; diff --git a/UI/Templates/MailerUI/UIxMailMainFrame.wox b/UI/Templates/MailerUI/UIxMailMainFrame.wox index fb807878c..639075baa 100644 --- a/UI/Templates/MailerUI/UIxMailMainFrame.wox +++ b/UI/Templates/MailerUI/UIxMailMainFrame.wox @@ -235,17 +235,17 @@
{{account.name}}
- - add_circle_outline - - - people - + + add_circle_outline + + + people +
@@ -346,14 +346,10 @@ @@ -49,152 +42,26 @@ - - - + + + + - - - - + + + + + - + - - - @@ -202,31 +69,58 @@ + @@ -236,40 +130,31 @@ - + - + - + - + - - + + + diff --git a/UI/Templates/UIxSidenavToolbarTemplate.wox b/UI/Templates/UIxSidenavToolbarTemplate.wox index 73e6af2eb..4b42c0db4 100644 --- a/UI/Templates/UIxSidenavToolbarTemplate.wox +++ b/UI/Templates/UIxSidenavToolbarTemplate.wox @@ -3,27 +3,14 @@ xmlns="http://www.w3.org/1999/xhtml" xmlns:var="http://www.skyrix.com/od/binding" xmlns:const="http://www.skyrix.com/od/constant" - xmlns:label="OGo:label" - > - -
- - apps - - -
- -
-
-

{{activeUser.identification}}

- - -
-
-
+ xmlns:label="OGo:label"> + +
+ +

{{activeUser.identification}}

+

{{activeUser.email}}

+
+
diff --git a/UI/Templates/UIxTopnavToolbarTemplate.wox b/UI/Templates/UIxTopnavToolbarTemplate.wox index 4f14dcc1d..da8cc79a8 100644 --- a/UI/Templates/UIxTopnavToolbarTemplate.wox +++ b/UI/Templates/UIxTopnavToolbarTemplate.wox @@ -3,8 +3,8 @@ xmlns="http://www.w3.org/1999/xhtml" xmlns:var="http://www.skyrix.com/od/binding" xmlns:const="http://www.skyrix.com/od/constant" - xmlns:label="OGo:label" - > + xmlns:label="OGo:label"> +

+ +
+ + + apps + + +
+ + event + + + + contacts + + + + email + + + + settings + + + + settings_applications + + + + settings_power + + +
+
+
+
+ diff --git a/UI/WebServerResources/js/Common/Common.app.js b/UI/WebServerResources/js/Common/Common.app.js index 2afa226f9..0fae33594 100644 --- a/UI/WebServerResources/js/Common/Common.app.js +++ b/UI/WebServerResources/js/Common/Common.app.js @@ -12,9 +12,18 @@ var settings = { login: UserLogin || null, identification: UserIdentification || null, + email: UserEmail || null, language: UserLanguage || null, folderURL: UserFolderURL || null, - isSuperUser: IsSuperUser || null + isSuperUser: IsSuperUser || null, + path: { + calendar: UserCalendarPath || null, + contacts: UserContactsPath || null, + mail: UserMailPath || null, + preferences: UserPreferencesPath || null, + administration: (IsSuperUser ? UserAdministrationPath : null), + logoff: UserLogoffPath || null + } }; if (param) return settings[param]; diff --git a/UI/WebServerResources/js/Common/navController.js b/UI/WebServerResources/js/Common/navController.js index 3254600c1..39c4fb6e1 100644 --- a/UI/WebServerResources/js/Common/navController.js +++ b/UI/WebServerResources/js/Common/navController.js @@ -13,6 +13,7 @@ function navController($scope, $timeout, $interval, $http, $mdSidenav, $mdBottomSheet, $mdMedia, $log, sgConstant, sgSettings, Alarm) { $scope.activeUser = sgSettings.activeUser(); + $scope.baseURL = sgSettings.baseURL(); // Show current day in top bar $scope.currentDay = window.currentDay;