decidim-consultations 0.22.0 → 0.23.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. checksums.yaml +4 -4
  2. data/app/commands/decidim/consultations/admin/update_consultation.rb +9 -4
  3. data/app/forms/decidim/consultations/admin/consultation_form.rb +5 -6
  4. data/app/forms/decidim/consultations/admin/question_form.rb +5 -6
  5. data/app/models/decidim/consultation.rb +9 -0
  6. data/app/models/decidim/consultations/question.rb +12 -1
  7. data/app/models/decidim/consultations/response.rb +4 -0
  8. data/app/models/decidim/consultations/response_group.rb +4 -0
  9. data/app/presenters/decidim/consultations/question_stats_presenter.rb +1 -1
  10. data/app/views/decidim/consultations/questions/_vote_modal_confirm.html.erb +1 -1
  11. data/app/views/decidim/consultations/questions/show.html.erb +1 -1
  12. data/app/views/layouts/decidim/consultation.html.erb +1 -0
  13. data/config/locales/am-ET.yml +1 -0
  14. data/config/locales/bg.yml +1 -0
  15. data/config/locales/cs.yml +2 -2
  16. data/config/locales/da.yml +1 -0
  17. data/config/locales/eo.yml +1 -0
  18. data/config/locales/et.yml +1 -0
  19. data/config/locales/fr.yml +2 -2
  20. data/config/locales/hr.yml +1 -0
  21. data/config/locales/is.yml +185 -0
  22. data/config/locales/ja-JP.yml +39 -39
  23. data/config/locales/ja.yml +367 -0
  24. data/config/locales/ko-KR.yml +1 -0
  25. data/config/locales/ko.yml +1 -0
  26. data/config/locales/lt.yml +1 -0
  27. data/config/locales/{lv-LV.yml → lv.yml} +0 -0
  28. data/config/locales/mt.yml +1 -0
  29. data/config/locales/no.yml +2 -0
  30. data/config/locales/om-ET.yml +1 -0
  31. data/config/locales/pl.yml +10 -10
  32. data/config/locales/sl.yml +4 -0
  33. data/config/locales/so-SO.yml +1 -0
  34. data/config/locales/ti-ER.yml +1 -0
  35. data/config/locales/vi-VN.yml +1 -0
  36. data/config/locales/vi.yml +1 -0
  37. data/config/locales/zh-CN.yml +367 -0
  38. data/config/locales/zh-TW.yml +1 -0
  39. data/db/migrate/20200827154143_add_commentable_counter_cache_to_consultations.rb +9 -0
  40. data/lib/decidim/consultations/admin_engine.rb +1 -0
  41. data/lib/decidim/consultations/participatory_space.rb +17 -17
  42. data/lib/decidim/consultations/test/factories.rb +1 -0
  43. data/lib/decidim/consultations/version.rb +1 -1
  44. metadata +33 -13
@@ -0,0 +1 @@
1
+ zh-TW:
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ class AddCommentableCounterCacheToConsultations < ActiveRecord::Migration[5.2]
4
+ def change
5
+ add_column :decidim_consultations_questions, :comments_count, :integer, null: false, default: 0, index: true
6
+ Decidim::Consultations::Question.reset_column_information
7
+ Decidim::Consultations::Question.find_each(&:update_comments_count)
8
+ end
9
+ end
@@ -32,6 +32,7 @@ module Decidim
32
32
  member do
33
33
  put :publish
34
34
  put :unpublish
35
+ get :share
35
36
  end
36
37
  resources :exports, only: :create
37
38
  end
@@ -49,10 +49,10 @@ Decidim.register_participatory_space(:consultations) do |participatory_space|
49
49
  published_at: Time.now.utc,
50
50
  start_voting_date: Time.zone.today,
51
51
  end_voting_date: Time.zone.today + 1.month,
52
- banner_image: File.new(File.join(seeds_root, "city2.jpeg")),
52
+ organization: organization,
53
+ banner_image: File.new(File.join(seeds_root, "city2.jpeg")), # Keep after organization
53
54
  introductory_video_url: "https://www.youtube.com/embed/zhMMW0TENNA",
54
- decidim_highlighted_scope_id: Decidim::Scope.reorder(Arel.sql("RANDOM()")).first.id,
55
- organization: organization
55
+ decidim_highlighted_scope_id: Decidim::Scope.reorder(Arel.sql("RANDOM()")).first.id
56
56
  }
57
57
 
58
58
  active_consultation = Decidim.traceability.perform_action!(
@@ -76,10 +76,10 @@ Decidim.register_participatory_space(:consultations) do |participatory_space|
76
76
  results_published_at: Time.zone.today - 1.month,
77
77
  start_voting_date: Time.zone.today - 2.months,
78
78
  end_voting_date: Time.zone.today - 1.month,
79
- banner_image: File.new(File.join(seeds_root, "city2.jpeg")),
79
+ organization: organization,
80
+ banner_image: File.new(File.join(seeds_root, "city2.jpeg")), # Keep after organization
80
81
  introductory_video_url: "https://www.youtube.com/embed/zhMMW0TENNA",
81
- decidim_highlighted_scope_id: Decidim::Scope.reorder(Arel.sql("RANDOM()")).first.id,
82
- organization: organization
82
+ decidim_highlighted_scope_id: Decidim::Scope.reorder(Arel.sql("RANDOM()")).first.id
83
83
  }
