decidim-assemblies 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 (70) hide show
  1. checksums.yaml +4 -4
  2. data/app/commands/decidim/assemblies/admin/import_assembly.rb +72 -0
  3. data/app/commands/decidim/assemblies/admin/update_assembly.rb +10 -5
  4. data/app/controllers/decidim/assemblies/admin/assembly_exports_controller.rb +24 -0
  5. data/app/controllers/decidim/assemblies/admin/assembly_imports_controller.rb +31 -0
  6. data/app/controllers/decidim/assemblies/admin/assembly_user_roles_controller.rb +2 -1
  7. data/app/controllers/decidim/assemblies/{assembly_widgets_controller.rb → widgets_controller.rb} +2 -2
  8. data/app/forms/decidim/assemblies/admin/assembly_form.rb +5 -6
  9. data/app/forms/decidim/assemblies/admin/assembly_import_form.rb +83 -0
  10. data/app/forms/decidim/assemblies/admin/assembly_user_role_form.rb +8 -2
  11. data/app/models/decidim/assemblies_type.rb +3 -0
  12. data/app/models/decidim/assembly.rb +14 -1
  13. data/app/permissions/decidim/assemblies/permissions.rb +5 -1
  14. data/app/presenters/decidim/assemblies/assembly_presenter.rb +29 -0
  15. data/app/serializers/decidim/assemblies/assembly_importer.rb +172 -0
  16. data/app/serializers/decidim/assemblies/assembly_serializer.rb +147 -0
  17. data/app/views/decidim/assemblies/admin/assemblies/index.html.erb +10 -0
  18. data/app/views/decidim/assemblies/admin/assembly_imports/_form.html.erb +46 -0
  19. data/app/views/decidim/assemblies/admin/assembly_imports/new.html.erb +7 -0
  20. data/app/views/decidim/assemblies/assemblies/show.html.erb +1 -1
  21. data/app/views/layouts/decidim/assembly.html.erb +1 -0
  22. data/config/locales/am-ET.yml +1 -0
  23. data/config/locales/bg.yml +7 -0
  24. data/config/locales/ca.yml +24 -2
  25. data/config/locales/cs.yml +29 -7
  26. data/config/locales/da.yml +1 -0
  27. data/config/locales/de.yml +19 -0
  28. data/config/locales/el.yml +19 -0
  29. data/config/locales/en.yml +22 -0
  30. data/config/locales/eo.yml +1 -0
  31. data/config/locales/es-MX.yml +22 -0
  32. data/config/locales/es-PY.yml +22 -0
  33. data/config/locales/es.yml +24 -2
  34. data/config/locales/et.yml +1 -0
  35. data/config/locales/fi-plain.yml +19 -0
  36. data/config/locales/fi.yml +22 -3
  37. data/config/locales/fr-CA.yml +22 -0
  38. data/config/locales/fr.yml +22 -0
  39. data/config/locales/hr.yml +1 -0
  40. data/config/locales/hu.yml +18 -0
  41. data/config/locales/is.yml +263 -0
  42. data/config/locales/it.yml +19 -0
  43. data/config/locales/ja-JP.yml +145 -126
  44. data/config/locales/ja.yml +471 -0
  45. data/config/locales/ko-KR.yml +1 -0
  46. data/config/locales/ko.yml +1 -0
  47. data/config/locales/lt.yml +1 -0
  48. data/config/locales/{lv-LV.yml → lv.yml} +0 -0
  49. data/config/locales/mt.yml +1 -0
  50. data/config/locales/nl.yml +19 -0
  51. data/config/locales/no.yml +19 -0
  52. data/config/locales/om-ET.yml +1 -0
  53. data/config/locales/pl.yml +37 -18
  54. data/config/locales/pt.yml +19 -0
  55. data/config/locales/ro-RO.yml +19 -0
  56. data/config/locales/sl.yml +151 -0
  57. data/config/locales/so-SO.yml +1 -0
  58. data/config/locales/sv.yml +22 -0
  59. data/config/locales/ti-ER.yml +1 -0
  60. data/config/locales/tr-TR.yml +19 -0
  61. data/config/locales/vi-VN.yml +1 -0
  62. data/config/locales/vi.yml +1 -0
  63. data/config/locales/zh-CN.yml +471 -0
  64. data/config/locales/zh-TW.yml +1 -0
  65. data/lib/decidim/assemblies/admin_engine.rb +7 -0
  66. data/lib/decidim/assemblies/engine.rb +1 -1
  67. data/lib/decidim/assemblies/participatory_space.rb +20 -12
  68. data/lib/decidim/assemblies/test/factories.rb +3 -3
  69. data/lib/decidim/assemblies/version.rb +1 -1
  70. metadata +40 -12
