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

48 lines
1.4 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>
<% @journals.each do |node| %>
<tr>
<td>
<%= link_to node.title, journal_path(node.id) %>
<div class="quick-edit">
<ul class="nav nav-pills">
<% if can_edit_or_delete?(node) %>
<% if can_edit_or_delete?(node) %>
<li><a href="<%= admin_journal_path(node.id) %>"><%= t("journals.add_chapter") %></a></li>
<% end %>
<li><%= link_to t(:edit), edit_admin_journal_path(node.id) %></li>
<li><%= link_to t(:delete_), admin_journal_path(node.id), method: :delete, data: {confirm: "Are you sure?"} %></li>
<% end %>
</ul>
</div>
</td>
<td><%= node.status_for_table %></td>
<td><%= node.author %></td>
<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
content_tag :div, paginate(@journals), class: "pagination pagination-centered"
end
%>