Sha256: b454666fa917826620dbcf468bdcddc2bd85f66d048f1a08f99b7f9ad897d5a4

Contents?: true

Size: 1.57 KB

Versions: 23

Compression:

Stored size: 1.57 KB

Contents

module C80Yax
  module Items
    module Photos
      module ItemPhotosHelper

        # вывести первую фотку и кол-во всего
        # noinspection RubyResolve
        def item_photos_short(item)
          r = ''
          if item.iphotos.count > 0
            r = link_to image_tag(item.iphotos.first.image.thumb_md,
                                  style: 'width:150px'),
                        item.iphotos.first.image.url,
                        target: '_blank'
            r = "#{r}<br><sup>Всего фотографий: #{item.iphotos.count}</sup>".html_safe
          end
          r
        end

        # вывести lazy magnific popup slider фотографий товара
        # С помощью +thumb_type+ можно задать, какие версии фотографий будут использованы в слайдере
        def item_photos(item, thumb_type = 'thumb_lg')

          # TODO-0:: реализовать gem и использовать его тут в том виде, какой описан в комментах
          #
          # photos = {
          #   thumb_list: ['image01_thumb_lg.jpg'], # на основе этого строится slider
          #   big_list: ['image01.jpg'] # эти фотки magnific открываются
          # }
          # c80_lazy_maginific_popup_slider(photos)

          r = ''
          if item.iphotos.count > 0
            r = image_tag(item.iphotos.first.image.send(thumb_type))
          end
          r.html_safe

        end

      end
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
c80_yax-0.1.0.25 app/helpers/c80_yax/items/photos/item_photos_helper.rb
c80_yax-0.1.0.24 app/helpers/c80_yax/items/photos/item_photos_helper.rb
c80_yax-0.1.0.23 app/helpers/c80_yax/items/photos/item_photos_helper.rb
c80_yax-0.1.0.22 app/helpers/c80_yax/items/photos/item_photos_helper.rb
c80_yax-0.1.0.21 app/helpers/c80_yax/items/photos/item_photos_helper.rb
c80_yax-0.1.0.20 app/helpers/c80_yax/items/photos/item_photos_helper.rb
c80_yax-0.1.0.18 app/helpers/c80_yax/items/photos/item_photos_helper.rb
c80_yax-0.1.0.17 app/helpers/c80_yax/items/photos/item_photos_helper.rb
c80_yax-0.1.0.16 app/helpers/c80_yax/items/photos/item_photos_helper.rb
c80_yax-0.1.0.15 app/helpers/c80_yax/items/photos/item_photos_helper.rb
c80_yax-0.1.0.14 app/helpers/c80_yax/items/photos/item_photos_helper.rb
c80_yax-0.1.0.13 app/helpers/c80_yax/items/photos/item_photos_helper.rb
c80_yax-0.1.0.12 app/helpers/c80_yax/items/photos/item_photos_helper.rb
c80_yax-0.1.0.11 app/helpers/c80_yax/items/photos/item_photos_helper.rb
c80_yax-0.1.0.10 app/helpers/c80_yax/items/photos/item_photos_helper.rb
c80_yax-0.1.0.9 app/helpers/c80_yax/items/photos/item_photos_helper.rb
c80_yax-0.1.0.8 app/helpers/c80_yax/items/photos/item_photos_helper.rb
c80_yax-0.1.0.7 app/helpers/c80_yax/items/photos/item_photos_helper.rb
c80_yax-0.1.0.6 app/helpers/c80_yax/items/photos/item_photos_helper.rb
c80_yax-0.1.0.5 app/helpers/c80_yax/items/photos/item_photos_helper.rb