2018-03-22 16:35:36 +08:00
|
|
|
<% provide(:head_title, t('libraries.repository_columns.head_title', repository: @repository.name)) %>
|
2019-07-11 15:50:39 +08:00
|
|
|
|
2018-05-08 22:33:42 +08:00
|
|
|
<div class="content-pane">
|
2018-03-22 16:35:36 +08:00
|
|
|
<div class="repository-columns-header container">
|
|
|
|
<div class="row">
|
|
|
|
<%= link_to t('libraries.repository_columns.index.back_to_repository_html', repository: @repository.name),
|
2018-04-05 15:56:09 +08:00
|
|
|
repository_path(@repository),
|
2018-04-12 23:09:53 +08:00
|
|
|
data: { no_turbolink: false } %>
|
2018-03-22 16:35:36 +08:00
|
|
|
</div>
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-md-6 text-left page-title">
|
|
|
|
<h2><strong><%=t 'libraries.repository_columns.index.manage_column' %></strong></h2>
|
|
|
|
</div>
|
|
|
|
<div class="col-md-6 text-right">
|
2018-09-14 19:07:09 +08:00
|
|
|
<button class="btn btn-primary help_tooltips"
|
2018-03-23 23:00:33 +08:00
|
|
|
data-modal-url="<%= repository_columns_create_html_path(@repository) %>"
|
2018-08-20 19:03:30 +08:00
|
|
|
data-action="new-column-modal"
|
2018-09-14 19:07:09 +08:00
|
|
|
data-tooltiplink="<%= I18n.t('tooltips.link.inventory.manage_columns') %>"
|
|
|
|
data-tooltipcontent="<%= I18n.t('tooltips.text.inventory.manage_columns') %>">
|
2018-07-09 19:13:44 +08:00
|
|
|
<span class="fas fa-plus"></span> <%=t 'libraries.repository_columns.index.new_column' %>
|
2018-03-22 16:35:36 +08:00
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="repository-columns-body container">
|
|
|
|
<ul class="list-group"
|
|
|
|
data-repository-id="<%= @repository.id %>">
|
|
|
|
<% if @repository_columns.length.zero? %>
|
2018-03-23 23:00:33 +08:00
|
|
|
<li class="list-group-item text-center" data-attr="no-columns">
|
2018-03-22 16:35:36 +08:00
|
|
|
<strong><%=t 'libraries.repository_columns.index.no_column' %></strong>
|
|
|
|
</li>
|
|
|
|
<% else %>
|
|
|
|
<% @repository_columns.each do |column| %>
|
|
|
|
<% cache column do %>
|
2018-06-12 16:22:48 +08:00
|
|
|
<li class="list-group-item row"
|
2018-03-22 16:35:36 +08:00
|
|
|
data-id="<%= column.id %>"
|
2018-03-23 23:00:33 +08:00
|
|
|
data-destroy-url="<%= repository_columns_destroy_html_path(@repository, column) %>"
|
|
|
|
data-edit-url="<%= edit_repository_repository_column_path(@repository, column) %>">
|
2018-06-12 16:22:48 +08:00
|
|
|
<div class="col-xs-8">
|
|
|
|
<span class="pull-left column-name"><%= column.name %></span>
|
|
|
|
</div>
|
|
|
|
<div class="col-xs-4">
|
|
|
|
<span class="controlls pull-right">
|
|
|
|
<button class="btn btn-default" data-action="edit">
|
|
|
|
<span class="fas fa-pencil-alt"></span>
|
|
|
|
<%=t 'libraries.repository_columns.index.edit_column'%>
|
|
|
|
</button>
|
|
|
|
<button class="btn btn-default delete-column" data-action="destroy">
|
2018-07-09 19:13:44 +08:00
|
|
|
<span class="fas fa-trash-alt"></span>
|
2018-06-12 16:22:48 +08:00
|
|
|
<%=t 'libraries.repository_columns.index.delete_column'%>
|
|
|
|
</button>
|
|
|
|
</span>
|
|
|
|
</div>
|
2018-03-22 16:35:36 +08:00
|
|
|
</li>
|
|
|
|
<% end %>
|
|
|
|
<% end %>
|
|
|
|
<% end %>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<%= render partial: 'delete_column_modal' %>
|
2018-07-19 23:56:42 +08:00
|
|
|
<%= javascript_include_tag "repository_columns/index" %>
|