decidim-posts 1.0.0 → 2.0.1

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.
Files changed (46) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +60 -5
  3. data/app/cells/decidim/posts/content_blocks/posts/show.erb +41 -3
  4. data/app/cells/decidim/posts/content_blocks/posts_cell.rb +6 -7
  5. data/app/cells/decidim/posts/meeting/show.erb +2 -2
  6. data/app/cells/decidim/posts/meeting_cell.rb +5 -1
  7. data/app/cells/decidim/posts/post/show.erb +2 -2
  8. data/app/cells/decidim/posts/post/survey.erb +6 -6
  9. data/app/cells/decidim/posts/post_attachments/show.erb +1 -1
  10. data/app/cells/decidim/posts/post_cell.rb +0 -1
  11. data/app/cells/decidim/posts/post_comment/show.erb +1 -1
  12. data/app/cells/decidim/posts/post_header/show.erb +4 -4
  13. data/app/cells/decidim/posts/post_host/show.erb +2 -2
  14. data/app/cells/decidim/posts/post_metadata_cell.rb +2 -0
  15. data/app/cells/decidim/posts/reaction_menu/show.erb +1 -1
  16. data/app/controllers/decidim/posts/meetings_controller.rb +28 -12
  17. data/app/helpers/decidim/posts/application_helper.rb +20 -0
  18. data/app/packs/src/decidim/posts/host_status.js +13 -9
  19. data/app/packs/src/decidim/posts/posts.js +38 -1
  20. data/app/packs/stylesheets/decidim/posts/_variables.scss +19 -8
  21. data/app/packs/stylesheets/decidim/posts/posts.scss +219 -164
  22. data/app/views/decidim/posts/meetings/edit.html.erb +15 -14
  23. data/app/views/decidim/posts/meetings/new.html.erb +27 -0
  24. data/app/views/decidim/posts/posts/_attachment.html.erb +1 -1
  25. data/app/views/decidim/posts/posts/_form.html.erb +22 -22
  26. data/app/views/decidim/posts/posts/_index.html.erb +9 -9
  27. data/app/views/decidim/posts/posts/_meeting_form.erb +1 -1
  28. data/app/views/decidim/posts/posts/_new_survey.html.erb +1 -1
  29. data/app/views/decidim/posts/posts/_new_survey_question.html.erb +1 -1
  30. data/app/views/decidim/posts/posts/_post.html.erb +1 -1
  31. data/app/views/decidim/posts/posts/_sidebar.html.erb +19 -19
  32. data/app/views/decidim/posts/posts/edit.html.erb +7 -6
  33. data/app/views/decidim/posts/posts/index.html.erb +1 -1
  34. data/config/assets.rb +1 -1
  35. data/config/locales/bs.yml +11 -3
  36. data/config/locales/de.yml +11 -3
  37. data/config/locales/en.yml +11 -3
  38. data/config/locales/hr.yml +11 -3
  39. data/config/locales/it.yml +11 -3
  40. data/config/locales/sr.yml +11 -4
  41. data/config/locales/tr.yml +11 -3
  42. data/lib/decidim/posts/component.rb +4 -0
  43. data/lib/decidim/posts/content_blocks/content_blocks_homepage.rb +16 -12
  44. data/lib/decidim/posts/version.rb +2 -2
  45. metadata +5 -5
  46. data/app/views/decidim/posts/posts/_new.html.erb +0 -33
@@ -4,26 +4,26 @@
4
4
  else
5
5
  params[:filter_post_category]
6
6
  end %>
7
- <div id="posts__post_newElement" class="posts__post_newElement_modal" role="dialog" aria-modal="true" aria-label="<%= t("decidim.components.posts.newFeed.title") %>" data-active-feed="" data-active-filter="<%= activefilter %>">
8
- <div class="posts__post_newElement_modal_frame">
9
- <div class="posts__post_newElement_modal_content">
7
+ <div id="posts__post_newElement" class="posts__post_newElement_modal fixed left-0 top-0 right-0 bottom-0 w-full h-full bg-white bg-opacity-60 z-50 justify-center items-start pt-[72px] hidden" role="dialog" aria-modal="true" aria-label="<%= t("decidim.components.posts.newFeed.title") %>" data-active-feed="" data-active-filter="<%= activefilter %>">
8
+ <div class="posts__post_newElement_modal_frame p-4 gap-2 shadow shadow-feedBox rounded lg:max-w-screen-md bg-white w-[calc(100%-2rem)] max-h-[80vh] overflow-auto motion-safe:transition-all">
9
+ <div class="posts__post_newElement_modal_content flex flex-col gap-2">
10
10
  <div class="close-button flex justify-end pb-2">
