Sha256: 4ea7a5bc9657c931f0a84e81c463666ec5e9c1ef925d73b4a1f58e4285c82d1e

Contents?: true

Size: 863 Bytes

Versions: 15

Compression:

Stored size: 863 Bytes

Contents

module Locomotive
  module Liquid
    module Tags
      module Editable
        class File < Base

          protected

          def default_element_attributes
            if @nodelist.first.is_a?(String)
              super.merge(:default_source_url => @nodelist.first.try(:to_s))
            else
              super
            end
          end

          def render_element(context, element)
            if element.source?
              element.source.url
            else
              if element.default_source_url.present?
                element.default_source_url
              else
                render_default_content(context)
              end
            end
          end

          def document_type
            EditableFile
          end

        end

        ::Liquid::Template.register_tag('editable_file', File)
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 2 rubygems

Version Path
locomotive_cms-2.0.3 lib/locomotive/liquid/tags/editable/file.rb
locomotive_cms-2.0.2 lib/locomotive/liquid/tags/editable/file.rb
locomotive_cms-2.0.1 lib/locomotive/liquid/tags/editable/file.rb
locomotive_cms-2.0.0 lib/locomotive/liquid/tags/editable/file.rb
tribeca_cms-0.1.1 lib/locomotive/liquid/tags/editable/file.rb
tribeca_cms-2.0.0.rc12 lib/locomotive/liquid/tags/editable/file.rb
locomotive_cms-2.0.0.rc12 lib/locomotive/liquid/tags/editable/file.rb
locomotive_cms-2.0.0.rc11 lib/locomotive/liquid/tags/editable/file.rb
locomotive_cms-2.0.0.rc10 lib/locomotive/liquid/tags/editable/file.rb
locomotive_cms-2.0.0.rc9 lib/locomotive/liquid/tags/editable/file.rb
locomotive_cms-2.0.0.rc8 lib/locomotive/liquid/tags/editable/file.rb
locomotive_cms-2.0.0.rc7 lib/locomotive/liquid/tags/editable/file.rb
locomotive_cms-2.0.0.rc6 lib/locomotive/liquid/tags/editable/file.rb
locomotive_cms-2.0.0.rc5 lib/locomotive/liquid/tags/editable/file.rb
locomotive_cms-2.0.0.rc4 lib/locomotive/liquid/tags/editable/file.rb