Skip to content

Commit

Permalink
collection sortable.
Browse files Browse the repository at this point in the history
  • Loading branch information
saberma committed Apr 29, 2011
1 parent 95d2512 commit 6a9f3d6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Vagrantfile
Expand Up @@ -23,8 +23,8 @@ Vagrant::Config.run do |config|
# to this Vagrantfile), and adding some recipes and/or roles.
#
config.vm.provision :chef_solo do |chef|
chef.recipe_url = "https://dl.dropbox.com/u/19519145/shopqi/chef-solo.tar.gz"
#chef.cookbooks_path = "/home/saberma/Documents/chef-repo/cookbooks"
#chef.recipe_url = "https://dl.dropbox.com/u/19519145/shopqi/chef-solo.tar.gz"
chef.cookbooks_path = "/home/saberma/Documents/chef-repo/cookbooks"
chef.add_recipe "develop"

# You may also specify custom JSON attributes:
Expand Down
3 changes: 3 additions & 0 deletions app/coffeescripts/controllers/smart_collections.coffee
Expand Up @@ -19,6 +19,9 @@ App.Controllers.SmartCollections = Backbone.Controller.extend
else
li.remove()
false
#手动排序
$("#products").sortable handle: '.drag-handle', update: (event, ui) ->
#$.post "#{self.model.links.url}/sort", $(this).sortable('serialize')

routes:
"edit": "edit"
Expand Down
2 changes: 1 addition & 1 deletion app/views/smart_collections/show.html.haml
Expand Up @@ -64,7 +64,7 @@
%span.note 集合排序
=form_for smart_collection, url: update_order_smart_collection_path(smart_collection), remote: true, html: {id: 'smart_collection_orders_form'} do |f|
=f.select :products_order, rule_orders, {}, onchange: "$('#smart_collection_orders_form').submit();"
%ul#products.nobull.products_for_collection
%ul#products.nobull.products_for_collection(url="#{sort_smart_collection_path(smart_collection)}")
=render partial: 'product', collection: products
-if products.empty?
#no-products.pgroup(style="")
Expand Down

0 comments on commit 6a9f3d6

Please sign in to comment.