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 2015/08/20 20:17:32 UTC

ambari git commit: AMBARI-12814. Ambari Files View: Add Date as a column. (Dipayak Bhowmick via yusaku)

Repository: ambari
Updated Branches:
  refs/heads/trunk 30d9dcf41 -> 0bfb1ccf3


AMBARI-12814. Ambari Files View: Add Date as a column. (Dipayak Bhowmick via yusaku)


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

Branch: refs/heads/trunk
Commit: 0bfb1ccf327b3392638d8aaf9802a2875658dcdb
Parents: 30d9dcf
Author: Yusaku Sako <yu...@hortonworks.com>
Authored: Thu Aug 20 11:16:56 2015 -0700
Committer: Yusaku Sako <yu...@hortonworks.com>
Committed: Thu Aug 20 11:16:56 2015 -0700

----------------------------------------------------------------------
 .../src/main/resources/ui/app/controllers/files.js    |  4 ++++
 .../src/main/resources/ui/app/styles/application.less | 14 +++++++++-----
 .../src/main/resources/ui/app/templates/files.hbs     |  9 +++++++--
 .../main/resources/ui/app/templates/util/fileRow.hbs  | 10 +++++-----
 4 files changed, 25 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/0bfb1ccf/contrib/views/files/src/main/resources/ui/app/controllers/files.js
----------------------------------------------------------------------
diff --git a/contrib/views/files/src/main/resources/ui/app/controllers/files.js b/contrib/views/files/src/main/resources/ui/app/controllers/files.js
index 74e70c0..22cbb7a 100644
--- a/contrib/views/files/src/main/resources/ui/app/controllers/files.js
+++ b/contrib/views/files/src/main/resources/ui/app/controllers/files.js
@@ -162,6 +162,10 @@ App.FilesController = Ember.ArrayController.extend({
     return this.get('selectedFiles').filterProperty('isDirectory').get('length')===0;
   }.property('selectedFiles.length'),
 
+  isSortPropertyEqualsDate: function() {
+    return this.get('sortProperties').get('firstObject') === 'date';
+  }.property('sortProperties.firstObject'),
+
   searchString:'',
   fileList: function () {
     var fileList = this.get('arrangedContent');

http://git-wip-us.apache.org/repos/asf/ambari/blob/0bfb1ccf/contrib/views/files/src/main/resources/ui/app/styles/application.less
----------------------------------------------------------------------
diff --git a/contrib/views/files/src/main/resources/ui/app/styles/application.less b/contrib/views/files/src/main/resources/ui/app/styles/application.less
index 6f858dd..b41fa2e 100644
--- a/contrib/views/files/src/main/resources/ui/app/styles/application.less
+++ b/contrib/views/files/src/main/resources/ui/app/styles/application.less
@@ -107,24 +107,28 @@
     }
     thead tr th.size {
       cursor: pointer;
-      width: 15%;
+      width: 10%;
+    }
+    thead tr th.date {
+      cursor: pointer;
+      width: 20%;
     }
     thead tr th.owner {
       cursor: pointer;
-      width: 15%;
+      width: 10%;
     }
     thead tr th.grp {
       cursor: pointer;
-      width: 15%;
+      width: 10%;
     }
     thead tr th.perm {
       cursor: pointer;
-      width: 15%;
+      width: 10%;
     }
     thead tr th.download {
       width: 2%;
       .btn-group{
-        width: 130px;
+        width: 145px;
       }
     }
     thead tr th.check{

http://git-wip-us.apache.org/repos/asf/ambari/blob/0bfb1ccf/contrib/views/files/src/main/resources/ui/app/templates/files.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/files/src/main/resources/ui/app/templates/files.hbs b/contrib/views/files/src/main/resources/ui/app/templates/files.hbs
index c784db6..3d4af71 100644
--- a/contrib/views/files/src/main/resources/ui/app/templates/files.hbs
+++ b/contrib/views/files/src/main/resources/ui/app/templates/files.hbs
@@ -63,6 +63,7 @@
         <th class="icon"></th>
         <th class="path" {{action 'sort' 'name'}}> Name {{sort-arrow sPs=sortProperties sA=sortAscending sP='name'}} </th>
         <th class="size" {{action 'sort' 'size'}}>Size {{sort-arrow sPs=sortProperties sA=sortAscending sP='size'}}</th>
+        <th class="date" {{action 'sort' 'date'}}>Last Modified {{sort-arrow sPs=sortProperties sA=sortAscending sP='date'}}</th>
         <th class="owner" {{action 'sort' 'owner'}}>Owner {{sort-arrow sPs=sortProperties sA=sortAscending sP='owner'}}</th>
         <th class="grp" {{action 'sort' 'group'}} >Group {{sort-arrow sPs=sortProperties sA=sortAscending sP='group'}}</th>
         <th class="perm" {{action 'sort' 'permission'}} >Permission {{sort-arrow sPs=sortProperties sA=sortAscending sP='permission'}}</th>
@@ -74,17 +75,21 @@
 
             <button type="button" class="btn btn-xs btn-default dropdown-toggle" data-toggle="dropdown">
               <span>
-              {{capitalize sortProperties.firstObject}}
+                {{#if isSortPropertyEqualsDate}}
+                  Last Modified
+                {{else}}
+                  {{capitalize sortProperties.firstObject}}
+                {{/if}}
               </span>
               <span class="caret"></span>
             </button>
             <ul class="dropdown-menu" role="menu">
               <li><a href="#" {{action 'sort' 'name'}} >Name</a></li>
               <li><a href="#" {{action 'sort' 'size'}} >Size</a></li>
+              <li><a href="#" {{action 'sort' 'date'}} >Last Modified</a></li>
               <li><a href="#" {{action 'sort' 'owner'}} >Owner</a></li>
               <li><a href="#" {{action 'sort' 'group'}} >Group</a></li>
               <li><a href="#" {{action 'sort' 'permission'}} >Permission</a></li>
-              <li><a href="#" {{action 'sort' 'date'}} >Date</a></li>
             </ul>
           </div>
         </th>

http://git-wip-us.apache.org/repos/asf/ambari/blob/0bfb1ccf/contrib/views/files/src/main/resources/ui/app/templates/util/fileRow.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/files/src/main/resources/ui/app/templates/util/fileRow.hbs b/contrib/views/files/src/main/resources/ui/app/templates/util/fileRow.hbs
index cffd0f4..1dc9ff4 100644
--- a/contrib/views/files/src/main/resources/ui/app/templates/util/fileRow.hbs
+++ b/contrib/views/files/src/main/resources/ui/app/templates/util/fileRow.hbs
@@ -35,17 +35,17 @@
           </a>
         </span>
       {{/file-shaker}}
-        <span class="help-block mod-time allow-open">
-          <small class='allow-open'>
-            Updated {{showDate modificationTime 'YYYY-MM-DD HH:mm'}}
-          </small>
-        </span>
       </div>
     {{/rename-input}}
   </td>
   <td>
     {{#unless content.isDirectory}}{{humanSize content.size}}{{else}}-{{/unless}}
   </td>
+  <td>
+    <small class='allow-open'>
+      {{showDate modificationTime 'YYYY-MM-DD HH:mm'}}
+    </small>
+  </td>
   <td >{{content.owner}}</td>
   <td>{{content.group}}</td>
   <td class="permission-cell">