type_station 0.3.2 → 0.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/presenters/type_station/content_presenter.rb +13 -3
- data/app/presenters/type_station/presenter.rb +1 -1
- data/lib/type_station/blocks/base.rb +1 -3
- data/lib/type_station/version.rb +1 -1
- data/spec/dummy/log/development.log +1223 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/1e7d8fa3d4680fd1b85b0881f495525f +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/2e14a727c7ff43dcd32c2d15c7d4e49c +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/4c48023968030daffd8c05e4e1ea78bf +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/722eee3ce416c20905dda68eab3d517e +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/9eafacb2fca5506e20523d97e92f5251 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/afa9de4377b9615980b737000fc68a2a +0 -0
- data/spec/dummy/tmp/pids/server.pid +1 -1
- metadata +2 -2
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA1:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: dbc3bfe45610ed1a0658853f418a200ab072ae20
         | 
| 4 | 
            +
              data.tar.gz: 242b1d85fc6f8d990db57990c3d8e010ce0917cd
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 903ab291d03f3f5cc70c5d8c5d2fffbc09e0393db2b58b5694ca1ad9eccf7b1f21a54dc54dc223692e7b2fde9ab4a7da66843dc07943967a47bc6b470376fd16
         | 
| 7 | 
            +
              data.tar.gz: dc98920de5e9f4ae6f994593b3e38a6124916bdfc8b47a7706f3db81472c8faf52cae51870f4eda38a762ae424580ecace8feced32bb5b2295671bc28471eef3
         | 
| @@ -4,16 +4,26 @@ module TypeStation | |
| 4 4 |  | 
| 5 5 | 
             
                def tag(default, options = {})
         | 
| 6 6 | 
             
                  css_class = options.delete(:class) if options.include?(:class)
         | 
| 7 | 
            -
                  cl_image_tag(( | 
| 7 | 
            +
                  cl_image_tag((content.present? ? content['identifier'] : default), options.merge({class: ['ts-editable-image-tag', css_class], data: options}))
         | 
| 8 8 | 
             
                end
         | 
| 9 9 |  | 
| 10 10 | 
             
                def link(default, html_options = nil, &block)
         | 
| 11 11 | 
             
                  css_class = html_options.delete(:class) if html_options.include?(:class)
         | 
| 12 | 
            -
                  content_tag(:a, nil, html_options.merge({class: ['ts-editable-link-tag', css_class], href: ( | 
| 12 | 
            +
                  content_tag(:a, nil, html_options.merge({class: ['ts-editable-link-tag', css_class], href: (content.present? ? cloudinary_url(content['identifier'], format: content['format']) : default)}), &block)
         | 
| 13 | 
            +
                end
         | 
| 14 | 
            +
             | 
| 15 | 
            +
                def value_is_hash?
         | 
| 16 | 
            +
                  content.is_a? Hash
         | 
| 13 17 | 
             
                end
         | 
| 14 18 |  | 
| 15 19 | 
             
                def value
         | 
| 16 | 
            -
                   | 
| 20 | 
            +
                  sanitized_value
         | 
| 21 | 
            +
                end
         | 
| 22 | 
            +
             | 
| 23 | 
            +
                private
         | 
| 24 | 
            +
             | 
| 25 | 
            +
                def sanitized_value
         | 
| 26 | 
            +
                  @sanitized_value ||= Rails::Html::WhiteListSanitizer.new.sanitize(content)
         | 
| 17 27 | 
             
                end
         | 
| 18 28 |  | 
| 19 29 | 
             
              end
         | 
| @@ -41,7 +41,7 @@ module TypeStation | |
| 41 41 | 
             
                  if content_attribute.present?
         | 
| 42 42 | 
             
                    content_presenter = ContentPresenter.new(content_attribute, h)
         | 
| 43 43 |  | 
| 44 | 
            -
                    if content_presenter. | 
| 44 | 
            +
                    if content_presenter.value_is_hash?
         | 
| 45 45 | 
             
                      content += h.capture(content_presenter, &block)
         | 
| 46 46 | 
             
                    else
         | 
| 47 47 | 
             
                      content += content_presenter.value
         |