ecm_galleries 0.4.1 → 0.5.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 461ed4677bf37436834d02023099cd959950bb19c7c11ad2fef4a3b293dce95d
4
- data.tar.gz: 3551f8b20add86719349947eec21fbbd68b05f8bc3e97a048fc02bb9fbbc6560
3
+ metadata.gz: fe9c5d37fb56874f9c289b1100cc52d8f45277bb40b30996df1f617cab4086a7
4
+ data.tar.gz: 569e6412180bb2df8dc54517ab0e0b2f45d0680fe40407cafc0c50e820ddc9df
5
5
  SHA512:
6
- metadata.gz: a766322590267e1a01cd7c4229fdac6f895b1892fdee6aa309c44c94dd4acc1a35bc66f2e028f4b970e6240ee44c9d7fb37b9e6fda22198a1cba7ffc3661e747
7
- data.tar.gz: 24d273588d2b693e87661e43336e42757d8e303c01a773dd868c39d63ff5549e1f68625cb6584fcee2d39357e3b6f105096320467acdc5cbf553b4ca525ce772
6
+ metadata.gz: 865e59b09e6a1a7a11f05e11e26f187b630292dce3d80d35f847965ee8fc03872127cc752fe724cd61d04bb893c22e83e69fae4f7516547a22a00324fd498d1f
7
+ data.tar.gz: cbd4239339391aaba9cc12a6184f0405c6f692e55799b9a8f4a3301c7c3ed6b4cb58345c249bf0fb7e08f4871ca10c984ac1c8b4df65744455306c04145fd3a1
@@ -6,8 +6,8 @@
6
6
  - resource.picture_details.published.each do |picture_detail|
7
7
  .col-md-6.col-lg-3.d-flex.align-items-stretch.mb-4
8
8
  = bootstrap_card(additional_css_classes: 'text-center border-0 w-100' ) do
9
- %a{ href: main_app.url_for(picture_detail.asset.variant(variant_options)), data: { gallery: dom_id(resource) } }
10
- %img{ src: main_app.url_for(picture_detail.asset) }
9
+ %a{ href: main_app.url_for(picture_detail.asset), data: { gallery: dom_id(resource) } }
10
+ %img{ src: main_app.url_for(picture_detail.asset.variant(variant_options)) }
11
11
  - if show_details
12
12
  .card-body
13
13
  %h5.card-title
@@ -3,8 +3,8 @@
3
3
  .row
4
4
  - @collection.each do |picture_gallery|
5
5
  .col-4
6
- - image_options = if picture_gallery.assets.any?
7
- - { src: main_app.url_for(picture_gallery.assets.first) }
6
+ - image_options = if picture_gallery.picture_details.first.try(:asset).present?
7
+ - { src: main_app.url_for(picture_gallery.picture_details.first.asset.variant(Ecm::Galleries::Configuration.thumbnail_variant_options)) }
8
8
  - else
9
9
  - {}
10
10
  = bootstrap_card(image_options: image_options, additional_css_classes: 'text-center border-0') do
@@ -3,8 +3,10 @@
3
3
  %div{ id: dom_id(@resource), class: dom_class(@resource) }
4
4
  .row
5
5
  - @resource.picture_details.each do |picture_detail|
6
- .col-lg-4.d-flex.align-items-stretch
7
- = bootstrap_card(image_options: { src: main_app.url_for(picture_detail.asset), data: { gallery: "##{dom_id(@resource)}" } }, additional_css_classes: 'text-center border-0' ) do
6
+ .col-md-6.col-lg-3.d-flex.align-items-stretch.mb-4
7
+ = bootstrap_card(additional_css_classes: 'text-center border-0' ) do
8
+ %a{ href: main_app.url_for(picture_detail.asset), data: { gallery: dom_id(@resource) } }
9
+ %img.img-fluid{ src: main_app.url_for(picture_detail.asset.variant(Ecm::Galleries::Configuration.thumbnail_variant_options)) }
8
10
  .card-body
9
11
  %h5.card-title
10
12
  = picture_detail.title
@@ -6,6 +6,7 @@ module Ecm::Galleries
6
6
 
7
7
  mattr_accessor(:base_controller) { '::FrontendController' }
8
8
  mattr_accessor(:galleries_helper_render_default_options) { { variant_options: {}, show_details: false } }
9
- mattr_accessor(:pictures_helper_render_default_options) { { variant_options: {}, show_details: false } }
9
+ mattr_accessor(:pictures_helper_render_default_options) { { image_tag_only: true } }
10
+ mattr_accessor(:thumbnail_variant_options) { { combine_options: { resize: "384x216^", extent: "384x216", gravity: "center"} } }
10
11
  end
11
12
  end
@@ -1,5 +1,5 @@
1
1
  module Ecm
2
2
  module Galleries
3
- VERSION = '0.4.1'.freeze
3
+ VERSION = '0.5.0'.freeze
4
4
  end
5
5
  end
@@ -10,12 +10,18 @@ Ecm::Galleries.configure do |config|
10
10
  #
11
11
  # Default: config.galleries_helper_render_default_options = { variant_options: {}, show_details: false }
12
12
  #
13
- config.base_controller = '<%= base_controller_class_name %>'
13
+ config.galleries_helper_render_default_options = { variant_options: {}, show_details: false }
14
14
 
15
15
  # These options are the defaults that will be applied to when rendering
16
16
  # pictures through the pictures helper.
17
17
  #
18
- # Default: config.pictures_helper_render_default_options = { variant_options: {}, show_details: false }
18
+ # Default: config.pictures_helper_render_default_options = { image_tag_only: true }
19
+ #
20
+ config.pictures_helper_render_default_options = { image_tag_only: true }
21
+
22
+ # This options will be applied when rendering thumbails in galleries.
23
+ #
24
+ # Default: config.thumbnail_variant_options = { combine_options: { resize: "384x216^", extent: "384x216", gravity: "center" } }
19
25
  #
20
- config.pictures_helper_render_default_options = { variant_options: {}, show_details: false }
26
+ config.thumbnail_variant_options = { combine_options: { resize: "384x216^", extent: "384x216", gravity: "center" } }
21
27
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ecm_galleries
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roberto Vasquez Angel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-12-25 00:00:00.000000000 Z
11
+ date: 2018-12-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails