2018-03-20 21:45:57 +08:00
|
|
|
<% provide(:head_title, t("libraries.index.head_title")) %>
|
2018-05-08 22:33:42 +08:00
|
|
|
<% provide(:container_class, "no-second-nav-container") %>
|
2017-05-22 23:54:30 +08:00
|
|
|
|
|
|
|
<% if current_team %>
|
2021-01-06 17:13:10 +08:00
|
|
|
<% provide(:sidebar_url, sidebar_repositories_path) %>
|
|
|
|
<% provide(:sidebar_title, t('sidebar.repositories.sidebar_title')) %>
|
|
|
|
<%= content_for :sidebar do %>
|
|
|
|
<%= render partial: "sidebar", locals: { repositories: @repositories, archived: params[:archived] } %>
|
|
|
|
<% end %>
|
2020-07-02 20:29:18 +08:00
|
|
|
<div class="content-pane flexible <%= params[:archived] ? :archived : :active %> repositories-index"
|
|
|
|
data-readonly="<%= !current_user.is_admin_of_team?(current_team) %>">
|
2020-06-01 16:24:03 +08:00
|
|
|
<div class="content-header">
|
2021-01-25 22:36:23 +08:00
|
|
|
<div class="title-row">
|
|
|
|
<h1 data-view-mode="active"><%= t('libraries.index.head_title') %></h1>
|
|
|
|
<h1 data-view-mode="archived"><i class="fas fa-archive"></i> <%= t('libraries.index.head_title_archived') %></h1>
|
|
|
|
<%= render layout: "shared/view_switch", locals: { disabled: false } do %>
|
|
|
|
<li class="view-switch-archived" data-view-mode="active">
|
|
|
|
<i class="fas fa-archive button-icon"></i>
|
|
|
|
<%= t('libraries.index.switch_view.archived') %>
|
|
|
|
</li>
|
|
|
|
<li class="view-switch-active" data-view-mode="archived">
|
|
|
|
<i class="fas fa-rocket button-icon"></i>
|
|
|
|
<%= t('libraries.index.switch_view.active') %>
|
|
|
|
</li>
|
|
|
|
<% end %>
|
|
|
|
</div>
|
2020-06-01 16:24:03 +08:00
|
|
|
</div>
|
|
|
|
<div class="content-body">
|
|
|
|
</div>
|
2017-05-24 15:29:44 +08:00
|
|
|
</div>
|
2017-05-22 23:54:30 +08:00
|
|
|
<% end %>
|
2017-05-30 21:09:09 +08:00
|
|
|
|
2020-07-02 20:35:48 +08:00
|
|
|
<!-- table template -->
|
|
|
|
<template id="RepositoriesListTable">
|
2020-06-03 19:42:09 +08:00
|
|
|
<table id="repositoriesList" class="table"
|
2020-07-02 20:29:18 +08:00
|
|
|
data-source="<%= team_repositories_path(current_team, format: :json) %>">
|
2020-06-03 19:42:09 +08:00
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th>
|
|
|
|
<div class="sci-checkbox-container">
|
2020-06-09 19:16:50 +08:00
|
|
|
<input value="1" type="checkbox" class="sci-checkbox select-all-checkbox">
|
2020-06-03 19:42:09 +08:00
|
|
|
<span class="sci-checkbox-label"></span>
|
|
|
|
</div>
|
|
|
|
</th>
|
|
|
|
<th><%= t('libraries.index.table.name') %></th>
|
|
|
|
<th><%= t('libraries.index.table.number_of_items') %></th>
|
|
|
|
<th><%= t('libraries.index.table.shared') %></th>
|
|
|
|
<th><%= t('libraries.index.table.ownership') %></th>
|
|
|
|
<th><%= t('libraries.index.table.added_on') %></th>
|
|
|
|
<th><%= t('libraries.index.table.added_by') %></th>
|
|
|
|
<th><%= t('libraries.index.table.archived_on') %></th>
|
|
|
|
<th><%= t('libraries.index.table.archived_by') %></th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
</table>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<!-- Repositories action buttons -->
|
|
|
|
<template id="repositoriesListButtons">
|
|
|
|
<% if can_create_repositories?(current_team) %>
|
2020-06-19 21:54:45 +08:00
|
|
|
<a id="createRepoBtn" class="btn btn-primary"
|
2020-06-03 19:42:09 +08:00
|
|
|
data-remote="true"
|
|
|
|
data-view-mode="active"
|
|
|
|
href="<%= create_modal_team_repositories_path(current_team) %>">
|
|
|
|
<span class="fas fa-plus"></span>
|
|
|
|
<span class="hidden-xs"><%= t('libraries.index.no_libraries.create_new_button') %></span>
|
|
|
|
</a>
|
|
|
|
<% end %>
|
2020-07-07 19:53:31 +08:00
|
|
|
<a id="renameRepoBtn" class="btn btn-light disabled hidden" data-view-mode="active" href="#" data-action-mode="single" data-remote="true">
|
2020-06-03 19:42:09 +08:00
|
|
|
<span class="fas fa-pencil-alt"></span>
|
|
|
|
<%= t('libraries.index.buttons.edit') %>
|
|
|
|
</a>
|
2020-07-08 19:42:27 +08:00
|
|
|
<% if can_create_repositories?(current_team) %>
|
2020-07-09 17:46:54 +08:00
|
|
|
<a id="copyRepoBtn" class="btn btn-light disabled hidden" data-view-mode="active" href="#" data-action-mode="single" data-remote="true">
|
2020-07-08 19:42:27 +08:00
|
|
|
<span class="fas fa-copy"></span>
|
|
|
|
<%= t('libraries.index.buttons.duplicate') %>
|
|
|
|
</a>
|
|
|
|
<% end %>
|
2020-06-19 00:07:23 +08:00
|
|
|
<a id="archiveRepoBtn"
|
2020-07-07 19:53:31 +08:00
|
|
|
class="btn btn-light disabled hidden"
|
2020-06-19 00:07:23 +08:00
|
|
|
data-view-mode="active"
|
2020-06-19 21:54:45 +08:00
|
|
|
data-action-mode="multiple"
|
2020-06-19 00:07:23 +08:00
|
|
|
data-archive-repositories="<%= archive_team_repositories_path(current_team) %>">
|
2020-06-03 19:42:09 +08:00
|
|
|
<span class="fas fa-archive"></span>
|
|
|
|
<%= t('libraries.index.buttons.archive') %>
|
|
|
|
</a>
|
2020-06-19 00:07:23 +08:00
|
|
|
<a id="restoreRepoBtn"
|
2020-07-07 19:53:31 +08:00
|
|
|
class="btn btn-light disabled hidden"
|
2020-06-19 00:07:23 +08:00
|
|
|
data-view-mode="archived"
|
2020-06-19 21:54:45 +08:00
|
|
|
data-action-mode="multiple"
|
2020-06-19 00:07:23 +08:00
|
|
|
data-restore-repositories="<%= restore_team_repositories_path(current_team) %>">
|
2020-06-03 19:42:09 +08:00
|
|
|
<span class="fas fa-undo"></span>
|
|
|
|
<%= t('libraries.index.buttons.restore') %>
|
|
|
|
</a>
|
2020-07-07 19:53:31 +08:00
|
|
|
<a id="deleteRepoBtn" class="btn btn-light disabled hidden" data-view-mode="archived" href="#" data-action-mode="single" data-remote="true">
|
2020-06-03 19:42:09 +08:00
|
|
|
<span class="fas fa-trash"></span>
|
|
|
|
<%= t('libraries.index.buttons.delete') %>
|
|
|
|
</a>
|
|
|
|
</template>
|
|
|
|
|
2018-07-19 23:56:42 +08:00
|
|
|
<%= javascript_include_tag "repositories/index" %>
|
2020-06-01 16:24:03 +08:00
|
|
|
<%= stylesheet_link_tag 'datatables' %>
|