<commit_before>## Licensed to Cloudera, Inc. under one
## or more contributor license agreements.  See the NOTICE file
## distributed with this work for additional information
## regarding copyright ownership.  Cloudera, Inc. licenses this file
## to you under the Apache License, Version 2.0 (the
## "License"); you may not use this file except in compliance
## with the License.  You may obtain a copy of the License at
##
##     http://www.apache.org/licenses/LICENSE-2.0
##
## Unless required by applicable law or agreed to in writing, software
## distributed under the License is distributed on an "AS IS" BASIS,
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
## See the License for the specific language governing permissions and
## limitations under the License.
<%!
from django.utils.html import escape
from django.utils.translation import ugettext as _

from desktop import conf
from desktop.conf import USE_NEW_EDITOR
from desktop.lib.i18n import smart_unicode
from desktop.views import commonheader, commonfooter, _ko
from beeswax.conf import LIST_PARTITIONS_LIMIT

from metastore.conf import ENABLE_NEW_CREATE_TABLE
%>

<%namespace name="actionbar" file="actionbar.mako" />
<%namespace name="assist" file="/assist.mako" />
<%namespace name="components" file="components.mako" />

% if not is_embeddable:
${ commonheader(_("Metastore"), app_name, user, request) | n,unicode }

<script src="${ static('desktop/ext/js/jquery/plugins/jquery-ui-1.10.4.custom.min.js') }"></script>
<script src="${ static('desktop/ext/js/jquery/plugins/jquery.mousewheel.min.js') }"></script>
<script src="${ static('desktop/ext/js/selectize.min.js') }"></script>
<script src="${ static('desktop/js/apiHelper.js') }"></script>
<script src="${ static('desktop/js/ko.charts.js') }"></script>
<script src="${ static('desktop/ext/js/knockout-sortable.min.js') }"></script>
<script src="${ static('desktop/js/ko.editable.js') }"></script>
<script src="${ static('desktop/ext/js/bootstrap-editable.min.js') }" type="text/javascript" charset="utf-8"></script>
<script src="${ static('beeswax/js/stats.utils.js') }"></script>
<script src="${ static('desktop/js/jquery.huedatatable.js') }"></script>

${ assist.assistJSModels() }

<link rel="stylesheet" href="${ static('desktop/ext/css/bootstrap-editable.css') }">
<link rel="stylesheet" href="${ static('notebook/css/notebook.css') }">
<link rel="stylesheet" href="${ static('notebook/css/notebook-layout.css') }">
<style type="text/css">
% if conf.CUSTOM.BANNER_TOP_HTML.get():
  .show-assist {
    top: 110px!important;
  }
  .main-content {
    top: 112px!important;
  }
% endif
</style>

${ assist.assistPanel() }
% endif

<span class="notebook">

${ components.menubar() }

<script src="${ static('metastore/js/metastore.ko.js') }"></script>
<link rel="stylesheet" href="${ static('metastore/css/metastore.css') }" type="text/css">

<script type="text/html" id="metastore-breadcrumbs">
  <ul class="nav nav-pills hueBreadcrumbBar" id="breadcrumbs">
    <li>
      <a href="javascript:void(0);" data-bind="click: databasesBreadcrumb">${_('Databases')}</a>
      <!-- ko if: database -->
      <span class="divider">&gt;</span>
      <!-- /ko -->
    </li>
    <!-- ko with: database -->
    <li>
      <a href="javascript:void(0);" data-bind="text: name, click: $root.tablesBreadcrumb"></a>
      <!-- ko if: table -->
      <span class="divider">&gt;</span>
      <!-- /ko -->
    </li>
    <!-- ko with: table -->
    <li class="editable-breadcrumbs" title="${_('Edit path')}" data-bind="click: function(){ $parent.editingTable(true); }, visible: !$parent.editingTable()">
      <span data-bind="text: name"></span>
    </li>
    <!-- /ko -->
    <!-- ko if: editingTable -->
      <!-- ko with: table -->
      <li class="editable-breadcrumb-input">
        <input type="text" data-bind="hivechooser: {data: name, database: $parent.name, skipColumns: true, searchEverywhere: true, onChange: function(val){ $parent.setTableByName(val); $parent.editingTable(false); }}" autocomplete="off" />
      </li>
      <!-- /ko -->
    <!-- /ko -->
    <!-- /ko -->
  </ul>
