Sha256: 046a44c9ab171b0470503250b3b1b849570d0a444a70e337c29f48870de01105

Contents?: true

Size: 1.59 KB

Versions: 3

Compression:

Stored size: 1.59 KB

Contents

- if model.package? || model.family?
  .grid__cell
    .card{ class: card_classes(:featured_products, local_assigns[:active]) }
      = link_to select_featured_product_path(model.to_global_id), class: 'card__header' do
        %span.card__header-text= t('workarea.admin.catalog_products.cards.packaged_products.title')
        = inline_svg 'workarea/admin/icons/featured_products.svg', class: 'card__icon'

      - if local_assigns[:active].blank?
        .card__body
          - if model.packaged_products.empty?
            .card__empty-note
              %p= t('workarea.admin.catalog_products.cards.packaged_products.empty')
            %p= t('workarea.admin.catalog_products.cards.packaged_products.description')
            = link_to select_featured_product_path(model.to_global_id), class: 'card__button' do
              %span.button.button--small= t('workarea.admin.catalog_products.cards.packaged_products.empty_button')
          - else
            %ol.grid
              - model.packaged_products.take(4).each_with_index do |product, i|
                %li.grid__cell.grid__cell--50
                  .card__photo-box
                    - if i == 3 && model.packaged_products.size > 4
                      %span.card__photo +#{model.packaged_products.size - i}
                    - else
                      = image_tag product_image_url(product.primary_image, :medium), alt: product.name, class: 'card__photo'
            = link_to edit_featured_product_path(model.to_global_id), class: 'card__button' do
              %span.button.button--small= t('workarea.admin.catalog_products.cards.packaged_products.button')

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
workarea-package_products-3.4.1 app/views/workarea/admin/catalog_products/_packaged_products_card.html.haml
workarea-package_products-3.4.0 app/views/workarea/admin/catalog_products/_packaged_products_card.html.haml
workarea-package_products-3.3.3 app/views/workarea/admin/catalog_products/_packaged_products_card.html.haml