Эх сурвалжийг харах

HUE-6345 [home] Add description to the document list

Currently left align to have name fits in priority.
Romain Rigaux 8 жил өмнө
parent
commit
564aae9eda

+ 7 - 1
desktop/core/src/desktop/static/desktop/js/document/hueFileEntry.js

@@ -17,7 +17,7 @@
 var HueFileEntry = (function () {
   var self = this;
   self.loading = ko.observable(false);
- 
+
   var sorts = {
     defaultAsc: function (a, b) {
       if (a.isDirectory() && !b.isDirectory()) {
@@ -34,6 +34,12 @@ var HueFileEntry = (function () {
     nameDesc: function (a, b) {
       return sorts.nameAsc(b, a);
     },
+    descriptionAsc: function (a, b) {
+      return a.definition().description.localeCompare(b.definition().description);
+    },
+    descriptionDesc: function (a, b) {
+      return sorts.descriptionAsc(b, a);
+    },
     typeAsc: function (a, b) {
       return a.definition().type.localeCompare(b.definition().type);
     },

+ 2 - 2
desktop/core/src/desktop/templates/common_home.mako

@@ -14,9 +14,10 @@
 ## See the License for the specific language governing permissions and
 ## limitations under the License.
 <%!
+  from django.utils.translation import ugettext as _
+
   from desktop.views import commonheader, commonfooter, _ko
   from desktop import conf
-  from django.utils.translation import ugettext as _
 %>
 
 <%namespace name="docBrowser" file="/document_browser.mako" />
@@ -130,4 +131,3 @@
 
 </script>
 </%def>
-

+ 14 - 11
desktop/core/src/desktop/templates/document_browser.mako

@@ -15,9 +15,10 @@
 ## limitations under the License.
 
 <%!
+from django.utils.translation import ugettext as _
+
 from desktop import conf
 from desktop.lib.i18n import smart_unicode
-from django.utils.translation import ugettext as _
 from desktop.views import _ko
 %>
 
@@ -428,6 +429,7 @@ from desktop.views import _ko
       <div class="doc-browser-header">
         <div class="doc-browser-primary-col" data-bind="click: function () { setSort('name') }, css: { 'sorting_asc' : activeSort() === 'nameAsc', 'sorting_desc' : activeSort() === 'nameDesc', 'sorting' : activeSort().indexOf('name') !== 0 }">${ _('Name') }</div>
         <div class="doc-browser-attr-group">
+          <div class="doc-browser-attr-col" data-bind="click: function () { setSort('description') }, css: { 'sorting_asc' : activeSort() === 'descriptionAsc', 'sorting_desc' : activeSort() === 'descriptionDesc', 'sorting' : activeSort().indexOf('description') !== 0 }">${ _('Description') }</div>
           <div class="doc-browser-attr-col doc-browser-type" data-bind="click: function () { setSort('type') }, css: { 'sorting_asc' : activeSort() === 'typeAsc', 'sorting_desc' : activeSort() === 'typeDesc', 'sorting' : activeSort().indexOf('type') !== 0 }">${ _('Type') }</div>
           <div class="doc-browser-attr-col doc-browser-owner" data-bind="click: function () { setSort('owner') }, css: { 'sorting_asc' : activeSort() === 'ownerAsc', 'sorting_desc' : activeSort() === 'ownerDesc', 'sorting' : activeSort().indexOf('owner') !== 0 }">${ _('Owner') }</div>
           <div class="doc-browser-attr-col doc-browser-modified" data-bind="click: function () { setSort('lastModified') }, css: { 'sorting_asc' : activeSort() === 'lastModifiedAsc', 'sorting_desc' : activeSort() === 'lastModifiedDesc', 'sorting' : activeSort().indexOf('lastModified') !== 0 }">${ _('Last Modified') }</div>
@@ -480,18 +482,19 @@ from desktop.views import _ko
               </div>
               <div class="doc-browser-attr-group">
                 <!-- ko with: definition -->
+                <div class="doc-browser-attr-col doc-browser-description" data-bind="text: description, attr: { 'title': description }"></div>
                 <div class="doc-browser-attr-col doc-browser-type">
                   <!-- ko switch: type -->
-                  <!-- ko case: 'directory' -->${ _('Directory')}<!-- /ko -->
-                  <!-- ko case: 'link-pigscript' -->${ _('Pig Script')}<!-- /ko -->
-                  <!-- ko case: 'link-workflow' -->${ _('Job Design')}<!-- /ko -->
-                  <!-- ko case: 'notebook' -->${ _('Notebook')}<!-- /ko -->
-                  <!-- ko case: 'oozie-bundle2' -->${ _('Oozie Bundle')}<!-- /ko -->
-                  <!-- ko case: 'oozie-coordinator2' -->${ _('Oozie Coordinator')}<!-- /ko -->
-                  <!-- ko case: 'oozie-workflow2' -->${ _('Oozie Workflow')}<!-- /ko -->
-                  <!-- ko case: 'query-hive' -->${ _('Hive Query')}<!-- /ko -->
-                  <!-- ko case: 'query-impala' -->${ _('Impala Query')}<!-- /ko -->
-                  <!-- ko case: 'search-dashboard' -->${ _('Search Dashboard')}<!-- /ko -->
+                  <!-- ko case: 'directory' -->${ _('Directory') }<!-- /ko -->
+                  <!-- ko case: 'link-pigscript' -->${ _('Pig Script') }<!-- /ko -->
+                  <!-- ko case: 'link-workflow' -->${ _('Job Design') }<!-- /ko -->
+                  <!-- ko case: 'notebook' -->${ _('Notebook') }<!-- /ko -->
+                  <!-- ko case: 'oozie-bundle2' -->${ _('Oozie Bundle') }<!-- /ko -->
+                  <!-- ko case: 'oozie-coordinator2' -->${ _('Oozie Coordinator') }<!-- /ko -->
+                  <!-- ko case: 'oozie-workflow2' -->${ _('Oozie Workflow') }<!-- /ko -->
+                  <!-- ko case: 'query-hive' -->${ _('Hive Query') }<!-- /ko -->
+                  <!-- ko case: 'query-impala' -->${ _('Impala Query') }<!-- /ko -->
+                  <!-- ko case: 'search-dashboard' -->${ _('Search Dashboard') }<!-- /ko -->
                   <!-- ko case: $default -->
                   <!-- ko text: $value --><!-- /ko -->
                   <!-- /ko -->

+ 2 - 6
desktop/core/src/desktop/templates/home2.mako

@@ -14,9 +14,10 @@
 ## See the License for the specific language governing permissions and
 ## limitations under the License.
 <%!
+  from django.utils.translation import ugettext as _
+
   from desktop.views import commonheader, commonfooter, _ko
   from desktop import conf
-  from django.utils.translation import ugettext as _
 %>
 
 <%namespace name="assist" file="/assist.mako" />
@@ -205,11 +206,6 @@ ${ common_home.navbar() }
 %else :
 
 <div id="homeComponents" class="main-content">
-##   Uncomment to enable the assist panel
-##   <a title="${_('Toggle Assist')}" class="pointer show-assist" data-bind="visible: !$root.isLeftPanelVisible(), click: function() { $root.isLeftPanelVisible(true); }" style="display:none;">
-##     <i class="fa fa-chevron-right"></i>
-##   </a>
-
   <div class="vertical-full container-fluid" data-bind="style: { 'padding-left' : $root.isLeftPanelVisible() ? '0' : '20px' }">
     <div class="vertical-full row-fluid panel-container">
       <div class="assist-container left-panel" data-bind="visible: $root.isLeftPanelVisible" style="display: none;">

+ 1 - 1
desktop/core/src/desktop/templates/hue.mako

@@ -149,7 +149,7 @@ ${ hueIcons.symbols() }
 
       <div class="top-nav-middle">
         <div class="search-container-top">
-          <input placeholder="${ _('Search all data and saved documents...') }" type="text"
+          <input placeholder="${ _('Search data and saved documents...') }" type="text"
             data-bind="autocomplete: {
                 source: searchAutocompleteSource,
                 itemTemplate: 'top-search-autocomp-item',