</script>

<script type="text/html" id="metastore-columns-table">
  <div style="overflow-x: auto; overflow-y: hidden">
    <table class="table table-striped table-condensed table-nowrap">
      <br/>
      <thead>
      <tr>
        <th width="2%">&nbsp;</th>
        <th width="2%" class="no-sort">&nbsp;</th>
        <th width="17%">${_('Name')}</th>
        <th width="15%">${_('Type')}</th>
        <!-- ko if: $root.optimizerEnabled  -->
          <th width="15%">${_('Popularity')}</th>
        <!-- /ko -->
        <th width="50%">${_('Comment')}</th>
      </tr>
      </thead>
      <tbody data-bind="hueach: {data: $data, itemHeight: 29, scrollable: '.content-panel', scrollableOffset: 200, disableHueEachRowCount: 5, scrollUp: true}">
        <tr>
          <td data-bind="text: $index() + $indexOffset() + 1"></td>
          <td><a class="blue" href="javascript:void(0)" data-bind="click: showContextPopover"><i class="fa fa-fw fa-info" title="${_('Show details')}"></i></a></td>
          <td title="${ _("Scroll to the column") }">
            <!-- ko if: $root.database().table().samples.loading() -->
            <span data-bind="text: name"></span><commit_msg>HUE-5753 [metastore] Make Hivechooser use the new apiHelper calls<commit_after>## Licensed to Cloudera, Inc. under one
## or more contributor license agreements.  See the NOTICE file
## distributed with this work for additional information
## regarding copyright ownership.  Cloudera, Inc. licenses this file
## to you under the Apache License, Version 2.0 (the
## "License"); you may not use this file except in compliance
## with the License.  You may obtain a copy of the License at
##
##     http://www.apache.org/licenses/LICENSE-2.0
##
## Unless required by applicable law or agreed to in writing, software
## distributed under the License is distributed on an "AS IS" BASIS,
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
## See the License for the specific language governing permissions and
## limitations under the License.
<%!
from django.utils.html import escape
from django.utils.translation import ugettext as _

from desktop import conf
from desktop.conf import USE_NEW_EDITOR
from desktop.lib.i18n import smart_unicode
from desktop.views import commonheader, commonfooter, _ko
from beeswax.conf import LIST_PARTITIONS_LIMIT

from metastore.conf import ENABLE_NEW_CREATE_TABLE
%>

<%namespace name="actionbar" file="actionbar.mako" />
<%namespace name="assist" file="/assist.mako" />
<%namespace name="components" file="components.mako" />

% if not is_embeddable:
${ commonheader(_("Metastore"), app_name, user, request) | n,unicode }

<script src="${ static('desktop/ext/js/jquery/plugins/jquery-ui-1.10.4.custom.min.js') }"></script>
<script src="${ static('desktop/ext/js/jquery/plugins/jquery.mousewheel.min.js') }"></script>
<script src="${ static('desktop/ext/js/selectize.min.js') }"></script>
<script src="${ static('desktop/js/apiHelper.js') }"></script>
<script src="${ static('desktop/js/ko.charts.js') }"></script>
<script src="${ static('desktop/ext/js/knockout-sortable.min.js') }"></script>
<script src="${ static('desktop/js/ko.editable.js') }"></script>
<script src="${ static('desktop/ext/js/bootstrap-editable.min.js') }" type="text/javascript" charset="utf-8"></script>
<script src="${ static('beeswax/js/stats.utils.js') }"></script>
<script src="${ static('desktop/js/jquery.huedatatable.js') }"></script>

