dgw_gallery 0.2.4 → 0.2.5

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: 7da1d61ff9fa256f1cf31f6957e0342d555f51e25d0660e9d10044b07ecdeb05
4
- data.tar.gz: 6c456b6685462b418f784786b92ec1960e05edb21458af91a457b52649ddb1be
3
+ metadata.gz: 535bdf862efea2355ce15b4fa8e0582e391cef4778312d2258932618ab804ca0
4
+ data.tar.gz: f93e073d41d30f8045a7ef346b2e79689c1461c1d66a8dae4d70b31086e207d0
5
5
  SHA512:
6
- metadata.gz: 86f32e6e25ef2052a88f5da9313548534a915914ad6fd0a76a6a3c4b45662f47ffb7aed2449d873d6dee49bf22387d065d94a1d380719a584b1edab859b36139
7
- data.tar.gz: c5508777a3f65744575e47e3211ebec3359bca53b0caf769a24c674adbce1f5779d7aef6b1b845aa7186547c7fed0ab118e62a2f61eed68354ee8bfe4f65ee55
6
+ metadata.gz: ca32a15e8485a366139dbd8c7cce16663fcb3b5779fc69d6b431f3c0a37522d8696dc3ddc7b8b1dfad291693dd5536e4727c828db4e3362018af3ca7043edb90
7
+ data.tar.gz: ce1a4e40184586fdb98d6a81cdf960e9ec84b4997e0f541d09094b8ed5ebce39d46860c97dd5a284d919ff87ca4388cdb9e8ef22c54d4fbcd1a9b7e781f5e26d
data/README.md CHANGED
@@ -36,6 +36,40 @@ $ rails app:dgw_gallery:install:views # Install Gallery Views
36
36
  $ rails app:dgw_gallery:install:controller # Install Gallery Controller
37
37
  ```
38
38
 
39
+ ## Usage
40
+ #### To embed the carousel on your page you will use code similar to this
41
+ ```ruby
42
+ ### in your action where you want to display gallery
43
+ ### replace 'id' with the id of gallery you want
44
+ @gallery = Gallery.find(id)
45
+ ```
46
+
47
+ ```erb
48
+ <!-- Code in view.html.erb -->
49
+ <!-- Start Embeded Gallery Area -->
50
+ <% if !@gallery.gallery_images.blank? %>
51
+ <div id="dgwGalleryIndicators" class="carousel slide" data-bs-ride="carousel" data-bs-interval="5000">
52
+ <div class="carousel-inner">
53
+ <% @gallery.gallery_images.each_with_index do |gi, idx| %>
54
+ <div data-bs-interval="5000" class="carousel-item <%= (idx == 0)? "active" : nil %>">
55
+ <figure>
56
+ <%= image_tag gi.image.variant(resize_to_fill: [900, 500]), class: "img-fluid border-radius-xl" %>
57
+ </figure>
58
+ <figcaption class="blockquote-footer text-center">
59
+ <%= gi.caption %>
60
+ </figcaption>
61
+ </div>
62
+ <% end %>
63
+ </div>
64
+ </div>
65
+ <% else %>
66
+ <div class="col-12 text-center">
67
+ There Are No Slides to Display. Please add some.
68
+ </div>
69
+ <% end %>
70
+ <!-- End Embeded Gallery Area -->
71
+ ```
72
+
39
73
  ## Contributing
40
74
  If you wish to contribute submit a pull request and detail your changes and comment them in the code as well.
41
75