decidim-proposals 0.26.4 → 0.27.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (141) hide show
  1. checksums.yaml +4 -4
  2. data/app/cells/decidim/proposals/highlighted_proposals_for_component_cell.rb +9 -1
  3. data/app/cells/decidim/proposals/proposal_m_cell.rb +6 -8
  4. data/app/commands/decidim/proposals/accept_access_to_collaborative_draft.rb +1 -1
  5. data/app/commands/decidim/proposals/admin/answer_proposal.rb +1 -1
  6. data/app/commands/decidim/proposals/admin/assign_proposals_to_valuator.rb +1 -1
  7. data/app/commands/decidim/proposals/admin/create_proposal.rb +8 -2
  8. data/app/commands/decidim/proposals/admin/create_proposal_note.rb +2 -2
  9. data/app/commands/decidim/proposals/admin/discard_participatory_text.rb +1 -1
  10. data/app/commands/decidim/proposals/admin/import_participatory_text.rb +1 -1
  11. data/app/commands/decidim/proposals/admin/import_proposals.rb +2 -5
  12. data/app/commands/decidim/proposals/admin/merge_proposals.rb +1 -1
  13. data/app/commands/decidim/proposals/admin/notify_proposal_answer.rb +1 -1
  14. data/app/commands/decidim/proposals/admin/publish_answers.rb +1 -1
  15. data/app/commands/decidim/proposals/admin/split_proposals.rb +1 -1
  16. data/app/commands/decidim/proposals/admin/unassign_proposals_from_valuator.rb +1 -1
  17. data/app/commands/decidim/proposals/admin/update_participatory_text.rb +1 -1
  18. data/app/commands/decidim/proposals/admin/update_proposal.rb +8 -2
  19. data/app/commands/decidim/proposals/admin/update_proposal_category.rb +5 -3
  20. data/app/commands/decidim/proposals/admin/update_proposal_scope.rb +3 -3
  21. data/app/commands/decidim/proposals/create_collaborative_draft.rb +5 -5
  22. data/app/commands/decidim/proposals/create_proposal.rb +1 -1
  23. data/app/commands/decidim/proposals/destroy_proposal.rb +1 -1
  24. data/app/commands/decidim/proposals/publish_collaborative_draft.rb +1 -1
  25. data/app/commands/decidim/proposals/publish_proposal.rb +1 -1
  26. data/app/commands/decidim/proposals/reject_access_to_collaborative_draft.rb +1 -1
  27. data/app/commands/decidim/proposals/request_access_to_collaborative_draft.rb +1 -1
  28. data/app/commands/decidim/proposals/unvote_proposal.rb +1 -1
  29. data/app/commands/decidim/proposals/update_collaborative_draft.rb +1 -1
  30. data/app/commands/decidim/proposals/update_proposal.rb +8 -2
  31. data/app/commands/decidim/proposals/vote_proposal.rb +1 -1
  32. data/app/commands/decidim/proposals/withdraw_collaborative_draft.rb +1 -1
  33. data/app/commands/decidim/proposals/withdraw_proposal.rb +1 -1
  34. data/app/controllers/concerns/decidim/proposals/orderable.rb +7 -5
  35. data/app/controllers/decidim/proposals/admin/proposals_controller.rb +7 -7
  36. data/app/controllers/decidim/proposals/collaborative_drafts_controller.rb +10 -10
  37. data/app/controllers/decidim/proposals/proposal_votes_controller.rb +1 -1
  38. data/app/controllers/decidim/proposals/proposals_controller.rb +25 -18
  39. data/app/events/decidim/proposals/publish_proposal_event.rb +0 -8
  40. data/app/forms/decidim/proposals/admin/import_participatory_text_form.rb +4 -4
  41. data/app/forms/decidim/proposals/admin/proposal_base_form.rb +4 -4
  42. data/app/forms/decidim/proposals/admin/proposal_form.rb +2 -0
  43. data/app/forms/decidim/proposals/admin/proposals_fork_form.rb +2 -2
  44. data/app/forms/decidim/proposals/admin/proposals_import_form.rb +1 -1
  45. data/app/forms/decidim/proposals/proposal_form.rb +11 -4
  46. data/app/forms/decidim/proposals/proposal_wizard_create_step_form.rb +3 -0
  47. data/app/helpers/decidim/proposals/admin/proposal_bulk_actions_helper.rb +4 -0
  48. data/app/helpers/decidim/proposals/application_helper.rb +4 -6
  49. data/app/helpers/decidim/proposals/proposal_cells_helper.rb +1 -3
  50. data/app/helpers/decidim/proposals/proposal_wizard_helper.rb +7 -7
  51. data/app/jobs/decidim/proposals/notify_proposals_mentioned_job.rb +1 -1
  52. data/app/models/decidim/proposals/collaborative_draft.rb +10 -0
  53. data/app/models/decidim/proposals/collaborative_draft_collaborator_request.rb +0 -2
  54. data/app/models/decidim/proposals/proposal.rb +47 -8
  55. data/app/queries/decidim/proposals/filtered_proposals.rb +1 -1
  56. data/app/queries/decidim/proposals/similar_proposals.rb +1 -1
  57. data/app/services/decidim/proposals/proposal_search.rb +16 -71
  58. data/app/validators/proposal_length_validator.rb +2 -5
  59. data/app/views/decidim/proposals/admin/proposals/_form.html.erb +1 -1
  60. data/app/views/decidim/proposals/admin/proposals/_proposal-tr.html.erb +2 -2
  61. data/app/views/decidim/proposals/admin/proposals/publish_answers.js.erb +1 -1
  62. data/app/views/decidim/proposals/admin/proposals/update_attribute.js.erb +26 -0
  63. data/app/views/decidim/proposals/collaborative_drafts/_edit_form_fields.html.erb +8 -16
  64. data/app/views/decidim/proposals/collaborative_drafts/_filters.html.erb +4 -4
  65. data/app/views/decidim/proposals/collaborative_drafts/_wizard_aside.html.erb +1 -1
  66. data/app/views/decidim/proposals/collaborative_drafts/edit.html.erb +3 -1
  67. data/app/views/decidim/proposals/collaborative_drafts/new.html.erb +3 -1
  68. data/app/views/decidim/proposals/proposals/_edit_form_fields.html.erb +13 -36
  69. data/app/views/decidim/proposals/proposals/_filters.html.erb +5 -5
  70. data/app/views/decidim/proposals/proposals/_proposals.html.erb +5 -5
  71. data/app/views/decidim/proposals/proposals/complete.html.erb +3 -1
  72. data/app/views/decidim/proposals/proposals/edit.html.erb +3 -1
  73. data/app/views/decidim/proposals/proposals/edit_draft.html.erb +3 -1
  74. data/app/views/decidim/proposals/proposals/new.html.erb +3 -1
  75. data/config/locales/am-ET.yml +1 -0
  76. data/config/locales/ar.yml +3 -9
  77. data/config/locales/bg.yml +1 -4
  78. data/config/locales/ca.yml +14 -26
  79. data/config/locales/cs.yml +32 -28
  80. data/config/locales/da.yml +1 -0
  81. data/config/locales/de.yml +3 -54
  82. data/config/locales/el.yml +3 -6
  83. data/config/locales/en.yml +12 -25
  84. data/config/locales/eo.yml +1 -0
  85. data/config/locales/es-MX.yml +13 -25
  86. data/config/locales/es-PY.yml +13 -25
  87. data/config/locales/es.yml +12 -24
  88. data/config/locales/et.yml +1 -0
  89. data/config/locales/eu.yml +3 -10
  90. data/config/locales/fi-plain.yml +12 -23
  91. data/config/locales/fi.yml +12 -23
  92. data/config/locales/fr-CA.yml +12 -25
  93. data/config/locales/fr.yml +12 -25
  94. data/config/locales/ga-IE.yml +1 -2
  95. data/config/locales/gl.yml +12 -9
  96. data/config/locales/hr.yml +1 -0
  97. data/config/locales/hu.yml +10 -9
  98. data/config/locales/id-ID.yml +3 -5
  99. data/config/locales/is-IS.yml +2 -2
  100. data/config/locales/it.yml +4 -9
  101. data/config/locales/ja.yml +53 -49
  102. data/config/locales/ko.yml +1 -0
  103. data/config/locales/lb.yml +1 -0
  104. data/config/locales/lt.yml +1 -988
  105. data/config/locales/lv.yml +3 -6
  106. data/config/locales/mt.yml +1 -0
  107. data/config/locales/nl.yml +7 -9
  108. data/config/locales/no.yml +3 -6
  109. data/config/locales/om-ET.yml +1 -0
  110. data/config/locales/pl.yml +3 -9
  111. data/config/locales/pt-BR.yml +4 -10
  112. data/config/locales/pt.yml +3 -9
  113. data/config/locales/ro-RO.yml +7 -9
  114. data/config/locales/ru.yml +1 -1
  115. data/config/locales/si-LK.yml +1 -0
  116. data/config/locales/sk.yml +3 -6
  117. data/config/locales/sl.yml +1 -0
  118. data/config/locales/so-SO.yml +1 -0
  119. data/config/locales/sr-CS.yml +1 -2
  120. data/config/locales/sv.yml +10 -9
  121. data/config/locales/sw-KE.yml +1 -0
  122. data/config/locales/ti-ER.yml +1 -0
  123. data/config/locales/tr-TR.yml +3 -9
  124. data/config/locales/uk.yml +1 -1
  125. data/config/locales/val-ES.yml +1 -0
  126. data/config/locales/vi.yml +1 -0
  127. data/config/locales/zh-CN.yml +3 -9
  128. data/config/locales/zh-TW.yml +1 -0
  129. data/db/migrate/20180529110230_move_authorships_to_coauthorships.rb +1 -0
  130. data/lib/decidim/proposals/component.rb +19 -14
  131. data/lib/decidim/proposals/import/proposal_answer_creator.rb +21 -19
  132. data/lib/decidim/proposals/test/factories.rb +1 -1
  133. data/lib/decidim/proposals/version.rb +1 -1
  134. metadata +25 -31
  135. data/app/services/decidim/proposals/collaborative_draft_search.rb +0 -59
  136. data/app/views/decidim/proposals/admin/proposals/_js-callout.html.erb +0 -6
  137. data/app/views/decidim/proposals/admin/proposals/update_category.js.erb +0 -26
  138. data/app/views/decidim/proposals/admin/proposals/update_scope.js.erb +0 -27
  139. data/config/locales/gn-PY.yml +0 -1
  140. data/config/locales/lo-LA.yml +0 -1
  141. data/config/locales/oc-FR.yml +0 -1
