Sha256: 3e190e4a0ef8fa2cbc396befafdad0d60d69cebcf65168cd69db39b25170b711

Contents?: true

Size: 1.12 KB

Versions: 29

Compression:

Stored size: 1.12 KB

Contents

- uid = "effective-carousel-#{carousel}-#{Time.zone.now.to_i}"
- options = carousel_options

- raise('expected one or more carousel items') unless carousel_items.present?

.carousel.slide{id: uid, 'data-ride': 'carousel', **options}
  %ol.carousel-indicators
    - carousel_items.each_with_index do |item, index|
      %li{'data-target': '#' + uid, 'data-slide-to': index, class: ('active' if index == 0)}

  .carousel-inner
    - carousel_items.each_with_index do |item, index|
      .carousel-item{class: ('active' if index == 0)}
        - if item.caption.blank?
          = image_tag(item.file, class: 'd-block w-100', alt: "Slide #{index+1}")
        - else
          = image_tag(item.file, alt: item.caption)
          .carousel-caption.d-none.d-md-block
            %p= item.caption

  %button.carousel-control-prev{'data-target': '#' + uid, type: 'button', 'data-slide': 'prev'}
    %span.carousel-control-prev-icon{'aria-hidden': true}
    %span.sr-only Previous

  %button.carousel-control-next{'data-target': '#' + uid, type: 'button', 'data-slide': 'next'}
    %span.carousel-control-next-icon{'aria-hidden': true}
    %span.sr-only Next

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
effective_pages-3.10.0 app/views/effective/carousels/_carousel.html.haml
effective_pages-3.9.0 app/views/effective/carousels/_carousel.html.haml
effective_pages-3.8.4 app/views/effective/carousels/_carousel.html.haml
effective_pages-3.8.3 app/views/effective/carousels/_carousel.html.haml
effective_pages-3.8.2 app/views/effective/carousels/_carousel.html.haml
effective_pages-3.8.1 app/views/effective/carousels/_carousel.html.haml
effective_pages-3.8.0 app/views/effective/carousels/_carousel.html.haml
effective_pages-3.7.11 app/views/effective/carousels/_carousel.html.haml
effective_pages-3.7.10 app/views/effective/carousels/_carousel.html.haml
effective_pages-3.7.9 app/views/effective/carousels/_carousel.html.haml
effective_pages-3.7.8 app/views/effective/carousels/_carousel.html.haml
effective_pages-3.7.7 app/views/effective/carousels/_carousel.html.haml
effective_pages-3.7.6 app/views/effective/carousels/_carousel.html.haml
effective_pages-3.7.5 app/views/effective/carousels/_carousel.html.haml
effective_pages-3.7.4 app/views/effective/carousels/_carousel.html.haml
effective_pages-3.7.3 app/views/effective/carousels/_carousel.html.haml
effective_pages-3.7.2 app/views/effective/carousels/_carousel.html.haml
effective_pages-3.7.1 app/views/effective/carousels/_carousel.html.haml
effective_pages-3.7.0 app/views/effective/carousels/_carousel.html.haml
effective_pages-3.6.0 app/views/effective/carousels/_carousel.html.haml