decidim-proposals 0.28.1 → 0.28.3

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 (61) hide show
  1. checksums.yaml +4 -4
  2. data/app/cells/decidim/proposals/proposal_l_cell.rb +1 -1
  3. data/app/controllers/concerns/decidim/proposals/orderable.rb +1 -1
  4. data/app/helpers/decidim/proposals/application_helper.rb +1 -1
  5. data/app/packs/entrypoints/participatory_texts_admin.js +2 -0
  6. data/app/packs/stylesheets/decidim/proposals/admin/participatory_texts.scss +23 -0
  7. data/app/presenters/decidim/proposals/admin_log/proposal_presenter.rb +1 -5
  8. data/app/presenters/decidim/proposals/admin_log/value_types/proposal_title_body_presenter.rb +1 -3
  9. data/app/presenters/decidim/proposals/log/valuation_assignment_presenter.rb +1 -1
  10. data/app/views/decidim/proposals/admin/participatory_texts/index.html.erb +6 -3
  11. data/app/views/decidim/proposals/admin/proposal_answers/_form.html.erb +1 -1
  12. data/app/views/decidim/proposals/admin/proposals/_bulk-actions.html.erb +10 -6
  13. data/app/views/decidim/proposals/admin/proposals/index.html.erb +2 -0
  14. data/app/views/decidim/proposals/proposals/_proposal_aside.html.erb +4 -2
  15. data/app/views/decidim/proposals/proposals/compare.html.erb +1 -1
  16. data/app/views/decidim/proposals/proposals/preview.html.erb +1 -1
  17. data/config/assets.rb +1 -0
  18. data/config/locales/ar.yml +1 -7
  19. data/config/locales/bg.yml +696 -1
  20. data/config/locales/ca.yml +10 -10
  21. data/config/locales/cs.yml +5 -5
  22. data/config/locales/de.yml +20 -20
  23. data/config/locales/el.yml +0 -6
  24. data/config/locales/en.yml +5 -5
  25. data/config/locales/es-MX.yml +6 -6
  26. data/config/locales/es-PY.yml +6 -6
  27. data/config/locales/es.yml +6 -6
  28. data/config/locales/eu.yml +9 -9
  29. data/config/locales/fi-plain.yml +4 -4
  30. data/config/locales/fi.yml +13 -13
  31. data/config/locales/fr-CA.yml +6 -6
  32. data/config/locales/fr.yml +6 -6
  33. data/config/locales/ga-IE.yml +6 -0
  34. data/config/locales/gl.yml +1 -7
  35. data/config/locales/hu.yml +1 -5
  36. data/config/locales/id-ID.yml +0 -2
  37. data/config/locales/is-IS.yml +0 -3
  38. data/config/locales/it.yml +1 -3
  39. data/config/locales/ja.yml +6 -6
  40. data/config/locales/lt.yml +0 -6
  41. data/config/locales/lv.yml +0 -2
  42. data/config/locales/nl.yml +1 -7
  43. data/config/locales/no.yml +0 -6
  44. data/config/locales/pl.yml +103 -2
  45. data/config/locales/pt-BR.yml +0 -2
  46. data/config/locales/pt.yml +0 -6
  47. data/config/locales/ro-RO.yml +0 -5
  48. data/config/locales/ru.yml +0 -3
  49. data/config/locales/sk.yml +0 -2
  50. data/config/locales/sv.yml +104 -52
  51. data/config/locales/tr-TR.yml +3 -3
  52. data/config/locales/uk.yml +0 -3
  53. data/config/locales/zh-CN.yml +0 -2
  54. data/config/locales/zh-TW.yml +0 -6
  55. data/lib/decidim/proposals/component.rb +2 -4
  56. data/lib/decidim/proposals/proposal_serializer.rb +51 -0
  57. data/lib/decidim/proposals/seeds.rb +5 -1
  58. data/lib/decidim/proposals/test/factories.rb +13 -1
  59. data/lib/decidim/proposals/version.rb +1 -1
  60. metadata +26 -25
  61. data/app/presenters/decidim/proposals/log/resource_presenter.rb +0 -22
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 07d2cb0c58472efc567a33a1d35c8d46a3ec723196f543a2af5f0fb7d37ed2d2
4
- data.tar.gz: 67404c9736f2b189d338d503a9ae24727711f803305cc640df00fcdf384c3a19
3
+ metadata.gz: 4e4bd14ec5e23a0ba39c81c825c919ceaadbba6c9a2f47498a8f1a2d0bf59dd6
4
+ data.tar.gz: 757238cf1ff370f483d05ce6a569f4cd41aa5f06191342b374a583babc10d570
5
5
  SHA512:
