<commit_before><% content_for :head do %>
  <meta name="turbolinks-cache-control" content="no-cache">
<% end %>

<% provide(:head_title, t("libraries.show.head_title", library: @repository.name)) %>
<%= stylesheet_link_tag 'datatables' %>
<% provide(:container_class, "no-second-nav-container") %>

<%= render partial: "sidebar", locals: { repositories: @repositories } %>
<div id="alert-container"></div>

<div class="content-pane repository-show">
  <div id="repository-toolbar">
    <div class="repository-title-name">
      <span class="name-container">
        <% if @inline_editable_title_config.present? %>
          <%= render partial: "shared/inline_editing",
                     locals: {
                        initial_value: @repository.name,
                        config: @inline_editable_title_config
                     } %>
        <% else %>
          <div class="read-only-name">
            <%= @repository.name %>
          </div>
          <span class="repository-share-icon">
            <%= inventory_shared_status_icon(@repository, current_team) %>
          </span>
        <% end %>
      </span>
      <% if @repository.shared_with_anybody? %>
        <% team_name = @repository.team == current_team ? 'your Team' : @repository.team.name %>
        <div class="repository-subtitle"><%= t('repositories.subtitle', team_name: team_name) %></div>
      <% end %>
    </div>
    <div id="datatables-buttons" class="datatables-buttons">
      <div class="new-repository-button">
        <% if can_share_repository?(@repository) && current_user.teams.count > 1 %>
          <%= link_to team_repository_share_modal_path(current_team, repository_id: @repository),
                      class: 'btn btn-default share-repo-option', remote: true, id: 'shareRepoBtn' do %>
            <span class="fas fa-user-plus"></span>
            <span class="hidden-xs"><%= t('repositories.index.share_inventory') %></span>
          <% end %>
        <% end %>
      </div>
      <%= render partial: "columns_reorder_dropdown", formats: :html %>
    </div>

    <div class="repository-cog dropdown">
        <button id="repository-acitons-dropdown"
                class="btn btn-default"
                type="button"
                data-toggle="dropdown"
                aria-haspopup="true"
                aria-expanded="true"
                <%= "disabled" unless can_perform_repository_actions(@repository) %>>
          <span class="fas fa-pencil-alt"></span>
          <span class="hidden-xs"><%= t('repositories.index.edit_inventory') %></span>
          <span class="caret"></span>
        </button>

        <% if can_perform_repository_actions(@repository) %>
          <ul class="dropdown-menu pull-right">
            <% if can_create_repository_columns?(@repository) %>
              <li>
                <%= link_to t('repositories.index.options_dropdown.manage_columns'),
                            repository_repository_columns_path(@repository) %>
              </li>
            <% end %>
            <% if can_create_repository_rows?(@repository) %>
            <li>
              <a href="#" id="importRecordsButton" data-turbolinks="false">
                <%= t('repositories.index.options_dropdown.import_items') %>
              </a>
            <li>
            <% end %>
            <% if can_read_repository?(@repository) %>
            <li>
              <a href="#"  id="exportRepositoriesButton" data-turbolinks="false">
                <%= t("repositories.index.options_dropdown.export_items") %>
              </a>
            </li>
            <% end %>
            <% if can_create_repositories?(current_team) && !@repository.shared_with?(current_team) %>
              <li>
                <%= link_to t('repositories.index.options_dropdown.copy'),
                            team_repository_copy_modal_path(current_team, repository_id: @repository),
                            class: "copy-repo-option",
                            remote: true %>
              </li>
            <% end %>
            <% if can_manage_repository?(@repository) %>
              <li data-hook="destroy-repository-option" role="separator" class="divider"></li>
              <li data-hook="destroy-repository-option">
                <%= link_to t('repositories.index.options_dropdown.delete'),
                            team_repository_destroy_modal_path(current_team, repository_id: @repository),
                            class: "delete-repo-option",
                            remote: true %>
              </li>
            <% end %>
          </ul>
        <% end %>
    </div>
  </div>

  <!-- These buttons are appended to table in javascript, after table initialization -->
  <div class="toolbarButtonsDatatable" style="display:none">

    <% if can_create_repository_rows?(@repository) %>
      <button type="button" class="btn btn-primary editAdd help_tooltips"
              id="addRepositoryRecord" onclick="onClickAddRecord()"
              data-tooltiplink="<%= I18n.t('tooltips.link.inventory.new') %>"
              data-tooltipcontent="<%= I18n.t('tooltips.text.inventory.new') %>">
        <span class="fas fa-plus"></span>
        <span class="hidden-xs"><%= t("repositories.add_new_record") %></span>
      </button>
    <% end %>

    <% if can_manage_repository_rows?(@repository) %>
      <span id="editDeleteCopy" data-toggle="buttons" style="display:none">
        <%if @display_edit_button %>
          <button type="button" class="btn btn-default editAdd" id="editRepositoryRecord" onclick="onClickEdit()" disabled>
            <span class="fas fa-pencil-alt"></span>
            <span class="hidden-xs-custom"><%= t("repositories.edit_record") %></span>
          </button>
        <% end %>

        <%if @display_delete_button %>
          <button type="button" class="btn btn-default"
            id="deleteRepositoryRecordsButton" onclick="onClickDelete()" disabled>
            <span class="fas fa-trash"></span>
            <span class="hidden-xs-custom"><%= t'repositories.delete_record' %></span>
            <%= submit_tag I18n.t('repositories.delete_record'), :class => "hidden delete_repository_records_submit" %>
          </button>
        <% end %>

        <%if @display_duplicate_button %>
          <button type="button" class="btn btn-default copyRow" id="copyRepositoryRecords" onclick="onClickCopyRepositoryRecords()" disabled>
            <span class="fas fa-copy"></span>
            <span class="hidden-xs-custom"><%= t("repositories.copy_record") %></span>
          </button>
        <%end%>
      </span>

      <span id="saveCancel" data-toggle="buttons" style="display:none">
        <button type="button" class="btn btn-success" id="saveRecord">
          <span class="fas fa-save"></span>
          <%= t("repositories.save_record") %>
        </button>
        <button type="button" class="btn btn-default" id="cancelSave">
          <span class="fas fa-times-circle"></span>
          <%= t("repositories.cancel_save") %>
        </button>
      </span>
    <% elsif @repository.shared_with?(current_team) %>
      <p class="view-only-label"><%= t('repositories.index.view_only_permission_label') %></p>
    <% end %>
  </div>

  <%= render partial: "repositories/repository_table.html.erb",
             locals: {
               repository: @repository,
               repository_index_link: repository_table_index_path(@repository)
             }
  %>
