more robust pool ordering
This commit is contained in:
@@ -34,6 +34,8 @@ div#c-pools {
|
||||
}
|
||||
|
||||
div#c-pool-orders {
|
||||
width: 75%;
|
||||
|
||||
h1 {
|
||||
font-size: $h2_size;
|
||||
}
|
||||
@@ -43,19 +45,19 @@ div#c-pool-orders {
|
||||
list-style-type: none;
|
||||
|
||||
li {
|
||||
padding: 0.5em;
|
||||
cursor: pointer;
|
||||
margin-right: 20px;
|
||||
margin-bottom: 20px;
|
||||
width: 150px;
|
||||
padding: 10px;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
li.ui-state-default {
|
||||
margin-bottom: 20px;
|
||||
width: 180px;
|
||||
background: none;
|
||||
}
|
||||
|
||||
li.ui-state-placeholder {
|
||||
margin-bottom: 20px;
|
||||
width: 180px;
|
||||
height: 150px;
|
||||
background: none;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
@import "../common/000_vars.css.scss";
|
||||
|
||||
div#c-tag-subscriptions {
|
||||
div#a-posts {
|
||||
h1 {
|
||||
font-size: $h3_size;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -10,7 +10,7 @@ class Pool < ActiveRecord::Base
|
||||
before_validation :normalize_post_ids
|
||||
before_validation :initialize_creator, :on => :create
|
||||
after_save :create_version
|
||||
attr_accessible :name, :description, :post_ids, :is_active, :post_count
|
||||
attr_accessible :name, :description, :post_ids, :post_id_array, :is_active, :post_count
|
||||
|
||||
def self.name_to_id(name)
|
||||
if name =~ /^\d+$/
|
||||
@@ -123,6 +123,11 @@ class Pool < ActiveRecord::Base
|
||||
@post_id_array ||= post_ids.scan(/\d+/).map(&:to_i)
|
||||
end
|
||||
|
||||
def post_id_array=(array)
|
||||
self.post_ids = array.join(" ")
|
||||
clear_post_id_array
|
||||
end
|
||||
|
||||
def post_id_array_was
|
||||
@post_id_array_was ||= post_ids_was.scan(/\d+/).map(&:to_i)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user