<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.template.defaultfilters import urlencode
from desktop.views import commonheader, commonfooter
from django.utils.translation import ugettext as _

from filebrowser.conf import ENABLE_EXTRACT_UPLOADED_ARCHIVE

%>

<%namespace name="actionbar" file="actionbar.mako" />
<%namespace name="dir" file="listdir_components.mako" />
<%namespace name="fb_components" file="fb_components.mako" />

%if not is_embeddable:
${ commonheader(None, 'filebrowser', user, request) | n,unicode }
%endif
${ fb_components.menubar() }

<style type="text/css">
  .tooltip.left {
    margin-left: -10px;
  }

  %if is_embeddable:
    .filebrowser .pagination {
      position: inherit;
    }
  %endif
</style>

<div id="${ path.startswith('S3A://') and 'filebrowser_s3Components' or 'filebrowserComponents' }" class="container-fluid filebrowser">
  <div class="card card-small">
    <div class="actionbar">
    <%actionbar:render>
      <%def name="search()">
        <input type="text" class="input-large search-query" placeholder="${_('Search for file name')}" data-bind="clearable: searchQuery, valueUpdate: 'afterkeydown'">
      </%def>

      <%def name="actions()">
        <div class="btn-toolbar" style="display: inline; vertical-align: middle">
          <div id="ch-dropdown" class="btn-group" style="vertical-align: middle">
            <button href="javascript: void(0)" class="btn dropdown-toggle" title="${_('Actions')}" data-toggle="dropdown"
            data-bind="visible: !inTrash(), enable: selectedFiles().length > 0 && (!isS3() || (isS3() && !isS3Root()))">
              <i class="fa fa-cog"></i> ${_('Actions')}
              <span class="caret" style="line-height: 15px"></span>
            </button>
            <ul class="dropdown-menu" style="top: auto">
              <li><a href="javascript: void(0)" title="${_('Rename')}" data-bind="visible: !inTrash() && selectedFiles().length == 1, click: renameFile,
              enable: selectedFiles().length == 1 && isCurrentDirSelected().length == 0"><i class="fa fa-fw fa-font"></i>
              ${_('Rename')}</a></li>
              <li><a href="javascript: void(0)"title="${_('Move')}" data-bind="click: move, enable: selectedFiles().length > 0 &&
              isCurrentDirSelected().length == 0"><i class="fa fa-fw fa-random"></i> ${_('Move')}</a></li>
              <li><a href="javascript: void(0)" title="${_('Copy')}" data-bind="click: copy, enable: selectedFiles().length > 0 &&
              isCurrentDirSelected().length == 0"><i class="fa fa-fw fa-files-o"></i> ${_('Copy')}</a></li>
              % if show_download_button:
              <li>
                <a href="javascript: void(0)" title="${_('Download')}" data-bind="visible: !inTrash() && selectedFiles().length == 1 && selectedFile().type == 'file', click: downloadFile">
                  <i class="fa fa-fw fa-arrow-circle-o-down"></i> ${_('Download')}
                </a>
              </li>
              % endif
              <li class="divider" data-bind="visible: !isS3()"></li>
              % if is_fs_superuser:
              <li data-bind="css: {'disabled': isCurrentDirSentryManaged() || selectedSentryFiles().length > 0 }">
                <a href="javascript: void(0)" data-bind="visible: ! inTrash(), click: changeOwner, enable: selectedFiles().length > 0">
                  <i class="fa fa-fw fa-user"></i> ${_('Change owner / group')}
                </a>
              </li>
              % endif
              <li data-bind="css: {'disabled': isCurrentDirSentryManaged() || selectedSentryFiles().length > 0 }, visible: !isS3()">
                <a href="javascript: void(0)" data-bind="visible: ! inTrash(), click: changePermissions, enable: selectedFiles().length > 0">
                  <i class="fa fa-fw fa-list-alt"></i> ${_('Change permissions')}
                </a>
              </li>
              <li class="divider" data-bind="visible: !isS3()"></li>
              <li data-bind="css: {'disabled': inTrash() || selectedFiles().length > 1 }, visible: !isS3()">
                <a class="pointer" data-bind="click: function(){ selectedFiles().length == 1 ? showSummary(): void(0)}">
                  <i class="fa fa-fw fa-pie-chart"></i> ${_('Summary')}
                </a>
              </li>
              <li>
                <a href="javascript: void(0)" title="${_('Set Replication')}" data-bind="visible: !inTrash() && !isS3() && selectedFiles().length == 1 && selectedFile().type == 'file', click: setReplicationFactor">
                  <i class="fa fa-fw fa-hdd-o"></i>${_('Set replication')}
                </a>
              </li>
              % if ENABLE_EXTRACT_UPLOADED_ARCHIVE.get():
                <li><a href="javascript: void(0)" title="${_('Compress selection into a single archive')}" data-bind="click: function() { setCompressArchiveDefault(); confirmCompressFiles();}, visible: showCompressButton">
                  <i class="fa fa-fw fa-file-archive-o"></i> ${_('Compress')}</a>
                </li>
                <li><a href="javascript: void(0)" title="${_('Extract selected archive')}" data-bind="visible: selectedFiles().length == 1 && isArchive() && !isS3(), click: confirmExtractArchive">
                  <i class="fa fa-fw fa-file-archive-o"></i> ${_('Extract')}</a>
                </li>
              % endif
            </ul>
          </div>

          <button class="btn fileToolbarBtn" title="${_('Restore from trash')}" data-bind="visible: inRestorableTrash(), click: restoreTrashSelected, enable: selectedFiles().length > 0 && isCurrentDirSelected().length == 0"><i class="fa fa-cloud-upload"></i> ${_('Restore')}</button>
          <!-- ko ifnot: inTrash -->
          <!-- ko if: $root.isS3 -->
          <button class="btn fileToolbarBtn delete-link" title="${_('Delete forever')}" data-bind="enable: selectedFiles().length > 0, click: deleteSelected"><i class="fa fa-bolt"></i> ${_('Delete forever')}</button>
          <!-- /ko -->
          <!-- ko ifnot: $root.isS3 -->
          <div id="delete-dropdown" class="btn-group" style="vertical-align: middle">
            <button id="trash-btn" class="btn toolbarBtn" data-bind="enable: selectedFiles().length > 0 && isCurrentDirSelected().length == 0, click: trashSelected"><i class="fa fa-times"></i> ${_('Move to trash')}</button>
            <button id="trash-btn-caret" class="btn toolbarBtn dropdown-toggle" data-toggle="dropdown" data-bind="enable: selectedFiles().length > 0 && isCurrentDirSelected().length == 0">
              <span class="caret"></span>
            </button>
            <ul class="dropdown-menu">
              <li><a href="javascript: void(0)" class="delete-link" title="${_('Delete forever')}" data-bind="enable: selectedFiles().length > 0, click: deleteSelected"><i class="fa fa-bolt"></i> ${_('Delete forever')}</a></li>
            </ul>
          </div>
          <!-- /ko -->
          <!-- /ko -->
          % if 'oozie' in apps:
            <button class="btn fileToolbarBtn" title="${_('Submit')}"
              data-bind="visible: selectedFiles().length == 1 && $.inArray(selectedFile().name, ['workflow.xml', 'coordinator.xml', 'bundle.xml']) > -1, click: submitSelected">
              <i class="fa fa-play"></i> ${_('Submit')}
            </button>
            % if ENABLE_EXTRACT_UPLOADED_ARCHIVE.get():
              <button class="btn extractArchiveBtn" title="${_('Extract')}"
                data-bind="visible: selectedFiles().length == 1 && isArchive() && !isS3(), click: confirmExtractArchive">
                <i class="fa fa-play"></i> ${_('Extract')}
              </button>
            % endif
          % endif
          % if 'beeswax' in apps:
            <a class="btn" title="${_('Open in Editor')}"
              data-bind="visible: selectedFiles().length == 1 && isSelectedFileSql(), click: openFileInEditor">
              ${_('Open in Editor')}
            </a>
          % endif
        </div>
      </%def>