6
- metadata.gz: 3ef557822bacfa28606a3a4685b20d920c19afaae09e041d1ea457c7e243e5e8f8b2e84c6c169ad037a99bca67236aae0bfe6ba71e8eeeeb4bf9622df7dd07fc
7
- data.tar.gz: ca2bc013940842932fe67588f9bfd31209efcb5a40d99c45a15135c2d03091d96480bedf533a6d9ab060e6e49024d393f31aea2b34373dbe2cab27e8ac0cfd21
6
+ metadata.gz: a08f20046706481335121d31d830f25e2255b76cec1b93aa4bc38e63145498aa8111995505a8f4ac007cbf245d252466b90f744d5bd51b80fc9e74bc2db82af3
7
+ data.tar.gz: 3ae92e1d44a2c9bdbce252029947d91dca471f9a00d3f932980ce55f2b796e4ecd7abf83c394f746dd4651dcb736f7c2bc88abc566cd72127b4fa4ca7dfc4066
@@ -29,7 +29,7 @@ module Decidim
29
29
  hash << model.endorsements_count
30
30
  hash << model.comments_count
31
31
  hash << Digest::MD5.hexdigest(model.component.cache_key_with_version)
32
- hash << Digest::MD5.hexdigest(resource_image_path) if resource_image_path
32
+ hash << Digest::MD5.hexdigest(resource_image_url) if resource_image_url
33
33
  hash << render_space? ? 1 : 0
34
34
  if current_user
35
35
  hash << current_user.cache_key_with_version
@@ -35,7 +35,7 @@ module Decidim
35
35
 
36
36
  def fetch_default_order
37
37
  default_order = current_settings.default_sort_order.presence || component_settings.default_sort_order
38
- return order_by_default if default_order == "default"
38
+ return order_by_default if default_order == "automatic"
39
39
 
40
40
  possible_orders.include?(default_order) ? default_order : order_by_default
41
41
  end
@@ -139,7 +139,7 @@ module Decidim
139
139
  end
140
140
 
141
141
  def show_voting_rules?
142
- return false unless votes_enabled?
142
+ return false if !votes_enabled? || current_settings.votes_blocked?
143
143
 
144
144
  return true if vote_limit_enabled?
145
145
  return true if threshold_per_proposal_enabled?
@@ -0,0 +1,2 @@
1
+ require.context("../images", true)
2
+ import "stylesheets/decidim/proposals/admin/participatory_texts.scss"
@@ -0,0 +1,23 @@
1
+ #participatory-text {
2
+ li {
3
+ @apply py-4 hover:cursor-move;
4
+
5
+ a {
6
+ @apply font-bold flex;
7
+
8
+ > svg {
9
+ @apply text-2xl fill-black;
10
+ }
11
+
12
+ &[aria-expanded="true"] {
13
+ & > svg {
14
+ @apply rotate-90 transition-transform;
15
+ }
16
+ }
17
+
18
+ span {
19
+ @apply ml-auto;
20
+ }
21
+ }
22
+ }
23
+ }
@@ -15,13 +15,9 @@ module Decidim
15
15
  class ProposalPresenter < Decidim::Log::BasePresenter
16
16
  private
17
17
 
18
- def resource_presenter
19
- @resource_presenter ||= Decidim::Proposals::Log::ResourcePresenter.new(action_log.resource, h, action_log.extra["resource"])
20
- end
21
-
22
18
  def diff_fields_mapping
