more robust pool ordering

This commit is contained in:
albert
2011-10-15 16:58:36 -04:00
parent e7b8daba98
commit 5f9e56b88c
3 changed files with 23 additions and 7 deletions

View File

@@ -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;
}
}

View File

@@ -0,0 +1,9 @@
@import "../common/000_vars.css.scss";
div#c-tag-subscriptions {
div#a-posts {
h1 {
font-size: $h3_size;
}
}
}

View File

@@ -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