</div>

<%= render partial: 'repositories/import_repository_records_modal.html.erb',
                    locals: { repository: @repository } %>

<%= render partial: "repositories/delete_record_modal.html.erb" %>
<%= render partial: 'repositories/export_repository_modal.html.erb',
           locals: { repository: @repository } %>

<%= javascript_include_tag 'repositories/edit' %>
<%= javascript_include_tag 'repositories/repository_datatable' %>
<%= javascript_include_tag "repositories/show" %>
<%= javascript_include_tag "repositories/index" %>
<%= javascript_pack_tag 'custom/inputmask' %>

<script type="text/javascript" charset="utf-8">
  <%
    js_format = I18n.backend.date_format.dup
    js_format.gsub!(/%-d/, 'D')
    js_format.gsub!(/%d/, 'DD')
    js_format.gsub!(/%-m/, 'M')
    js_format.gsub!(/%m/, 'MM')
    js_format.gsub!(/%b/, 'MMM')
    js_format.gsub!(/%B/, 'MMMM')
    js_format.gsub!('%Y', 'YYYY')
  %>

  if (typeof(formatJS) == undefined) { // Turbolinks fix
    const formatJS = "<%= js_format %>" 
  }
</script>
<commit_msg>Fix const in repository show view<commit_after><% content_for :head do %>
  <meta name="turbolinks-cache-control" content="no-cache">
<% end %>

