decidim-posts 2.0.0 → 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: ed188fbdbb7cffaa6e432d60995adfde8a170dc193e93beead1776c30a76e926
4
- data.tar.gz: 1398fbf981da81969486a9d90687bb569beff495e6e6f005eecb15658befac0e
3
+ metadata.gz: a32dbea8c50c20a8fdc8e1cd013afa1ea1eaa111f1e33c5b613c0712d597ee61
4
+ data.tar.gz: ebcbb460f42f4f47de30343e3e21b970eca7a1345e2c22c4bfb98e68866250f5
5
5
  SHA512:
6
- metadata.gz: 0c32714e955277dd1d16d3cfba058f2284bcf034f98a8dd6af60a94164a74d7752b4b19e0a4016345ce0b61eb088503470adc8e33e9f198511151f3a37fa8046
7
- data.tar.gz: c24cb0a8f574aa13d5f37215f5e828e4362c0bcd57a526ed0095813f905d0c3ca6e3a16ff3c4b808fff6d77d363d63ddc308ef7f714103422bbfc166ec809195
6
+ metadata.gz: '080a5ffb87de74507a545c5b589534c08aabd2fd3f34199bce29076affc7b520bebe7a651e7e06c60397a9cfd5e094d7e846f2e851809b6580d61d7aa7542dcf'
7
+ data.tar.gz: 4a464c768007672992bc7879f3d6ff1927a128e6764722f8dbca5b2b22854eebbe4c7f6481bbd75edfd79c22ea2329d96bc3197011296d066c3994d72a5052ab
data/README.md CHANGED
@@ -69,7 +69,7 @@ Reactions are part of this module and are an alternative to endorsements. The id
69
69
  Add this line to your application's Gemfile:
70
70
 
71
71
  ```ruby
72
- gem "decidim-posts"
72
+ gem "decidim-posts", "~> 2.0"
73
73
  ```
74
74
 
75
75
  And then execute:
@@ -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| %>
@@ -40,7 +40,7 @@
40
40
  <div id="posts__post_newElement_Meeting" aria-live="polite">
41
41
  <%= decidim_form_for(Decidim::Meetings::MeetingForm.from_params(params).with_context(context), url: Decidim::EngineRouter.main_proxy(posts_component).meetings_path, html: { class: "meetings_form new_meeting hidden opacity-0 scale-0 motion-safe:transition-transform motion-safe:transition-opacity" }) do |form| %>
42
42
  <div class="form__wrapper p-0 gap-4">
43
- <%= render partial: "meeting_form", locals: { form: form } %>
43
+ <%= render partial: "decidim/posts/posts/meeting_form", locals: { form: form } %>
44
44
  </div>
45
45
  <div class="form__wrapper-block flex-col-reverse md:flex-row justify-between">
46
46
  <%= form.submit "#{t("decidim.components.posts.newFeed.action")} #{icon('send-plane-line')}".html_safe, class: "sndBtn button button__sm button__transparent-primary", data: { disable: true } %>
@@ -51,13 +51,13 @@
51
51
  <div id="posts__post_newElement_Post" aria-live="polite">
52
52
  <%= decidim_form_for(Decidim::Posts::PostForm.from_params(params).with_context(context), url: Decidim::EngineRouter.main_proxy(posts_component).posts_path, html: { class: "posts_form new_post hidden opacity-0 scale-0 motion-safe:transition-transform motion-safe:transition-opacity" }) do |form| %>
53
53
  <div class="form__wrapper p-0">
54
- <%= render partial: "post_form", locals: { form: form } %>
54
+ <%= render partial: "decidim/posts/posts/post_form", locals: { form: form } %>
55
55
  </div>
56
56
  <div id="extraFieldsForSurvey" class="posts__post_newElement_Xtra relative hidden opacity-0 scale-0 motion-safe:transition-transform motion-safe:transition-opacity posts__post_newSurvey" aria-live="polite">
57
- <%= render partial: 'new_survey', locals: { form: form } %>
57
+ <%= render partial: 'decidim/posts/posts/new_survey', locals: { form: form } %>
58
58
  </div>
59
- <%= render partial: "attachment", locals: { form: form } %>
60
- <%= render partial: "admin_options", locals: { form: form, participatory_space: target_participatory_space } %>
59
+ <%= render partial: "decidim/posts/posts/attachment", locals: { form: form } %>
60
+ <%= render partial: "decidim/posts/posts/admin_options", locals: { form: form, participatory_space: target_participatory_space } %>
61
61
  <div class="form__wrapper-block flex-col-reverse md:flex-row justify-between">
62
62
  <%= form.submit "#{t("decidim.components.posts.newFeed.action")} #{icon('send-plane-line')}".html_safe, data: { disable: true }, class: "sndBtn button button__sm button__transparent-primary self-end" %>
63
63
  </div>
@@ -3,7 +3,7 @@
3
3
  module Decidim
4
4
  # This holds the decidim-meetings version.
5
5
  module Posts
6
- VERSION = "2.0.0"
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.0
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