11
- <button class="btn circle posts__post_newElement-closer" type="button">
12
- <%= icon "close-circle-line" %>
11
+ <button class="btn circle posts__post_newElement-closer w-[52px] h-[52px] p-2 bg-white rounded-[52px] shadow shadow-feedMenu justify-center items-center inline-flex text-black rotate-45" type="button">
12
+ <%= icon "close-circle-line", class:'w-[36px] h-[36px] fill-feeds-sidebar rotate-45' %>
13
13
  <span class="sr-only"><%= t("decidim.components.posts.newFeed.close") %></span>
14
14
  </button>
15
15
  </div>
16
16
  <% if current_user %>
17
- <div class="category-selection">
18
- <% filters = [
19
- { filter: 'post', icon: 'home-5-line' },
20
- { filter: 'sharecare', icon: 'shake-hands-line' },
21
- { filter: 'host', icon: 'home-gear-line' },
22
- { filter: 'survey', icon: 'draft-line' },
23
- { filter: 'calendar', icon: 'calendar-line' }
24
- ] %>
25
- <% filters.each do |filter| %>
26
- <button type="button" class="button button__sm button__transparent-primary" data-category="<%= filter[:filter] %>" aria-pressed="false"><%= t("decidim.components.posts.filter.#{filter[:filter]}_singular") %></button>
17
+ <div class="category-selection flex gap-2 flex-wrap justify-center">
18
+ <% filters = {
19
+ post: 'home-5-line',
20
+ sharecare: 'shake-hands-line',
21
+ host: 'home-gear-line',
22
+ survey: 'draft-line',
23
+ calendar: 'calendar-line'
24
+ } %>
25
+ <% filters.each do |category, icon| %>
26
+ <button type="button" class="button button__sm button__transparent-primary border-2 hover:bg-white hover:text-black" data-category="<%= category %>" aria-pressed="false"><%= ActionController::Base.helpers.extend(Decidim::Posts::ApplicationHelper).category_label_singular(category, posts_component.settings) %></button>
27
27
  <% end %>
28
28
  </div>
29
29
 
@@ -38,7 +38,7 @@
38
38
  %>
39
39
  <div id="posts__post_newElement_Form-LiveRegion" class="sr-only" aria-live="polite"></div>
40
40
  <div id="posts__post_newElement_Meeting" aria-live="polite">
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" }) do |form| %>
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
43
  <%= render partial: "decidim/posts/posts/meeting_form", locals: { form: form } %>
44
44
  </div>
@@ -49,17 +49,17 @@
49
49
  </div>
50
50
 
51
51
  <div id="posts__post_newElement_Post" aria-live="polite">
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" }) do |form| %>
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
54
  <%= render partial: "decidim/posts/posts/post_form", locals: { form: form } %>
55
55
  </div>
56
- <div id="extraFieldsForSurvey" class="posts__post_newElement_Xtra posts__post_newSurvey" aria-live="polite">
57
- <%= render partial: 'decidim/posts/posts/new_survey.html', locals: { form: form } %>
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: 'decidim/posts/posts/new_survey', locals: { form: form } %>
58
58
  </div>
59
- <%= render partial: "decidim/posts/posts/attachment.html", locals: { form: form } %>
60
- <%= render partial: "decidim/posts/posts/admin_options.html", 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
- <%= 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" %>
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>
64
64
  <% end %>
65
65
  </div>
@@ -1,13 +1,13 @@
1
- <main class="feeds__main home">
1
+ <main class="feeds__main home flex w-full xl:max-w-screen-xl 2xl:max-w-screen-2xl mx-auto p-4 lg:p-16 lg:flex-row lg:gap-4 lg:justify-between">
2
2
  <!-- This is the sidebar that appears on the right side of the page -->
3
3
  <%= render partial: "decidim/posts/posts/sidebar" %>
4
- <div class="feeds__container">
5
- <div class="feeds__body">
4
+ <div class="feeds__container order-1 grow min-h-[calc(100vh-72px)]">
5
+ <div class="feeds__body flex-grow flex flex-wrap gap-4 items-start">
6
6
  <div class="card__grid-home w-full lg:grid-cols-8 xl:grid-cols-12 gap-6">
7
7
  <% if current_user %>
