order assets when used in liquid templates

This commit is contained in:
dinedine 2010-10-19 16:56:50 +02:00
parent c1b21fac8b
commit b4d3aae46f
4 changed files with 12 additions and 9 deletions

View File

@ -12,8 +12,9 @@ BOARD:
- global regions: keyword in editable element (http://www.mongodb.org/display/DOCS/Updating) - global regions: keyword in editable element (http://www.mongodb.org/display/DOCS/Updating)
- write my first tutorial about locomotive - write my first tutorial about locomotive
- rewrite the unzip process (for the import) - cosmetic / ui bugs:
- bug with asset collections (assets disappear if we save the collection ?!) - increase the input field for domain names
- drag&drop for assets ('last' class issue)
- refactor slugify method (use parameterize + create a module) - refactor slugify method (use parameterize + create a module)
- [content types] the "display column" selector should not include file types - [content types] the "display column" selector should not include file types
@ -138,3 +139,5 @@ x import tool:
x theme assets whitelist x theme assets whitelist
x fonts x fonts
x asset collections x asset collections
x rewrite the unzip process (for the import)
x bug with asset collections (assets disappear if we save the collection ?!)

View File

@ -18,19 +18,19 @@ module Locomotive
end end
def first def first
@collection.assets.first @collection.ordered_assets.first
end end
def last def last
@collection.assets.last @collection.ordered_assets.last
end end
def each(&block) def each(&block)
@collection.assets.each(&block) @collection.ordered_assets.each(&block)
end end
def paginate(options = {}) def paginate(options = {})
paginated_collection = @collection.assets.paginate(options) paginated_collection = @collection.ordered_assets.paginate(options)
{ {
:collection => paginated_collection, :collection => paginated_collection,
:current_page => paginated_collection.current_page, :current_page => paginated_collection.current_page,

View File

@ -1,3 +1,3 @@
module Locomotive #:nodoc module Locomotive #:nodoc
VERSION = "0.0.4.beta3" VERSION = "0.0.4.beta5"
end end

View File

@ -29,7 +29,7 @@ Gem::Specification.new do |s|
s.add_dependency "fog" s.add_dependency "fog"
s.add_dependency "mimetype-fu" s.add_dependency "mimetype-fu"
s.add_dependency "formtastic", ">= 1.1.0" s.add_dependency "formtastic", ">= 1.1.0"
s.add_dependency "locomotive_carrierwave", "0.5.0.1.beta1" s.add_dependency "locomotive_carrierwave", "0.5.0.1.beta2"
s.add_dependency "actionmailer-with-request" s.add_dependency "actionmailer-with-request"
s.add_dependency "heroku" s.add_dependency "heroku"
s.add_dependency "httparty", ">= 0.6.1" s.add_dependency "httparty", ">= 0.6.1"
@ -37,7 +37,7 @@ Gem::Specification.new do |s|
s.add_dependency "inherited_resources", ">= 1.1.2" s.add_dependency "inherited_resources", ">= 1.1.2"
s.add_dependency "delayed_job", "2.1.0.pre2" s.add_dependency "delayed_job", "2.1.0.pre2"
s.add_dependency "delayed_job_mongoid", "1.0.0.rc" s.add_dependency "delayed_job_mongoid", "1.0.0.rc"
s.add_dependency "custom_fields", "1.0.0.beta" s.add_dependency "custom_fields", "1.0.0.beta2"
s.add_dependency "rubyzip" s.add_dependency "rubyzip"
s.files = Dir[ "Gemfile", s.files = Dir[ "Gemfile",