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

38 lines
2 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="<%= 5 + repository.repository_columns.count %>"
data-create-record="<%= repository_repository_rows_path(repository) %>"
data-delete-record="<%= repository_delete_records_path(repository) %>"
data-max-dropdown-length="<%= Constants::NAME_TRUNCATION_LENGTH_DROPDOWN %>"
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') %>">
<thead>
<tr>
<th id="checkbox"><input name="select_all" value="1" type="checkbox"></th>
<th id="assigned"><%= t("repositories.table.assigned") %></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| %>
2017-06-06 23:35:29 +08:00
<th class="repository-column" id="<%= column.id %>"
2017-06-07 23:07:28 +08:00
<%= 'data-editable' if can_edit_column_in_repository(column) %>
<%= 'data-deletable' if can_delete_column_in_repository(column) %>
2017-06-06 23:35:29 +08:00
<%= "data-edit-url='#{edit_repository_repository_column_path(repository, column)}'" %>
<%= "data-update-url='#{repository_repository_column_path(repository, column)}'" %>
<%= "data-destroy-html-url='#{repository_columns_destroy_html_path(repository, column)}'" %>
>
<%= display_tooltip(column.name) %>
</th>
<% end %>
</tr>
</thead>
<tbody></tbody>
</table>
</div>