84
84
 
85
85
  finished_consultation = Decidim.traceability.perform_action!(
@@ -102,10 +102,10 @@ Decidim.register_participatory_space(:consultations) do |participatory_space|
102
102
  published_at: Time.zone.today + 1.month,
103
103
  start_voting_date: Time.zone.today + 1.month + 1.day,
104
104
  end_voting_date: Time.zone.today + 2.months,
105
- banner_image: File.new(File.join(seeds_root, "city2.jpeg")),
105
+ organization: organization,
106
+ banner_image: File.new(File.join(seeds_root, "city2.jpeg")), # Keep after organization
106
107
  introductory_video_url: "https://www.youtube.com/embed/zhMMW0TENNA",
107
- decidim_highlighted_scope_id: Decidim::Scope.reorder(Arel.sql("RANDOM()")).first.id,
108
- organization: organization
108
+ decidim_highlighted_scope_id: Decidim::Scope.reorder(Arel.sql("RANDOM()")).first.id
109
109
  }
110
110
 
111
111
  upcoming_consultation = Decidim.traceability.perform_action!(
@@ -132,12 +132,12 @@ Decidim.register_participatory_space(:consultations) do |participatory_space|
132
132
  question_context: Decidim::Faker::Localized.wrapped("<p>", "</p>") do
133
133
  Decidim::Faker::Localized.paragraph(3)
134
134
  end,
135
- hero_image: File.new(File.join(seeds_root, "city.jpeg")),
136
- banner_image: File.new(File.join(seeds_root, "city2.jpeg")),
135
+ organization: organization,
136
+ hero_image: File.new(File.join(seeds_root, "city.jpeg")), # Keep after organization
137
+ banner_image: File.new(File.join(seeds_root, "city2.jpeg")), # Keep after organization
137
138
  promoter_group: Decidim::Faker::Localized.sentence(3),
138
139
  participatory_scope: Decidim::Faker::Localized.sentence(3),
139
- published_at: Time.now.utc,
140
- organization: organization
140
+ published_at: Time.now.utc
141
141
  }
142
142
 