${ assist.assistJSModels() }

<link rel="stylesheet" href="${ static('desktop/ext/css/bootstrap-editable.css') }">
<link rel="stylesheet" href="${ static('notebook/css/notebook.css') }">
<link rel="stylesheet" href="${ static('notebook/css/notebook-layout.css') }">
<style type="text/css">
% if conf.CUSTOM.BANNER_TOP_HTML.get():
  .show-assist {
    top: 110px!important;
  }
  .main-content {
    top: 112px!important;
  }
% endif
</style>

${ assist.assistPanel() }
% endif

<span class="notebook">

${ components.menubar() }

<script src="${ static('metastore/js/metastore.ko.js') }"></script>
<link rel="stylesheet" href="${ static('metastore/css/metastore.css') }" type="text/css">

<script type="text/html" id="metastore-breadcrumbs">
  <ul class="nav nav-pills hueBreadcrumbBar" id="breadcrumbs">
    <li>
      <a href="javascript:void(0);" data-bind="click: databasesBreadcrumb">${_('Databases')}</a>
      <!-- ko if: database -->
      <span class="divider">&gt;</span>
      <!-- /ko -->
    </li>
    <!-- ko with: database -->
    <li>
      <a href="javascript:void(0);" data-bind="text: name, click: $root.tablesBreadcrumb"></a>
      <!-- ko if: table -->
      <span class="divider">&gt;</span>
      <!-- /ko -->
    </li>
    <!-- ko with: table -->
    <li class="editable-breadcrumbs" title="${_('Edit path')}" data-bind="click: function(){ $parent.editingTable(true); }, visible: !$parent.editingTable()">
      <span data-bind="text: name"></span>
    </li>
    <!-- /ko -->
    <!-- ko if: editingTable -->
      <!-- ko with: table -->
      <li class="editable-breadcrumb-input">
        <input type="text" data-bind="hivechooser: {data: name, database: $parent.name, skipColumns: true, searchEverywhere: true, onChange: function(val){ $parent.setTableByName(val); $parent.editingTable(false); }, apiHelperUser: '${ user }', apiHelperType: 'hive'}" autocomplete="off" />
      </li>
      <!-- /ko -->
    <!-- /ko -->
    <!-- /ko -->
  </ul>
</script>

<script type="text/html" id="metastore-columns-table">
  <div style="overflow-x: auto; overflow-y: hidden">
    <table class="table table-striped table-condensed table-nowrap">
      <br/>
      <thead>
      <tr>
        <th width="2%">&nbsp;</th>
        <th width="2%" class="no-sort">&nbsp;</th>
        <th width="17%">${_('Name')}</th>
        <th width="15%">${_('Type')}</th>
        <!-- ko if: $root.optimizerEnabled  -->
          <th width="15%">${_('Popularity')}</th>
        <!-- /ko -->
        <th width="50%">${_('Comment')}</th>
      </tr>
      </thead>
      <tbody data-bind="hueach: {data: $data, itemHeight: 29, scrollable: '.content-panel', scrollableOffset: 200, disableHueEachRowCount: 5, scrollUp: true}">
        <tr>
          <td data-bind="text: $index() + $indexOffset() + 1"></td>
          <td><a class="blue" href="javascript:void(0)" data-bind="click: showContextPopover"><i class="fa fa-fw fa-info" title="${_('Show details')}"></i></a></td>
          <td title="${ _("Scroll to the column") }">
            <!-- ko if: $root.database().table().samples.loading() -->
            <span data-bind="text: name"></span>
{'fraction_non_alphanumeric': 0.20169791958205058, 'fraction_numerical': 0.007276798208788134, 'mean_word_length': 3.8771610555050047, 'pattern_counts': {'":': 0, '<': 211, '<?xml version=': 0, '>': 211, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2137067', 'n_tokens_mistral': 3527, 'n_tokens_neox': 3450, 'n_words': 817}