From d182202fc6001983541504ed323d68479086317e Mon Sep 17 00:00:00 2001 From: WuKong Date: Sat, 22 Apr 2017 13:25:07 +0200 Subject: add moonv4 Change-Id: I247af788d0b0fb961fbc85416486b241eb1d807c Signed-off-by: WuKong --- moonv4/moon_gui/static/app/common/404/404.tpl.html | 3 ++ .../common/compatibility/compatibility.tpl.html | 26 +++++++++++ .../static/app/common/footer/footer.controller.js | 54 ++++++++++++++++++++++ .../static/app/common/footer/footer.tpl.html | 7 +++ .../static/app/common/header/header.controller.js | 53 +++++++++++++++++++++ .../static/app/common/header/header.tpl.html | 50 ++++++++++++++++++++ .../static/app/common/loader/loader.dir.js | 19 ++++++++ .../static/app/common/loader/loader.tpl.html | 1 + .../static/app/common/waiting/waiting.tpl.html | 15 ++++++ 9 files changed, 228 insertions(+) create mode 100644 moonv4/moon_gui/static/app/common/404/404.tpl.html create mode 100644 moonv4/moon_gui/static/app/common/compatibility/compatibility.tpl.html create mode 100644 moonv4/moon_gui/static/app/common/footer/footer.controller.js create mode 100644 moonv4/moon_gui/static/app/common/footer/footer.tpl.html create mode 100644 moonv4/moon_gui/static/app/common/header/header.controller.js create mode 100644 moonv4/moon_gui/static/app/common/header/header.tpl.html create mode 100644 moonv4/moon_gui/static/app/common/loader/loader.dir.js create mode 100644 moonv4/moon_gui/static/app/common/loader/loader.tpl.html create mode 100644 moonv4/moon_gui/static/app/common/waiting/waiting.tpl.html (limited to 'moonv4/moon_gui/static/app/common') diff --git a/moonv4/moon_gui/static/app/common/404/404.tpl.html b/moonv4/moon_gui/static/app/common/404/404.tpl.html new file mode 100644 index 00000000..61e0420c --- /dev/null +++ b/moonv4/moon_gui/static/app/common/404/404.tpl.html @@ -0,0 +1,3 @@ +
Not found!
+ +
Go Projects ?
\ No newline at end of file diff --git a/moonv4/moon_gui/static/app/common/compatibility/compatibility.tpl.html b/moonv4/moon_gui/static/app/common/compatibility/compatibility.tpl.html new file mode 100644 index 00000000..0e32dc4f --- /dev/null +++ b/moonv4/moon_gui/static/app/common/compatibility/compatibility.tpl.html @@ -0,0 +1,26 @@ + \ No newline at end of file diff --git a/moonv4/moon_gui/static/app/common/footer/footer.controller.js b/moonv4/moon_gui/static/app/common/footer/footer.controller.js new file mode 100644 index 00000000..d7506840 --- /dev/null +++ b/moonv4/moon_gui/static/app/common/footer/footer.controller.js @@ -0,0 +1,54 @@ +/** + * @author arnaud marhin + */ + +(function() { + + 'use strict'; + + angular + .module('moon') + .controller('FooterController', FooterController); + + FooterController.$inject = ['$modal', 'versionService']; + + function FooterController($modal, versionService) { + + var footer = this; + + footer.version = null; + footer.browsersModal = null; + footer.showBrowsersCompliance = showBrowsersCompliance; + + newBrowsersModal(); + currentVersion(); + + function newBrowsersModal() { + + footer.browsersModal = $modal({ template: 'html/common/compatibility/compatibility.tpl.html', show: false }); + + return footer.browsersModal; + + } + + function showBrowsersCompliance() { + footer.browsersModal.$promise.then(footer.browsersModal.show); + } + + function currentVersion() { + + var _self = footer; + + versionService.version.get().$promise.then(function(data) { + + _self.version = (data.version) ? data.version : 'SNAPSHOT'; + + return _self.version; + + }); + + } + + } + +})(); \ No newline at end of file diff --git a/moonv4/moon_gui/static/app/common/footer/footer.tpl.html b/moonv4/moon_gui/static/app/common/footer/footer.tpl.html new file mode 100644 index 00000000..aacb392d --- /dev/null +++ b/moonv4/moon_gui/static/app/common/footer/footer.tpl.html @@ -0,0 +1,7 @@ + diff --git a/moonv4/moon_gui/static/app/common/header/header.controller.js b/moonv4/moon_gui/static/app/common/header/header.controller.js new file mode 100644 index 00000000..dfab502f --- /dev/null +++ b/moonv4/moon_gui/static/app/common/header/header.controller.js @@ -0,0 +1,53 @@ +/** + * @author arnaud marhin + */ + +(function() { + + 'use strict'; + + angular + .module('moon') + .controller('HeaderController', HeaderController); + + HeaderController.$inject = ['$translate', 'menuService', 'authenticationService', 'alertService']; + + function HeaderController($translate, menuService, authenticationService, alertService) { + + var header = this; + + /* + * + */ + + header.isProjectTabActive = menuService.isProjectTabActive; + header.isPDPTabActive = menuService.isPDPTabActive; + header.isLogsTabActive = menuService.isLogsTabActive; + header.isPolicyTabActive = menuService.isPolicyTabActive; + header.isModelTabActive = menuService.isModelTabActive; + header.changeLocale = changeLocale; + header.logout = logout; + + header.getUser = authenticationService.GetUser; + + /* + * + */ + + function changeLocale(localeKey, event) { + + event.preventDefault(); + + $translate.use(localeKey); + $translate.preferredLanguage(localeKey); + + } + + function logout(){ + authenticationService.Logout(); + $translate('moon.logout.success').then( function(translatedValue) { + alertService.alertSuccess(translatedValue); + }); + } + } +})(); \ No newline at end of file diff --git a/moonv4/moon_gui/static/app/common/header/header.tpl.html b/moonv4/moon_gui/static/app/common/header/header.tpl.html new file mode 100644 index 00000000..ad7b461d --- /dev/null +++ b/moonv4/moon_gui/static/app/common/header/header.tpl.html @@ -0,0 +1,50 @@ + diff --git a/moonv4/moon_gui/static/app/common/loader/loader.dir.js b/moonv4/moon_gui/static/app/common/loader/loader.dir.js new file mode 100644 index 00000000..ba40c121 --- /dev/null +++ b/moonv4/moon_gui/static/app/common/loader/loader.dir.js @@ -0,0 +1,19 @@ +(function() { + + 'use strict'; + + angular + .module('moon') + .directive('moonLoader', moonLoader); + + moonLoader.$inject = []; + + function moonLoader() { + + return { + templateUrl : 'html/common/loader/loader.tpl.html', + restrict : 'E' + }; + } + +})(); diff --git a/moonv4/moon_gui/static/app/common/loader/loader.tpl.html b/moonv4/moon_gui/static/app/common/loader/loader.tpl.html new file mode 100644 index 00000000..51da439f --- /dev/null +++ b/moonv4/moon_gui/static/app/common/loader/loader.tpl.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/moonv4/moon_gui/static/app/common/waiting/waiting.tpl.html b/moonv4/moon_gui/static/app/common/waiting/waiting.tpl.html new file mode 100644 index 00000000..6c042635 --- /dev/null +++ b/moonv4/moon_gui/static/app/common/waiting/waiting.tpl.html @@ -0,0 +1,15 @@ + \ No newline at end of file -- cgit 1.2.3-korg