@@ -1,3 +1,4 @@
1
+ ---
1
2
  zh-CN:
2
3
  activemodel:
3
4
  attributes:
@@ -38,10 +39,6 @@ zh-CN:
38
39
  valuator_role_id: 值名称
39
40
  errors:
40
41
  models:
41
- participatory_text:
42
- attributes:
43
- document:
44
- invalid_document_type: '无效的文档类型。接受的格式为: %{valid_mime_types}'
45
42
  proposal:
46
43
  attributes:
47
44
  add_documents:
@@ -239,6 +236,7 @@ zh-CN:
239
236
  affected_user:
240
237
  email_intro: '您的提议 "%{resource_title}" 已被拒绝。您可以在此页中读取答案:'
241
238
  email_outro: 您收到此通知是因为您是"%{resource_title} "的作者。
239
+ email_subject: 您的建议已被拒绝
242
240
  notification_title: 您的提议 <a href="%{resource_path}">%{resource_title}</a> 已被拒绝
243
241
  follower:
244
242
  email_intro: '提议 "%{resource_title}" 已被拒绝。您可以在此页中读取答案:'
@@ -498,7 +496,6 @@ zh-CN:
498
496
  all: 所有的
499
497
  filter_origin_values:
500
498
  all: 所有的
501
- citizens: Citizens
502
499
  meetings: 会议