<% provide(:head_title, t("libraries.show.head_title", library: @repository.name)) %>
<%= stylesheet_link_tag 'datatables' %>
<% provide(:container_class, "no-second-nav-container") %>

<%= render partial: "sidebar", locals: { repositories: @repositories } %>
<div id="alert-container"></div>

<div class="content-pane repository-show">
  <div id="repository-toolbar">
    <div class="repository-title-name">
      <span class="name-container">
        <% if @inline_editable_title_config.present? %>
          <%= render partial: "shared/inline_editing",
                     locals: {
                        initial_value: @repository.name,
                        config: @inline_editable_title_config
                     } %>
        <% else %>
          <div class="read-only-name">
            <%= @repository.name %>
          </div>
          <span class="repository-share-icon">
            <%= inventory_shared_status_icon(@repository, current_team) %>
          </span>
        <% end %>
      </span>
      <% if @repository.shared_with_anybody? %>
        <% team_name = @repository.team == current_team ? 'your Team' : @repository.team.name %>
        <div class="repository-subtitle"><%= t('repositories.subtitle', team_name: team_name) %></div>
      <% end %>
    </div>
    <div id="datatables-buttons" class="datatables-buttons">
      <div class="new-repository-button">
        <% if can_share_repository?(@repository) && current_user.teams.count > 1 %>
          <%= link_to team_repository_share_modal_path(current_team, repository_id: @repository),
                      class: 'btn btn-default share-repo-option', remote: true, id: 'shareRepoBtn' do %>
            <span class="fas fa-user-plus"></span>
            <span class="hidden-xs"><%= t('repositories.index.share_inventory') %></span>
          <% end %>
        <% end %>
      </div>
      <%= render partial: "columns_reorder_dropdown", formats: :html %>
    </div>

    <div class="repository-cog dropdown">
        <button id="repository-acitons-dropdown"
                class="btn btn-default"
                type="button"
                data-toggle="dropdown"
                aria-haspopup="true"
                aria-expanded="true"
                <%= "disabled" unless can_perform_repository_actions(@repository) %>>
          <span class="fas fa-pencil-alt"></span>
          <span class="hidden-xs"><%= t('repositories.index.edit_inventory') %></span>
          <span class="caret"></span>
        </button>

        <% if can_perform_repository_actions(@repository) %>
          <ul class="dropdown-menu pull-right">
            <% if can_create_repository_columns?(@repository) %>
              <li>
                <%= link_to t('repositories.index.options_dropdown.manage_columns'),
                            repository_repository_columns_path(@repository) %>
              </li>
            <% end %>
            <% if can_create_repository_rows?(@repository) %>
            <li>
              <a href="#" id="importRecordsButton" data-turbolinks="false">
                <%= t('repositories.index.options_dropdown.import_items') %>
              </a>
            <li>
            <% end %>
            <% if can_read_repository?(@repository) %>
            <li>
              <a href="#"  id="exportRepositoriesButton" data-turbolinks="false">
                <%= t("repositories.index.options_dropdown.export_items") %>
              </a>
            </li>
            <% end %>
            <% if can_create_repositories?(current_team) && !@repository.shared_with?(current_team) %>
              <li>
                <%= link_to t('repositories.index.options_dropdown.copy'),
                            team_repository_copy_modal_path(current_team, repository_id: @repository),
                            class: "copy-repo-option",
                            remote: true %>
              </li>
            <% end %>
            <% if can_manage_repository?(@repository) %>
              <li data-hook="destroy-repository-option" role="separator" class="divider"></li>
              <li data-hook="destroy-repository-option">
                <%= link_to t('repositories.index.options_dropdown.delete'),
                            team_repository_destroy_modal_path(current_team, repository_id: @repository),
                            class: "delete-repo-option",
                            remote: true %>
              </li>
            <% end %>
          </ul>
        <% end %>
    </div>
  </div>

  <!-- These buttons are appended to table in javascript, after table initialization -->
  <div class="toolbarButtonsDatatable" style="display:none">

    <% if can_create_repository_rows?(@repository) %>
      <button type="button" class="btn btn-primary editAdd help_tooltips"
              id="addRepositoryRecord" onclick="onClickAddRecord()"
              data-tooltiplink="<%= I18n.t('tooltips.link.inventory.new') %>"
              data-tooltipcontent="<%= I18n.t('tooltips.text.inventory.new') %>">
        <span class="fas fa-plus"></span>
        <span class="hidden-xs"><%= t("repositories.add_new_record") %></span>
      </button>
    <% end %>

    <% if can_manage_repository_rows?(@repository) %>
      <span id="editDeleteCopy" data-toggle="buttons" style="display:none">
        <%if @display_edit_button %>
          <button type="button" class="btn btn-default editAdd" id="editRepositoryRecord" onclick="onClickEdit()" disabled>
            <span class="fas fa-pencil-alt"></span>
            <span class="hidden-xs-custom"><%= t("repositories.edit_record") %></span>
          </button>
        <% end %>

        <%if @display_delete_button %>
          <button type="button" class="btn btn-default"
            id="deleteRepositoryRecordsButton" onclick="onClickDelete()" disabled>
            <span class="fas fa-trash"></span>
            <span class="hidden-xs-custom"><%= t'repositories.delete_record' %></span>
            <%= submit_tag I18n.t('repositories.delete_record'), :class => "hidden delete_repository_records_submit" %>
          </button>
        <% end %>

        <%if @display_duplicate_button %>
          <button type="button" class="btn btn-default copyRow" id="copyRepositoryRecords" onclick="onClickCopyRepositoryRecords()" disabled>
            <span class="fas fa-copy"></span>
            <span class="hidden-xs-custom"><%= t("repositories.copy_record") %></span>
          </button>
        <%end%>
      </span>

      <span id="saveCancel" data-toggle="buttons" style="display:none">
        <button type="button" class="btn btn-success" id="saveRecord">
          <span class="fas fa-save"></span>
          <%= t("repositories.save_record") %>
        </button>
        <button type="button" class="btn btn-default" id="cancelSave">
          <span class="fas fa-times-circle"></span>
          <%= t("repositories.cancel_save") %>
        </button>
      </span>
    <% elsif @repository.shared_with?(current_team) %>
      <p class="view-only-label"><%= t('repositories.index.view_only_permission_label') %></p>
    <% end %>
  </div>

  <%= render partial: "repositories/repository_table.html.erb",
             locals: {
               repository: @repository,
               repository_index_link: repository_table_index_path(@repository)
             }
  %>
