Browse Source

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

Yusaku Sako 11 years ago
parent
commit
bd865da069

+ 1 - 0
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...',

+ 8 - 4
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;
+      }
     }
   }
 

+ 6 - 2
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}}
 

+ 0 - 1
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') {