503
500
  official: 官方的
504
501
  user_groups: 群組
@@ -537,6 +534,7 @@ zh-CN:
537
534
  drafts_count:
538
535
  other: "%{count} 协作草稿"
539
536
  create:
537
+ error: 创建这个合作草稿时出现问题
540
538
  success: 协作草稿成功创建。
541
539
  edit:
542
540
  attachment_legend: "(可选) 添加附件"
@@ -662,12 +660,8 @@ zh-CN:
662
660
  proposals_count:
663
661
  other: "%{count} 个提议"
664
662
  edit:
665
- add_documents: www.un.org/webcast
666
- add_images: 文件
667
663
  attachment_legend: "(可选) 添加附件"
668
664
  back: 后退
669
- delete_document: 删除文档
670
- delete_image: 删除图像
671
665
  gallery_legend: "(可选) 添加图像到提案卡"
672
666
  select_a_category: 请选择一个类别
673
667
  send: 发送
@@ -1 +1,2 @@
1
+ ---
1
2
  zh-TW:
@@ -4,6 +4,7 @@ class MoveAuthorshipsToCoauthorships < ActiveRecord::Migration[5.1]
4
4
  class Proposal < ApplicationRecord
5
5
  self.table_name = :decidim_proposals_proposals
6
6
  end
