82 lines
2.2 KiB
Plaintext
82 lines
2.2 KiB
Plaintext
<% content_for :page_specific_javascript do %>
|
|
<%= javascript_include_tag "lib/jquery-ui-sortable.min" %>
|
|
<% end %>
|
|
|
|
<% content_for :page_specific_css do %>
|
|
<style type="text/css">
|
|
.order-list{
|
|
list-style: none;
|
|
}
|
|
.order-list-chapter i{
|
|
font-size: 20px;
|
|
cursor: move;
|
|
}
|
|
|
|
.order-list-chapter h4{
|
|
display: inline-block;
|
|
margin-left: 30px;
|
|
}
|
|
|
|
#sort-chapter-modal .modal-body {
|
|
max-height: 60vh;
|
|
}
|
|
|
|
#sort-chapter-modal .modal-body .order-list-chapter img {
|
|
width: 150px;
|
|
margin: 0 0 10px 10px;
|
|
}
|
|
</style>
|
|
<% end %>
|
|
|
|
<table class="table main-list">
|
|
<thead>
|
|
<tr class="sort-header">
|
|
<% @table_fields.each do |f| %>
|
|
<%= thead(f) %>
|
|
<% end %>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<% @chapters.each do |chapter| %>
|
|
<tr>
|
|
<td>
|
|
<%= chapter.title %>
|
|
<% if can_edit_or_delete?(@banner) %>
|
|
<div class="quick-edit">
|
|
<ul class="nav nav-pills">
|
|
<li><a href="<%= edit_admin_chapter_path(chapter.id, page: params[:page]) %>"><%= t(:edit) %></a></li>
|
|
<li><a href="<%= admin_chapter_path(chapter.id, page: params[:page]) %>" class="delete text-error" data-method="delete" data-confirm="Are you sure?" ><%= t(:delete_) %></a></li>
|
|
</ul>
|
|
</div>
|
|
<% end %>
|
|
</td>
|
|
<td>
|
|
<ul class="tags-groups">
|
|
<% chapter.tags.each do |tag| %>
|
|
<li class="label"><%= tag.name %></li>
|
|
<% end %>
|
|
</ul>
|
|
</td>
|
|
<td>
|
|
<%= chapter.author %>
|
|
</td>
|
|
<td>
|
|
<%= chapter.page %>
|
|
</td>
|
|
<td>
|
|
<%= chapter.keywords %>
|
|
</td>
|
|
</tr>
|
|
<% end %>
|
|
</tbody>
|
|
</table>
|
|
|
|
<% if can_edit_or_delete?(@publication) %>
|
|
<div class="bottomnav clearfix" style="left: 81px;">
|
|
<div class="action pull-right">
|
|
<%= link_to t("publications_.add_chapter"), new_admin_chapter_path(page: params[:page], publication_id: @publication.id), class: "btn btn-primary" %>
|
|
</div>
|
|
<%= content_tag :div, paginate(@chapters), class: "pagination pagination-centered" %>
|
|
</div>
|
|
<% end %>
|