Sha256: bb0972afbea8274ee8cdb1025d618e3340c3ceed4110cee3fedebb2153b8754c

Contents?: true

Size: 860 Bytes

Versions: 21

Compression:

Stored size: 860 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

21 entries across 21 versions & 1 rubygems

Version Path
locomotive_cms-2.5.4 lib/locomotive/liquid/tags/editable/file.rb
locomotive_cms-2.5.3 lib/locomotive/liquid/tags/editable/file.rb
locomotive_cms-2.5.2 lib/locomotive/liquid/tags/editable/file.rb
locomotive_cms-2.5.1 lib/locomotive/liquid/tags/editable/file.rb
locomotive_cms-2.5.0 lib/locomotive/liquid/tags/editable/file.rb
locomotive_cms-2.5.0.rc3 lib/locomotive/liquid/tags/editable/file.rb
locomotive_cms-2.5.0.rc2 lib/locomotive/liquid/tags/editable/file.rb
locomotive_cms-2.5.0.rc1 lib/locomotive/liquid/tags/editable/file.rb
locomotive_cms-2.4.1 lib/locomotive/liquid/tags/editable/file.rb
locomotive_cms-2.4.0 lib/locomotive/liquid/tags/editable/file.rb
locomotive_cms-2.3.1 lib/locomotive/liquid/tags/editable/file.rb
locomotive_cms-2.3.0 lib/locomotive/liquid/tags/editable/file.rb
locomotive_cms-2.2.3 lib/locomotive/liquid/tags/editable/file.rb
locomotive_cms-2.2.2 lib/locomotive/liquid/tags/editable/file.rb
locomotive_cms-2.2.1 lib/locomotive/liquid/tags/editable/file.rb
locomotive_cms-2.2.0 lib/locomotive/liquid/tags/editable/file.rb
locomotive_cms-2.1.4 lib/locomotive/liquid/tags/editable/file.rb
locomotive_cms-2.1.3 lib/locomotive/liquid/tags/editable/file.rb
locomotive_cms-2.1.2 lib/locomotive/liquid/tags/editable/file.rb
locomotive_cms-2.1.1 lib/locomotive/liquid/tags/editable/file.rb