23
19
  {
24
- title: "Decidim::Proposals::AdminLog::ValueTypes::ProposalTitleBodyPresenter",
20
+ title: :i18n,
25
21
  body: "Decidim::Proposals::AdminLog::ValueTypes::ProposalTitleBodyPresenter",
26
22
  state: "Decidim::Proposals::AdminLog::ValueTypes::ProposalStatePresenter",
27
23
  answered_at: :date,
@@ -5,12 +5,10 @@ module Decidim
5
5
  module AdminLog
6
6
  module ValueTypes
7
7
  class ProposalTitleBodyPresenter < Decidim::Log::ValueTypes::DefaultPresenter
8
- include Decidim::TranslatableAttributes
9
-
10
8
  def present
11
9
  return unless value
12
10
 
13
- translated_value = translated_attribute(value)
11
+ translated_value = h.decidim_escape_translated(value)
14
12
  return if translated_value.blank?
15
13
 
16
14
  renderer = Decidim::ContentRenderers::HashtagRenderer.new(translated_value)
@@ -11,7 +11,7 @@ module Decidim
11
11
  # Returns an HTML-safe String.
12
12
  def present_resource_name
13
13
  if resource.present?
14
- Decidim::Proposals::ProposalPresenter.new(resource.proposal).title
14
+ resource.proposal.presenter.title(html_escape: true)
15
15
  else
16
16
  super
17
17
  end
@@ -15,6 +15,7 @@
15
15
  <div class="row column">
16
16
  <p class="mt-3"><%= t(".info_1") %></p>
17
17
  <ul id="participatory-text" class="draggable-list js-connect js-list-actives accordion mb-m mt-2.5 ml-2.5 mr-2.5"
18
+ data-component="accordion"
18
19
  data-accordion
19
20
  data-sort-url="#"
20
21
  data-multi-expand="true"
@@ -22,11 +23,13 @@
22
23
  <%= form.fields_for(:proposals) do |prop_form| %>
23
24
  <% proposal = @drafts[prop_form.index] %>
24
25
 
25
- <li class="py-4 draggable-content <%= proposal.article? ? "is-active" : nil %>" data-accordion-item draggable="true">
26
- <a href="#" class="accordion-title font-bold mt-5"><%= preview_participatory_text_section_title(proposal) %>
26
+ <li class="draggable-content is-active" data-accordion-item draggable="true">
27
+ <a data-open="true" data-controls="article-<%= proposal.id %>">
28
+ <%= icon "arrow-right-s-line" %>
29
+ <%= preview_participatory_text_section_title(proposal) %>
27
30
  <span class="mr-m"><%= icon "menu-line", class: "fill-black" %></span>
28
31
  </a>
29
- <div class="accordion-content" data-tab-content>
32
+ <div data-tab-content id="article-<%= proposal.id %>">
30
33
  <%= render "article-preview", { form: prop_form, proposal: } %>
31
34
  </div>
32
35
  </li>
@@ -5,7 +5,7 @@
5
5
  <h2 class="card-title"><%= t ".title", title: present(proposal).title %></h2>
6
6
  </div>
7
7
 
8
- <% if defined?(Decidim::Templates) %>
8
+ <% if Decidim.module_installed?(:templates) %>
9
9
  <%= render "decidim/templates/admin/proposal_answer_templates/template_chooser", form: f %>
10
10
  <% end %>
11
11
 
@@ -10,13 +10,17 @@
10
10
 
11
11
  <% if allowed_to? :import, :proposals %>
12
12
  <%= import_dropdown do %>
13
- <li class="imports--component imports--proposals">
14
- <%= link_to t("actions.import", scope: "decidim.proposals", name: t("models.proposal.name", scope: "decidim.proposals.admin")), new_proposals_import_path %>
15
- </li>
16
- <% current_component.manifest.import_manifests.each do |import_manifest| %>
17
- <li class="imports--file imports--<%= import_manifest.name %>">
18
- <%= link_to import_manifest.message(:label, self), admin_imports_path(current_component, name: import_manifest.name) %>
13
+ <%= link_to new_proposals_import_path do %>
14
+ <li class="imports--component imports--proposals">
15
+ <%= t("actions.import", scope: "decidim.proposals", name: t("models.proposal.name", scope: "decidim.proposals.admin")) %>
19
16
  </li>
17
+ <% current_component.manifest.import_manifests.each do |import_manifest| %>
18
+ <%= link_to admin_imports_path(current_component, name: import_manifest.name) do %>
19
+ <li class="imports--file imports--<%= import_manifest.name %>">
20
+ <%= import_manifest.message(:label, self) %>
21
+ </li>
22
+ <% end %>
23
+ <% end %>
20
24
  <% end %>
21
25
  <% end %>
22
26
  <% end %>
@@ -6,8 +6,10 @@
6
6
  <%= t(".title") %>
7
7
  <span id="js-selected-proposals-count" class="component-counter component-counter--inline" title="<%= t("decidim.proposals.admin.proposals.index.selected") %>"></span>
8
8
  </div>
9
+ <div class="flex items-center gap-x-4">
9
10
  <%= render partial: "bulk-actions" %>
10
11
  <%= render partial: "decidim/admin/components/resource_action" %>
12
+ </div>
11
13
  </h1>
12
14
  </div>
13
15
  <%= admin_filter_selector(:proposals) %>
@@ -10,7 +10,10 @@
10
10
  <% if (@proposal.amendable? && allowed_to?(:edit, :proposal, proposal: @proposal)) || (amendments_enabled? && @proposal.amendable? && current_component.current_settings.amendment_creation_enabled && can_participate_in_private_space?) || amendments_enabled? && can_react_to_emendation?(@proposal) || @proposal.withdrawable_by?(current_user) %>
11
11
  <section class="layout-aside__section layout-aside__buttons">
12
12
  <% if @proposal.amendable? && allowed_to?(:edit, :proposal, proposal: @proposal) %>
13
- <%= link_to t("edit_proposal", scope: "decidim.proposals.proposals.show"), edit_proposal_path(@proposal), class: "button button__sm button__transparent-secondary w-full" %>
13
+ <%= link_to edit_proposal_path(@proposal), class: "button button__sm button__transparent-secondary w-full" do %>
14
+ <span><%= t("edit_proposal", scope: "decidim.proposals.proposals.show") %></span>
15
+ <%= icon "pencil-line" %>
16
+ <% end %>
14
17
  <% else %>
15
18
  <%= amend_button_for @proposal %>
16
19
  <% end %>
@@ -22,7 +25,6 @@
22
25
  <% if @proposal.withdrawable_by?(current_user) %>
23
26
  <%= action_authorized_link_to :withdraw, withdraw_proposal_path(@proposal), method: :put, class: "button button__sm button__transparent-secondary w-full", title: t("withdraw_btn_hint", scope: "decidim.proposals.proposals.show" ), data: { confirm: t("withdraw_confirmation_html", scope: "decidim.proposals.proposals.show" ) } do %>
24
27
  <span><%= t("withdraw_proposal", scope: "decidim.proposals.proposals.show") %></span>
25
- <%= icon "pencil-line" %>
26
28
  <% end %>
27
29
  <% end %>
28
30
  </section>
@@ -10,7 +10,7 @@
10
10
  <% if @similar_proposals.present? %>
11
11
  <div class="proposal__container my-10">
12
12
  <% @similar_proposals.each do |proposal| %>
13
- <%= card_for @proposal %>
13
+ <%= card_for proposal %>
14
14
  <% end %>
15
15
  </div>
16
16
  <% end %>
@@ -7,7 +7,7 @@
7
7
 
8
8
  <%= render partial: "wizard_header", locals: { callout_help_text_class: "warning" } %>
9
9
 
10
- <div class="proposal__container my-10">
10
+ <div class="proposal__container my-10 flex flex-col gap-4">
11
11
  <h2 class="h3 text-secondary"><%= present(@proposal).title(links: true, html_escape: true) %></h2>
12
12
 
13
13
  <% unless component_settings.participatory_texts_enabled? %>
data/config/assets.rb CHANGED
@@ -5,5 +5,6 @@ base_path = File.expand_path("..", __dir__)
5
5
  Decidim::Webpacker.register_path("#{base_path}/app/packs")
6
6
  Decidim::Webpacker.register_entrypoints(
7
7
  decidim_proposals: "#{base_path}/app/packs/entrypoints/decidim_proposals.js",
8
+ participatory_texts_admin: "#{base_path}/app/packs/entrypoints/participatory_texts_admin.js",
8
9
  decidim_proposals_admin: "#{base_path}/app/packs/entrypoints/decidim_proposals_admin.js"
9
10
  )
@@ -157,9 +157,7 @@ ar:
157
157
  comments_enabled: تم تمكين التعليقات
158
158
  comments_max_length: الحد الأقصى لطول التعليقات (اترك 0 لاستعمال القيمة الافتراضية)
159
159
  default_sort_order: التصنيف الافتراضي للاقتراح
160
- default_sort_order_help: الافتراضي يعني أنه إذا تم تمكين الدعم، سيتم عرض المقترحات عشوائياً، وإذا تم حظر الدعم، فسيتم فرزها حسب الأكثر دعم.
161
160
  default_sort_order_options:
162
- default: الافتراضي
163
161
  most_commented: صاحبة الأكثر تعليقات
164
162
  most_endorsed: صاحبة أكثر تأييدات
165
163
  most_followed: صاحبة أكثر متابعات
@@ -186,7 +184,6 @@ ar:
186
184
  proposal_wizard_step_1_help_text: اقتراح الاقتراح "إنشاء" نص مساعدة الخطوة
187
185
  proposal_wizard_step_2_help_text: اقتراح الاقتراح "قارن" نص خطوة المساعدة
188
186
  proposal_wizard_step_3_help_text: نص اقتراح "إكمال" تعليمات نص المعالج
189
- proposal_wizard_step_4_help_text: اقتراح الاقتراح "نشر" نص تعليمات الخطوة
190
187
  resources_permissions_enabled: يمكن تعيين أذونات الإجراءات لكل اقتراح
191
188
  scope_id: نطاق
192
189
  scopes_enabled: النطاقات مفعلة
@@ -211,9 +208,7 @@ ar:
211
208
  creation_enabled: يمكن للمشارِكين إنشاء اقتراحات
212
209
  creation_enabled_readonly: يتم تعطيل هذا الإعداد عند تفعيل وظيفة النصوص التشاركية. لتحميل الاقتراحات كنص تشاركي، يرجى النقر على زر النصوص التشاركية واتباع التعليمات.
213
210
  default_sort_order: التصنيف الافتراضي للاقتراح
214
- default_sort_order_help: الافتراضي يعني أنه إذا تم تمكين الدعم، سيتم عرض المقترحات عشوائياً، وإذا تم حظر الدعم، فسيتم فرزها حسب الأكثر دعم.
215
211
  default_sort_order_options:
216
- default: الافتراضي
217
212
  most_commented: صاحبة الأكثر تعليقات
218
213
  most_endorsed: صاحبة أكثر تأييدات
219
214
  most_followed: صاحبة أكثر متابعات
@@ -742,7 +737,6 @@ ar:
742
737
  discard: تجاهل هذه المسودة
743
738
  discard_confirmation: هل أنت متأكد من أنك تريد التخلص من مسودة الاقتراح؟
744
739
  send: معاينة
745
- title: تحرير مسودة الاقتراح
746
740
  filters:
747
741
  activity: نشاطي
748
742
  all: الكل
@@ -861,7 +855,7 @@ ar:
861
855
  step_1: إنشاء اقتراحك
862
856
  step_2: قارن
863
857
  step_3: إكمال
864
- step_4: انشر اقتراحك
858
+ step_4: نشر اقتراحك
865
859
  title: خطوات إنشاء الاقتراحات
866
860
  proposals_picker:
867
861
  choose_proposals: اختيار الاقتراحات