<commit_before><% provide(:head_title, t("libraries.show.head_title", library: @repository.name)) %>
<%= stylesheet_link_tag 'datatables' %>

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

<div id="repository-toolbar">

  <% if can_create_repository_rows?(@repository.team) %>
    <button type="button" class="btn btn-default editAdd" id="addRepositoryRecord" onclick="onClickAddRecord()">
      <span class="glyphicon glyphicon-plus"></span>
      <span class="hidden-xs"><%= t("repositories.add_new_record") %></span>
    </button>
    <button type="button" class="btn btn-default" id="importRecordsButton">
      <span class="glyphicon glyphicon-cloud-upload"></span>
      <span class="hidden-xs"><%= t('repositories.import_records.import') %></span>
    </button>
  <% end %>

  <% if can_read_team?(@repository.team) %>
    <a href="#" class="btn btn-default" id="exportRepositoriesButton" data-turbolinks="false">
      <span class="glyphicon glyphicon-cloud-download"></span>
      <span class="hidden-xs"><%= t("my_modules.repository.export") %></span>
    </a>
  <% end %>

  <div class="repository-cog">
    <div class="dropdown">
      <div class="btn btn-default"
           type="button"
           data-toggle="dropdown"
           aria-haspopup="true"
           aria-expanded="true"
           <%= "disabled" unless can_manage_repository?(@repository) || can_create_repositories?(@repository.team) %>>
        <span class="glyphicon glyphicon-cog"></span>
        <span class="caret"></span>
      </div>
      <% if can_manage_repository?(@repository) || can_create_repositories?(@repository.team) %>
        <ul class="dropdown-menu pull-right">
          <li class="dropdown-header">
            <%= t("repositories.index.options_dropdown.header") %>
          </li>
          <% if can_manage_repository?(@repository) %>
            <li>
              <%= link_to t('repositories.index.options_dropdown.rename'),
                          team_repository_rename_modal_path(current_team, repository_id: @repository),
                          class: "rename-repo-option",
                          remote: true %>
            </li>
            <li>
              <%= link_to t('repositories.index.options_dropdown.manage_columns'),
                          repository_repository_columns_path(@repository) %>
            </li>
          <% end %>
          <% if can_create_repositories?(@repository.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 role="separator" class="divider"></li>
            <li>
              <%= link_to t('repositories.index.modal_delete.delete'),
                          team_repository_destroy_modal_path(current_team, repository_id: @repository),
                          class: "delete-repo-option",
                          remote: true %>
            </li>
          <% end %>
        </ul>
      <% end %>
    </div>
  </div>


  <div id="datatables-buttons" style="display: inline;">
    <div class="new-repository-button">
      <% if can_create_repositories?(@repository.team) %>
        <%= link_to t('libraries.index.no_libraries.create_new_button'),
                    create_modal_team_repositories_path(@repository.team),
                    class: "btn btn-default",
                    id: "create-new-repository",
                    remote: true %>
      <% end %>
    </div>

    <div id="repository-columns-dropdown" class="dropdown">
      <button class="btn btn-default dropdown-toggle" type="button" data-toggle="dropdown">
        <%= t('repositories.columns') %>
        <span class="caret"></span>
      </button>
      <ul class="dropdown-menu dropdown-menu-right smart-dropdown" id="repository-columns-list">
        <% if can_create_repository_columns?(@repository.team) %>
          <li class="add-new-column-form">
            <div id="new-column-form" class="form-group" data-action="<%= repository_repository_columns_path(@repository) %>">
              <div class="input-group">
                <input class="form-control" id="new-column-name" placeholder="<%= t("repositories.column_new_text") %>">
                <span class="input-group-btn">
                  <a id="add-new-column-button" class="btn btn-primary">
                    <%= t("repositories.column_create") %>
                  </a>
                </span>
              </div>
            </div>
          </li>
        <% end %>
      </ul>
    </div>
  </div>
</div>

<div class="btn-group inline" id="saveCancel" data-toggle="buttons" style="display:none">
  <button type="button" class="btn btn-primary" id="saveRecord" onclick="onClickSave()">
    <span class="glyphicon glyphicon-save"></span>
    <%= t("repositories.save_record") %>
  </button>
  <button type="button" class="btn btn-default" id="cancelSave" onclick="onClickCancel()">
    <span class="glyphicon glyphicon-remove visible-xs-inline"></span>
    <span class="hidden-xs"><%= t("repositories.cancel_save") %></span>
  </button>
</div>

<!-- These buttons are appended to table in javascript, after table initialization -->
<div class="toolbarButtons" style="display:none">
  <button type="button" class="btn btn-default editAdd" id="editRepositoryRecord" onclick="onClickEdit()" disabled>
    <span class="glyphicon glyphicon-pencil"></span>
    <span class="hidden-xs-custom"><%= t("repositories.edit_record") %></span>
  </button>

  <% if can_manage_repository_rows?(@repository.team) %>
    <button type="button" class="btn btn-default"
      id="deleteRepositoryRecordsButton" data-target="#deleteRepositoryRecord" data-toggle="modal" disabled>
      <span class="glyphicon glyphicon-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 %>
</div>

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

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

<%= javascript_include_tag 'repositories/edit', 'data-turbolinks-track' => true %><commit_msg>remove destroy column modal<commit_after><% provide(:head_title, t("libraries.show.head_title", library: @repository.name)) %>
<%= stylesheet_link_tag 'datatables' %>

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

<div id="repository-toolbar">

  <% if can_create_repository_rows?(@repository.team) %>
    <button type="button" class="btn btn-default editAdd" id="addRepositoryRecord" onclick="onClickAddRecord()">
      <span class="glyphicon glyphicon-plus"></span>
      <span class="hidden-xs"><%= t("repositories.add_new_record") %></span>
    </button>
    <button type="button" class="btn btn-default" id="importRecordsButton">
      <span class="glyphicon glyphicon-cloud-upload"></span>
      <span class="hidden-xs"><%= t('repositories.import_records.import') %></span>
    </button>
  <% end %>

  <% if can_read_team?(@repository.team) %>
    <a href="#" class="btn btn-default" id="exportRepositoriesButton" data-turbolinks="false">
      <span class="glyphicon glyphicon-cloud-download"></span>
      <span class="hidden-xs"><%= t("my_modules.repository.export") %></span>
    </a>
  <% end %>

  <div class="repository-cog">
    <div class="dropdown">
      <div class="btn btn-default"
           type="button"
           data-toggle="dropdown"
           aria-haspopup="true"
           aria-expanded="true"
           <%= "disabled" unless can_manage_repository?(@repository) || can_create_repositories?(@repository.team) %>>
        <span class="glyphicon glyphicon-cog"></span>
        <span class="caret"></span>
      </div>
      <% if can_manage_repository?(@repository) || can_create_repositories?(@repository.team) %>
        <ul class="dropdown-menu pull-right">
          <li class="dropdown-header">
            <%= t("repositories.index.options_dropdown.header") %>
          </li>
          <% if can_manage_repository?(@repository) %>
            <li>
              <%= link_to t('repositories.index.options_dropdown.rename'),
                          team_repository_rename_modal_path(current_team, repository_id: @repository),
                          class: "rename-repo-option",
                          remote: true %>
            </li>
            <li>
              <%= link_to t('repositories.index.options_dropdown.manage_columns'),
                          repository_repository_columns_path(@repository) %>
            </li>
          <% end %>
          <% if can_create_repositories?(@repository.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 role="separator" class="divider"></li>
            <li>
              <%= link_to t('repositories.index.modal_delete.delete'),
                          team_repository_destroy_modal_path(current_team, repository_id: @repository),
                          class: "delete-repo-option",
                          remote: true %>
            </li>
          <% end %>
        </ul>
      <% end %>
    </div>
  </div>


  <div id="datatables-buttons" style="display: inline;">
    <div class="new-repository-button">
      <% if can_create_repositories?(@repository.team) %>
        <%= link_to t('libraries.index.no_libraries.create_new_button'),
                    create_modal_team_repositories_path(@repository.team),
                    class: "btn btn-default",
                    id: "create-new-repository",
                    remote: true %>
      <% end %>
    </div>

    <div id="repository-columns-dropdown" class="dropdown">
      <button class="btn btn-default dropdown-toggle" type="button" data-toggle="dropdown">
        <%= t('repositories.columns') %>
        <span class="caret"></span>
      </button>
      <ul class="dropdown-menu dropdown-menu-right smart-dropdown" id="repository-columns-list">
        <% if can_create_repository_columns?(@repository.team) %>
          <li class="add-new-column-form">
            <div id="new-column-form" class="form-group" data-action="<%= repository_repository_columns_path(@repository) %>">
              <div class="input-group">
                <input class="form-control" id="new-column-name" placeholder="<%= t("repositories.column_new_text") %>">
                <span class="input-group-btn">
                  <a id="add-new-column-button" class="btn btn-primary">
                    <%= t("repositories.column_create") %>
                  </a>
                </span>
              </div>
            </div>
          </li>
        <% end %>
      </ul>
    </div>
  </div>
</div>

<div class="btn-group inline" id="saveCancel" data-toggle="buttons" style="display:none">
  <button type="button" class="btn btn-primary" id="saveRecord" onclick="onClickSave()">
    <span class="glyphicon glyphicon-save"></span>
    <%= t("repositories.save_record") %>
  </button>
  <button type="button" class="btn btn-default" id="cancelSave" onclick="onClickCancel()">
    <span class="glyphicon glyphicon-remove visible-xs-inline"></span>
    <span class="hidden-xs"><%= t("repositories.cancel_save") %></span>
  </button>
</div>

<!-- These buttons are appended to table in javascript, after table initialization -->
<div class="toolbarButtons" style="display:none">
  <button type="button" class="btn btn-default editAdd" id="editRepositoryRecord" onclick="onClickEdit()" disabled>
    <span class="glyphicon glyphicon-pencil"></span>
    <span class="hidden-xs-custom"><%= t("repositories.edit_record") %></span>
  </button>

  <% if can_manage_repository_rows?(@repository.team) %>
    <button type="button" class="btn btn-default"
      id="deleteRepositoryRecordsButton" data-target="#deleteRepositoryRecord" data-toggle="modal" disabled>
      <span class="glyphicon glyphicon-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 %>
</div>

<%= render partial: "repositories/repository_table.html.erb",
           locals: {
             repository: @repository,
             repository_index_link: repository_table_index_path(@repository)
           }
%>
<%= 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', 'data-turbolinks-track' => true %>
{'fraction_non_alphanumeric': 0.15997413978880828, 'fraction_numerical': 0.0002873356799080526, 'mean_word_length': 2.7505387931034484, 'pattern_counts': {'":': 0, '<': 286, '<?xml version=': 0, '>': 290, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4806054', 'n_tokens_mistral': 4240, 'n_tokens_neox': 3929, 'n_words': 678}