143
143
  question = Decidim.traceability.perform_action!(
@@ -161,15 +161,15 @@ Decidim.register_participatory_space(:consultations) do |participatory_space|
161
161
  Decidim::Attachment.create!(
162
162
  title: Decidim::Faker::Localized.sentence(2),
163
163
  description: Decidim::Faker::Localized.sentence(5),
164
- file: File.new(File.join(seeds_root, "city.jpeg")),
165
- attached_to: question
164
+ attached_to: question,
165
+ file: File.new(File.join(seeds_root, "city.jpeg")) # Keep after attached_to
166
166
  )
167
167
 
168
168
  Decidim::Attachment.create!(
169
169
  title: Decidim::Faker::Localized.sentence(2),
170
170
  description: Decidim::Faker::Localized.sentence(5),
171
- file: File.new(File.join(seeds_root, "Exampledocument.pdf")),
172
- attached_to: question
171
+ attached_to: question,
172
+ file: File.new(File.join(seeds_root, "Exampledocument.pdf")) # Keep after attached_to
173
173
  )
174
174
  end
175
175
  end
@@ -22,6 +22,7 @@ FactoryBot.define do
22
22
  published_at { Time.current }
23
23
  start_voting_date { Time.zone.today }
24
24
  end_voting_date { Time.zone.today + 1.month }
25
+ introductory_image { Decidim::Dev.test_file("city.jpeg", "image/jpeg") }
25
26
  introductory_video_url { "https://www.youtube.com/embed/zhMMW0TENNA" }
26
27
  decidim_highlighted_scope_id { create(:scope, organization: organization).id }
27
28
  results_published_at { nil }
@@ -3,7 +3,7 @@
3
3
  module Decidim
4
4
  module Consultations
5
5
  def self.version
6
- "0.22.0"
6
+ "0.23.0"
7
7
  end
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: decidim-consultations
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.22.0
4
+ version: 0.23.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juan Salvador Perez Garcia
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-09-01 00:00:00.000000000 Z
11
+ date: 2020-11-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: decidim-admin
@@ -16,56 +16,56 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 0.22.0
19
+ version: 0.23.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 0.22.0
26
+ version: 0.23.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: decidim-comments
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: 0.22.0
33
+ version: 0.23.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - '='
39
39
  - !ruby/object:Gem::Version
40
- version: 0.22.0
40
+ version: 0.23.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: decidim-core
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - '='
46
46
  - !ruby/object:Gem::Version
47
- version: 0.22.0
47
+ version: 0.23.0
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - '='
53
53
  - !ruby/object:Gem::Version
54
- version: 0.22.0
54
+ version: 0.23.0
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: decidim-dev
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - '='
60
60
  - !ruby/object:Gem::Version
61
- version: 0.22.0
61
+ version: 0.23.0
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - '='
67
67
  - !ruby/object:Gem::Version
68
- version: 0.22.0
68
+ version: 0.23.0
69
69
  description: Extends Decidim adding a first level public consultation component
70
70
  email:
71
71
  - jsperezg@gmail.com
@@ -246,22 +246,27 @@ files:
246
246
  - app/views/layouts/decidim/consultation_choose.html.erb
247
247
  - app/views/layouts/decidim/question.html.erb
248
248
  - app/views/layouts/decidim/question_multivote.html.erb
249
+ - config/locales/am-ET.yml
249
250
  - config/locales/ar-SA.yml
250
251
  - config/locales/ar.yml
251
252
  - config/locales/bg-BG.yml
253
+ - config/locales/bg.yml
252
254
  - config/locales/ca.yml
253
255
  - config/locales/cs-CZ.yml
254
256
  - config/locales/cs.yml
255
257
  - config/locales/da-DK.yml
258
+ - config/locales/da.yml
256
259
  - config/locales/de.yml
257
260
  - config/locales/el-GR.yml
258
261
  - config/locales/el.yml
259
262
  - config/locales/en.yml
260
263
  - config/locales/eo-UY.yml
264
+ - config/locales/eo.yml
261
265
  - config/locales/es-MX.yml
262
266
  - config/locales/es-PY.yml
263
267
  - config/locales/es.yml
264
268
  - config/locales/et-EE.yml
269
+ - config/locales/et.yml
265
270
  - config/locales/eu.yml
266
271
  - config/locales/fi-pl.yml
267
272
  - config/locales/fi-plain.yml
@@ -271,16 +276,24 @@ files:
271
276
  - config/locales/ga-IE.yml
272
277
  - config/locales/gl.yml
273
278
  - config/locales/hr-HR.yml
279
+ - config/locales/hr.yml
274
280
  - config/locales/hu.yml
275
281
  - config/locales/id-ID.yml
276
282
  - config/locales/is-IS.yml
283
+ - config/locales/is.yml
277
284
  - config/locales/it.yml
278
285
  - config/locales/ja-JP.yml
286
+ - config/locales/ja.yml
287
+ - config/locales/ko-KR.yml
288
+ - config/locales/ko.yml
279
289
  - config/locales/lt-LT.yml
280
- - config/locales/lv-LV.yml
290
+ - config/locales/lt.yml
291
+ - config/locales/lv.yml
281
292
  - config/locales/mt-MT.yml
293
+ - config/locales/mt.yml
282
294
  - config/locales/nl.yml
283
295
  - config/locales/no.yml
296
+ - config/locales/om-ET.yml
284
297
  - config/locales/pl.yml
285
298
  - config/locales/pt-BR.yml
286
299
  - config/locales/pt.yml
@@ -289,10 +302,16 @@ files:
289
302
  - config/locales/sk-SK.yml
290
303
  - config/locales/sk.yml
291
304
  - config/locales/sl.yml
305
+ - config/locales/so-SO.yml
292
306
  - config/locales/sr-CS.yml
293
307
  - config/locales/sv.yml
308
+ - config/locales/ti-ER.yml
294
309
  - config/locales/tr-TR.yml
295
310
  - config/locales/uk.yml
311
+ - config/locales/vi-VN.yml
312
+ - config/locales/vi.yml
313
+ - config/locales/zh-CN.yml
314
+ - config/locales/zh-TW.yml
296
315
  - db/migrate/20180109092205_create_decidim_consultations.rb
297
316
  - db/migrate/20180112053247_create_decidim_consultations_questions.rb
298
317
  - db/migrate/20180115132000_add_end_voting_date_to_decidim_consultations.rb
@@ -327,6 +346,7 @@ files:
327
346
  - db/migrate/20190708121643_add_response_groups_to_decidim_consultations_responses.rb
328
347
  - db/migrate/20190710121122_add_free_instructions_field_to_consultations_questions.rb
329
348
  - db/migrate/20200320105916_index_foreign_keys_in_decidim_consultations_votes.rb
349
+ - db/migrate/20200827154143_add_commentable_counter_cache_to_consultations.rb
330
350
  - db/seeds/Exampledocument.pdf
331
351
  - db/seeds/city.jpeg
332
352
  - db/seeds/city2.jpeg
@@ -350,14 +370,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
350
370
  requirements:
351
371
  - - ">="
352
372
  - !ruby/object:Gem::Version
353
- version: '2.5'
373
+ version: '2.6'
354
374
  required_rubygems_version: !ruby/object:Gem::Requirement
355
375
  requirements:
356
376
  - - ">="
357
377
  - !ruby/object:Gem::Version
358
378
  version: '0'
359
379
  requirements: []
360
- rubygems_version: 3.1.2
380
+ rubygems_version: 3.0.3
361
381
  signing_key:
362
382
  specification_version: 4
363
383
  summary: Decidim consultations module