publication/app/views/admin/publications/_index.html.erb

44 lines
1.3 KiB
Plaintext
Raw Normal View History

2018-10-04 02:47:23 +00:00
<script>
if(document.querySelectorAll("#orbit-bar").length==0) location.reload();
</script>
<table class="table main-list">
<thead>
<tr class="sort-header">
<% @table_fields.each do |f| %>
<%= thead(f) %>
<% end %>
</tr>
</thead>
<tbody>
2023-06-04 14:41:53 +00:00
<% @publications.each do |node| %>
2018-10-04 02:47:23 +00:00
<tr>
<td>
2023-07-21 02:10:22 +00:00
<%= link_to node.title, page_for_publication(node) %>
2018-10-04 02:47:23 +00:00
<div class="quick-edit">
<ul class="nav nav-pills">
<% if can_edit_or_delete?(node) %>
2023-06-04 14:41:53 +00:00
<li><%= link_to t(:edit), edit_admin_publication_path(node.id) %></li>
<li><%= link_to t(:delete_), admin_publication_path(node.id), method: :delete, data: {confirm: "Are you sure?"} %></li>
2018-10-04 02:47:23 +00:00
<% end %>
</ul>
</div>
</td>
2023-06-23 10:25:35 +00:00
<td><%= link_to node.chapters.length, admin_publication_path(node.id) %></td>
2018-10-04 02:47:23 +00:00
<td><%= node.pub_date.strftime('%Y-%m-%d') %></td>
<td>
<%= node.category.title rescue "" %>
<% if (node.category.disable rescue false) %>
<span class='label'><%= t(:disabled) %></span>
<% end %>
</td>
</tr>
<% end %>
</tbody>
</table>
<%=
content_tag :div, class: "bottomnav clearfix" do
2023-06-04 14:41:53 +00:00
content_tag :div, paginate(@publications), class: "pagination pagination-centered"
2018-10-04 02:47:23 +00:00
end
%>