universal_table/app/views/admin/universal_tables/_index.html.erb

48 lines
2.0 KiB
Plaintext
Raw Permalink Normal View History

2015-11-13 13:10:00 +00:00
<table class="table main-list">
<thead>
<tr class="sort-header">
<% @table_fields.each do |f| %>
<%= thead(f) %>
<% end %>
</tr>
</thead>
<tbody>
<% @tables.each do |table| %>
2019-03-09 05:28:52 +00:00
<% can_edit = can_edit_or_delete?(table) %>
<tr id="table_<%= table.id.to_s %>">
2015-11-13 13:10:00 +00:00
<td>
<a href="<%= admin_universal_table_path(table) %>"><%= table.title %></a>
2022-02-25 06:49:00 +00:00
<div class="quick-edit">
<ul class="nav nav-pills">
<% if can_edit %>
<li><a href="<%= edit_admin_universal_table_path(table) %>"><%= t(:edit) %></a></li>
<% if table.ordered_with_sort_number %>
<li><a href="<%= admin_universal_table_edit_sort_path(table) %>"><%= t('universal_table.edit_sort') %></a></li>
<% end %>
<li><a href="/admin/universal_tables/<%=table.id.to_s%>/export_data?format=xlsx" data-table-id="<%= table.id.to_s %>" class="export-xls"><%= t('universal_table.export_xls') %></a></li>
<li><a href="<%= admin_universal_table_path(table) %>" class="delete text-error" data-method="delete" data-confirm="Are you sure?"><%= t(:delete_) %></a></li>
<% end %>
</ul>
</div>
2015-11-13 13:10:00 +00:00
</td>
<td>
<%= table.created_at.strftime("%Y-%m-%d") %>
</td>
<td>
<%= table.table_entries.count %>
</td>
<td>
2019-03-09 05:28:52 +00:00
<% if can_edit %>
<form action="/admin/universal_tables/import_data_from_excel" method="post" enctype="multipart/form-data" class="import_from_excel_form">
<%= hidden_field_tag :authenticity_token, form_authenticity_token %>
<input type="file" name="import_data" />
<button class="btn btn-primary btn-small"><i class="icons-upload"></i></button>
<input type="hidden" name="universal_table_id" value="<%= table.id.to_s %>" />
<a href="<%= admin_universal_table_export_structure_path(table, :format => "xlsx") %>"><%= t("universal_table.export_structure") %></a>
</form>
2019-03-09 05:28:52 +00:00
<% end %>
</td>
2015-11-13 13:10:00 +00:00
</tr>
<% end %>
</tbody>
</table>