Previously if a pool had >100 posts then the 'Order' link wouldn't appear in the navbar, but it was still possible to visit the pool order page directly. If a user did so, only the first 100 posts in the pool would be shown in the drag-and-drop widget. If they tried to reorder the pool anyway, then everything beyond the first 100 posts would be silently removed from the pool. Now we always show the 'Order' link, but we disable the drag-and-drop reordering widget when the pool has >100 posts to prevent posts from being silently removed.
34 lines
1.0 KiB
Plaintext
34 lines
1.0 KiB
Plaintext
<div id="c-pool-orders">
|
|
<div id="a-edit">
|
|
<h1>Order Pool: <%= @pool.pretty_name %></h1>
|
|
|
|
<%= simple_form_for(@pool, format: :js, html: { id: "ordering-form" }) do |f| %>
|
|
<% if @pool.post_count <= Pool::POOL_ORDER_LIMIT %>
|
|
<p>Drag and drop the list below to determine ordering.</p>
|
|
|
|
<%= render "posts/partials/common/inline_blacklist" %>
|
|
|
|
<ul id="sortable">
|
|
<% @pool.posts.each do |post| %>
|
|
<li class="ui-state-default" id="pool[post_ids]_<%= post.id %>">
|
|
<%= PostPresenter.preview(post).presence || "Hidden: Post ##{post.id}" %>
|
|
</li>
|
|
<% end %>
|
|
</ul>
|
|
<% else %>
|
|
<p>Reorder the post IDs in the text box below to reorder the pool.</p>
|
|
|
|
<%= f.input :post_ids_string, as: :text, label: "Posts" %>
|
|
<% end %>
|
|
|
|
<%= f.submit "Save" %>
|
|
<% end %>
|
|
</div>
|
|
</div>
|
|
|
|
<%= render "pools/secondary_links" %>
|
|
|
|
<% content_for(:page_title) do %>
|
|
Order Pool - <%= Danbooru.config.app_name %>
|
|
<% end %>
|