diff --git a/app/views/admin/notifications/new_content_instance.html.haml b/app/views/admin/notifications/new_content_instance.html.haml index 7feeb5ff..1fabb1ac 100644 --- a/app/views/admin/notifications/new_content_instance.html.haml +++ b/app/views/admin/notifications/new_content_instance.html.haml @@ -14,4 +14,8 @@ %li %strong= field.label  -  - %i= @content.send(field._name) + %i + - if field.file? + = link_to File.basename(@content.send(field._name).url), @content.send(field._name).url + - else + = @content.send(field._alias) diff --git a/lib/locomotive/custom_fields.rb b/lib/locomotive/custom_fields.rb index 5091e5fc..6b40fbbd 100644 --- a/lib/locomotive/custom_fields.rb +++ b/lib/locomotive/custom_fields.rb @@ -19,6 +19,16 @@ module CustomFields end end + + module Category + class Item + + def to_liquid + { 'id' => self._id, 'name' => self.name } + end + + end + end end end diff --git a/lib/locomotive/liquid/drops/contents.rb b/lib/locomotive/liquid/drops/contents.rb index 65a2e1c2..26714749 100644 --- a/lib/locomotive/liquid/drops/contents.rb +++ b/lib/locomotive/liquid/drops/contents.rb @@ -28,15 +28,15 @@ module Locomotive def each(&block) self.collection.each(&block) end - + def size self.collection.size end - + def empty? self.collection.empty? end - + def any? self.collection.any? end @@ -47,6 +47,7 @@ module Locomotive def before_method(meth) klass = @content_type.contents.klass # delegate to the proxy class + if (meth.to_s =~ /^group_by_.+$/) == 0 klass.send(meth, :ordered_contents) else @@ -73,6 +74,7 @@ module Locomotive @collection ||= @content_type.ordered_contents(@context['with_scope']) end end + end end end