瀏覽代碼

[metastore] Add favourite toggle to columns

Johan Ahlen 10 年之前
父節點
當前提交
e6352ce
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4 0
      apps/metastore/src/metastore/templates/describe_table.mako

+ 4 - 0
apps/metastore/src/metastore/templates/describe_table.mako

@@ -65,6 +65,7 @@ ${ assist.assistPanel() }
       <th width="1%">&nbsp;</th>
       ## no stats for partition key type
       <th width="1%" class="no-sort">&nbsp;</th>
+      <th width="1%">&nbsp;</th>
       <th>${_('Name')}</th>
       <th>${_('Type')}</th>
       <th>${_('Comment')}</th>
@@ -86,6 +87,7 @@ ${ assist.assistPanel() }
             assistHelper: $root.assistHelper
           } }"></span>
         </td>
+        <td class="pointer" data-bind="click: function() { favourite(!favourite()) }"><i style="color: #338bb8" class="fa" data-bind="css: {'fa-star': favourite, 'fa-star-o': !favourite() }"></i></td>
         <td title="${ _("Scroll to the column") }">
           <a href="javascript:void(0)" class="column-selector" data-bind="text: name"></a>
         </td>
@@ -461,6 +463,8 @@ ${ assist.assistPanel() }
       var self = this;
       ko.mapping.fromJS(extendedColumn, {}, self);
 
+      self.favourite = ko.observable(false);
+
       self.comment.subscribe(function (newValue) {
         $.post("${ url('metastore:alter_column', database=database, table=table.name) }", {
           column: self.name(),