pools: store post_ids as array instead of string (fix #3979)
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
|
||||
<ul id="sortable">
|
||||
<% @pool.posts(:limit => 1_000).each do |post| %>
|
||||
<li class="ui-state-default" id="pool[post_id_array]_<%= post.id %>">
|
||||
<li class="ui-state-default" id="pool[post_ids]_<%= post.id %>">
|
||||
<%= PostPresenter.preview(post).presence || "Hidden: Post ##{post.id}" %>
|
||||
</li>
|
||||
<% end %>
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<%= f.input :name, :as => :string, :input_html => { :value => @pool.pretty_name } %>
|
||||
<%= dtext_field "pool", "description" %>
|
||||
<%= dtext_preview_button "pool", "description" %>
|
||||
<%= f.input :post_ids, :label => "Posts" %>
|
||||
<%= f.input :post_ids, as: :text, label: "Posts", input_html: { value: @pool.post_ids.join(" ") } %>
|
||||
<%= f.input :category, :collection => ["series", "collection"], :include_blank => false %>
|
||||
<%= f.input :is_active %>
|
||||
<%= f.button :submit %>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<%= simple_form_for(@pool) do |f| %>
|
||||
<%= f.input :name, :as => :string, :required => true %>
|
||||
<%= dtext_field "pool", "description" %>
|
||||
<%= f.input :post_ids, :label => "Posts" %>
|
||||
<%= f.input :post_ids, as: :text, label: "Posts", input_html: { value: @pool.post_ids.join(" ") } %>
|
||||
<%= f.input :category, :collection => ["series", "collection"], :include_blank => true, :selected => "", :required => true %>
|
||||
<%= f.input :is_active %>
|
||||
<%= f.button :submit, "Submit" %>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<%= content_tag :li, id: "nav-link-for-pool-#{pool.id}", class: "pool-category-#{pool.category} pool-selected-#{selected}" do -%>
|
||||
<% if !pool.first_post?(post.id) -%>
|
||||
<%= link_to("«".html_safe, post_path(pool.first_post_id, pool_id: pool.id), class: "first", title: "to page 1") %>
|
||||
<%= link_to("«".html_safe, post_path(pool.post_ids.first, pool_id: pool.id), class: "first", title: "to page 1") %>
|
||||
<% else -%>
|
||||
<span class="first">«</span>
|
||||
<% end -%>
|
||||
@@ -25,8 +25,8 @@
|
||||
<% end -%>
|
||||
<% end -%>
|
||||
|
||||
<% if post.id != pool.post_id_array.last -%>
|
||||
<%= link_to("»".html_safe, post_path(pool.post_id_array.last, pool_id: pool.id), class: "last", title: "to page #{pool.post_count}") -%>
|
||||
<% if post.id != pool.post_ids.last -%>
|
||||
<%= link_to("»".html_safe, post_path(pool.post_ids.last, pool_id: pool.id), class: "last", title: "to page #{pool.post_count}") -%>
|
||||
<% else -%>
|
||||
<span class="last">»</span>
|
||||
<% end -%>
|
||||
|
||||
Reference in New Issue
Block a user