<commit_msg>HUE-6077 [frontend] Harmonize extract icons on FB<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.template.defaultfilters import urlencode
from desktop.views import commonheader, commonfooter
from django.utils.translation import ugettext as _

from filebrowser.conf import ENABLE_EXTRACT_UPLOADED_ARCHIVE

%>

<%namespace name="actionbar" file="actionbar.mako" />
<%namespace name="dir" file="listdir_components.mako" />
<%namespace name="fb_components" file="fb_components.mako" />

%if not is_embeddable:
${ commonheader(None, 'filebrowser', user, request) | n,unicode }
%endif
${ fb_components.menubar() }

<style type="text/css">
  .tooltip.left {
    margin-left: -10px;
  }

  %if is_embeddable:
    .filebrowser .pagination {
      position: inherit;
    }
  %endif
</style>

<div id="${ path.startswith('S3A://') and 'filebrowser_s3Components' or 'filebrowserComponents' }" class="container-fluid filebrowser">
  <div class="card card-small">
    <div class="actionbar">
    <%actionbar:render>
      <%def name="search()">
        <input type="text" class="input-large search-query" placeholder="${_('Search for file name')}" data-bind="clearable: searchQuery, valueUpdate: 'afterkeydown'">
      </%def>

      <%def name="actions()">
        <div class="btn-toolbar" style="display: inline; vertical-align: middle">
          <div id="ch-dropdown" class="btn-group" style="vertical-align: middle">
            <button href="javascript: void(0)" class="btn dropdown-toggle" title="${_('Actions')}" data-toggle="dropdown"
            data-bind="visible: !inTrash(), enable: selectedFiles().length > 0 && (!isS3() || (isS3() && !isS3Root()))">
              <i class="fa fa-cog"></i> ${_('Actions')}
              <span class="caret" style="line-height: 15px"></span>
            </button>
            <ul class="dropdown-menu" style="top: auto">
              <li><a href="javascript: void(0)" title="${_('Rename')}" data-bind="visible: !inTrash() && selectedFiles().length == 1, click: renameFile,
              enable: selectedFiles().length == 1 && isCurrentDirSelected().length == 0"><i class="fa fa-fw fa-font"></i>
              ${_('Rename')}</a></li>
              <li><a href="javascript: void(0)"title="${_('Move')}" data-bind="click: move, enable: selectedFiles().length > 0 &&
              isCurrentDirSelected().length == 0"><i class="fa fa-fw fa-random"></i> ${_('Move')}</a></li>
              <li><a href="javascript: void(0)" title="${_('Copy')}" data-bind="click: copy, enable: selectedFiles().length > 0 &&
              isCurrentDirSelected().length == 0"><i class="fa fa-fw fa-files-o"></i> ${_('Copy')}</a></li>
              % if show_download_button:
              <li>
                <a href="javascript: void(0)" title="${_('Download')}" data-bind="visible: !inTrash() && selectedFiles().length == 1 && selectedFile().type == 'file', click: downloadFile">
                  <i class="fa fa-fw fa-arrow-circle-o-down"></i> ${_('Download')}
                </a>
              </li>
              % endif
              <li class="divider" data-bind="visible: !isS3()"></li>
              % if is_fs_superuser:
              <li data-bind="css: {'disabled': isCurrentDirSentryManaged() || selectedSentryFiles().length > 0 }">
                <a href="javascript: void(0)" data-bind="visible: ! inTrash(), click: changeOwner, enable: selectedFiles().length > 0">
                  <i class="fa fa-fw fa-user"></i> ${_('Change owner / group')}
                </a>
              </li>
              % endif
              <li data-bind="css: {'disabled': isCurrentDirSentryManaged() || selectedSentryFiles().length > 0 }, visible: !isS3()">
                <a href="javascript: void(0)" data-bind="visible: ! inTrash(), click: changePermissions, enable: selectedFiles().length > 0">
                  <i class="fa fa-fw fa-list-alt"></i> ${_('Change permissions')}
                </a>
              </li>
              <li class="divider" data-bind="visible: !isS3()"></li>
              <li data-bind="css: {'disabled': inTrash() || selectedFiles().length > 1 }, visible: !isS3()">
                <a class="pointer" data-bind="click: function(){ selectedFiles().length == 1 ? showSummary(): void(0)}">
                  <i class="fa fa-fw fa-pie-chart"></i> ${_('Summary')}
                </a>
              </li>
              <li>
                <a href="javascript: void(0)" title="${_('Set Replication')}" data-bind="visible: !inTrash() && !isS3() && selectedFiles().length == 1 && selectedFile().type == 'file', click: setReplicationFactor">
                  <i class="fa fa-fw fa-hdd-o"></i> ${_('Set replication')}
                </a>
              </li>
              % if ENABLE_EXTRACT_UPLOADED_ARCHIVE.get():
                <li><a href="javascript: void(0)" title="${_('Compress selection into a single archive')}" data-bind="click: function() { setCompressArchiveDefault(); confirmCompressFiles();}, visible: showCompressButton">
                  <i class="fa fa-fw fa-file-archive-o"></i> ${_('Compress')}</a>
                </li>
                <li><a href="javascript: void(0)" title="${_('Extract selected archive')}" data-bind="visible: selectedFiles().length == 1 && isArchive() && !isS3(), click: confirmExtractArchive">
                  <i class="fa fa-fw fa-file-archive-o"></i> ${_('Extract')}</a>
                </li>
              % endif
            </ul>
          </div>

          <button class="btn fileToolbarBtn" title="${_('Restore from trash')}" data-bind="visible: inRestorableTrash(), click: restoreTrashSelected, enable: selectedFiles().length > 0 && isCurrentDirSelected().length == 0"><i class="fa fa-cloud-upload"></i> ${_('Restore')}</button>
          <!-- ko ifnot: inTrash -->
          <!-- ko if: $root.isS3 -->
          <button class="btn fileToolbarBtn delete-link" title="${_('Delete forever')}" data-bind="enable: selectedFiles().length > 0, click: deleteSelected"><i class="fa fa-bolt"></i> ${_('Delete forever')}</button>
          <!-- /ko -->
          <!-- ko ifnot: $root.isS3 -->
          <div id="delete-dropdown" class="btn-group" style="vertical-align: middle">
            <button id="trash-btn" class="btn toolbarBtn" data-bind="enable: selectedFiles().length > 0 && isCurrentDirSelected().length == 0, click: trashSelected"><i class="fa fa-times"></i> ${_('Move to trash')}</button>
            <button id="trash-btn-caret" class="btn toolbarBtn dropdown-toggle" data-toggle="dropdown" data-bind="enable: selectedFiles().length > 0 && isCurrentDirSelected().length == 0">
              <span class="caret"></span>
            </button>
            <ul class="dropdown-menu">
              <li><a href="javascript: void(0)" class="delete-link" title="${_('Delete forever')}" data-bind="enable: selectedFiles().length > 0, click: deleteSelected"><i class="fa fa-bolt"></i> ${_('Delete forever')}</a></li>
            </ul>
          </div>
          <!-- /ko -->
          <!-- /ko -->
          % if 'oozie' in apps:
            <button class="btn fileToolbarBtn" title="${_('Submit')}"
              data-bind="visible: selectedFiles().length == 1 && $.inArray(selectedFile().name, ['workflow.xml', 'coordinator.xml', 'bundle.xml']) > -1, click: submitSelected">
              <i class="fa fa-fw fa-play"></i> ${_('Submit')}
            </button>
            % if ENABLE_EXTRACT_UPLOADED_ARCHIVE.get():
              <button class="btn extractArchiveBtn" title="${_('Extract')}"
                data-bind="visible: selectedFiles().length == 1 && isArchive() && !isS3(), click: confirmExtractArchive">
                <i class="fa fa-fw fa-file-archive-o"></i> ${_('Extract')}
              </button>
            % endif
          % endif
          % if 'beeswax' in apps:
            <a class="btn" title="${_('Open in Editor')}"
              data-bind="visible: selectedFiles().length == 1 && isSelectedFileSql(), click: openFileInEditor">
              ${_('Open in Editor')}
            </a>
          % endif
        </div>
      </%def>

{'fraction_non_alphanumeric': 0.18534114835258636, 'fraction_numerical': 0.007397712399704092, 'mean_word_length': 2.7850527676071506, 'pattern_counts': {'":': 0, '<': 269, '<?xml version=': 0, '>': 297, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 6}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2399532', 'n_tokens_mistral': 5198, 'n_tokens_neox': 5089, 'n_words': 1245}