8
- <div class="card__grid posts__post posts__post_newElement flex-row justify-between">
9
- <button class="btn circle posts__post_newElement-opener" aria-expanded="false" aria-controls="posts__post_newElement" aria-haspopup="posts__post_newElement" type="button">
10
- <%= icon "close-circle-line" %>
8
+ <div class="card__grid posts__post posts__post_newElement flex-row justify-between gap-4 ring-1 hover:cursor-default md:col-start-1 md:col-end-4 lg:col-start-2 lg:col-end-8 xl:col-start-2 xl:col-end-10">
9
+ <button class="btn circle posts__post_newElement-opener w-[52px] h-[52px] p-2 bg-white rounded-[52px] shadow shadow-feedMenu justify-center items-center inline-flex text-black" aria-expanded="false" aria-controls="posts__post_newElement" aria-haspopup="dialog" type="button">
10
+ <%= icon "close-circle-line", class: "w-[36px] h-[36px] fill-feeds-sidebar rotate-45 motion-safe:transition-transform" %>
11
11
  <span class="sr-only"><%= t("decidim.components.posts.newFeed.openButton") %></span>
12
12
  </button>
13
13
  </div>
@@ -18,7 +18,6 @@
18
18
 
19
19
  </div>
20
20
  </div>
21
-
22
21
 
23
22
  <dialog id="confirmationModal" class="p-4 shadow-md rounded-md ring-1 ring-feeds-host" aria-labelledby="confirmationModal__Label">
24
23
  <div class="flex flex-col gap-4">
@@ -42,8 +41,9 @@
42
41
  </dialog>
43
42
  <!-- In case the Module Decidim FeedsUi is present, the form will be installed in the footer of the application -->
44
43
  <% unless defined?(Decidim::FeedsUi) %>
45
- <%= render partial: "decidim/posts/posts/form.html" %>
46
- <%= append_javascript_pack_tag "decidim_feeds" %>
44
+ <%#= render partial: "decidim/posts/posts/form.html" %>
45
+ <%= render partial: "form" %>
46
+ <%= append_javascript_pack_tag "decidim_posts" %>
47
47
  <% end %>
48
48
  </div>
49
49
  </main>
@@ -5,7 +5,7 @@
5
5
  <%= form.hidden_field :registration_terms, value: 'none' %>
6
6
  <%= form.text_field :title, autofocus: true, class: "js-hashtags", hashtaggable: true %>
7
7
  <%= text_editor_for(form, :description, hashtaggable: true) %>
8
- <%= form.text_area :location %>
8
+ <%= form.text_area :location, required: true %>
9
9
  <%= form.datetime_field :start_time %>
10
10
  <%= form.datetime_field :end_time %>
