archive/app/views/admin/archive_files/_index.html.erb

51 lines
1.6 KiB
Plaintext
Raw Normal View History

<script>
2014-07-28 07:09:27 +00:00
if(document.querySelectorAll("#orbit-bar").length==0) location.reload();
</script>
2014-05-14 11:52:06 +00:00
<table class="table main-list">
2014-08-07 10:46:24 +00:00
<thead>
<tr class="sort-header">
<% @table_fields.each do |f| %>
<%= thead(f) %>
<% end %>
</tr>
</thead>
<tbody>
<% @archives.each do |archive| %>
<tr>
<td><%= archive.status_for_table %></td>
2014-12-11 09:43:16 +00:00
<td>
<%= archive.category.title rescue "" %>
<% if (archive.category.disable rescue false) %>
<span class='label'><%= t(:disabled) %></span>
<% end %>
</td>
2014-08-07 10:46:24 +00:00
<td>
<a href="#" target="_blank"><%= archive.title %></a>
<div class="quick-edit">
<ul class="nav nav-pills">
<% if can_edit_or_delete?(archive) %>
<li><a href="/<%= I18n.locale.to_s %>/admin/archive_files/<%= archive.id.to_s %>/edit"><%= t(:edit) %></a></li>
<li><a href="/admin/archive_files/<%= archive.id.to_s %>" data-method="delete" data-confirm="Are you sure?"><%= t(:delete_) %></a></li>
<% end %>
</ul>
</div>
</td>
<td><%= format_value archive.updated_at rescue nil %></td>
<td><%= User.find(archive.update_user_id).user_name rescue nil %></td>
2015-03-18 09:59:03 +00:00
<% download_total = 0
archive.archive_file_multiples.each do |afm|
download_total = download_total + afm.download_count
end
%>
<td><%= download_total %></td>
2014-08-07 10:46:24 +00:00
</tr>
<% end %>
</tbody>
2014-07-04 07:54:11 +00:00
</table>
<%=
content_tag :div, class: "bottomnav clearfix" do
content_tag :div, paginate(@archives), class: "pagination pagination-centered"
end
%>