@@ -0,0 +1 @@
1
+ zh-TW:
@@ -31,6 +31,12 @@ module Decidim
31
31
 
32
32
  resources :attachment_collections, controller: "assembly_attachment_collections"
33
33
  resources :attachments, controller: "assembly_attachments"
34
+
35
+ resource :export, controller: "assembly_exports", only: :create
36
+
37
+ collection do
38
+ resources :imports, controller: "assembly_imports", only: [:new, :create]
39
+ end
34
40
  end
35
41
 
36
42
  scope "/assemblies/:assembly_slug" do
@@ -41,6 +47,7 @@ module Decidim
41
47
  member do
42
48
  put :publish
43
49
  put :unpublish
50
+ get :share
44
51
  end
45
52
  resources :exports, only: :create
46
53
  end
@@ -25,7 +25,7 @@ module Decidim
25
25
 
26
26
  resources :assemblies, only: [:index, :show], param: :slug, path: "assemblies" do
27
27
  resources :assembly_members, only: :index, path: "members"
28
- resource :assembly_widget, only: :show, path: "embed"
28
+ resource :widget, only: :show, path: "embed"
29
29
  end
30
30
 
31
31
  scope "/assemblies/:assembly_slug/f/:component_id" do
@@ -28,6 +28,14 @@ Decidim.register_participatory_space(:assemblies) do |participatory_space|
28
28
  context.layout = "layouts/decidim/admin/assembly"
29
29
  end
30
30
 
31
+ participatory_space.exports :assemblies do |export|
32
+ export.collection do |assembly|
33
+ Decidim::Assembly.where(id: assembly.id)
34
+ end
35
+
36
+ export.serializer Decidim::Assemblies::AssemblySerializer
37
+ end
38
+
31
39
  participatory_space.register_on_destroy_account do |user|
32
40
  Decidim::AssemblyUserRole.where(user: user).destroy_all
33
41
  Decidim::AssemblyMember.where(user: user).destroy_all
@@ -57,11 +65,11 @@ Decidim.register_participatory_space(:assemblies) do |participatory_space|
57
65
  description: Decidim::Faker::Localized.wrapped("<p>", "</p>") do
58
66
  Decidim::Faker::Localized.paragraph(3)
59
67
  end,
60
- hero_image: File.new(File.join(seeds_root, "city.jpeg")),
61
- banner_image: File.new(File.join(seeds_root, "city2.jpeg")),
68
+ organization: organization,
69
+ hero_image: File.new(File.join(seeds_root, "city.jpeg")), # Keep after organization
70
+ banner_image: File.new(File.join(seeds_root, "city2.jpeg")), # Keep after organization
62
71
  promoted: true,
63
72
  published_at: 2.weeks.ago,
64
- organization: organization,
65
73
  meta_scope: Decidim::Faker::Localized.word,
66
74
  developer_group: Decidim::Faker::Localized.sentence(1),
67
75
  local_area: Decidim::Faker::Localized.sentence(2),
@@ -140,11 +148,11 @@ Decidim.register_participatory_space(:assemblies) do |participatory_space|
140
148
  description: Decidim::Faker::Localized.wrapped("<p>", "</p>") do
141
149
  Decidim::Faker::Localized.paragraph(3)
142
150
  end,
143
- hero_image: File.new(File.join(seeds_root, "city.jpeg")),
144
- banner_image: File.new(File.join(seeds_root, "city2.jpeg")),
151
+ organization: organization,
152
+ hero_image: File.new(File.join(seeds_root, "city.jpeg")), # Keep after organization
153
+ banner_image: File.new(File.join(seeds_root, "city2.jpeg")), # Keep after organization
145
154
  promoted: true,
146
155
  published_at: 2.weeks.ago,
147
- organization: organization,
148
156
  meta_scope: Decidim::Faker::Localized.word,
149
157
  developer_group: Decidim::Faker::Localized.sentence(1),
150
158
  local_area: Decidim::Faker::Localized.sentence(2),