</div>

<%= render partial: 'repositories/import_repository_records_modal.html.erb',
                    locals: { repository: @repository } %>

<%= render partial: "repositories/delete_record_modal.html.erb" %>
<%= render partial: 'repositories/export_repository_modal.html.erb',
           locals: { repository: @repository } %>

<%= javascript_include_tag 'repositories/edit' %>
<%= javascript_include_tag 'repositories/repository_datatable' %>
<%= javascript_include_tag "repositories/show" %>
<%= javascript_include_tag "repositories/index" %>
<%= javascript_pack_tag 'custom/inputmask' %>

<script type="text/javascript" charset="utf-8">
  <%
    js_format = I18n.backend.date_format.dup
    js_format.gsub!(/%-d/, 'D')
    js_format.gsub!(/%d/, 'DD')
    js_format.gsub!(/%-m/, 'M')
    js_format.gsub!(/%m/, 'MM')
    js_format.gsub!(/%b/, 'MMM')
    js_format.gsub!(/%B/, 'MMMM')
    js_format.gsub!('%Y', 'YYYY')
  %>

  var formatJS = "<%= js_format %>"
</script>

{'fraction_non_alphanumeric': 0.1594766619519095, 'fraction_numerical': 0.0011786892975011788, 'mean_word_length': 2.4419878296146043, 'pattern_counts': {'":': 0, '<': 341, '<?xml version=': 0, '>': 345, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '111619', 'n_tokens_mistral': 5242, 'n_tokens_neox': 4855, 'n_words': 812}