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
|
|
|
|
2018-03-21 16:22:55 +08:00
|
|
|
<%= render partial: "sidebar", locals: { repositories: @repositories } %>
|
2017-06-06 23:35:29 +08:00
|
|
|
<div id="alert-container"></div>
|
|
|
|
|
2018-05-08 22:33:42 +08:00
|
|
|
<div class="content-pane">
|
|
|
|
<div id="repository-toolbar">
|
2017-06-06 23:35:29 +08:00
|
|
|
|
2018-05-08 22:33:42 +08:00
|
|
|
<% if can_create_repository_rows?(@repository.team) %>
|
2018-09-14 19:07:09 +08:00
|
|
|
<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') %>">
|
2018-07-09 19:13:44 +08:00
|
|
|
<span class="fas fa-plus"></span>
|
2018-05-08 22:33:42 +08:00
|
|
|
<span class="hidden-xs"><%= t("repositories.add_new_record") %></span>
|
|
|
|
</button>
|
|
|
|
<% end %>
|
2017-06-06 22:12:34 +08:00
|
|
|
|
2018-06-15 17:37:01 +08:00
|
|
|
<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) %>>
|
2018-05-22 22:55:58 +08:00
|
|
|
<span class="fas fa-ellipsis-v"></span>
|
2018-05-08 22:33:42 +08:00
|
|
|
<span class="hidden-xs"><%= t('repositories.index.advanced') %></span>
|
|
|
|
<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">
|
|
|
|
<li class="dropdown-header">
|
|
|
|
<%= t("repositories.index.options_dropdown.header") %>
|
2018-01-05 18:17:01 +08:00
|
|
|
</li>
|
2018-05-08 22:33:42 +08:00
|
|
|
<% if can_create_repository_columns?(@repository.team) %>
|
|
|
|
<li>
|
|
|
|
<%= link_to t('repositories.index.options_dropdown.manage_columns'),
|
|
|
|
repository_repository_columns_path(@repository) %>
|
|
|
|
</li>
|
|
|
|
<% end %>
|
|
|
|
<% if can_create_repository_rows?(@repository.team) %>
|
2018-03-29 23:10:57 +08:00
|
|
|
<li>
|
2018-05-08 22:33:42 +08:00
|
|
|
<a href="#" id="importRecordsButton" data-turbolinks="false">
|
2018-05-15 00:33:57 +08:00
|
|
|
<%= t('repositories.index.options_dropdown.import_items') %>
|
2018-05-08 22:33:42 +08:00
|
|
|
</a>
|
2017-06-16 17:52:26 +08:00
|
|
|
<li>
|
2018-05-08 22:33:42 +08:00
|
|
|
<% end %>
|
|
|
|
<% if can_read_team?(@repository.team) %>
|
2018-01-05 18:17:01 +08:00
|
|
|
<li>
|
2018-05-08 22:33:42 +08:00
|
|
|
<a href="#" id="exportRepositoriesButton" data-turbolinks="false">
|
2018-05-15 00:33:57 +08:00
|
|
|
<%= t("repositories.index.options_dropdown.export_items") %>
|
2018-05-08 22:33:42 +08:00
|
|
|
</a>
|
2018-01-05 18:17:01 +08:00
|
|
|
</li>
|
2018-05-08 22:33:42 +08:00
|
|
|
<% end %>
|
2018-05-15 00:33:57 +08:00
|
|
|
<% 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>
|
|
|
|
<% 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 %>
|
2018-05-08 22:33:42 +08:00
|
|
|
<% if can_manage_repository?(@repository) %>
|
2018-06-07 16:50:48 +08:00
|
|
|
<li data-hook="destroy-repository-option" role="separator" class="divider"></li>
|
|
|
|
<li 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 %>
|
2017-06-16 17:52:26 +08:00
|
|
|
</div>
|
|
|
|
|
2018-03-21 16:22:55 +08:00
|
|
|
|
2018-05-08 22:33:42 +08:00
|
|
|
<div id="datatables-buttons" style="display: inline;">
|
|
|
|
<div class="new-repository-button">
|
|
|
|
<% if can_create_repositories?(@repository.team) %>
|
|
|
|
<a class="btn btn-default"
|
|
|
|
id="create-new-repository"
|
|
|
|
data-remote="true"
|
|
|
|
href="<%= create_modal_team_repositories_path(@repository.team) %>">
|
2018-07-09 19:13:44 +08:00
|
|
|
<span class="fas fa-plus"></span>
|
2018-05-08 22:33:42 +08:00
|
|
|
<span class="hidden-xs"><%= t('libraries.index.no_libraries.create_new_button') %></span>
|
|
|
|
</a>
|
|
|
|
<% end %>
|
|
|
|
</div>
|
|
|
|
<%= render partial: "columns_reorder_dropdown", formats: :html %>
|
2018-03-21 16:22:55 +08:00
|
|
|
</div>
|
2017-06-06 23:35:29 +08:00
|
|
|
</div>
|
|
|
|
|
2018-05-08 22:33:42 +08:00
|
|
|
<div class="btn-group inline" id="saveCancel" data-toggle="buttons" style="display:none">
|
|
|
|
<button type="button" class="btn btn-success" id="saveRecord" onclick="onClickSave()">
|
2018-07-09 19:13:44 +08:00
|
|
|
<span class="fas fa-save"></span>
|
2018-05-08 22:33:42 +08:00
|
|
|
<%= t("repositories.save_record") %>
|
2018-03-09 23:19:36 +08:00
|
|
|
</button>
|
2018-05-08 22:33:42 +08:00
|
|
|
<button type="button" class="btn btn-default" id="cancelSave" onclick="onClickCancel()">
|
2018-07-09 19:13:44 +08:00
|
|
|
<span class="fas fa-times visible-xs-inline"></span>
|
2018-05-08 22:33:42 +08:00
|
|
|
<span class="hidden-xs"><%= t("repositories.cancel_save") %></span>
|
2018-04-11 23:17:19 +08:00
|
|
|
</button>
|
2018-05-08 22:33:42 +08:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<!-- These buttons are appended to table in javascript, after table initialization -->
|
|
|
|
<div class="toolbarButtons" style="display:none">
|
|
|
|
<% if can_manage_repository_rows?(@repository.team) %>
|
|
|
|
<button type="button" class="btn btn-default editAdd" id="editRepositoryRecord" onclick="onClickEdit()" disabled>
|
2018-05-22 22:55:58 +08:00
|
|
|
<span class="fas fa-pencil-alt"></span>
|
2018-05-08 22:33:42 +08:00
|
|
|
<span class="hidden-xs-custom"><%= t("repositories.edit_record") %></span>
|
|
|
|
</button>
|
|
|
|
<button type="button" class="btn btn-default"
|
2018-07-09 03:59:02 +08:00
|
|
|
id="deleteRepositoryRecordsButton" onclick="onClickDelete()" disabled>
|
2018-07-09 19:13:44 +08:00
|
|
|
<span class="fas fa-trash-alt"></span>
|
2018-05-08 22:33:42 +08:00
|
|
|
<span class="hidden-xs-custom"><%= t'repositories.delete_record' %></span>
|
|
|
|
<%= submit_tag I18n.t('repositories.delete_record'), :class => "hidden
|
|
|
|
delete_repository_records_submit" %>
|
|
|
|
</button>
|
|
|
|
<button type="button" class="btn btn-default copyRow" id="copyRepositoryRecords" onclick="onClickCopyRepositoryRecords()" disabled>
|
2018-07-09 19:13:44 +08:00
|
|
|
<span class="fas fa-copy"></span>
|
2018-05-08 22:33:42 +08:00
|
|
|
<span class="hidden-xs-custom"><%= t("repositories.copy_record") %></span>
|
|
|
|
</button>
|
|
|
|
<% end %>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<%= 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
|
|
|
|
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" %>
|
|
|
|
<%= javascript_include_tag "repositories/index" %>
|