@@ -166,23 +174,23 @@ Decidim.register_participatory_space(:assemblies) do |participatory_space|
166
174
  Decidim::Attachment.create!(
167
175
  title: Decidim::Faker::Localized.sentence(2),
168
176
  description: Decidim::Faker::Localized.sentence(5),
169
- file: File.new(File.join(seeds_root, "Exampledocument.pdf")),
170
177
  attachment_collection: attachment_collection,
171
- attached_to: current_assembly
178
+ attached_to: current_assembly,
179
+ file: File.new(File.join(seeds_root, "Exampledocument.pdf")) # Keep after attached_to
172
180
  )
173
181
 
174
182
  Decidim::Attachment.create!(
175
183
  title: Decidim::Faker::Localized.sentence(2),
176
184
  description: Decidim::Faker::Localized.sentence(5),
177
- file: File.new(File.join(seeds_root, "city.jpeg")),
178
- attached_to: current_assembly
185
+ attached_to: current_assembly,
186
+ file: File.new(File.join(seeds_root, "city.jpeg")) # Keep after attached_to
179
187
  )
180
188
 
181
189
  Decidim::Attachment.create!(
182
190
  title: Decidim::Faker::Localized.sentence(2),
183
191
  description: Decidim::Faker::Localized.sentence(5),
184
- file: File.new(File.join(seeds_root, "Exampledocument.pdf")),
185
- attached_to: current_assembly
192
+ attached_to: current_assembly,
193
+ file: File.new(File.join(seeds_root, "Exampledocument.pdf")) # Keep after attached_to
186
194
  )
187
195
 
188
196
  2.times do
@@ -24,10 +24,10 @@ FactoryBot.define do
24
24
  subtitle { generate_localized_title }
25
25
  short_description { Decidim::Faker::Localized.wrapped("<p>", "</p>") { generate_localized_title } }
26
26
  description { Decidim::Faker::Localized.wrapped("<p>", "</p>") { generate_localized_title } }
27
- hero_image { Decidim::Dev.test_file("city.jpeg", "image/jpeg") }
28
- banner_image { Decidim::Dev.test_file("city2.jpeg", "image/jpeg") }
29
- published_at { Time.current }
30
27
  organization
28
+ hero_image { Decidim::Dev.test_file("city.jpeg", "image/jpeg") } # Keep after organization
29
+ banner_image { Decidim::Dev.test_file("city2.jpeg", "image/jpeg") } # Keep after organization
30
+ published_at { Time.current }
31
31
  meta_scope { Decidim::Faker::Localized.word }
32
32
  developer_group { generate_localized_title }
33
33
  local_area { generate_localized_title }
@@ -4,7 +4,7 @@ module Decidim
4
4
  # This holds the decidim-assemblies version.
5
5
  module Assemblies
6
6
  def self.version
7
- "0.22.0"
7
+ "0.23.0"
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-assemblies
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
  - Josep Jaume Rey Peroy
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2020-09-01 00:00:00.000000000 Z
13
+ date: 2020-11-05 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: decidim-core
@@ -18,42 +18,42 @@ dependencies:
18
18
  requirements:
19
19
  - - '='
20
20
  - !ruby/object:Gem::Version
21
- version: 0.22.0
21
+ version: 0.23.0
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.22.0
28
+ version: 0.23.0
29
29
  - !ruby/object:Gem::Dependency
30
30
  name: decidim-admin
31
31
  requirement: !ruby/object:Gem::Requirement
32
32
  requirements:
33
33
  - - '='
34
34
  - !ruby/object:Gem::Version
35
- version: 0.22.0
35
+ version: 0.23.0
36
36
  type: :development
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.22.0
42
+ version: 0.23.0
43
43
  - !ruby/object:Gem::Dependency
44
44
  name: decidim-dev
45
45
  requirement: !ruby/object:Gem::Requirement
46
46
  requirements:
47
47
  - - '='
48
48
  - !ruby/object:Gem::Version
49
- version: 0.22.0
49
+ version: 0.23.0
50
50
  type: :development
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.22.0
56
+ version: 0.23.0
57
57
  description: Assemblies component for decidim.
58
58
  email:
59
59
  - josepjaume@gmail.com
@@ -91,6 +91,7 @@ files:
91
91
  - app/commands/decidim/assemblies/admin/destroy_assemblies_type.rb
