Repository: incubator-zeppelin Updated Branches: refs/heads/master 7811b1dda -> 4c66919b5
Remove double HomeCtrl, clean HomeCtrl to vm HomeCtrl was inserted twice, making extra API calls. This PR also replace the last $scope values to vm. Author: Damien Corneau <[email protected]> Closes #307 from corneadoug/fix/doubleHomeCtrl and squashes the following commits: d6af9f3 [Damien Corneau] Remove double HomeCtrl, clean HomeCtrl to vm Project: http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/commit/4c66919b Tree: http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/tree/4c66919b Diff: http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/diff/4c66919b Branch: refs/heads/master Commit: 4c66919b52e3ae898d9f05d3e50f43982d41991a Parents: 7811b1d Author: Damien Corneau <[email protected]> Authored: Mon Sep 14 18:19:31 2015 +0900 Committer: Damien Corneau <[email protected]> Committed: Thu Sep 17 17:29:18 2015 +0900 ---------------------------------------------------------------------- zeppelin-web/src/app/app.js | 3 +- zeppelin-web/src/app/home/home.controller.js | 14 ++-- zeppelin-web/src/app/home/home.html | 99 ++++++++++++----------- 3 files changed, 62 insertions(+), 54 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/4c66919b/zeppelin-web/src/app/app.js ---------------------------------------------------------------------- diff --git a/zeppelin-web/src/app/app.js b/zeppelin-web/src/app/app.js index 28a84e0..b4a769b 100644 --- a/zeppelin-web/src/app/app.js +++ b/zeppelin-web/src/app/app.js @@ -43,8 +43,7 @@ angular.module('zeppelinWebApp', [ .config(function ($routeProvider, ngToastProvider) { $routeProvider .when('/', { - templateUrl: 'app/home/home.html', - controller: 'HomeCtrl' + templateUrl: 'app/home/home.html' }) .when('/notebook/:noteId', { templateUrl: 'app/notebook/notebook.html', http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/4c66919b/zeppelin-web/src/app/home/home.controller.js ---------------------------------------------------------------------- diff --git a/zeppelin-web/src/app/home/home.controller.js b/zeppelin-web/src/app/home/home.controller.js index dea26a6..64ff880 100644 --- a/zeppelin-web/src/app/home/home.controller.js +++ b/zeppelin-web/src/app/home/home.controller.js @@ -20,8 +20,8 @@ angular.module('zeppelinWebApp').controller('HomeCtrl', function($scope, noteboo vm.websocketMsgSrv = websocketMsgSrv; vm.arrayOrderingSrv = arrayOrderingSrv; - $scope.notebookHome = false; - $scope.staticHome = false; + vm.notebookHome = false; + vm.staticHome = false; var initHome = function() { websocketMsgSrv.getHomeNotebook(); @@ -31,17 +31,19 @@ angular.module('zeppelinWebApp').controller('HomeCtrl', function($scope, noteboo $scope.$on('setNoteContent', function(event, note) { if (note) { - $scope.note = note; + vm.note = note; // initialize look And Feel $rootScope.$broadcast('setLookAndFeel', 'home'); // make it read only - $scope.viewOnly = true; + vm.viewOnly = true; - $scope.notebookHome = true; + vm.notebookHome = true; + vm.staticHome = false; } else { - $scope.staticHome = true; + vm.staticHome = true; + vm.notebookHome = false; } }); }); http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/4c66919b/zeppelin-web/src/app/home/home.html ---------------------------------------------------------------------- diff --git a/zeppelin-web/src/app/home/home.html b/zeppelin-web/src/app/home/home.html index 387d218..cdefa69 100644 --- a/zeppelin-web/src/app/home/home.html +++ b/zeppelin-web/src/app/home/home.html @@ -12,61 +12,68 @@ See the License for the specific language governing permissions and limitations under the License. --> -<div ng-show="staticHome" class="box width-full home" ng-controller="HomeCtrl as home"> - <div class="zeppelin"> - <div class="zeppelin2"></div> - </div> - <div style="margin-top: -380px;"> - <h1 class="box-heading" id="welcome"> - Welcome to Zeppelin! - </h1> - Zeppelin is web-based notebook that enables interactive data analytics.<br>You can make beautiful data-driven, interactive, collaborative document with SQL, code and even more!<br> +<div ng-controller="HomeCtrl as home"> + <div ng-show="home.staticHome" class="box width-full home"> + <div class="zeppelin"> + <div class="zeppelin2"></div> + </div> + <div style="margin-top: -380px;"> + <h1 class="box-heading" id="welcome"> + Welcome to Zeppelin! + </h1> + Zeppelin is web-based notebook that enables interactive data analytics.<br> + You can make beautiful data-driven, interactive, collaborative document with SQL, code and even more!<br> - <div class="row"> - <div class="col-md-4"> - <h4>Notebook</h4> + <div class="row"> + <div class="col-md-4"> + <h4>Notebook</h4> - <div> - <h5><a href="" data-toggle="modal" data-target="#noteNameModal" style="text-decoration: none;"> + <div> + <h5><a href="" data-toggle="modal" data-target="#noteNameModal" style="text-decoration: none;"> <i style="font-size: 15px;" class="icon-notebook"></i> Create new note</a></h5> - <ul style="list-style-type: none;"> - <li ng-repeat="note in home.notes.list | orderBy:home.arrayOrderingSrv.notebookListOrdering track by $index"><i style="font-size: 10px;" class="icon-doc"></i> - <a style="text-decoration: none;" href="#/notebook/{{note.id}}">{{note.name || 'Note ' + note.id}}</a> - </li> - </ul> + <ul style="list-style-type: none;"> + <li ng-repeat="note in home.notes.list | orderBy:home.arrayOrderingSrv.notebookListOrdering track by $index"> + <i style="font-size: 10px;" class="icon-doc"></i> + <a style="text-decoration: none;" href="#/notebook/{{note.id}}">{{note.name || 'Note ' + note.id}}</a> + </li> + </ul> + </div> </div> - </div> - <div class="col-md-6"> - <h4>Help</h4> - Get started with <a style="text-decoration: none;" href="http://zeppelin.incubator.apache.org/docs/index.html" target="_blank">Zeppelin documentation</a><br> + <div class="col-md-6"> + <h4>Help</h4> + Get started with <a style="text-decoration: none;" target="_blank" + href="http://zeppelin.incubator.apache.org/docs/index.html">Zeppelin documentation</a><br> - <h4>Community</h4> - Please feel free to help us to improve Zeppelin, <br> - Any contribution are welcome!<br><br> - <a style="text-decoration: none;" href="http://zeppelin.incubator.apache.org/community.html" target="_blank"><i style="font-size: 15px;" class="fa fa-users"></i> Mailing list</a><br> - <a style="text-decoration: none;" href="https://issues.apache.org/jira/browse/ZEPPELIN" target="_blank"><i style="font-size: 15px;" class="fa fa-bug"></i> Issues tracking</a><br> - <a style="text-decoration: none;" href="https://github.com/apache/incubator-zeppelin" target="_blank"><i style="font-size: 20px;" class="fa fa-github"></i> Github</a> + <h4>Community</h4> + Please feel free to help us to improve Zeppelin, <br> + Any contribution are welcome!<br><br> + <a style="text-decoration: none;" href="http://zeppelin.incubator.apache.org/community.html" + target="_blank"><i style="font-size: 15px;" class="fa fa-users"></i> Mailing list</a><br> + <a style="text-decoration: none;" href="https://issues.apache.org/jira/browse/ZEPPELIN" + target="_blank"><i style="font-size: 15px;" class="fa fa-bug"></i> Issues tracking</a><br> + <a style="text-decoration: none;" href="https://github.com/apache/incubator-zeppelin" + target="_blank"><i style="font-size: 20px;" class="fa fa-github"></i> Github</a> + </div> </div> </div> + <br/><br/><br/> </div> - <br/><br/><br/> -</div> -<!-- Load notebook --> -<div id="{{currentParagraph.id}}_paragraphColumn_main" - ng-show="notebookHome" - ng-repeat="currentParagraph in note.paragraphs" - ng-controller="ParagraphCtrl" - ng-Init="init(currentParagraph)" - ng-class="columnWidthClass(currentParagraph.config.colWidth)" - class="paragraph-col"> - <div id="{{currentParagraph.id}}_paragraphColumn" - ng-if="currentParagraph.result" - ng-include src="'app/notebook/paragraph/paragraph.html'" - ng-class="{'paragraph-space box paragraph-margin': !asIframe, 'focused': paragraphFocused}" - ng-hide="currentParagraph.config.tableHide && viewOnly"> + <!-- Load notebook --> + <div ng-show="home.notebookHome" id="{{currentParagraph.id}}_paragraphColumn_main" + ng-repeat="currentParagraph in home.note.paragraphs" + ng-controller="ParagraphCtrl" + ng-Init="init(currentParagraph)" + ng-class="columnWidthClass(currentParagraph.config.colWidth)" + class="paragraph-col"> + <div id="{{currentParagraph.id}}_paragraphColumn" + ng-if="currentParagraph.result" + ng-include src="'app/notebook/paragraph/paragraph.html'" + ng-class="{'paragraph-space box paragraph-margin': !asIframe, 'focused': paragraphFocused}" + ng-hide="currentParagraph.config.tableHide && home.viewOnly"> + </div> </div> -</div> -<div style="clear:both;height:10px"></div> + <div style="clear:both;height:10px"></div> +</div>