7
+
7
8
  class Coauthorship < ApplicationRecord
8
9
  self.table_name = :decidim_coauthorships
9
10
  end
@@ -266,26 +266,31 @@ Decidim.register_component(:proposals) do |component|
266
266
  visibility: "all"
267
267
  ) do
268
268
  proposal = Decidim::Proposals::Proposal.new(params)
269
- proposal.add_coauthor(participatory_space.organization)
269
+ meeting_component = participatory_space.components.find_by(manifest_name: "meetings")
270
+
271
+ coauthor = case n
272
+ when 0
273
+ Decidim::User.where(decidim_organization_id: participatory_space.decidim_organization_id).order(Arel.sql("RANDOM()")).first
274
+ when 1
275
+ Decidim::UserGroup.where(decidim_organization_id: participatory_space.decidim_organization_id).order(Arel.sql("RANDOM()")).first
276
+ when 2
277
+ Decidim::Meetings::Meeting.where(component: meeting_component).order(Arel.sql("RANDOM()")).first
278
+ else
279
+ participatory_space.organization
280
+ end
281
+ proposal.add_coauthor(coauthor)
270
282
  proposal.save!
271
283
  proposal
272
284
  end
273
285
 
274
- if n.positive?
275
- Decidim::User.where(decidim_organization_id: participatory_space.decidim_organization_id).all.sample(n).each do |author|
276
- user_group = [true, false].sample ? Decidim::UserGroups::ManageableUserGroups.for(author).verified.sample : nil
277
- proposal.add_coauthor(author, user_group: user_group)
278
- end
279
- end
280
-
281
286
  if proposal.state.nil?
282
287
  email = "amendment-author-#{participatory_space.underscored_name}-#{participatory_space.id}-#{n}-amend#{n}@example.org"
283
288
  name = "#{Faker::Name.name} #{participatory_space.id} #{n} amend#{n}"
284
289
 
285
290
  author = Decidim::User.find_or_initialize_by(email: email)