92
92
  - app/commands/decidim/assemblies/admin/destroy_assembly_admin.rb
93
93
  - app/commands/decidim/assemblies/admin/destroy_assembly_member.rb
94
+ - app/commands/decidim/assemblies/admin/import_assembly.rb
94
95
  - app/commands/decidim/assemblies/admin/notify_role_assigned_to_assembly.rb
95
96
  - app/commands/decidim/assemblies/admin/publish_assembly.rb
96
97
  - app/commands/decidim/assemblies/admin/unpublish_assembly.rb
@@ -110,6 +111,8 @@ files:
110
111
  - app/controllers/decidim/assemblies/admin/assembly_attachment_collections_controller.rb
111
112
  - app/controllers/decidim/assemblies/admin/assembly_attachments_controller.rb
112
113
  - app/controllers/decidim/assemblies/admin/assembly_copies_controller.rb
114
+ - app/controllers/decidim/assemblies/admin/assembly_exports_controller.rb
115
+ - app/controllers/decidim/assemblies/admin/assembly_imports_controller.rb
113
116
  - app/controllers/decidim/assemblies/admin/assembly_members_controller.rb
114
117
  - app/controllers/decidim/assemblies/admin/assembly_publications_controller.rb
115
118
  - app/controllers/decidim/assemblies/admin/assembly_user_roles_controller.rb
@@ -124,13 +127,14 @@ files:
124
127
  - app/controllers/decidim/assemblies/application_controller.rb
125
128
  - app/controllers/decidim/assemblies/assemblies_controller.rb
126
129
  - app/controllers/decidim/assemblies/assembly_members_controller.rb
127
- - app/controllers/decidim/assemblies/assembly_widgets_controller.rb
130
+ - app/controllers/decidim/assemblies/widgets_controller.rb
128
131
  - app/events/decidim/assemblies/create_assembly_member_event.rb
129
132
  - app/events/decidim/role_assigned_to_assembly_event.rb
130
133
  - app/forms/decidim/assemblies/admin/assemblies_setting_form.rb
131
134
  - app/forms/decidim/assemblies/admin/assemblies_type_form.rb
132
135
  - app/forms/decidim/assemblies/admin/assembly_copy_form.rb
133
136
  - app/forms/decidim/assemblies/admin/assembly_form.rb
137
+ - app/forms/decidim/assemblies/admin/assembly_import_form.rb
134
138
  - app/forms/decidim/assemblies/admin/assembly_member_form.rb
135
139
  - app/forms/decidim/assemblies/admin/assembly_user_role_form.rb
136
140
  - app/helpers/decidim/assemblies/admin/assemblies_helper.rb
@@ -150,6 +154,7 @@ files:
150
154
  - app/presenters/decidim/assemblies/admin_log/assembly_user_role_presenter.rb
151
155
  - app/presenters/decidim/assemblies/admin_log/value_types/member_position_presenter.rb
152
156
  - app/presenters/decidim/assemblies/admin_log/value_types/role_presenter.rb
157
+ - app/presenters/decidim/assemblies/assembly_presenter.rb
153
158
  - app/presenters/decidim/assemblies/assembly_stats_presenter.rb
154
159
  - app/presenters/decidim/assembly_member_presenter.rb
155
160
  - app/presenters/decidim/assembly_presenter.rb
@@ -169,6 +174,8 @@ files:
169
174
  - app/queries/decidim/assemblies/promoted_assemblies.rb
170
175
  - app/queries/decidim/assemblies/published_assemblies.rb
171
176
  - app/queries/decidim/assemblies/visible_assemblies.rb
177
+ - app/serializers/decidim/assemblies/assembly_importer.rb
178
+ - app/serializers/decidim/assemblies/assembly_serializer.rb
172
179
  - app/services/decidim/assemblies/assembly_search.rb
173
180
  - app/types/decidim/assemblies/assemblies_type_type.rb
174
181
  - app/types/decidim/assemblies/assembly_member_type.rb
@@ -187,6 +194,8 @@ files:
187
194
  - app/views/decidim/assemblies/admin/assemblies_types/new.html.erb
188
195
  - app/views/decidim/assemblies/admin/assembly_copies/_form.html.erb
189
196
  - app/views/decidim/assemblies/admin/assembly_copies/new.html.erb
