scinote-web/app/views/repositories/_repository_table.html.erb

51 lines
2.7 KiB
Text
Raw Normal View History

2017-06-06 23:35:29 +08:00
<div class="repository-table">
<table id="repository-table-<%= repository.id %>" class="table"
2017-06-06 23:35:29 +08:00
data-current-uri="<%= request.original_url %>"
data-repository-id="<%= repository.id %>"
data-source="<%= repository_index_link %>"
data-num-columns="<%= 6 + repository.repository_columns.count %>"
2017-06-06 23:35:29 +08:00
data-create-record="<%= repository_repository_rows_path(repository) %>"
data-delete-record="<%= repository_delete_records_path(repository) %>"
data-copy-records="<%= repository_copy_records_path(repository) %>"
data-direct-upload-url="<%= rails_direct_uploads_url %>"
data-max-dropdown-length="<%= Constants::MODAL_TEXT_MAX_LENGTH %>"
data-repository-columns-ids="<%= repository.available_columns_ids %>"
2017-06-06 23:35:29 +08:00
data-save-text="<%= I18n.t('general.save') %>"
data-edit-text="<%= I18n.t('general.edit') %>"
data-cancel-text="<%= I18n.t('general.cancel') %>"
data-columns-visibility-text="<%= I18n.t('repositories.columns_visibility') %>"
data-columns-delete-text="<%= I18n.t('repositories.columns_delete') %>"
data-available-columns="<%= repository_available_columns_path(repository) %>"
data-columns-changed="<%= I18n.t('repositories.columns_changed') %>"
data-default-order="<%= default_table_order_as_js_array %>"
data-default-table-columns="<%= default_table_columns %>"
data-editable="<%= can_manage_repository_rows?(repository) %>">
2017-06-06 23:35:29 +08:00
<thead>
<tr>
<th id="checkbox"><input name="select_all" value="1" type="checkbox"></th>
<th id="assigned"><%= t("repositories.table.assigned") %></th>
<th id="row-id"><%= t("repositories.table.id") %></th>
2017-06-06 23:35:29 +08:00
<th id="row-name"><%= t("repositories.table.row_name") %></th>
<th id="added-on"><%= t("repositories.table.added_on") %></th>
<th id="added-by"><%= t("repositories.table.added_by") %></th>
<% repository.repository_columns.order(:id).each do |column| %>
<th
class="repository-column"
id="<%= column.id %>"
data-type="<%= column.data_type %>"
<% column.metadata.each do |k, v| %>
<%= "data-metadata-#{k}=#{v}" %>
<% end %>
2019-12-23 21:34:11 +08:00
<%= "data-items-url=#{items_repository_repository_columns_checklist_column_path(repository, column)}" if column.repository_checklist_value? %>
<%= "data-items-url=#{items_repository_repository_columns_list_column_path(repository, column)}" if column.repository_list_value? %>
<%= "data-items-url=#{items_repository_repository_columns_status_column_path(repository, column)}" if column.repository_status_value? %>
>
2017-06-06 23:35:29 +08:00
<%= display_tooltip(column.name) %>
</th>
<% end %>
</tr>
</thead>
<tbody></tbody>
</table>
</div>