decidim-posts 2.0.1 → 2.0.2

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: 1f81b68dbcbce53c688236a18f5bf1783cee0065e670281ef71e3585656a1516
4
- data.tar.gz: ce7afa875e613b88dbd9ab8125f7de1c654f79889738cdcf75bbc7fc6e03ce8e
3
+ metadata.gz: a32dbea8c50c20a8fdc8e1cd013afa1ea1eaa111f1e33c5b613c0712d597ee61
4
+ data.tar.gz: ebcbb460f42f4f47de30343e3e21b970eca7a1345e2c22c4bfb98e68866250f5
5
5
  SHA512:
6
- metadata.gz: 25e5cf2c16fbdeb6e786a62d398ec4c9300822d546cda9d147a3c07185175a6cb4fcedb9255150a62e8cc2b5e87b20404ed7797c766b05f85e22fda7985d6cce
7
- data.tar.gz: a9e6a304790c9f6d98dac6145a848f4ff41b5b05328bf4e26c5e103896f665c38cfee729139fcae8e8d582ca9cf175e5262839eeb82ae02585c57dd9e503b521
6
+ metadata.gz: '080a5ffb87de74507a545c5b589534c08aabd2fd3f34199bce29076affc7b520bebe7a651e7e06c60397a9cfd5e094d7e846f2e851809b6580d61d7aa7542dcf'
7
+ data.tar.gz: 4a464c768007672992bc7879f3d6ff1927a128e6764722f8dbca5b2b22854eebbe4c7f6481bbd75edfd79c22ea2329d96bc3197011296d066c3994d72a5052ab
@@ -15,7 +15,10 @@ module Decidim
15
15
  end
16
16
 
17
17
  def available_feeds
18
- @available_feeds ||= Decidim::Component.where(manifest_name: "posts").where(participatory_space_id: current_organization.participatory_spaces.pluck(:id))
18
+ @available_feeds ||= Decidim::Component
19
+ .where(manifest_name: "posts")
20
+ .where(participatory_space: current_organization.participatory_spaces)
21
+
19
22
  end
20
23
  end
21
24
  end
@@ -3,9 +3,9 @@
3
3
 
4
4
  <div class="flex flex-col items-center">
5
5
  <ul id="galleryItems_<%= post.id %>" class="posts__post_gallery flex overflow-hidden">
6
- <% post.attachments.select { |a| a.url.match(/\.(jpg|jpeg|png|svg|webp|mp4|webm)$/i) }.each_with_index do |attachment, index| %>
7
- <li class="<%= attachment.url.match(/\.(mp4|webm)$/i) ? 'video' : 'image' %> <%= index.zero? ? 'active' : '' %> aspect-[4/3] overflow-hidden flex justify-center items-center" data-src="<%= attachment.url %>">
8
- <% if attachment.url.match(/\.(mp4|webm)$/i) %>
6
+ <% post.attachments.select { |a| a.file_type.match(/(jpg|jpeg|png|svg|webp|mp4|webm)$/i) }.each_with_index do |attachment, index| %>
7
+ <li class="<%= attachment.file_type.match(/(mp4|webm)$/i) ? 'video' : 'image' %> <%= index.zero? ? 'active' : '' %> aspect-[4/3] overflow-hidden flex justify-center items-center" data-src="<%= attachment.url %>">
8
+ <% if attachment.file_type.match(/(mp4|webm)$/i) %>
9
9
  <%= video_tag(attachment.url, class: "object-cover w-full h-full", controls: true, preload: "auto") %>
10
10
  <% else %>
11
11
  <div class="w-full h-full flex justify-center items-center">
@@ -15,10 +15,10 @@
15
15
  </li>
16
16
  <% end %>
17
17
  </ul>
18
- <% if post.attachments.select { |a| a.url.match(/\.(jpg|jpeg|png|svg|webp|mp4|webm)$/i) }.count > 1 %>
18
+ <% if post.attachments.select { |a| a.file_type.match(/(jpg|jpeg|png|svg|webp|mp4|webm)$/i) }.count > 1 %>
19
19
  <div id="navDots_<%= post.id %>" class="nav-dots p-1 flex flex-wrap justify-center">
20
- <% total = post.attachments.select { |a| a.url.match(/\.(jpg|jpeg|png|svg|webp|mp4|webm)$/i) }.count %>
21
- <% post.attachments.select { |a| a.url.match(/\.(jpg|jpeg|png|svg|webp|mp4|webm)$/i) }.each_with_index do |_, index| %>
20
+ <% total = post.attachments.select { |a| a.file_type.match(/(jpg|jpeg|png|svg|webp|mp4|webm)$/i) }.count %>
21
+ <% post.attachments.select { |a| a.file_type.match(/(jpg|jpeg|png|svg|webp|mp4|webm)$/i) }.each_with_index do |_, index| %>
22
22
  <div class="posts__post_gallery_nav_dot flex justify-center items-center cursor-pointer h-6 w-6" role="button" aria-label="<%= t('decidim.components.posts.gallery.navigation', number: index + 1, total: total) %>" data-target="galleryItems_<%= post.id %>" data-index="<%= index %>">
23
23
  <span class="h-2 w-2 rounded-full ring-1 ring-offset-1 ring-feeds-notification <%= index.zero? ? 'bg-feeds-notification' : '' %>"></span>
24
24
  </div>
@@ -26,7 +26,7 @@
26
26
  </div>
27
27
  <% end %>
28
28
  </div>
29
- <% non_media_attachments = post.attachments.reject { |a| a.url.match(/\.(jpg|jpeg|png|svg|webp|mp4|webm)$/i) } %>
29
+ <% non_media_attachments = post.attachments.reject { |a| a.file_type.match(/(jpg|jpeg|png|svg|webp|mp4|webm)$/i) } %>
30
30
  <% if non_media_attachments.any? %>
31
31
  <ul class="document-list space-y-2 mt-4">
32
32
  <% non_media_attachments.each_with_index do |attachment, index| %>
@@ -3,7 +3,7 @@
3
3
  module Decidim
4
4
  # This holds the decidim-meetings version.
5
5
  module Posts
6
- VERSION = "2.0.1"
6
+ VERSION = "2.0.2"
7
7
  COMPAT_DECIDIM_VERSION = [">= 0.28.0", "< 0.31"].freeze
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: decidim-posts
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.1
4
+ version: 2.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Rusa
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2025-05-25 00:00:00.000000000 Z
12
+ date: 2025-06-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: decidim-core