Repository: ignite Updated Branches: refs/heads/ignite-843-rc2 5b7b84039 -> f76118aaa
IGNITE-843 Add extension point for terms. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/f76118aa Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/f76118aa Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/f76118aa Branch: refs/heads/ignite-843-rc2 Commit: f76118aaa5873b3e10c74b1fd3eaee81175feeaa Parents: 5b7b840 Author: Andrey <[email protected]> Authored: Thu Dec 10 13:13:02 2015 +0700 Committer: Andrey <[email protected]> Committed: Thu Dec 10 13:13:02 2015 +0700 ---------------------------------------------------------------------- .../control-center-web/src/main/js/app/index.js | 4 +- .../main/js/app/modules/states/login/index.js | 5 +- .../src/main/js/app/modules/terms/main.js | 61 ++++++++++++++++++++ .../src/main/js/controllers/common-module.js | 2 - .../src/main/js/public/stylesheets/style.scss | 4 +- .../src/main/js/views/includes/footer.jade | 6 +- .../src/main/js/views/login.jade | 5 ++ 7 files changed, 78 insertions(+), 9 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/f76118aa/modules/control-center-web/src/main/js/app/index.js ---------------------------------------------------------------------- diff --git a/modules/control-center-web/src/main/js/app/index.js b/modules/control-center-web/src/main/js/app/index.js index 087885c..2085352 100644 --- a/modules/control-center-web/src/main/js/app/index.js +++ b/modules/control-center-web/src/main/js/app/index.js @@ -67,6 +67,7 @@ import './modules/states/admin/index' import './modules/navbar/main' import './modules/userbar/main' import './modules/configuration/sidebar/main' +import './modules/terms/main' // endignite // Directives. @@ -102,7 +103,8 @@ angular // Common modules. 'ignite-console.navbar', 'ignite-console.userbar', - 'ignite-console.configuration.sidebar' + 'ignite-console.configuration.sidebar', + 'ignite-console.terms' ]) // Directives. .directive(...igniteLoading) http://git-wip-us.apache.org/repos/asf/ignite/blob/f76118aa/modules/control-center-web/src/main/js/app/modules/states/login/index.js ---------------------------------------------------------------------- diff --git a/modules/control-center-web/src/main/js/app/modules/states/login/index.js b/modules/control-center-web/src/main/js/app/modules/states/login/index.js index 7f60267..46ba664 100644 --- a/modules/control-center-web/src/main/js/app/modules/states/login/index.js +++ b/modules/control-center-web/src/main/js/app/modules/states/login/index.js @@ -31,8 +31,11 @@ angular templateUrl: '/login.html' }); }]) -.run(['$rootScope', '$state', 'Auth', function($root, $state, Auth) { +.run(['$rootScope', '$state', 'Auth', 'igniteTerms', function($root, $state, Auth, igniteTerms) { $root.$on('$stateChangeStart', function(event, toState, toParams, fromState, fromParams) { + if (toState.name === igniteTerms.termsState) + return; + if (!Auth.authorized && (toState.name !== 'login' && !_.startsWith(toState.name, 'password.'))) { event.preventDefault(); http://git-wip-us.apache.org/repos/asf/ignite/blob/f76118aa/modules/control-center-web/src/main/js/app/modules/terms/main.js ---------------------------------------------------------------------- diff --git a/modules/control-center-web/src/main/js/app/modules/terms/main.js b/modules/control-center-web/src/main/js/app/modules/terms/main.js new file mode 100644 index 0000000..fe820b8 --- /dev/null +++ b/modules/control-center-web/src/main/js/app/modules/terms/main.js @@ -0,0 +1,61 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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. + */ + +import angular from 'angular' + +angular + .module('ignite-console.terms', [ + + ]) + .provider('igniteTerms', function() { + var _rows = [ + 'Apache Ignite Web Console, version 1.0.0 beta', + '© 2015 The Apache Software Foundation.', + 'Apache, Apache Ignite, the Apache feather and the Apache Ignite logo are trademarks of The Apache Software Foundation.' + ]; + + var _state; + + this.footerRows = function(rows) { + _rows = rows; + }; + + this.termsState = function(state) { + _state = state; + }; + + this.$get = [function() { + return { + footerRows: _rows, + termsState: _state + }; + }] + }) + .directive('igniteTerms', ['igniteTerms', function(igniteTerms) { + function controller() { + var ctrl = this; + + ctrl.footerRows = igniteTerms.footerRows; + ctrl.termsState = igniteTerms.termsState; + } + + return { + restrict: 'A', + controller: controller, + controllerAs: 'terms' + } + }]); http://git-wip-us.apache.org/repos/asf/ignite/blob/f76118aa/modules/control-center-web/src/main/js/controllers/common-module.js ---------------------------------------------------------------------- diff --git a/modules/control-center-web/src/main/js/controllers/common-module.js b/modules/control-center-web/src/main/js/controllers/common-module.js index ac8e418..938e218 100644 --- a/modules/control-center-web/src/main/js/controllers/common-module.js +++ b/modules/control-center-web/src/main/js/controllers/common-module.js @@ -20,8 +20,6 @@ var consoleModule = angular.module('ignite-web-console', 'ngAnimate', 'ngSanitize', 'mgcrea.ngStrap', 'smart-table', 'ui.ace', 'treeControl', 'darthwade.dwLoading', 'ui.grid', 'ui.grid.autoResize', 'ui.grid.exporter', 'nvd3', 'dndLists' /* ignite:modules */ , 'ignite-console' - , 'ignite-console.navbar' - , 'ignite-console.configuration.sidebar' /* endignite */ /* ignite:plugins */ /* endignite */ http://git-wip-us.apache.org/repos/asf/ignite/blob/f76118aa/modules/control-center-web/src/main/js/public/stylesheets/style.scss ---------------------------------------------------------------------- diff --git a/modules/control-center-web/src/main/js/public/stylesheets/style.scss b/modules/control-center-web/src/main/js/public/stylesheets/style.scss index 7c9e010..fe2431f 100644 --- a/modules/control-center-web/src/main/js/public/stylesheets/style.scss +++ b/modules/control-center-web/src/main/js/public/stylesheets/style.scss @@ -298,9 +298,11 @@ h1, h2, h3, h4, h5, h6 { .container-footer { margin-top: 20px; + margin-bottom: 20px; p { font-size: 12px; + margin-bottom: 0; } } @@ -384,7 +386,7 @@ h1, h2, h3, h4, h5, h6 { .greedy { min-height: 100%; - height: #{"calc(100vh - 290px)"}; + height: #{"calc(100vh - 270px)"}; } @media (min-width: 768px) { http://git-wip-us.apache.org/repos/asf/ignite/blob/f76118aa/modules/control-center-web/src/main/js/views/includes/footer.jade ---------------------------------------------------------------------- diff --git a/modules/control-center-web/src/main/js/views/includes/footer.jade b/modules/control-center-web/src/main/js/views/includes/footer.jade index 8a9aa2a..e8a3623 100644 --- a/modules/control-center-web/src/main/js/views/includes/footer.jade +++ b/modules/control-center-web/src/main/js/views/includes/footer.jade @@ -16,7 +16,5 @@ .container.container-footer footer - center - p Apache Ignite Web Console, version 1.0.0 beta - p © 2015 The Apache Software Foundation. - p Apache, Apache Ignite, the Apache feather and the Apache Ignite logo are trademarks of The Apache Software Foundation. \ No newline at end of file + center(ignite-terms) + p(ng-repeat='item in terms.footerRows' ng-bind-html='item') http://git-wip-us.apache.org/repos/asf/ignite/blob/f76118aa/modules/control-center-web/src/main/js/views/login.jade ---------------------------------------------------------------------- diff --git a/modules/control-center-web/src/main/js/views/login.jade b/modules/control-center-web/src/main/js/views/login.jade index 9af6ab2..5814051 100644 --- a/modules/control-center-web/src/main/js/views/login.jade +++ b/modules/control-center-web/src/main/js/views/login.jade @@ -54,6 +54,11 @@ header#header.header +lbl('Confirm:') .col-xs-9.col-md-8 input#user_confirm.form-control(type='password' ng-model='user_info.confirm' match='user_info.password' placeholder='Confirm password' ng-required='action == "register"' on-enter='loginForm.$valid && auth(action, user_info)') + .settings-row(ignite-terms) + .col-md-offset-3(ng-if='action == "register" && terms.termsState') + input(type='checkbox' ng-model='user_info.agree', ng-required='true') + | I agree to the + a(ui-sref='{{::terms.termsState}}') terms and conditions .col-xs-12.col-md-11 .login-footer(ng-show='action == "register"') a.labelField(ng-click='action = "password/forgot"' on-click-focus='user_email') Forgot password?