286
291
  author.update!(
287
- password: "decidim123456",
288
- password_confirmation: "decidim123456",
292
+ password: "decidim123456789",
293
+ password_confirmation: "decidim123456789",
289
294
  name: name,
290
295
  nickname: Faker::Twitter.unique.screen_name,
291
296
  organization: component.organization,
@@ -350,8 +355,8 @@ Decidim.register_component(:proposals) do |component|
350
355
 
351
356
  author = Decidim::User.find_or_initialize_by(email: email)
352
357
  author.update!(
353
- password: "decidim123456",
354
- password_confirmation: "decidim123456",
358
+ password: "decidim123456789",
359
+ password_confirmation: "decidim123456789",
355
360
  name: name,
356
361
  nickname: Faker::Twitter.unique.screen_name,
357
362
  organization: component.organization,
@@ -372,8 +377,8 @@ Decidim.register_component(:proposals) do |component|
372
377
 
373
378
  author = Decidim::User.find_or_initialize_by(email: email)
374
379
  author.update!(
375
- password: "decidim123456",
376
- password_confirmation: "decidim123456",
380
+ password: "decidim123456789",
381
+ password_confirmation: "decidim123456789",
377
382
  name: name,
378
383
  nickname: Faker::Twitter.unique.screen_name,
379
384
  organization: component.organization,
@@ -40,26 +40,28 @@ module Decidim
40
40
  private
41
41
 
42
42
  def resource
43
- @resource ||= begin
44
- proposal = Decidim::Proposals::Proposal.find_by(id: id)
45
- return nil unless proposal
46
- return nil if proposal.emendation?
47
-
48
- if proposal.component != component
49
- proposal.errors.add(:component, :invalid)
50
- return proposal
51
- end
52
-
53
- proposal.answer = answer
54
- proposal.answered_at = Time.current
55
- if POSSIBLE_ANSWER_STATES.include?(state)
56
- proposal.state = state
57
- proposal.state_published_at = Time.current if component.current_settings.publish_answers_immediately?
58
- else
59
- proposal.errors.add(:state, :invalid)
60
- end
61
- proposal
43
+ @resource ||= fetch_resource
44
+ end
45
+
46
+ def fetch_resource
47
+ proposal = Decidim::Proposals::Proposal.find_by(id: id)
48
+ return nil unless proposal
49
+ return nil if proposal.emendation?
50
+
51
+ if proposal.component != component
52
+ proposal.errors.add(:component, :invalid)
53
+ return proposal
54
+ end
55
+
56
+ proposal.answer = answer
57
+ proposal.answered_at = Time.current
58
+ if POSSIBLE_ANSWER_STATES.include?(state)
59
+ proposal.state = state
60
+ proposal.state_published_at = Time.current if component.current_settings.publish_answers_immediately?
61
+ else
62
+ proposal.errors.add(:state, :invalid)
62
63
  end
64
+ proposal
63
65
  end
64
66
 
65
67
  def id
@@ -305,7 +305,7 @@ FactoryBot.define do
305
305
  published_at { nil }
306
306
  end
307
307
 
308
- trait :citizen_author do
308
+ trait :participant_author do
309
309
  after :build do |proposal|
310
310
  proposal.coauthorships.clear
311
311
  user = build(:user, organization: proposal.component.participatory_space.organization)
@@ -4,7 +4,7 @@ module Decidim
4
4
  # This holds decidim-proposals version.
5
5
  module Proposals
6
6
  def self.version
7
- "0.26.4"
7
+ "0.27.0.rc1"
8
8
  end
9
9
  end
10
10
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: decidim-proposals
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.26.4
4
+ version: 0.27.0.rc1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josep Jaume Rey Peroy
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2022-11-15 00:00:00.000000000 Z
13
+ date: 2022-06-27 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: decidim-comments
@@ -18,42 +18,42 @@ dependencies:
18
18
  requirements:
19
19
  - - '='
20
20
  - !ruby/object:Gem::Version
21
- version: 0.26.4
21
+ version: 0.27.0.rc1
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  requirements:
26
26
  - - '='
27
27
  - !ruby/object:Gem::Version
28
- version: 0.26.4
28
+ version: 0.27.0.rc1
29
29
  - !ruby/object:Gem::Dependency
30
30
  name: decidim-core
31
31
  requirement: !ruby/object:Gem::Requirement
32
32
  requirements:
33
33
  - - '='
34
34
  - !ruby/object:Gem::Version
35
- version: 0.26.4
35
+ version: 0.27.0.rc1
36
36
  type: :runtime
37
37
  prerelease: false
38
38
  version_requirements: !ruby/object:Gem::Requirement
39
39
  requirements:
40
40
  - - '='
41
41
  - !ruby/object:Gem::Version
42
- version: 0.26.4
42
+ version: 0.27.0.rc1
43
43
  - !ruby/object:Gem::Dependency
44
44
  name: doc2text
45
45
  requirement: !ruby/object:Gem::Requirement
46
46
  requirements:
47
47
  - - "~>"
48
48
  - !ruby/object:Gem::Version
49
- version: 0.4.4
49
+ version: 0.4.5
50
50
  type: :runtime
51
51
  prerelease: false
52
52
  version_requirements: !ruby/object:Gem::Requirement
53
53
  requirements:
54
54
  - - "~>"
55
55
  - !ruby/object:Gem::Version
56
- version: 0.4.4
56
+ version: 0.4.5
57
57
  - !ruby/object:Gem::Dependency
58
58
  name: redcarpet
59
59
  requirement: !ruby/object:Gem::Requirement
@@ -80,84 +80,84 @@ dependencies:
80
80
  requirements:
81
81
  - - '='
82
82
  - !ruby/object:Gem::Version
83
- version: 0.26.4
83
+ version: 0.27.0.rc1
84
84
  type: :development
85
85
  prerelease: false
86
86
  version_requirements: !ruby/object:Gem::Requirement
87
87
  requirements:
88
88
  - - '='
89
89
  - !ruby/object:Gem::Version
90
- version: 0.26.4
90
+ version: 0.27.0.rc1
91
91
  - !ruby/object:Gem::Dependency
92
92
  name: decidim-assemblies
93
93
  requirement: !ruby/object:Gem::Requirement
94
94
  requirements:
95
95
  - - '='
96
96
  - !ruby/object:Gem::Version
97
- version: 0.26.4
97
+ version: 0.27.0.rc1
98
98
  type: :development
99
99
  prerelease: false
100
100
  version_requirements: !ruby/object:Gem::Requirement
101
101
  requirements:
102
102
  - - '='
103
103
  - !ruby/object:Gem::Version
104
- version: 0.26.4
104
+ version: 0.27.0.rc1
105
105
  - !ruby/object:Gem::Dependency
106
106
  name: decidim-budgets
107
107
  requirement: !ruby/object:Gem::Requirement
108
108
  requirements:
109
109
  - - '='
110
110
  - !ruby/object:Gem::Version
111
- version: 0.26.4
111
+ version: 0.27.0.rc1
112
112
  type: :development
113
113
  prerelease: false
114
114
  version_requirements: !ruby/object:Gem::Requirement
115
115
  requirements:
116
116
  - - '='
117
117
  - !ruby/object:Gem::Version
118
- version: 0.26.4
118
+ version: 0.27.0.rc1
119
119
  - !ruby/object:Gem::Dependency
120
120
  name: decidim-dev
121
121
  requirement: !ruby/object:Gem::Requirement
122
122
  requirements:
123
123
  - - '='
124
124
  - !ruby/object:Gem::Version
125
- version: 0.26.4
125
+ version: 0.27.0.rc1
126
126
  type: :development
127
127
  prerelease: false
128
128
  version_requirements: !ruby/object:Gem::Requirement
129
129
  requirements:
130
130
  - - '='
131
131
  - !ruby/object:Gem::Version
132
- version: 0.26.4
132
+ version: 0.27.0.rc1
133
133
  - !ruby/object:Gem::Dependency
134
134
  name: decidim-meetings
135
135
  requirement: !ruby/object:Gem::Requirement
136
136
  requirements:
137
137
  - - '='
138
138
  - !ruby/object:Gem::Version
139
- version: 0.26.4
139
+ version: 0.27.0.rc1
140
140
  type: :development
141
141
  prerelease: false
142
142
  version_requirements: !ruby/object:Gem::Requirement
143
143
  requirements:
144
144
  - - '='
145
145
  - !ruby/object:Gem::Version
146
- version: 0.26.4
146
+ version: 0.27.0.rc1
147
147
  - !ruby/object:Gem::Dependency
148
148
  name: decidim-participatory_processes
149
149
  requirement: !ruby/object:Gem::Requirement
150
150
  requirements:
151
151
  - - '='
152
152
  - !ruby/object:Gem::Version
153
- version: 0.26.4
153
+ version: 0.27.0.rc1
154
154
  type: :development
155
155
  prerelease: false
156
156
  version_requirements: !ruby/object:Gem::Requirement
157
157
  requirements:
158
158
  - - '='
159
159
  - !ruby/object:Gem::Version
160
- version: 0.26.4
160
+ version: 0.27.0.rc1
161
161
  description: A proposals component for decidim's participatory spaces.
162
162
  email:
163
163
  - josepjaume@gmail.com
@@ -361,7 +361,6 @@ files:
361
361
  - app/queries/decidim/proposals/metrics/proposals_metric_manage.rb
362
362
  - app/queries/decidim/proposals/metrics/votes_metric_manage.rb
363
363
  - app/queries/decidim/proposals/similar_proposals.rb
364
- - app/services/decidim/proposals/collaborative_draft_search.rb
365
364
  - app/services/decidim/proposals/diff_renderer.rb
366
365
  - app/services/decidim/proposals/proposal_builder.rb
367
366
  - app/services/decidim/proposals/proposal_search.rb
@@ -376,7 +375,6 @@ files:
376
375
  - app/views/decidim/proposals/admin/proposal_notes/_proposal_notes.html.erb
377
376
  - app/views/decidim/proposals/admin/proposals/_bulk-actions.html.erb
378
377
  - app/views/decidim/proposals/admin/proposals/_form.html.erb
379
- - app/views/decidim/proposals/admin/proposals/_js-callout.html.erb
380
378
  - app/views/decidim/proposals/admin/proposals/_proposal-tr.html.erb
381
379
  - app/views/decidim/proposals/admin/proposals/bulk_actions/_assign_to_valuator.html.erb
382
380
  - app/views/decidim/proposals/admin/proposals/bulk_actions/_dropdown.html.erb
@@ -391,8 +389,7 @@ files:
391
389
  - app/views/decidim/proposals/admin/proposals/new.html.erb
392
390
  - app/views/decidim/proposals/admin/proposals/publish_answers.js.erb
393
391
  - app/views/decidim/proposals/admin/proposals/show.html.erb
394
- - app/views/decidim/proposals/admin/proposals/update_category.js.erb
395
- - app/views/decidim/proposals/admin/proposals/update_scope.js.erb
392
+ - app/views/decidim/proposals/admin/proposals/update_attribute.js.erb
396
393
  - app/views/decidim/proposals/admin/proposals_imports/new.html.erb
397
394
  - app/views/decidim/proposals/collaborative_drafts/_accept_request_access_form.html.erb
398
395
  - app/views/decidim/proposals/collaborative_drafts/_collaborative_drafts.html.erb
@@ -477,7 +474,6 @@ files:
477
474
  - config/locales/fr.yml
478
475
  - config/locales/ga-IE.yml
479
476
  - config/locales/gl.yml
480
- - config/locales/gn-PY.yml
481
477
  - config/locales/hr-HR.yml
482
478
  - config/locales/hr.yml
483
479
  - config/locales/hu.yml
@@ -490,7 +486,6 @@ files:
490
486
  - config/locales/ko.yml
491
487
  - config/locales/lb-LU.yml
492
488
  - config/locales/lb.yml
493
- - config/locales/lo-LA.yml
494
489
  - config/locales/lt-LT.yml
495
490
  - config/locales/lt.yml
496
491
  - config/locales/lv.yml
@@ -498,7 +493,6 @@ files:
498
493
  - config/locales/mt.yml
499
494
  - config/locales/nl.yml
500
495
  - config/locales/no.yml
501
- - config/locales/oc-FR.yml
502
496
  - config/locales/om-ET.yml
503
497
  - config/locales/pl.yml
504
498
  - config/locales/pt-BR.yml
@@ -616,14 +610,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
616
610
  requirements:
617
611
  - - ">="
618
612
  - !ruby/object:Gem::Version
619
- version: '2.7'
613
+ version: '3.0'
620
614
  required_rubygems_version: !ruby/object:Gem::Requirement
621
615
  requirements:
622
- - - ">="
616
+ - - ">"
623
617
  - !ruby/object:Gem::Version
624
- version: '0'
618
+ version: 1.3.1
625
619
  requirements: []
626
- rubygems_version: 3.1.6
620
+ rubygems_version: 3.2.22
627
621
  signing_key:
628
622
  specification_version: 4
629
623
  summary: Decidim proposals module
@@ -1,59 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Decidim
4
- module Proposals
5
- # A service to encapsualte all the logic when searching and filtering
6
- # collaborative drafts in a participatory process.
7
- class CollaborativeDraftSearch < ResourceSearch
8
- text_search_fields :title, :body
9
-
10
- # Public: Initializes the service.
11
- # component - A Decidim::Component to get the drafts from.
12
- # page - The page number to paginate the results.
13
- # per_page - The number of drafts to return per page.
14
- def initialize(options = {})
15
- super(CollaborativeDraft.all, options)
16
- end
17
-
18
- # Handle the search_text filter
19
- #
20
- # We can't use the search from `ResourceFilter` since these fields aren't
21
- # translated.
22
- def search_search_text
23
- query
24
- .where("title::text ILIKE ?", "%#{search_text}%")
25
- .or(query.where("body ILIKE ?", "%#{search_text}%"))
26
- end
27
-
28
- # Handle the state filter
29
- def search_state
30
- return query if state.member?("all")
31
-
32
- apply_scopes(%w(open withdrawn published), state)
33
- end
34
-
35
- # Filters drafts by the name of the classes they are linked to. By default,
36
- # returns all drafts. When a `related_to` param is given, then it camelcases item
37
- # to find the real class name and checks the links for the Collaborative Draft.
38
- #
39
- # The `related_to` param is expected to be in this form:
40
- #
41
- # "decidim/meetings/meeting"
42
- #
43
- # This can be achieved by performing `klass.name.underscore`.
44
- #
45
- # Returns only those drafts that are linked to the given class name.
46
- def search_related_to
47
- from = query
48
- .joins(:resource_links_from)
49
- .where(decidim_resource_links: { to_type: related_to.camelcase })
50
-
51
- to = query
52
- .joins(:resource_links_to)
53
- .where(decidim_resource_links: { from_type: related_to.camelcase })
54
-
55
- query.where(id: from).or(query.where(id: to))
56
- end
57
- end
58
- end
59
- end
@@ -1,6 +0,0 @@
1
- <div class="callout callout--full <%= css %>" data-closable>
2
- <%= text %>
3
- <button class="close-button" type="button" data-close="">
4
- <span aria-hidden="true">×</span>
5
- </button>
6
- </div>
@@ -1,26 +0,0 @@
1
- <% if flash.now[:error].present? %>
2
- $("#js-form-recategorize-proposals #category_id").addClass("is-invalid-input")
3
- $("<%= escape_javascript(render partial: %q{js-callout}, locals: { css: %q{alert}, text: flash.now[:error] }) %>").appendTo(".callout-wrapper");
4
- <% end %>
5
-
6
- <% if flash.now[:alert].present? %>
7
- $("#js-form-recategorize-proposals #category_id").removeClass("is-invalid-input")
8
- $("<%= escape_javascript(render partial: %q{js-callout}, locals: { css: %q{warning}, text: flash.now[:alert] }) %>").appendTo(".callout-wrapper");
9
- <% end %>
10
-
11
- <% if flash.now[:notice].present? %>
12
- $("<%= escape_javascript(render partial: %q{js-callout}, locals: { css: %q{success}, text: flash.now[:notice] }) %>").appendTo(".callout-wrapper");
13
-
14
- <% proposal_ids.each do |id| %>
15
- $(".table-list [data-id='<%= id %>']")
16
- .replaceWith("<%= escape_javascript(render partial: %q{proposal-tr}, locals: { proposal: proposal_find(id) }) %>");
17
- <% end %>
18
-
19
- $("#js-form-recategorize-proposals #category_id").removeClass("is-invalid-input")
20
- $(".js-check-all").prop('checked', false);
21
- $(".js-check-all-proposal").prop('checked', false);
22
- window.hideBulkActionsButton();
23
- window.hideBulkActionForms();
24
- window.showOtherActionsButtons();
25
- window.selectedProposalsCountUpdate();
26
- <% end %>
@@ -1,27 +0,0 @@
1
- <% if flash.now[:error].present? %>
2
- $("#js-form-scope-change-proposals #scope_id").addClass("is-invalid-input")
3
- $("<%= escape_javascript(render partial: %q{js-callout}, locals: { css: %q{alert}, text: flash.now[:error] }) %>").appendTo(".callout-wrapper");
4
- <% end %>
5
-
6
- <% if flash.now[:alert].present? %>
7
- $("#js-form-scope-change-proposals #scope_id").removeClass("is-invalid-input")
8
- $("<%= escape_javascript(render partial: %q{js-callout}, locals: { css: %q{warning}, text: flash.now[:alert] }) %>").appendTo(".callout-wrapper");
9
- <% end %>
10
-
11
- <% if flash.now[:notice].present? %>
12
- $("<%= escape_javascript(render partial: %q{js-callout}, locals: { css: %q{success}, text: flash.now[:notice] }) %>").appendTo(".callout-wrapper");
13
-
14
- <% @proposal_ids.each do |id| %>
15
- $(".table-list [data-id='<%= id %>']")
16
- .replaceWith("<%= escape_javascript(render partial: %q{proposal-tr}, locals: { proposal: proposal_find(id) }) %>");
17
- <% end %>
18
-
19
- $("#js-form-scope-change-proposals #scope_id").removeClass("is-invalid-input")
20
- $(".js-check-all").prop('checked', false);
21
- $(".js-check-all-proposal").prop('checked', false);
22
-
23
- window.hideBulkActionForms();
24
- window.hideBulkActionsButton();
25
- window.showOtherActionsButtons();
26
- window.selectedProposalsCountUpdate();
27
- <% end %>
@@ -1 +0,0 @@
1
- gn:
@@ -1 +0,0 @@
1
- lo:
@@ -1 +0,0 @@
1
- oc: