2018-07-19 23:56:42 +08:00
|
|
|
<% content_for :head do %>
|
|
|
|
<meta name="turbolinks-cache-control" content="no-cache">
|
|
|
|
<% end %>
|
|
|
|
|
2018-03-20 21:45:57 +08:00
|
|
|
<% provide(:head_title, t("libraries.show.head_title", library: @repository.name)) %>
|
2018-03-21 16:22:55 +08:00
|
|
|
<%= stylesheet_link_tag 'datatables' %>
|
2018-05-08 22:33:42 +08:00
|
|
|
<% provide(:container_class, "no-second-nav-container") %>
|
2017-06-06 23:35:29 +08:00
|
|
|
|
2020-06-17 20:05:23 +08:00
|
|
|
<%= render partial: "sidebar", locals: { repositories: @repositories, archived: @repository.archived? } %>
|
2017-06-06 23:35:29 +08:00
|
|
|
<div id="alert-container"></div>
|
|
|
|
|
2020-06-17 20:05:23 +08:00
|
|
|
<div class="content-pane repository-show <%= @repository.active? ? "active" : "archived" %>" data-table-url="<%= load_table_repository_path(@repository) %>">
|
2020-06-15 19:49:44 +08:00
|
|
|
<div id="repository-toolbar" class="content-header">
|
2020-06-17 20:05:23 +08:00
|
|
|
<% if @repository.active? %>
|
|
|
|
<div class="repository-title-name" data-view-mode="active">
|
2020-07-08 19:02:47 +08:00
|
|
|
<h1 class="name-container">
|
2020-06-17 20:05:23 +08:00
|
|
|
<% 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 %>
|
2020-07-08 19:02:47 +08:00
|
|
|
</h1>
|
2020-06-17 20:05:23 +08:00
|
|
|
<% if @repository.shared_with_anybody? %>
|
|
|
|
<% team_name = @repository.team == current_team ? t('repositories.show.your_team') : @repository.team.name %>
|
|
|
|
<div class="repository-subtitle"><%= t('repositories.show.subtitle', team_name: team_name) %></div>
|
2019-09-02 16:30:29 +08:00
|
|
|
<% end %>
|
2020-06-17 20:05:23 +08:00
|
|
|
</div>
|
|
|
|
<% end %>
|
2020-06-15 21:52:50 +08:00
|
|
|
<div class="repository-archived-title-name" data-view-mode="archived">
|
2020-07-08 19:42:27 +08:00
|
|
|
<% if @repository.archived? %>
|
2020-07-09 17:34:09 +08:00
|
|
|
<i class="fas fa-archive"></i>
|
2020-07-08 19:42:27 +08:00
|
|
|
<%= t('repositories.show.archived_inventory', repository_name: @repository.name) %>
|
|
|
|
<% else %>
|
|
|
|
<%= t('repositories.show.archived_inventory_items', repository_name: @repository.name) %>
|
|
|
|
<% end %>
|
2020-06-15 21:52:50 +08:00
|
|
|
</div>
|
2020-01-14 18:13:19 +08:00
|
|
|
<div class="repo-datatables-buttons">
|
2020-06-15 21:52:50 +08:00
|
|
|
<div class="share-repository-button" data-view-mode="active">
|
2019-08-23 17:29:03 +08:00
|
|
|
<% if can_share_repository?(@repository) && current_user.teams.count > 1 %>
|
2019-08-05 19:07:29 +08:00
|
|
|
<%= link_to team_repository_share_modal_path(current_team, repository_id: @repository),
|
2020-02-03 01:52:40 +08:00
|
|
|
class: 'btn btn-secondary share-repo-option', remote: true, id: 'shareRepoBtn' do %>
|
2019-07-29 22:39:23 +08:00
|
|
|
<span class="fas fa-user-plus"></span>
|
|
|
|
<span class="hidden-xs"><%= t('repositories.index.share_inventory') %></span>
|
2019-08-05 19:07:29 +08:00
|
|
|
<% end %>
|
2019-07-29 22:39:23 +08:00
|
|
|
<% end %>
|
|
|
|
</div>
|
2020-01-14 18:13:19 +08:00
|
|
|
|
2020-04-28 18:30:43 +08:00
|
|
|
<button class="btn btn-secondary manage-repo-column-index"
|
2020-05-28 18:18:46 +08:00
|
|
|
data-modal-url="<%= repository_repository_columns_path(@repository) %>"
|
2020-04-28 18:30:43 +08:00
|
|
|
data-action="new">
|
2020-01-14 18:13:19 +08:00
|
|
|
<span class="fas fa-wrench"></span> <%= t('repositories.index.columns') %>
|
|
|
|
</button>
|
2017-06-06 22:12:34 +08:00
|
|
|
|
2020-01-29 21:15:47 +08:00
|
|
|
<div class="repository-cog dropdown">
|
2018-06-15 17:37:01 +08:00
|
|
|
<button id="repository-acitons-dropdown"
|
2020-01-16 22:59:57 +08:00
|
|
|
class="btn btn-secondary"
|
2018-06-15 17:37:01 +08:00
|
|
|
type="button"
|
|
|
|
data-toggle="dropdown"
|
|
|
|
aria-haspopup="true"
|
|
|
|
aria-expanded="true"
|
|
|
|
<%= "disabled" unless can_perform_repository_actions(@repository) %>>
|
2019-07-29 22:39:23 +08:00
|
|
|
<span class="fas fa-pencil-alt"></span>
|
|
|
|
<span class="hidden-xs"><%= t('repositories.index.edit_inventory') %></span>
|
2018-05-08 22:33:42 +08:00
|
|
|
<span class="caret"></span>
|
2018-06-15 17:37:01 +08:00
|
|
|
</button>
|
2018-04-13 19:11:29 +08:00
|
|
|
|
2018-05-08 22:33:42 +08:00
|
|
|
<% if can_perform_repository_actions(@repository) %>
|
|
|
|
<ul class="dropdown-menu pull-right">
|
2019-07-12 22:43:54 +08:00
|
|
|
<% if can_create_repository_rows?(@repository) %>
|
2020-06-15 21:52:50 +08:00
|
|
|
<li data-view-mode="active">
|
2020-01-29 21:15:47 +08:00
|
|
|
<a href="#" id="importRecordsButton" data-turbolinks="false">
|
|
|
|
<%= t('repositories.index.options_dropdown.import_items') %>
|
|
|
|
</a>
|
2020-06-15 21:52:50 +08:00
|
|
|
</li>
|
2018-05-08 22:33:42 +08:00
|
|
|
<% end %>
|
2019-07-17 22:00:49 +08:00
|
|
|
<% if can_read_repository?(@repository) %>
|
2020-06-15 21:52:50 +08:00
|
|
|
<li >
|
2020-01-29 21:15:47 +08:00
|
|
|
<a href="#" id="exportRepositoriesButton" data-turbolinks="false">
|
|
|
|
<%= t("repositories.index.options_dropdown.export_items") %>
|
|
|
|
</a>
|
|
|
|
</li>
|
2018-05-08 22:33:42 +08:00
|
|
|
<% end %>
|
2019-08-29 19:39:22 +08:00
|
|
|
<% if can_create_repositories?(current_team) && !@repository.shared_with?(current_team) %>
|
2020-06-15 21:52:50 +08:00
|
|
|
<li data-view-mode="active">
|
2018-05-15 00:33:57 +08:00
|
|
|
<%= 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 %>
|
2020-06-24 17:32:20 +08:00
|
|
|
<% if can_archive_repository?(@repository) %>
|
|
|
|
<li data-view-mode="active" role="separator" class="divider"></li>
|
|
|
|
<li data-view-mode="active">
|
2020-06-24 04:59:21 +08:00
|
|
|
<%= link_to t('repositories.index.options_dropdown.archive'),
|
2020-06-24 17:32:20 +08:00
|
|
|
archive_team_repositories_path(current_team),
|
2020-06-24 04:59:21 +08:00
|
|
|
class: "archive-repository-option",
|
2020-06-24 17:32:20 +08:00
|
|
|
data: { repository_id: @repository.id } %>
|
2020-06-24 04:59:21 +08:00
|
|
|
</li>
|
2020-07-08 19:42:27 +08:00
|
|
|
<% if @repository.archived? %>
|
|
|
|
<li data-view-mode="archived">
|
|
|
|
<%= link_to t('repositories.index.options_dropdown.restore'),
|
|
|
|
restore_team_repositories_path(current_team),
|
|
|
|
class: "archive-repository-option",
|
|
|
|
data: { repository_id: @repository.id } %>
|
|
|
|
</li>
|
|
|
|
<% end %>
|
2020-06-24 17:32:20 +08:00
|
|
|
<% end %>
|
2020-07-08 19:42:27 +08:00
|
|
|
<% if can_manage_repository?(@repository) && @repository.archived? %>
|
2020-06-24 04:59:21 +08:00
|
|
|
<li data-view-mode="archived" data-hook="destroy-repository-option">
|
2018-05-15 00:33:57 +08:00
|
|
|
<%= link_to t('repositories.index.options_dropdown.delete'),
|
2018-05-08 22:33:42 +08:00
|
|
|
team_repository_destroy_modal_path(current_team, repository_id: @repository),
|
|
|
|
class: "delete-repo-option",
|
|
|
|
remote: true %>
|
|
|
|
</li>
|
|
|
|
<% end %>
|
|
|
|
</ul>
|
|
|
|
<% end %>
|
2020-01-29 21:15:47 +08:00
|
|
|
</div>
|
2020-06-17 20:05:23 +08:00
|
|
|
<%= render layout: "shared/view_switch", locals: {disabled: @repository.archived?} do %>
|
|
|
|
<li class="view-switch-archived" data-view-mode="active">
|
|
|
|
<i class="fas fa-archive button-icon"></i>
|
|
|
|
<%= t('repositories.show.show_archived_items') %>
|
|
|
|
</li>
|
|
|
|
<li class="view-switch-active" data-view-mode="archived">
|
|
|
|
<i class="fas fa-rocket button-icon"></i>
|
|
|
|
<%= t('repositories.show.show_active_items') %>
|
|
|
|
</li>
|
|
|
|
<% end %>
|
2017-06-16 17:52:26 +08:00
|
|
|
</div>
|
2020-01-29 21:15:47 +08:00
|
|
|
|
2020-01-13 21:46:43 +08:00
|
|
|
<div class="toolbar-delimiter"></div>
|
2017-06-06 23:35:29 +08:00
|
|
|
</div>
|
2019-08-26 14:56:46 +08:00
|
|
|
|
2018-05-08 22:33:42 +08:00
|
|
|
<!-- These buttons are appended to table in javascript, after table initialization -->
|
2020-01-28 21:11:11 +08:00
|
|
|
<div class="toolbar-filter-buttons" style="display:none">
|
|
|
|
</div>
|
|
|
|
|
2018-05-08 22:33:42 +08:00
|
|
|
<%= render partial: "repositories/repository_table.html.erb",
|
|
|
|
locals: {
|
|
|
|
repository: @repository,
|
|
|
|
repository_index_link: repository_table_index_path(@repository)
|
|
|
|
}
|
|
|
|
%>
|
2017-06-06 23:35:29 +08:00
|
|
|
</div>
|
|
|
|
|
2017-06-21 23:39:20 +08:00
|
|
|
<%= render partial: 'repositories/import_repository_records_modal.html.erb',
|
2018-03-20 21:45:57 +08:00
|
|
|
locals: { repository: @repository } %>
|
|
|
|
|
2018-03-21 16:22:55 +08:00
|
|
|
<%= render partial: "repositories/delete_record_modal.html.erb" %>
|
|
|
|
<%= render partial: 'repositories/export_repository_modal.html.erb',
|
|
|
|
locals: { repository: @repository } %>
|
2018-03-20 21:45:57 +08:00
|
|
|
|
2020-01-18 00:28:08 +08:00
|
|
|
<%= render partial: 'repository_columns/manage_column_modal.html.erb', locals: { my_module_page: false } %>
|
2020-01-14 18:13:19 +08:00
|
|
|
|
2018-07-19 23:56:42 +08:00
|
|
|
<%= javascript_include_tag 'repositories/edit' %>
|
2018-03-20 21:45:57 +08:00
|
|
|
<%= javascript_include_tag 'repositories/repository_datatable' %>
|
2018-07-19 23:56:42 +08:00
|
|
|
<%= javascript_include_tag "repositories/show" %>
|
2019-12-11 16:26:38 +08:00
|
|
|
<%= javascript_pack_tag 'custom/inputmask' %>
|
2020-01-21 18:43:04 +08:00
|
|
|
<%= javascript_pack_tag 'emoji_button' %>
|
2019-12-16 22:21:50 +08:00
|
|
|
|
|
|
|
<script type="text/javascript" charset="utf-8">
|
2020-03-28 00:35:24 +08:00
|
|
|
var formatJS = "<%= datetime_picker_format_date_only %>"
|
2019-12-16 22:21:50 +08:00
|
|
|
</script>
|