decidim-proposals 0.28.1 → 0.28.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/concerns/decidim/proposals/orderable.rb +1 -1
  3. data/app/helpers/decidim/proposals/application_helper.rb +1 -1
  4. data/app/packs/entrypoints/participatory_texts_admin.js +2 -0
  5. data/app/packs/stylesheets/decidim/proposals/admin/participatory_texts.scss +23 -0
  6. data/app/presenters/decidim/proposals/admin_log/proposal_presenter.rb +1 -5
  7. data/app/presenters/decidim/proposals/admin_log/value_types/proposal_title_body_presenter.rb +1 -3
  8. data/app/presenters/decidim/proposals/log/valuation_assignment_presenter.rb +1 -1
  9. data/app/views/decidim/proposals/admin/participatory_texts/index.html.erb +6 -3
  10. data/app/views/decidim/proposals/admin/proposals/index.html.erb +2 -0
  11. data/app/views/decidim/proposals/proposals/_proposal_aside.html.erb +4 -2
  12. data/app/views/decidim/proposals/proposals/compare.html.erb +1 -1
  13. data/config/assets.rb +1 -0
  14. data/config/locales/ar.yml +1 -6
  15. data/config/locales/bg.yml +697 -1
  16. data/config/locales/ca.yml +9 -9
  17. data/config/locales/cs.yml +2 -5
  18. data/config/locales/de.yml +5 -5
  19. data/config/locales/el.yml +0 -5
  20. data/config/locales/en.yml +4 -4
  21. data/config/locales/es-MX.yml +6 -6
  22. data/config/locales/es-PY.yml +5 -5
  23. data/config/locales/es.yml +6 -6
  24. data/config/locales/eu.yml +6 -6
  25. data/config/locales/fi-plain.yml +4 -4
  26. data/config/locales/fi.yml +4 -4
  27. data/config/locales/fr-CA.yml +5 -5
  28. data/config/locales/fr.yml +5 -5
  29. data/config/locales/ga-IE.yml +6 -0
  30. data/config/locales/gl.yml +1 -6
  31. data/config/locales/hu.yml +1 -4
  32. data/config/locales/id-ID.yml +0 -1
  33. data/config/locales/is-IS.yml +0 -2
  34. data/config/locales/it.yml +1 -2
  35. data/config/locales/ja.yml +4 -4
  36. data/config/locales/lt.yml +0 -5
  37. data/config/locales/lv.yml +0 -1
  38. data/config/locales/nl.yml +1 -6
  39. data/config/locales/no.yml +0 -5
  40. data/config/locales/pl.yml +103 -1
  41. data/config/locales/pt-BR.yml +0 -1
  42. data/config/locales/pt.yml +0 -5
  43. data/config/locales/ro-RO.yml +0 -4
  44. data/config/locales/ru.yml +0 -2
  45. data/config/locales/sk.yml +0 -1
  46. data/config/locales/sv.yml +0 -5
  47. data/config/locales/tr-TR.yml +3 -2
  48. data/config/locales/uk.yml +0 -2
  49. data/config/locales/zh-CN.yml +0 -1
  50. data/config/locales/zh-TW.yml +0 -5
  51. data/lib/decidim/proposals/component.rb +2 -4
  52. data/lib/decidim/proposals/proposal_serializer.rb +51 -0
  53. data/lib/decidim/proposals/seeds.rb +5 -1
  54. data/lib/decidim/proposals/test/factories.rb +13 -1
  55. data/lib/decidim/proposals/version.rb +1 -1
  56. metadata +26 -25
  57. 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: 8718c7a21c7d5b239eb3c3e92285579ea84d134ef432258b4b0e840b09a2556c
4
+ data.tar.gz: 41c17711b34bb29d133e040275fb34be7840cfab5375303b583cb7d2f4957e89
5
5
  SHA512:
6
- metadata.gz: 3ef557822bacfa28606a3a4685b20d920c19afaae09e041d1ea457c7e243e5e8f8b2e84c6c169ad037a99bca67236aae0bfe6ba71e8eeeeb4bf9622df7dd07fc
7
- data.tar.gz: ca2bc013940842932fe67588f9bfd31209efcb5a40d99c45a15135c2d03091d96480bedf533a6d9ab060e6e49024d393f31aea2b34373dbe2cab27e8ac0cfd21
6
+ metadata.gz: '08b53946fb8f1043a0eafb6363ea5c0b9550f0c521b16f11ab396a817d6b5f4c23f6ab464113b05e05ac09f4e3312c7b5165bb4bc248e5b6d78388e21fd67d99'
7
+ data.tar.gz: e03c97bb74d5a5aec2a2e494a7bf4f6f0d91dc2bdfd21f502a4bf03198ea12eccb4ae911d22391087f5a0ea62c4946fe78e0f5edc466ea612ca18710de5aafe9
@@ -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>
@@ -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 %>
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: صاحبة أكثر متابعات
@@ -861,7 +856,7 @@ ar:
861
856
  step_1: إنشاء اقتراحك
862
857
  step_2: قارن
863
858
  step_3: إكمال
864
- step_4: انشر اقتراحك
859
+ step_4: نشر اقتراحك
865
860
  title: خطوات إنشاء الاقتراحات
866
861
  proposals_picker:
867
862
  choose_proposals: اختيار الاقتراحات