You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by yu...@apache.org on 2014/05/02 01:30:29 UTC

git commit: AMBARI-5655. when no views, show 'No Views'. (xiwang via yusaku)

Repository: ambari
Updated Branches:
  refs/heads/trunk 65e819318 -> bd865da06


AMBARI-5655. when no views, show 'No Views'. (xiwang via yusaku)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/bd865da0
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/bd865da0
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/bd865da0

Branch: refs/heads/trunk
Commit: bd865da069b17379d937ced11e0b450d0a6f1489
Parents: 65e8193
Author: Yusaku Sako <yu...@hortonworks.com>
Authored: Thu May 1 16:29:31 2014 -0700
Committer: Yusaku Sako <yu...@hortonworks.com>
Committed: Thu May 1 16:30:21 2014 -0700

----------------------------------------------------------------------
 ambari-web/app/messages.js                  |  1 +
 ambari-web/app/styles/application.less      | 12 ++++++++----
 ambari-web/app/templates/main/menu_item.hbs |  8 ++++++--
 ambari-web/app/views/main/menu.js           |  1 -
 4 files changed, 15 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/bd865da0/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index afbdb95..b8d5ffe 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -1984,6 +1984,7 @@ Em.I18n.translations = {
   'menu.item.jobs':'Jobs',
   'menu.item.admin':'Admin',
   'menu.item.views':'<i class="icon-th"></i>',
+  'menu.item.views.noViews':'No Views',
 
   'jobs.nothingToShow': 'No jobs to display',
   'jobs.loadingTasks': 'Loading...',

http://git-wip-us.apache.org/repos/asf/ambari/blob/bd865da0/ambari-web/app/styles/application.less
----------------------------------------------------------------------
diff --git a/ambari-web/app/styles/application.less b/ambari-web/app/styles/application.less
index 0b9fefd..fe66e1c 100644
--- a/ambari-web/app/styles/application.less
+++ b/ambari-web/app/styles/application.less
@@ -276,9 +276,6 @@ footer {
       .top-nav-dropdown-menu > li{
         position: relative;
       }
-      .top-nav-dropdown-menu > li.active > a{
-        background-color: @top-nav-menu-dropdown-border-color;
-      }
       .top-nav-dropdown-menu > li > a {
         text-decoration: none;
         text-align: left;
@@ -300,7 +297,14 @@ footer {
         background-image: linear-gradient(to bottom, #666666, #555555);
         background-repeat: repeat-x;
       }
-
+      .top-nav-dropdown-menu > li.disabled > a {
+        color: #a9a9a9;
+      }
+      .top-nav-dropdown-menu > li.disabled > a:hover {
+        color: #a9a9a9;
+        background-color: @top-nav-menu-dropdown-bg-color;
+        background-image: none;
+      }
     }
   }
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/bd865da0/ambari-web/app/templates/main/menu_item.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/menu_item.hbs b/ambari-web/app/templates/main/menu_item.hbs
index 894e491..9581512 100644
--- a/ambari-web/app/templates/main/menu_item.hbs
+++ b/ambari-web/app/templates/main/menu_item.hbs
@@ -36,9 +36,13 @@
 {{/if}}
 {{#if view.isViewsItem}}
   <ul class="top-nav-dropdown-menu">
-    {{#each category in view.content.views}}
+    {{#if view.content.views}}
+      {{#each category in view.content.views}}
         <li><a href="#" {{action "setView" category target="App.router.mainViewsController"}}>{{category.label}}</a></li>
-    {{/each}}
+      {{/each}}
+    {{else}}
+      <li class="disabled"><a href="javascript:void(null);">{{t menu.item.views.noViews}}</a></li>
+    {{/if}}
   </ul>
 {{/if}}
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/bd865da0/ambari-web/app/views/main/menu.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/menu.js b/ambari-web/app/views/main/menu.js
index 98b6047..f93b3de 100644
--- a/ambari-web/app/views/main/menu.js
+++ b/ambari-web/app/views/main/menu.js
@@ -111,7 +111,6 @@ App.MainMenuView = Em.CollectionView.extend({
       return this.get('content').routing == 'views';
     }.property(''),
     goToCategory: function (event) {
-      //App.router.transitionTo('admin.service.summary', service);
       var itemName = this.get('content').routing;
       // route to correct category of current menu item
       if (itemName == 'admin') {