You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by al...@apache.org on 2014/02/13 16:06:37 UTC

git commit: AMBARI-4656. Jobs: On main Jobs table, if there is no jobs to show, show msg "No jobs to display" (alexantonenko)

Updated Branches:
  refs/heads/trunk 812092497 -> 957349c3b


AMBARI-4656. Jobs: On main Jobs table, if there is no jobs to show, show msg "No jobs to display" (alexantonenko)


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

Branch: refs/heads/trunk
Commit: 957349c3b8b56f96575268bdb79cd952ef26ad84
Parents: 8120924
Author: Alex Antonenko <hi...@gmail.com>
Authored: Thu Feb 13 17:04:19 2014 +0200
Committer: Alex Antonenko <hi...@gmail.com>
Committed: Thu Feb 13 17:04:19 2014 +0200

----------------------------------------------------------------------
 ambari-web/app/messages.js             |  1 +
 ambari-web/app/styles/apps.less        | 19 +++++++++++++++++--
 ambari-web/app/templates/main/jobs.hbs |  4 ++--
 ambari-web/app/views/main/jobs_view.js | 18 +++++++++++++++++-
 4 files changed, 37 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/957349c3/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index dda93b7..d20474c 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -1847,6 +1847,7 @@ Em.I18n.translations = {
   'menu.item.jobs':'Jobs',
   'menu.item.admin':'Admin',
 
+  'jobs.nothingToShow': 'No jobs to display',
   'jobs.table.custom.date.am':'AM',
   'jobs.table.custom.date.pm':'PM',
   'jobs.table.custom.date.header':'Select Custom Dates',

http://git-wip-us.apache.org/repos/asf/ambari/blob/957349c3/ambari-web/app/styles/apps.less
----------------------------------------------------------------------
diff --git a/ambari-web/app/styles/apps.less b/ambari-web/app/styles/apps.less
index 8d3ea6e..3829373 100644
--- a/ambari-web/app/styles/apps.less
+++ b/ambari-web/app/styles/apps.less
@@ -387,14 +387,29 @@
     th, td {
       border-left-width: 0;
     }
-
+    .no-data{
+      text-align: center;
+    }
     td:first-child,
     th:first-child {
       border-left-width: 1px;
+      width: 35%;
+    }
+    td:first-child + td,
+    th:first-child + th,
+    td:first-child + td + td,
+    th:first-child + th + th,
+    td:first-child + td + td + td,
+    th:first-child + th + th + th{
+      width: 16%;
+    }
+    td:first-child + td + td + td + td,
+    th:first-child + th + th + th + th{
+      width: 17%;
     }
   }
   .table {
-
+    table-layout: fixed;
     th {
       border-top: none;
     }

http://git-wip-us.apache.org/repos/asf/ambari/blob/957349c3/ambari-web/app/templates/main/jobs.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/jobs.hbs b/ambari-web/app/templates/main/jobs.hbs
index e9d7d10..7c08ceb 100644
--- a/ambari-web/app/templates/main/jobs.hbs
+++ b/ambari-web/app/templates/main/jobs.hbs
@@ -48,9 +48,9 @@
         </tr>
         </thead>
         <tbody>
-        {{#if  view.emptyData}}
+        {{#if  view.noDataToShow}}
             <tr>
-                <td class="no-data" {{bindAttr colspan="controller.columnsName.content.length"}}>{{t apps.filters.nothingToShow}}</td>
+                <td class="no-data" {{bindAttr colspan="controller.columnsName.content.length"}}>{{t jobs.nothingToShow}}</td>
             </tr>
         {{else}}
           {{#each job in view.pageContent}}

http://git-wip-us.apache.org/repos/asf/ambari/blob/957349c3/ambari-web/app/views/main/jobs_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/jobs_view.js b/ambari-web/app/views/main/jobs_view.js
index aeccab0..de21e54 100644
--- a/ambari-web/app/views/main/jobs_view.js
+++ b/ambari-web/app/views/main/jobs_view.js
@@ -31,6 +31,22 @@ App.MainJobsView = App.TableView.extend({
     this.set('filteredContent', this.get('controller.content'));
   },
 
+  /**
+   * If no jobs table rows to show.
+   */
+  noDataToShow:true,
+
+  /*
+   If no jobs to display set noDataToShow to true, else set emptyData to false.
+   */
+  noDataToShowObserver:function(){
+    if(this.get("controller.content.length") > 0){
+      this.set("noDataToShow",false);
+    }else{
+      this.set("noDataToShow",true);
+    }
+  }.observes("controller.content.length"),
+
   sortView: sort.wrapperView,
   idSort: sort.fieldView.extend({
     column: 0,
@@ -81,7 +97,7 @@ App.MainJobsView = App.TableView.extend({
    */
   filteredJobs: function () {
     return Em.I18n.t('jobs.filtered.jobs').format(this.get('content').get('length'), this.get('controller.totalOfJobs'));
-  }.property('content.length', 'filteredContent.length'),
+  }.property('content.length', 'filteredContent.length', 'controller.totalOfJobs'),
 
   /**
    * Filter-field for Jobs ID.