diff --git a/app/models/pool.rb b/app/models/pool.rb index b55c074a9..f862d753c 100644 --- a/app/models/pool.rb +++ b/app/models/pool.rb @@ -1,5 +1,6 @@ class Pool < ApplicationRecord class RevertError < Exception ; end + POOL_ORDER_LIMIT = 100 array_attribute :post_ids, parse: /\d+/, cast: :to_i belongs_to_creator diff --git a/app/views/pool_orders/edit.html.erb b/app/views/pool_orders/edit.html.erb index 936a4d2ef..b31be6a06 100644 --- a/app/views/pool_orders/edit.html.erb +++ b/app/views/pool_orders/edit.html.erb @@ -1,20 +1,27 @@

Order Pool: <%= @pool.pretty_name %>

-

Drag and drop the list below to determine ordering.

- <%= render "posts/partials/common/inline_blacklist" %> + <%= simple_form_for(@pool, format: :js, html: { id: "ordering-form" }) do |f| %> + <% if @pool.post_count <= Pool::POOL_ORDER_LIMIT %> +

Drag and drop the list below to determine ordering.

- - <%= simple_form_for(@pool, :format => :js, :html => {:id => "ordering-form"}) do |f| %> - <%= submit_tag "Save" %> + <%= f.submit "Save" %> <% end %>
diff --git a/app/views/pools/_secondary_links.html.erb b/app/views/pools/_secondary_links.html.erb index 13df4cc1b..60cf343b3 100644 --- a/app/views/pools/_secondary_links.html.erb +++ b/app/views/pools/_secondary_links.html.erb @@ -22,7 +22,7 @@ <% if PoolArchive.enabled? %> <%= subnav_link_to "History", pool_versions_path(:search => {:pool_id => @pool.id}) %> <% end %> - <% if @pool.post_count <= 100 && CurrentUser.is_member? %> + <% if CurrentUser.is_member? %> <%= subnav_link_to "Order", edit_pool_order_path(@pool) %> <% end %> <% end %>