diff options
Diffstat (limited to 'vnfmarket/src/main/webapp/app/modules/layouts')
4 files changed, 303 insertions, 0 deletions
diff --git a/vnfmarket/src/main/webapp/app/modules/layouts/main-page/main-page.html b/vnfmarket/src/main/webapp/app/modules/layouts/main-page/main-page.html new file mode 100644 index 00000000..57920a10 --- /dev/null +++ b/vnfmarket/src/main/webapp/app/modules/layouts/main-page/main-page.html @@ -0,0 +1,76 @@ +<!-- + Copyright 2017 Huawei Technologies Co., Ltd. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> + <md-toolbar ng-show="!showSearch"> + <div class="md-toolbar-tools"> + <md-button ng-click="layout.toggleSidenav('left')" hide-gt-md aria-label="Menu"> + <ng-md-icon icon="menu"></ng-md-icon> + </md-button> + <h3> + <a href="/">vnfmarket</a> + </h3> + <span flex></span> + <md-button aria-label="Search" ng-click="showSearch = !showSearch"> + <ng-md-icon icon="search"></ng-md-icon> + </md-button> + <md-menu> + <md-button aria-label="Open Settings" ng-click="layout.openMenu($mdOpenMenu, $event)"> + <md-icon> more_vert </md-icon> + </md-button> + <md-menu-content width="4"> + <md-menu-item> + <md-button ng-click="layout.changeProfile($event)"> + <md-icon>face</md-icon> + Profile + </md-button> + </md-menu-item> + <md-menu-item> + <md-button ng-click="layout.changePassword()"> + <md-icon>lock</md-icon> + Password + </md-button> + </md-menu-item> + <md-menu-divider></md-menu-divider> + <md-menu-item> + <md-button ng-click="layout.logOut()"> + <md-icon>power_settings_new</md-icon> + Logout + </md-button> + </md-menu-item> + </md-menu-content> + </md-menu> + </div> + </md-toolbar> + <md-toolbar class="md-hue-1" ng-show="showSearch"> + <div class="md-toolbar-tools"> + <md-button ng-click="showSearch = !showSearch" aria-label="Back"> + <ng-md-icon icon="arrow_back"></ng-md-icon> + </md-button> + <h3 flex="10"> + Back + </h3> + <md-input-container md-theme="input" flex> + <label> </label> + <input ng-model="search.who" placeholder="Search ..."> + </md-input-container> + + </div> + </md-toolbar> + <md-content class="md-blue-grey-theme" flex md-scroll-y> + <ui-view layout="column" layout-fill layout-padding> + + + </ui-view> + </md-content> diff --git a/vnfmarket/src/main/webapp/app/modules/layouts/main-page/mainPageCtrl.js b/vnfmarket/src/main/webapp/app/modules/layouts/main-page/mainPageCtrl.js new file mode 100644 index 00000000..c1430ffb --- /dev/null +++ b/vnfmarket/src/main/webapp/app/modules/layouts/main-page/mainPageCtrl.js @@ -0,0 +1,113 @@ +/* + * Copyright 2017 Huawei Technologies Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + (function () { + 'use strict'; + + /** + * @ngdoc function + * @name app.controller:LayoutCtrl + * @description + * # LayoutCtrl + * Controller of the app + */ + + angular + .module('vnfmarket') + .controller('LayoutCtrl', Layout); + + Layout.$inject = ['$mdSidenav', '$cookies', '$state', '$mdToast', '$mdDialog']; + + /* + * recommend + * Using function declarations + * and bindable members up top. + */ + + function Layout($mdSidenav, $cookies, $state, $mdToast, $mdDialog ) { + /*jshint validthis: true */ + var vm = this; + + vm.toggleSidenav = function (menuId) { + $mdSidenav(menuId).toggle(); + }; + + // vm.changePassword = function () { + // $mdToast.show( + // $mdToast.simple() + // .content('Password clicked!') + // .position('top right') + // .hideDelay(2000) + // ); + // }; + + // vm.changeProfile = function (ev) { + // $mdDialog.show({ + // controller: DialogController, + // templateUrl: 'tabDialog.tmpl.html', + // parent: angular.element(document.body), + // targetEvent: ev, + // clickOutsideToClose:true + // }) + // .then(function(answer) { + // $mdToast.show( + // $mdToast.simple() + // .content('You said the information was "' + answer + '".') + // .position('top right') + // .hideDelay(2000) + // ); + + // }, function() { + // $mdToast.show( + // $mdToast.simple() + // .content('You cancelled the dialog.') + // .position('top right') + // .hideDelay(2000) + // ); + // }); + + // function DialogController($scope, $mdDialog) { + // $scope.hide = function() { + // $mdDialog.hide(); + // }; + + // $scope.cancel = function() { + // $mdDialog.cancel(); + // }; + + // $scope.answer = function(answer) { + // $mdDialog.hide(answer); + // }; + // } + // }; + + + // vm.logOut = function () { + + // alert('Implement your Function Here'); + // // $cookies.put('dev_appserver_login', ' '); + // //$state.go('out', {}, {reload: true}); + + // }; + + // var originatorEv; + // vm.openMenu = function ($mdOpenMenu, ev) { + // originatorEv = ev; + // $mdOpenMenu(ev); + // }; + + } + +})(); diff --git a/vnfmarket/src/main/webapp/app/modules/layouts/side-nav/sidenav.html b/vnfmarket/src/main/webapp/app/modules/layouts/side-nav/sidenav.html new file mode 100644 index 00000000..36aebb6e --- /dev/null +++ b/vnfmarket/src/main/webapp/app/modules/layouts/side-nav/sidenav.html @@ -0,0 +1,46 @@ +<!-- + Copyright 2017 Huawei Technologies Co., Ltd. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> + <md-toolbar class="md-tall md-hue-2"> + <div layout="column" class="md-toolbar-tools-bottom inset"> + <div layout="row"> + <div flex="20"> + <img style="width: 36px; height: 36px; border-radius: 50%" + actual-src="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAUDBAsMBgkICQcJCQgGCQcGBgYFBgcHBQkGBgUHCQcGBgcHChwXBwg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HbCMwUESQ046vWB/tEzI4/iPZNkqgCCIjdpQuscU2+4GneiElzZf4jKuvEjpFdRdRe6Au3cKdLTeirTmujyOX6ftHwH96Kg8UctQUdX/fGIXZkl5iUl90BMqiD9wlWxeaPMsqk7duVSLVd5iWORVrx/ej2waoS0410l4QDX/D480MujQigqQCJW0/aiWr8QYmpi3h4wpuw/GibnGxUuYv4kWlfxDQsPIo7+9qt8NMVSLYtMKRKJEpGXMRFUlisdqhJHTxNYgfSkBG+VY7cCbq+g9SSK5FjswmYQHQNa0FRut8sRBZl8IF2SQTAtCaTQe9GOxrKhXKo/1cywfNm5y78gBt0PSIkBeYh61SJsx4G0WgmkAi73h8oBYHsuOjxIaU/eirfbUVtXu96C/mvBVC4LPpXxGBfjrFrtsBV1j2A6V90fEj2qwF5lDGFYmAO7cC3W/T4QwmW9q0sQiJnYVBu7XoXpCwSyav93RMZrdcm5fNAf/Z" + showloader="" loader-class="preload" loader-src="app/assets/images/loader.gif" + src="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAUDBAsMBgkICQcJCQgGCQcGBgYFBgcHBQkGBgUHCQcGBgcHChwXBwgaCQcHGCEMGhERHxMfBxciGCIeGBAeHxIBBQUFBwcFDAgIBxIIBQgSHhISEhISHhISEhISHh4SEhISEhISEhISEhISEhISEhISEhISEhISEhISEhISEhISEv/AABEIAGAAYAMBIgACEQEDEQH/xAAcAAACAwEBAQEAAAAAAAAAAAAHCAMFBgQCAQD/xAA6EAABAgQDBQYFAQgDAQAAAAACAQMABBESBQYiByExMkETQlFSYWIIcXKBoSMzgpGSorLR8BQk4RX/xAAWAQEBAQAAAAAAAAAAAAAAAAAAAQL/xAAWEQEBAQAAAAAAAAAAAAAAAAAAARH/2gAMAwEAAhEDEQA/AG0WPx9I+RDOPIIqS+F0BVZyx5uUknZpw0RGBU9XTTCJbRs6zGI4icw66pNiRCwBUsFoVXSm7wpBF+JraOr75yDRr2LSkLpCVBMx7q06ekAFmbVCUV7y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wmW9q0sQiJnYVBu7XoXpCwSyav93RMZrdcm5fNAf/Z"> + </div> + <div flex="80" style="margin-top: 10px;font-size: 1em;"> + <div></div> + </div> + </div> + </div> + </md-toolbar> + <md-list> + <md-list-item ng-repeat="item in vm.menu" ng-click="vm.navigateTo(item.link)" > + <div class="inset" ng-show="item.icon"> + <ng-md-icon icon="{{item.icon}}"></ng-md-icon> + </div> + <p> {{ item.name }}</p> + </md-list-item> + <md-divider></md-divider> + <md-subheader></md-subheader> + <md-list-item ng-repeat="item in vm.admin" ng-click="vm.showSettingsBottom($event)" > + <div class="inset"> + <ng-md-icon icon="{{item.icon}}"></ng-md-icon> + </div> + <p> {{ item.title }}</p> + </md-list-item> + </md-list> diff --git a/vnfmarket/src/main/webapp/app/modules/layouts/side-nav/sidenavCtrl.js b/vnfmarket/src/main/webapp/app/modules/layouts/side-nav/sidenavCtrl.js new file mode 100644 index 00000000..59bd9fae --- /dev/null +++ b/vnfmarket/src/main/webapp/app/modules/layouts/side-nav/sidenavCtrl.js @@ -0,0 +1,68 @@ +/* + * Copyright 2017 Huawei Technologies Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + (function () { + 'use strict'; + + /** + * @ngdoc function + * @name app.controller:SidenavCtrl + * @description + * # SidenavCtrl + * Controller of the app + */ + angular + .module('vnfmarket') + .controller('SidenavCtrl', SidenavCtrl) + // .controller('SettingsCtrl', SettingsCtrl); + + // Injecting Denpendencies + + SidenavCtrl.$inject = ['$mdSidenav', '$state', '$mdBottomSheet', '$mdToast', '$scope']; + // SettingsCtrl.$inject = ['$mdBottomSheet']; + + /* + * recommend + * Using function declarations + * and bindable members up top. + */ + + function SidenavCtrl($mdSidenav, $state, $mdBottomSheet, $mdToast, $scope) { + /*jshint validthis: true */ + var vm = this; + + vm.toggleSidenav = function (menuId) { + $mdSidenav(menuId).toggle(); + }; + + vm.closeSidenav = function() { + $mdSidenav('left').close(); + }; + + // Close menu on small screen after click on menu item. + // Only use $scope in controllerAs when necessary; for example, publishing and subscribing events using $emit, $broadcast, $on or $watch. + $scope.$on('$stateChangeSuccess', vm.closeSidenav); + + vm.navigateTo = function (target) { + + var page = target; + + $state.go(page); + + }; + + } + +})(); |