197
+ - app/views/decidim/assemblies/admin/assembly_imports/_form.html.erb
198
+ - app/views/decidim/assemblies/admin/assembly_imports/new.html.erb
190
199
  - app/views/decidim/assemblies/admin/assembly_members/_form.html.erb
191
200
  - app/views/decidim/assemblies/admin/assembly_members/edit.html.erb
192
201
  - app/views/decidim/assemblies/admin/assembly_members/index.html.erb
@@ -211,22 +220,27 @@ files:
211
220
  - app/views/layouts/decidim/admin/assemblies.html.erb
212
221
  - app/views/layouts/decidim/admin/assembly.html.erb
213
222
  - app/views/layouts/decidim/assembly.html.erb
223
+ - config/locales/am-ET.yml
214
224
  - config/locales/ar-SA.yml
215
225
  - config/locales/ar.yml
216
226
  - config/locales/bg-BG.yml
227
+ - config/locales/bg.yml
217
228
  - config/locales/ca.yml
218
229
  - config/locales/cs-CZ.yml
219
230
  - config/locales/cs.yml
220
231
  - config/locales/da-DK.yml
232
+ - config/locales/da.yml
221
233
  - config/locales/de.yml
222
234
  - config/locales/el-GR.yml
223
235
  - config/locales/el.yml
224
236
  - config/locales/en.yml
225
237
  - config/locales/eo-UY.yml
238
+ - config/locales/eo.yml
226
239
  - config/locales/es-MX.yml
227
240
  - config/locales/es-PY.yml
228
241
  - config/locales/es.yml
229
242
  - config/locales/et-EE.yml
243
+ - config/locales/et.yml
230
244
  - config/locales/eu.yml
231
245
  - config/locales/fi-pl.yml
232
246
  - config/locales/fi-plain.yml
@@ -236,16 +250,24 @@ files:
236
250
  - config/locales/ga-IE.yml
237
251
  - config/locales/gl.yml
238
252
  - config/locales/hr-HR.yml
253
+ - config/locales/hr.yml
239
254
  - config/locales/hu.yml
240
255
  - config/locales/id-ID.yml
241
256
  - config/locales/is-IS.yml
257
+ - config/locales/is.yml
242
258
  - config/locales/it.yml
243
259
  - config/locales/ja-JP.yml
260
+ - config/locales/ja.yml
261
+ - config/locales/ko-KR.yml
262
+ - config/locales/ko.yml
244
263
  - config/locales/lt-LT.yml
245
- - config/locales/lv-LV.yml
264
+ - config/locales/lt.yml
265
+ - config/locales/lv.yml
246
266
  - config/locales/mt-MT.yml
267
+ - config/locales/mt.yml
247
268
  - config/locales/nl.yml
248
269
  - config/locales/no.yml
270
+ - config/locales/om-ET.yml
249
271
  - config/locales/pl.yml
250
272
  - config/locales/pt-BR.yml
251
273
  - config/locales/pt.yml
@@ -254,10 +276,16 @@ files:
254
276
  - config/locales/sk-SK.yml
255
277
  - config/locales/sk.yml
256
278
  - config/locales/sl.yml
279
+ - config/locales/so-SO.yml
257
280
  - config/locales/sr-CS.yml
258
281
  - config/locales/sv.yml
282
+ - config/locales/ti-ER.yml
259
283
  - config/locales/tr-TR.yml
260
284
  - config/locales/uk.yml
285
+ - config/locales/vi-VN.yml
286
+ - config/locales/vi.yml
287
+ - config/locales/zh-CN.yml
288
+ - config/locales/zh-TW.yml
261
289
  - db/migrate/20170727190859_add_assemblies.rb
262
290
  - db/migrate/20170822153055_add_scopes_enabled_to_assemblies.rb
263
291
  - db/migrate/20180109105917_add_assembly_user_roles.rb
@@ -300,14 +328,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
300
328
  requirements:
301
329
  - - ">="
302
330
  - !ruby/object:Gem::Version
303
- version: '2.5'
331
+ version: '2.6'
304
332
  required_rubygems_version: !ruby/object:Gem::Requirement
305
333
  requirements:
306
334
  - - ">="
307
335
  - !ruby/object:Gem::Version
308
336
  version: '0'
309
337
  requirements: []
310
- rubygems_version: 3.1.2
338
+ rubygems_version: 3.0.3
311
339
  signing_key:
312
340
  specification_version: 4
313
341
  summary: Decidim assemblies module