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) %>
|
2015-12-17 13:58:04 +00:00
|
|
|
<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>
|
|
|
|
<div class="quick-edit">
|
|
|
|
<ul class="nav nav-pills">
|
2019-03-09 05:28:52 +00:00
|
|
|
<% if can_edit %>
|
2015-11-13 13:10:00 +00:00
|
|
|
<li><a href="<%= edit_admin_universal_table_path(table) %>"><%= t(:edit) %></a></li>
|
2017-04-13 10:50:32 +00:00
|
|
|
<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>
|
2015-11-13 13:10:00 +00:00
|
|
|
<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>
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
<%= table.created_at.strftime("%Y-%m-%d") %>
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
<%= table.table_entries.count %>
|
|
|
|
</td>
|
2015-12-17 13:58:04 +00:00
|
|
|
<td>
|
2019-03-09 05:28:52 +00:00
|
|
|
<% if can_edit %>
|
2015-12-17 13:58:04 +00:00
|
|
|
<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 %>
|
2015-12-17 13:58:04 +00:00
|
|
|
</td>
|
2015-11-13 13:10:00 +00:00
|
|
|
</tr>
|
|
|
|
<% end %>
|
|
|
|
</tbody>
|
|
|
|
</table>
|