11
11
  <%= form.select(
@@ -1,4 +1,4 @@
1
- <button class="posts__post_newSurvey-btn" type="button" aria-haspopup="true" aria-controls="posts__post_newSurvey_questionsContainer">
1
+ <button class="posts__post_newSurvey-btn flex justify-center items-center gap-2 text-black font-medium p-4 bg-feeds-bg w-full rounded" type="button" aria-controls="posts__post_newSurvey_questionsContainer">
2
2
  <%= t("decidim.components.posts.newFeed.newSurvey.newQuestion") %>
3
3
  <%= icon "add-line" %>
4
4
  </button>
@@ -5,7 +5,7 @@
5
5
  <% end %>
6
6
  <div class="flex gap-2 justify-betwee py-2">
7
7
  <%= form.select :question_type, options_for_select(Decidim::Posts::Question.question_types.keys.map { |key| [t("decidim.components.posts.newFeed.newSurvey.questionTypes.#{key}"), key] }), {}, class: 'form-control' %>
8
- <button class="posts__post_newAnswer-btn button button__sm button__transparent-primary ml-auto" type="button" aria-haspopup="true" aria-controls="posts__post_newSurvey_answersContainer" data-question-id="NEW_RECORD">
8
+ <button class="posts__post_newAnswer-btn button button__sm button__transparent-primary ml-auto" type="button" aria-controls="posts__post_newSurvey_answersContainer" data-question-id="NEW_RECORD">
9
9
  <%= t("decidim.components.posts.newFeed.newSurvey.newAnswer") %>
10
10
  <%= icon "add-line" %>
11
11
  </button>
@@ -1,5 +1,5 @@
1
1
  <% if post.is_a?(Decidim::Posts::Post) %>
2
- <article id="feeds_post-<%= post.id %>" class="card__grid posts__post <%= 'host-highlight' if post.highlighted %>" data-content="<%= post.category %>" <%= 'aria-live="polite"' if post.category == 'host' %>>
2
+ <article id="feeds_post-<%= post.id %>" class="card__grid posts__post gap-4 ring-1 hover:cursor-default md:col-start-1 md:col-end-4 lg:col-start-2 lg:col-end-8 xl:col-start-2 xl:col-end-10 <%= 'host-highlight' if post.highlighted %>" data-content="<%= post.category %>" <%= 'aria-live="polite"' if post.category == 'host' %>>
3
3
  <% if post.category == 'host' %>
4
4
  <%= cell("decidim/posts/post_host", post) %>
5
5
  <% else %>
@@ -1,26 +1,26 @@
1
- <aside class="posts__aside">
1
+ <aside class="posts__aside shrink-0 max-w-[72px] order-2 flex flex-col justify-between lg:justify-start">
2
2
  <nav aria-label="<%= t("decidim.components.posts.filter.menuAriaLabel") %>">
3
- <ul>
4
- <% filters = [
5
- { filter: 'all', icon: 'function-line' },
6
- { filter: 'post', icon: 'home-5-line' },
7
- { filter: 'sharecare', icon: 'shake-hands-line' },
8
- { filter: 'calendar', icon: 'calendar-line' },
9
- { filter: 'survey', icon: 'draft-line' },
10
- { filter: 'host', icon: 'home-gear-line' }
11
- ] %>
3
+ <ul class="flex flex-col space-y-4">
4
+ <% filters = {
5
+ all: 'function-line',
6
+ post: 'home-5-line',
7
+ sharecare: 'shake-hands-line',
8
+ calendar: 'calendar-line',
9
+ survey: 'draft-line',
10
+ host: 'home-gear-line'
11
+ } %>
12
12
  <% posts_component = current_component.manifest_name == "posts" ? current_component : current_component.participatory_space.components.find_by(manifest_name: "posts") %>
13
13
  <% current_posts_path = Decidim::EngineRouter.main_proxy(posts_component).posts_path %>
14
- <% activefilter = if current_user.admin? && params[:filter_post_category].blank?
15
- 'host'
16
- else
17
- params[:filter_post_category]
18
- end %>
19
- <% filters.each do |filter| %>
14
+ <% if current_user.admin? %>
15
+ <% activeFilter = params[:filter_post_category].blank? ? 'host' : params[:filter_post_category] %>
16
+ <% else %>
17
+ <% activeFilter = params[:filter_post_category].blank? ? 'all' : params[:filter_post_category] %>
18
+ <% end %>
19
+ <% filters.each do |category, icon| %>
20
20
  <li>
21
- <%= link_to "#{current_posts_path}?filter_post_category=#{filter[:filter]}", class: (activefilter == filter[:filter] ? 'active' : ''), data: { filter: filter[:filter] }, aria: { current: (params[:filter_post_category] == filter[:filter] ? 'page' : nil) } do %>
22
- <%= icon "#{filter[:icon]}" %>
23
- <span><%= t("decidim.components.posts.filter.#{filter[:filter]}") %></span>
21
+ <%= link_to "#{current_posts_path}?filter_post_category=#{category}", class: "flex flex-col items-center font-medium text-sm md:text-md text-feeds-sidebar text-center #{activeFilter.to_s.strip == category.to_s.strip ? 'active' : ''}", data: { filter: category }, aria: { current: (activeFilter.to_s.strip == category.to_s.strip ? 'page' : nil) } do %>
22
+ <%= icon "#{icon}", class:'w-[24px] h-auto fill-feeds-sidebar' %>
23
+ <span><%= category_label(category, component_settings) %></span>
24
24
  <% end %>
25
25
  </li>
26
26
  <% end %>
@@ -1,11 +1,12 @@
1
- <main class="feeds__main home">
1
+ <main class="feeds__main home flex w-full xl:max-w-screen-xl 2xl:max-w-screen-2xl mx-auto p-4 lg:p-16 lg:flex-row lg:gap-4 lg:justify-between">
2
2
  <!-- This is the sidebar that appears on the right side of the page -->
3
3
  <%= render partial: "decidim/posts/posts/sidebar" %>
4
- <div class="feeds__container">
5
- <div class="feeds__body">
4
+ <div class="feeds__container order-1 grow min-h-[calc(100vh-72px)]">
5
+ <div class="feeds__body flex-grow flex flex-wrap gap-4 items-start">
6
6
  <div class="card__grid-home w-full lg:grid-cols-8 xl:grid-cols-12 gap-6">
7
- <div class="card__grid posts__post p-2" data-content="<%= @post.category %>">
8
- <%= render "edit_form" %>
7
+ <div class="card__grid posts__post p-2 gap-4 ring-1 hover:cursor-default md:col-start-1 md:col-end-4 lg:col-start-2 lg:col-end-8 xl:col-start-2 xl:col-end-10" data-content="<%= @post.category %>">
8
+ <%= render "edit_form" %>
9
+ </div>
9
10
  </div>
10
11
  </div>
11
12
 
@@ -28,7 +29,7 @@
28
29
  </dialog>
29
30
  <!-- In case the Module Decidim FeedsUi is present, the form will be installed in the footer of the application -->
30
31
  <% unless defined?(Decidim::FeedsUi) %>
31
- <%= append_javascript_pack_tag "decidim_feeds" %>
32
+ <%= append_javascript_pack_tag "decidim_posts" %>
32
33
  <% end %>
33
34
  </div>
34
35
  </main>
@@ -1 +1 @@
1
- <%= render "index" %>
1
+ <%= render partial: "decidim/posts/posts/index" %>
data/config/assets.rb CHANGED
@@ -4,6 +4,6 @@ base_path = File.expand_path("..", __dir__)
4
4
 
5
5
  Decidim::Webpacker.register_path("#{base_path}/app/packs")
6
6
  Decidim::Webpacker.register_entrypoints(
7
- decidim_feeds: "#{base_path}/app/packs/entrypoints/decidim_posts.js"
7
+ decidim_posts: "#{base_path}/app/packs/entrypoints/decidim_posts.js"
8
8
  )
9
9
  Decidim::Webpacker.register_stylesheet_import("stylesheets/decidim/posts/posts")
@@ -13,8 +13,12 @@ bs:
13
13
  actions:
14
14
  preview: Pregled
15
15
  content_blocks:
16
- feeds:
16
+ posts_settings:
17
+ component: Prikazani feed
18
+ posts:
17
19
  name: Feed
20
+ title: Posljednji postovi
21
+ seeall: Pogledaj sve postove
18
22
  actions:
19
23
  title: Akcije
20
24
  edit_post: Uredi post
@@ -95,6 +99,10 @@ bs:
95
99
  settings:
96
100
  global:
97
101
  attachments_allowed?: Prilozi dopušteni
102
+ host_category_label_plural: Alternativni naslov za kategoriju Admin (Množina)
103
+ sharecare_category_label_plural: Alternativni naslov za kategoriju Podijeli & Brini (Množina)
104
+ host_category_label_singular: Alternativni naslov za kategoriju Admin (Jednina)
105
+ sharecare_category_label_singular: Alternativni naslov za kategoriju Podijeli & Brini (Jednina)
98
106
  step:
99
107
  endorsements_enabled: Omogući sviđanja
100
108
  endorsements_blocked: Sviđanja blokirana
@@ -168,8 +176,8 @@ bs:
168
176
  post_singular: Post
169
177
  sharecare: Podijeli & Brini
170
178
  sharecare_singular: Podijeli & Brini
171
- host: Domaćin
172
- host_singular: Domaćin
179
+ host: Admin
180
+ host_singular: Admin
173
181
  calendar: Sastanci
174
182
  calendar_singular: Sastanak
175
183
  survey: Ankete
@@ -13,8 +13,12 @@ de:
13
13
  actions:
14
14
  preview: Vorschau
15
15
  content_blocks:
16
- feeds:
16
+ posts_settings_form:
17
+ component: Anzuzeigender Feed
18
+ posts:
17
19
  name: Feed
20
+ title: Letzte Beiträge
21
+ seeall: Alle Beiträge anzeigen
18
22
  actions:
19
23
  title: Aktionen
20
24
  edit_post: Beitrag bearbeiten
@@ -95,6 +99,10 @@ de:
95
99
  settings:
96
100
  global:
97
101
  attachments_allowed?: Anhänge erlaubt
102
+ host_category_label_plural: Alternativ-Titel für die Admin-Kategorie (Plural)
103
+ sharecare_category_label_plural: Alternativ-Titel für die Share & Care-Kategorie (Plural)
104
+ host_category_label_singular: Alternativ-Titel für die Admin-Kategorie (Singular)
105
+ sharecare_category_label_singular: Alternativ-Titel für die Share & Care-Kategorie (Singular)
98
106
  step:
99
107
  endorsements_enabled: Unterstützungen aktivieren
100
108
  endorsements_blocked: Unterstützungen blockiert
@@ -168,8 +176,8 @@ de:
168
176
  post_singular: Beitrag
169
177
  sharecare: Share & Care
170
178
  sharecare_singular: Share & Care
171
- host: Host
172
- host_singular: Host
179
+ host: Admin
180
+ host_singular: Admin
173
181
  calendar: Meetings
174
182
  calendar_singular: Meeting
175
183
  survey: Umfragen
@@ -13,8 +13,12 @@ en:
13
13
  actions:
14
14
  preview: Preview
15
15
  content_blocks:
16
- feeds:
16
+ posts_settings_form:
17
+ component: Feed to display
18
+ posts:
17
19
  name: Feed
20
+ title: Latest posts
21
+ seeall: See all posts
18
22
  actions:
19
23
  title: Actions
20
24
  edit_post: Edit post
@@ -95,6 +99,10 @@ en:
95
99
  settings:
96
100
  global:
97
101
  attachments_allowed?: Attachments allowed
102
+ host_category_label_plural: Alternative title for the Admin category (Plural)
103
+ sharecare_category_label_plural: Alternative title for the Share & Care category (Plural)
104
+ host_category_label_singular: Alternative title for the Admin category (Singular)
105
+ sharecare_category_label_singular: Alternative title for the Share & Care category (Singular)
98
106
  step:
99
107
  endorsements_enabled: Enable endorsements
100
108
  endorsements_blocked: Endorsements blocked
@@ -169,8 +177,8 @@ en:
169
177
  post_singular: Post
170
178
  sharecare: Share & Care
171
179
  sharecare_singular: Share & Care
172
- host: Host
173
- host_singular: Host
180
+ host: Admin
181
+ host_singular: Admin
174
182
  calendar: Meetings
175
183
  calendar_singular: Meeting
176
184
  survey: Surveys
@@ -13,8 +13,12 @@ hr:
13
13
  actions:
14
14
  preview: Pregled
15
15
  content_blocks:
16
- feeds:
16
+ posts_settings_form:
17
+ component: Prikazani feed
18
+ posts:
17
19
  name: Feed
20
+ title: Posljednji postovi
21
+ seeall: Pogledaj sve postove
18
22
  actions:
19
23
  title: Akcije
20
24
  edit_post: Uredi post
@@ -95,6 +99,10 @@ hr:
95
99
  settings:
96
100
  global:
97
101
  attachments_allowed?: Prilozi dopušteni
102
+ host_category_label_plural: Alternativni naslov za kategoriju Admin (Množina)
103
+ sharecare_category_label_plural: Alternativni naslov za kategoriju Podijeli & Brini (Množina)
104
+ host_category_label_singular: Alternativni naslov za kategoriju Admin (Jednina)
105
+ sharecare_category_label_singular: Alternativni naslov za kategoriju Podijeli & Brini (Jednina)
98
106
  step:
99
107
  endorsements_enabled: Omogući sviđanja
100
108
  endorsements_blocked: Sviđanja blokirana
@@ -168,8 +176,8 @@ hr:
168
176
  post_singular: Post
169
177
  sharecare: Podijeli & Brini
170
178
  sharecare_singular: Podijeli & Brini
171
- host: Domaćin
172
- host_singular: Domaćin
179
+ host: Admin
180
+ host_singular: Admin
173
181
  calendar: Sastanci
174
182
  calendar_singular: Sastanak
175
183
  survey: Ankete
@@ -13,8 +13,12 @@ it:
13
13
  actions:
14
14
  preview: Anteprima
15
15
  content_blocks:
16
- feeds:
16
+ posts_settings_form:
17
+ component: Feed da visualizzare
18
+ posts:
17
19
  name: Feed
20
+ title: Ultimi post
21
+ seeall: Vedi tutti i post
18
22
  actions:
19
23
  title: Azioni
20
24
  edit_post: Modifica post
@@ -95,6 +99,10 @@ it:
95
99
  settings:
96
100
  global:
97
101
  attachments_allowed?: Allegati consentiti
102
+ host_category_label_plural: Titolo alternativo per la categoria Admin (Plurale)
103
+ sharecare_category_label_plural: Titolo alternativo per la categoria Share & Care (Plurale)
104
+ host_category_label_singular: Titolo alternativo per la categoria Admin (Singolare)
105
+ sharecare_category_label_singular: Titolo alternativo per la categoria Share & Care (Singolare)
98
106
  step:
99
107
  endorsements_enabled: Abilita le approvazioni
100
108
  endorsements_blocked: Approvazioni bloccate
@@ -168,8 +176,8 @@ it:
168
176
  post_singular: Post
169
177
  sharecare: Share & Care
170
178
  sharecare_singular: Share & Care
171
- host: Host
172
- host_singular: Host
179
+ host: Admin
180
+ host_singular: Admin
173
181
  calendar: Incontri
174
182
  calendar_singular: Incontro
175
183
  survey: Questionario
@@ -13,12 +13,15 @@ sr:
13
13
  actions:
14
14
  preview: Pregled
15
15
  content_blocks:
16
- feeds:
16
+ posts_settings_form:
17
+ component: Feed za prikaz
18
+ posts:
17
19
  name: Feed
20
+ title: Poslednji postovi
21
+ seeall: Pogledaj sve postove
18
22
  actions:
19
23
  title: Akcije
20
24
  edit_post: Uredi post
21
-
22
25
  time:
23
26
  minutes:
24
27
  one: Minut
@@ -96,6 +99,10 @@ sr:
96
99
  settings:
97
100
  global:
98
101
  attachments_allowed?: Dozvoljeni prilozi
102
+ host_category_label_plural: Alternativni naslov za kategoriju Admin (Množina)
103
+ sharecare_category_label_plural: Alternativni naslov za kategoriju Podeli & Brini (Množina)
104
+ host_category_label_singular: Alternativni naslov za kategoriju Admin (Jednina)
105
+ sharecare_category_label_singular: Alternativni naslov za kategoriju Podeli & Brini (Jednina)
99
106
  step:
100
107
  endorsements_enabled: Omogući sviđanja
101
108
  endorsements_blocked: Blokirana sviđanja
@@ -169,8 +176,8 @@ sr:
169
176
  post_singular: Post
170
177
  sharecare: Podeli & Brini
171
178
  sharecare_singular: Podeli & Brini
172
- host: Domaćin
173
- host_singular: Domaćin
179
+ host: Admin
180
+ host_singular: Admin
174
181
  calendar: Sastanci
175
182
  calendar_singular: Sastanak
176
183
  survey: Ankete
@@ -13,8 +13,12 @@ tr:
13
13
  actions:
14
14
  preview: Önizleme
15
15
  content_blocks:
16
- feeds:
16
+ posts_settings_form:
17
+ component: Gösterilecek feed
18
+ posts:
17
19
  name: Feed
20
+ title: Son gönderiler
21
+ seeall: Tüm gönderileri gör
18
22
  actions:
19
23
  title: Eylemler
20
24
  edit_post: Gönderiyi düzenle
@@ -95,6 +99,10 @@ tr:
95
99
  settings:
96
100
  global:
97
101
  attachments_allowed?: Ekler izin verildi
102
+ host_category_label_plural: Admin kategorisi için alternatif başlık (çoğul)
103
+ sharecare_category_label_plural: Paylaş ve Bakım kategorisi için alternatif başlık (çoğul)
104
+ host_category_label_singular: Admin kategorisi için alternatif başlık (tekil)
105
+ sharecare_category_label_singular: Paylaş ve Bakım kategorisi için alternatif başlık (tekil)
98
106
  step:
99
107
  endorsements_enabled: Beğenileri etkinleştir
100
108
  endorsements_blocked: Beğenileri engelle
@@ -168,8 +176,8 @@ tr:
168
176
  post_singular: Gönderi
169
177
  sharecare: Share & Care
170
178
  sharecare_singular: Share & Care
171
- host: Ev sahibi
172
- host_singular: Ev sahibi
179
+ host: Admin
180
+ host_singular: Admin
173
181
  calendar: Toplantılar
174
182
  calendar_singular: Toplantı
175
183
  survey: Anketler
@@ -27,6 +27,10 @@ Decidim.register_component(:posts) do |component|
27
27
  # end
28
28
  component.settings(:global) do |settings|
29
29
  settings.attribute :attachments_allowed?, type: :boolean, default: true
30
+ settings.attribute :host_category_label_plural, type: :string, translated: true, required: false, editor: false
31
+ settings.attribute :host_category_label_singular, type: :string, translated: true, required: false, editor: false
32
+ settings.attribute :sharecare_category_label_plural, type: :string, translated: true, required: false, editor: false
33
+ settings.attribute :sharecare_category_label_singular, type: :string, translated: true, required: false, editor: false
30
34
  end
31
35
 
32
36
  component.settings(:step) do |settings|
@@ -2,18 +2,22 @@
2
2
 
3
3
  def initialize_homepage_content_blocks
4
4
  initializer "Feeds.content_blocks" do
5
- Decidim.content_blocks.register(:homepage, :feeds) do |content_block|
6
- content_block.cell = "decidim/posts/content_blocks/feeds"
7
- content_block.settings_form_cell = "decidim/posts/content_blocks/feeds_settings_form"
8
- content_block.public_name_key = "decidim.posts.content_blocks.feeds.name"
5
+ register_content_block(:homepage, :feeds_homepage)
6
+ register_content_block(:assembly_homepage, :feeds_assembly_homepage)
7
+ register_content_block(:participatory_process_homepage, :feeds_participatory_process_homepage)
8
+ register_content_block(:participatory_process_group_homepage, :feeds_participatory_process_group_homepage)
9
+ end
10
+ end
11
+
9
12
 
10
- content_block.settings do |settings|
11
- # settings.attribute :title, type: :text, translated: true
12
- # settings.attribute :link_text, type: :text, translated: true
13
- # settings.attribute :link_url, type: :text, translated: true
14
- # settings.attribute :count, type: :integer, default: 3
15
- settings.attribute :component_id, type: :integer
16
- end
13
+ def register_content_block(component, type)
14
+ Decidim.content_blocks.register(component, type) do |content_block|
15
+ content_block.cell = "decidim/posts/content_blocks/posts"
16
+ content_block.settings_form_cell = "decidim/posts/content_blocks/posts_settings_form"
17
+ content_block.public_name_key = "decidim.posts.content_blocks.posts.name"
18
+
19
+ content_block.settings do |settings|
20
+ settings.attribute :component_id, type: :integer
17
21
  end
18
22
  end
19
- end
23
+ end
@@ -3,7 +3,7 @@
3
3
  module Decidim
4
4
  # This holds the decidim-meetings version.
5
5
  module Posts
6
- VERSION = "1.0.0"
7
- COMPAT_DECIDIM_VERSION = [">= 0.28.0", "< 0.29"].freeze
6
+ VERSION = "2.0.1"
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: 1.0.0
4
+ version: 2.0.1
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: 2024-10-26 00:00:00.000000000 Z
12
+ date: 2025-05-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: decidim-core
@@ -20,7 +20,7 @@ dependencies:
20
20
  version: 0.28.0
21
21
  - - "<"
22
22
  - !ruby/object:Gem::Version
23
- version: '0.29'
23
+ version: '0.31'
24
24
  type: :runtime
25
25
  prerelease: false
26
26
  version_requirements: !ruby/object:Gem::Requirement
@@ -30,7 +30,7 @@ dependencies:
30
30
  version: 0.28.0
31
31
  - - "<"
32
32
  - !ruby/object:Gem::Version
33
- version: '0.29'
33
+ version: '0.31'
34
34
  description: Social posts component for Decidim that should be used in combination
35
35
  with decidim-feeds.
36
36
  email:
@@ -120,6 +120,7 @@ files:
120
120
  - app/views/decidim/posts/admin/posts/_post-tr.html.erb
121
121
  - app/views/decidim/posts/admin/posts/index.html.erb
122
122
  - app/views/decidim/posts/meetings/edit.html.erb
123
+ - app/views/decidim/posts/meetings/new.html.erb
123
124
  - app/views/decidim/posts/posts/_admin_options.html.erb
124
125
  - app/views/decidim/posts/posts/_attachment.html.erb
125
126
  - app/views/decidim/posts/posts/_edit_form.html.erb
@@ -127,7 +128,6 @@ files:
127
128
  - app/views/decidim/posts/posts/_form.html.erb
128
129
  - app/views/decidim/posts/posts/_index.html.erb
129
130
  - app/views/decidim/posts/posts/_meeting_form.erb
130
- - app/views/decidim/posts/posts/_new.html.erb
131
131
  - app/views/decidim/posts/posts/_new_survey.html.erb
132
132
  - app/views/decidim/posts/posts/_new_survey_answer.html.erb
133
133
  - app/views/decidim/posts/posts/_new_survey_question.html.erb