decidim-assemblies 0.23.5 → 0.24.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (77) hide show
  1. checksums.yaml +4 -4
  2. data/app/cells/decidim/assemblies/assembly_m_cell.rb +2 -0
  3. data/app/cells/decidim/assemblies/statistic/show.erb +9 -0
  4. data/app/cells/decidim/assemblies/statistic_cell.rb +20 -0
  5. data/app/cells/decidim/assemblies/statistics/show.erb +17 -0
  6. data/app/cells/decidim/assemblies/statistics_cell.rb +18 -0
  7. data/app/commands/decidim/assemblies/admin/create_assembly.rb +1 -0
  8. data/app/commands/decidim/assemblies/admin/update_assembly.rb +2 -1
  9. data/app/controllers/decidim/assemblies/admin/imports_controller.rb +14 -0
  10. data/app/controllers/decidim/assemblies/admin/moderations/reports_controller.rb +14 -0
  11. data/app/controllers/decidim/assemblies/assemblies_controller.rb +1 -1
  12. data/app/forms/decidim/assemblies/admin/assembly_form.rb +3 -0
  13. data/app/helpers/decidim/assemblies/admin/assemblies_admin_menu_helper.rb +15 -0
  14. data/app/models/decidim/assembly.rb +3 -3
  15. data/app/presenters/decidim/assemblies/assembly_stats_presenter.rb +35 -25
  16. data/app/queries/decidim/assemblies/organization_assemblies.rb +1 -1
  17. data/app/queries/decidim/assemblies/organization_published_assemblies.rb +1 -1
  18. data/app/serializers/decidim/assemblies/assembly_serializer.rb +1 -0
  19. data/app/views/decidim/assemblies/admin/assemblies/_form.html.erb +4 -0
  20. data/app/views/decidim/assemblies/admin/assemblies/index.html.erb +11 -1
  21. data/app/views/decidim/assemblies/admin/assemblies_types/index.html.erb +1 -1
  22. data/app/views/decidim/assemblies/assemblies/show.html.erb +1 -1
  23. data/app/views/layouts/decidim/admin/assemblies.html.erb +2 -20
  24. data/app/views/layouts/decidim/admin/assembly.html.erb +2 -1
  25. data/config/locales/ar.yml +2 -1
  26. data/config/locales/ca.yml +9 -3
  27. data/config/locales/cs.yml +11 -5
  28. data/config/locales/de.yml +9 -3
  29. data/config/locales/el.yml +2 -4
  30. data/config/locales/en.yml +9 -3
  31. data/config/locales/es-MX.yml +9 -3
  32. data/config/locales/es-PY.yml +9 -3
  33. data/config/locales/es.yml +9 -3
  34. data/config/locales/eu.yml +2 -1
  35. data/config/locales/fi-plain.yml +8 -2
  36. data/config/locales/fi.yml +8 -2
  37. data/config/locales/fr-CA.yml +9 -3
  38. data/config/locales/fr.yml +9 -3
  39. data/config/locales/gl.yml +8 -6
  40. data/config/locales/hu.yml +2 -4
  41. data/config/locales/id-ID.yml +2 -1
  42. data/config/locales/is-IS.yml +1 -1
  43. data/config/locales/it.yml +2 -4
  44. data/config/locales/ja.yml +4 -3
  45. data/config/locales/lv.yml +2 -4
  46. data/config/locales/nl.yml +9 -3
  47. data/config/locales/no.yml +2 -4
  48. data/config/locales/pl.yml +10 -4
  49. data/config/locales/pt-BR.yml +2 -1
  50. data/config/locales/pt.yml +2 -4
  51. data/config/locales/ro-RO.yml +6 -3
  52. data/config/locales/ru.yml +2 -1
  53. data/config/locales/sk.yml +0 -3
  54. data/config/locales/sl.yml +2 -1
  55. data/config/locales/sr-CS.yml +0 -3
  56. data/config/locales/sv.yml +8 -3
  57. data/config/locales/tr-TR.yml +2 -4
  58. data/config/locales/uk.yml +2 -1
  59. data/config/locales/zh-CN.yml +2 -4
  60. data/db/migrate/20210204152393_add_weight_field_to_assembly.rb +7 -0
  61. data/db/migrate/20210310120444_add_followable_counter_cache_to_assemblies.rb +16 -0
  62. data/lib/decidim/api/assemblies_type_type.rb +16 -0
  63. data/lib/decidim/api/assembly_member_type.rb +28 -0
  64. data/lib/decidim/api/assembly_type.rb +64 -0
  65. data/lib/decidim/assemblies.rb +1 -0
  66. data/lib/decidim/assemblies/admin_engine.rb +31 -1
  67. data/lib/decidim/assemblies/api.rb +9 -0
  68. data/lib/decidim/assemblies/engine.rb +3 -5
  69. data/lib/decidim/assemblies/participatory_space.rb +38 -38
  70. data/lib/decidim/assemblies/query_extensions.rb +39 -20
  71. data/lib/decidim/assemblies/test/factories.rb +5 -4
  72. data/lib/decidim/assemblies/version.rb +1 -1
  73. metadata +23 -14
  74. data/app/types/decidim/assemblies/assemblies_type_type.rb +0 -17
  75. data/app/types/decidim/assemblies/assembly_member_type.rb +0 -29
  76. data/app/types/decidim/assemblies/assembly_type.rb +0 -67
  77. data/app/views/decidim/assemblies/assemblies/_statistics.html.erb +0 -10
@@ -327,13 +327,14 @@ pt:
327
327
  comments_count: Comentários
328
328
  debates_count: Debates
329
329
  endorsements_count: Endossos
330
- headline: Atividade
331
330
  meetings_count: Reuniões
332
331
  orders_count: Votos
333
332
  pages_count: Páginas
333
+ participants_count: Participantes
334
334
  projects_count: Projetos
335
335
  proposals_count: Propostas
336
336
  results_count: Resultados
337
+ supports_count: Votos
337
338
  surveys_count: pesquisas
338
339
  users_count: Participantes
339
340
  votes_count: Votos
@@ -246,7 +246,6 @@ pt:
246
246
  update: "%{user_name} atualizou as definições de reuniões"
247
247
  assembly_type:
248
248
  create: "%{user_name} criou o tipo de reunião %{resource_name}"
249
- delete: "%{user_name} removeu o membro %{resource_name} do tipo de reunião %{space_name}"
250
249
  publish: "%{user_name} publicou o tipo de reunião %{resource_name}"
251
250
  unpublish: "%{user_name} removeu a publicação do tipo de reunião %{resource_name}"
252
251
  update: "%{user_name} atualizou o tipo de reunião %{resource_name}"
@@ -380,14 +379,15 @@ pt:
380
379
  comments_count: Comentários
381
380
  debates_count: Debates
382
381
  endorsements_count: Endossos
383
- headline: Atividade
384
382
  meetings_count: Reuniões
385
383
  orders_count: Votos
386
384
  pages_count: Páginas
385
+ participants_count: Participantes
387
386
  posts_count: Publicações
388
387
  projects_count: Projetos
389
388
  proposals_count: Propostas
390
389
  results_count: Resultados
390
+ supports_count: Votos
391
391
  surveys_count: Inquéritos
392
392
  users_count: Participantes
393
393
  votes_count: Votos
@@ -437,8 +437,6 @@ pt:
437
437
  home:
438
438
  hero:
439
439
  participate_title: Participar nos processos da plataforma
440
- sub_hero:
441
- register_title: Inscreva-se para criar uma conta na plataforma
442
440
  participatory_processes:
443
441
  pages:
444
442
  home:
@@ -52,6 +52,7 @@ ro:
52
52
  target: Cine participă
53
53
  title: Titlu
54
54
  twitter: Twitter
55
+ weight: Pondere
55
56
  youtube: YouTube
56
57
  assembly_member:
57
58
  birthday: Data nașterii
@@ -252,7 +253,7 @@ ro:
252
253
  update: "%{user_name} a actualizat setările de asamblare"
253
254
  assembly_type:
254
255
  create: "%{user_name} a creat %{resource_name} tip de asamblare"
255
- delete: "%{user_name} a eliminat membrul %{resource_name} din tipul de adunare %{space_name}"
256
+ delete: "%{user_name} a creat tipul de organizație %{resource_name}"
256
257
  publish: "%{user_name} a publicat %{resource_name} tip de asamblare"
257
258
  unpublish: "%{user_name} nu a publicat %{resource_name} tip de asamblare"
258
259
  update: "%{user_name} a actualizat tipul de asamblare %{resource_name}"
@@ -389,14 +390,16 @@ ro:
389
390
  comments_count: Comentarii
390
391
  debates_count: Dezbateri
391
392
  endorsements_count: Susținători
392
- headline: Activitate
393
393
  meetings_count: Întâlniri
394
394
  orders_count: Suportă
395
395
  pages_count: Pagini
396
+ participants_count: Participanți
396
397
  posts_count: Mesaje
398
+ processes_count: Procese
397
399
  projects_count: Proiecte
398
400
  proposals_count: Propuneri
399
401
  results_count: Rezultate
402
+ supports_count: Suportă
400
403
  surveys_count: Chestionare
401
404
  users_count: Participanți
402
405
  votes_count: Suportă
@@ -447,7 +450,7 @@ ro:
447
450
  hero:
448
451
  participate_title: Participă la procesele platformei
449
452
  sub_hero:
450
- register_title: Înregistrează-te pentru a crea un cont pe platformă
453
+ register_title: Înregistrează-te pentru a crea un cont
451
454
  participatory_processes:
452
455
  pages:
453
456
  home:
@@ -311,13 +311,14 @@ ru:
311
311
  comments_count: Комментариев
312
312
  debates_count: Обсуждений
313
313
  endorsements_count: Выражений поддержки
314
- headline: Деятельность
315
314
  meetings_count: Встреч
316
315
  orders_count: Голосов
317
316
  pages_count: Страниц
317
+ participants_count: Участников
318
318
  projects_count: Проектов
319
319
  proposals_count: Предложений
320
320
  results_count: Итогов
321
+ supports_count: Голосов
321
322
  surveys_count: Опросов
322
323
  users_count: Участников
323
324
  votes_count: Голосов
@@ -129,7 +129,6 @@ sk:
129
129
  admin_log:
130
130
  assembly_type:
131
131
  create: "%{user_name} vytvoril %{resource_name} nový typ zhromaždenia"
132
- delete: "%{user_name} odstránil %{resource_name} používateľa z typu zhromaždenia %{space_name}"
133
132
  publish: "%{user_name} vytvoril nový typ zhromaždenia %{resource_name}"
134
133
  unpublish: "%{user_name} zrušil publikovanie typu zhromaždenia %{resource_name}"
135
134
  update: "%{user_name} aktualizoval typ zhromaždenia %{resource_name}"
@@ -163,8 +162,6 @@ sk:
163
162
  home:
164
163
  hero:
165
164
  participate_title: Podieľajte sa na procesoch platformy
166
- sub_hero:
167
- register_title: Vytvorte si účet na platforme
168
165
  participatory_processes:
169
166
  pages:
170
167
  home:
@@ -238,14 +238,15 @@ sl:
238
238
  assemblies_count: Združbe
239
239
  comments_count: Komentarji
240
240
  debates_count: Debate
241
- headline: Dejavnost
242
241
  meetings_count: Sestanki
243
242
  orders_count: Podpora
244
243
  pages_count: Strani
244
+ participants_count: Udeleženci
245
245
  posts_count: Objave
246
246
  projects_count: Projekti
247
247
  proposals_count: Predlogi
248
248
  results_count: Rezultati
249
+ supports_count: Podpora
249
250
  surveys_count: Ankete
250
251
  users_count: Udeleženci
251
252
  votes_count: Podpora
@@ -25,7 +25,6 @@ sr:
25
25
  admin_log:
26
26
  assembly_type:
27
27
  create: "%{user_name} je stvorio tip veća %{resource_name}"
28
- delete: "%{user_name} je uklonio člana %{resource_name} iz tipa veća %{space_name}"
29
28
  publish: "%{user_name} je objavio tip veća %{resource_name}"
30
29
  unpublish: "%{user_name} je odustao od objavljivanja tipa veća %{resource_name}"
31
30
  update: "%{user_name} je ažurirao tip veća %{resource_name}"
@@ -64,8 +63,6 @@ sr:
64
63
  home:
65
64
  hero:
66
65
  participate_title: Učestvujte u procesima platforme
67
- sub_hero:
68
- register_title: Registrujte se na platformu
69
66
  participatory_processes:
70
67
  pages:
71
68
  home:
@@ -52,6 +52,7 @@ sv:
52
52
  target: Vem deltar
53
53
  title: Titel
54
54
  twitter: Twitter
55
+ weight: Vikt
55
56
  youtube: YouTube
56
57
  assembly_member:
57
58
  birthday: Födelsedag
@@ -249,7 +250,7 @@ sv:
249
250
  update: "%{user_name} uppdaterade inställningarna för församlingarna"
250
251
  assembly_type:
251
252
  create: "%{user_name} skapade grupptypen %{resource_name}"
252
- delete: "%{user_name} tog bort medlemmen %{resource_name} från grupptypen %{space_name}"
253
+ delete: "%{user_name} raderade grupptypen %{resource_name}"
253
254
  publish: "%{user_name} publicerade grupptypen %{resource_name}"
254
255
  unpublish: "%{user_name} avpublicerade grupptypen %{resource_name}"
255
256
  update: "%{user_name} uppdaterade grupptypen %{resource_name}"
@@ -386,14 +387,18 @@ sv:
386
387
  comments_count: Kommentarer
387
388
  debates_count: Debatter
388
389
  endorsements_count: Instämmanden
389
- headline: Aktivitet
390
+ followers_count: Följare
391
+ headline: Statistik
390
392
  meetings_count: Möten
391
393
  orders_count: Stöd
392
394
  pages_count: Sidor
395
+ participants_count: Deltagare
393
396
  posts_count: Inlägg
397
+ processes_count: Dialoger
394
398
  projects_count: Projekt
395
399
  proposals_count: Förslag
396
400
  results_count: Resultat
401
+ supports_count: Stöd
397
402
  surveys_count: Undersökningar
398
403
  users_count: Deltagare
399
404
  votes_count: Stöd
@@ -444,7 +449,7 @@ sv:
444
449
  hero:
445
450
  participate_title: Delta i plattformens dialoger
446
451
  sub_hero:
447
- register_title: Skapa ett konto på plattformen genom att logga in
452
+ register_title: Skapa ett konto
448
453
  participatory_processes:
449
454
  pages:
450
455
  home:
@@ -249,7 +249,6 @@ tr:
249
249
  update: "%{user_name}, kurul ayarlarını güncelledi"
250
250
  assembly_type:
251
251
  create: "%{user_name},%{resource_name} kurul türünü oluşturdu"
252
- delete: "%{user_name},%{resource_name} üyesini %{space_name} kurul türünden kaldırdı"
253
252
  publish: "%{user_name}, %{resource_name} kurul türünü yayınladı"
254
253
  unpublish: "%{user_name}, %{resource_name} kurul türünü yayından kaldırdı"
255
254
  update: "%{user_name}, %{resource_name} kurul türünü güncelledi"
@@ -386,14 +385,15 @@ tr:
386
385
  comments_count: Yorumlar
387
386
  debates_count: Tartışmalar
388
387
  endorsements_count: Onaylar
389
- headline: Aktivite
390
388
  meetings_count: Toplantılar
391
389
  orders_count: Destekler
392
390
  pages_count: Sayfalar
391
+ participants_count: Katılımcılar
393
392
  posts_count: Yayınlar
394
393
  projects_count: Projeler
395
394
  proposals_count: Teklifler
396
395
  results_count: Sonuçlar
396
+ supports_count: Destekler
397
397
  surveys_count: Anketler
398
398
  users_count: Katılımcılar
399
399
  votes_count: Destekler
@@ -443,8 +443,6 @@ tr:
443
443
  home:
444
444
  hero:
445
445
  participate_title: Platformun süreçlerine katılın
446
- sub_hero:
447
- register_title: Platformda bir hesap oluşturmak için kaydolun
448
446
  participatory_processes:
449
447
  pages:
450
448
  home:
@@ -311,13 +311,14 @@ uk:
311
311
  comments_count: Коментарів
312
312
  debates_count: Обговорень
313
313
  endorsements_count: Проявів підтримки
314
- headline: Діяльність
315
314
  meetings_count: Зустрічей
316
315
  orders_count: Голосів
317
316
  pages_count: Сторінок
317
+ participants_count: Учасників
318
318
  projects_count: Проектів
319
319
  proposals_count: Пропозицій
320
320
  results_count: Підсумків
321
+ supports_count: Голосів
321
322
  surveys_count: Опитувань
322
323
  users_count: Учасників
323
324
  votes_count: Голосів
@@ -243,7 +243,6 @@ zh-CN:
243
243
  update: "%{user_name} 更新了程序集设置"
244
244
  assembly_type:
245
245
  create: "%{user_name} 创建了 %{resource_name} 组装类型"
246
- delete: "%{user_name} 将 %{resource_name} 成员从 %{space_name} 组装类型中移除"
247
246
  publish: "%{user_name} 发布了 %{resource_name} 组装类型"
248
247
  unpublish: "%{user_name} 未发布的 %{resource_name} 组装类型"
249
248
  update: "%{user_name} 更新了 %{resource_name} 装配体类型"
@@ -377,14 +376,15 @@ zh-CN:
377
376
  comments_count: 评论
378
377
  debates_count: 辩论
379
378
  endorsements_count: 授权
380
- headline: 活动
381
379
  meetings_count: 会议
382
380
  orders_count: 支持
383
381
  pages_count: 页 次
382
+ participants_count: 参加者
384
383
  posts_count: 员额
385
384
  projects_count: 项目
386
385
  proposals_count: 建议
387
386
  results_count: 成果
387
+ supports_count: 支持
388
388
  surveys_count: 调查
389
389
  users_count: 参加者
390
390
  votes_count: 支持
@@ -434,8 +434,6 @@ zh-CN:
434
434
  home:
435
435
  hero:
436
436
  participate_title: 参与平台进程
437
- sub_hero:
438
- register_title: 注册在平台上创建帐户
439
437
  participatory_processes:
440
438
  pages:
441
439
  home:
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ class AddWeightFieldToAssembly < ActiveRecord::Migration[5.2]
4
+ def change
5
+ add_column :decidim_assemblies, :weight, :integer, null: false, default: true
6
+ end
7
+ end
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ class AddFollowableCounterCacheToAssemblies < ActiveRecord::Migration[5.2]
4
+ def change
5
+ add_column :decidim_assemblies, :follows_count, :integer, null: false, default: 0, index: true
6
+
7
+ reversible do |dir|
8
+ dir.up do
9
+ Decidim::Assembly.reset_column_information
10
+ Decidim::Assembly.find_each do |record|
11
+ record.class.reset_counters(record.id, :follows)
12
+ end
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decidim
4
+ module Assemblies
5
+ # This type represents an AssembliesType.
6
+ class AssembliesTypeType < Decidim::Api::Types::BaseObject
7
+ description "An assemblies type"
8
+
9
+ field :id, GraphQL::Types::ID, "The assemblies type's unique ID", null: false
10
+ field :title, Decidim::Core::TranslatedFieldType, "The title of this assemblies type.", null: false
11
+ field :created_at, Decidim::Core::DateTimeType, "The time this assemblies type was created", null: false
12
+ field :updated_at, Decidim::Core::DateTimeType, "The time this assemblies type was updated", null: false
13
+ field :assemblies, [Decidim::Assemblies::AssemblyType, { null: true }], "Assemblies with this assemblies type", null: false
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decidim
4
+ module Assemblies
5
+ # This type represents a assembly.
6
+ class AssemblyMemberType < Decidim::Api::Types::BaseObject
7
+ description "An assembly member"
8
+
9
+ field :id, GraphQL::Types::ID, "Internal ID of the member", null: false
10
+ field :full_name, GraphQL::Types::String, "Full name of the member", null: true
11
+ field :position, GraphQL::Types::String, "Position of the member in the assembly", null: true
12
+
13
+ field :user, Decidim::Core::UserType, "The corresponding decidim user", null: true
14
+
15
+ field :created_at, Decidim::Core::DateTimeType, "The time this member was created", null: true
16
+ field :updated_at, Decidim::Core::DateTimeType, "The time this member was updated", null: true
17
+
18
+ field :weight, GraphQL::Types::Int, "Order of appearance in which it should be represented", null: true
19
+ field :gender, GraphQL::Types::String, "Gender of the member", null: true
20
+ # field :birthday, Decidim::Core::DateType, "Birthday date of the member" # non-public currently
21
+ field :birthplace, GraphQL::Types::String, "Birthplace of the member", null: true
22
+ field :designation_date, Decidim::Core::DateType, "Date of designation of the member", null: true
23
+ # field :designationMode, types.String, "Mode in which the member was designated", property: :designation_mode # non-public currently
24
+ field :position_other, GraphQL::Types::String, "Custom position name", null: true
25
+ field :ceased_date, Decidim::Core::DateType, "Date of cease for the member", null: true
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,64 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decidim
4
+ module Assemblies
5
+ # This type represents a assembly.
6
+ class AssemblyType < Decidim::Api::Types::BaseObject
7
+ implements Decidim::Core::ParticipatorySpaceInterface
8
+ implements Decidim::Core::AttachableInterface
9
+ implements Decidim::Core::ParticipatorySpaceResourceableInterface
10
+
11
+ description "An assembly"
12
+
13
+ field :id, ID, "The internal ID for this assembly", null: false
14
+ field :subtitle, Decidim::Core::TranslatedFieldType, "The subtitle of this assembly", null: true
15
+ field :short_description, Decidim::Core::TranslatedFieldType, "The sort description of this assembly", null: true
16
+ field :description, Decidim::Core::TranslatedFieldType, "The description of this assembly", null: true
17
+ field :slug, String, "The slug of this assembly", null: false
18
+ field :hashtag, String, "The hashtag for this assembly", null: true
19
+ field :created_at, Decidim::Core::DateTimeType, "The time this assembly was created", null: false
20
+ field :updated_at, Decidim::Core::DateTimeType, "The time this assembly was updated", null: false
21
+ field :published_at, Decidim::Core::DateTimeType, "The time this assembly was published", null: false
22
+ field :reference, String, "Reference for this assembly", null: false
23
+ field :categories, [Decidim::Core::CategoryType, { null: true }], "Categories for this assembly", null: false
24
+
25
+ field :hero_image, String, "The hero image for this assembly", null: true
26
+ field :banner_image, String, "The banner image for this assembly", null: true
27
+ field :promoted, Boolean, "If this assembly is promoted (therefore in the homepage)", null: true
28
+ field :developer_group, Decidim::Core::TranslatedFieldType, "The promoter group of this assembly", null: true
29
+ field :meta_scope, Decidim::Core::TranslatedFieldType, "The scope metadata of this assembly", null: true
30
+ field :local_area, Decidim::Core::TranslatedFieldType, "The organization area of this assembly", null: true
31
+ field :target, Decidim::Core::TranslatedFieldType, "Who participates in this assembly", null: true
32
+ field :participatory_scope, Decidim::Core::TranslatedFieldType, "What is decided on this assembly", null: true
33
+ field :participatory_structure, Decidim::Core::TranslatedFieldType, "How it is decided on this assembly", null: true
34
+ field :show_statistics, Boolean, "If this assembly should show statistics", null: true
35
+ field :scopes_enabled, Boolean, "If this assembly has scopes enabled", null: true
36
+ field :private_space, Boolean, "If this assembly is a private space", null: true
37
+ field :area, Decidim::Core::AreaApiType, "Area of this assembly", null: true
38
+ field :parent, Decidim::Assemblies::AssemblyType, "The parent assembly of this assembly", null: true
39
+ field :parents_path, String, "Assembly hierarchy representation", null: true
40
+ field :children_count, Integer, "Number of children assemblies", null: true
41
+ field :purpose_of_action, Decidim::Core::TranslatedFieldType, "Purpose of action", null: true
42
+ field :composition, Decidim::Core::TranslatedFieldType, "Composition of this assembly", null: true
43
+ field :assembly_type, Decidim::Assemblies::AssembliesTypeType, "Type of the assembly", null: true
44
+ field :creation_date, Decidim::Core::DateType, "Creation date of this assembly", null: true
45
+ field :created_by, String, "The creator of this assembly", null: true
46
+ field :created_by_other, Decidim::Core::TranslatedFieldType, "Custom creator", null: true
47
+ field :duration, Decidim::Core::DateType, "Duration of this assembly", null: true
48
+ field :included_at, Decidim::Core::DateType, "Included at", null: true
49
+ field :closing_date, Decidim::Core::DateType, "Closing date of the assembly", null: true
50
+ field :closing_date_reason, Decidim::Core::TranslatedFieldType, "Closing date reason of this assembly", null: true
51
+ field :internal_organisation, Decidim::Core::TranslatedFieldType, "Internal organisation of this assembly", null: true
52
+ field :is_transparent, Boolean, "If this assembly is transparent", null: true
53
+ field :special_features, Decidim::Core::TranslatedFieldType, "Special features of this assembly", null: true
54
+ field :twitter_handler, String, "Twitter handler", null: true
55
+ field :instagram_handler, String, "Instagram handler", null: true
56
+ field :facebook_handler, String, "Facebook handler", null: true
57
+ field :youtube_handler, String, "Youtube handler", null: true
58
+ field :github_handler, String, "Github handler", null: true
59
+
60
+ field :members, [Decidim::Assemblies::AssemblyMemberType, { null: true }], "Members of this assembly", null: false
61
+ field :children, [Decidim::Assemblies::AssemblyType, { null: true }], "Childrens of this assembly", null: false
62
+ end
63
+ end
64
+ end
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "decidim/assemblies/admin"
4
+ require "decidim/assemblies/api"
4
5
  require "decidim/assemblies/engine"
5
6
  require "decidim/assemblies/admin_engine"
6
7
  require "decidim/assemblies/participatory_space"
@@ -50,6 +50,7 @@ module Decidim
50
50
  get :share
51
51
  end
52
52
  resources :exports, only: :create
53
+ resources :imports, only: [:new, :create]
53
54
  end
54
55
 
55
56
  resources :moderations do
@@ -58,6 +59,7 @@ module Decidim
58
59
  put :hide
59
60
  put :unhide
60
61
  end
62
+ resources :reports, controller: "moderations/reports", only: [:index, :show]
61
63
  end
62
64
 
63
65
  resources :participatory_space_private_users, controller: "participatory_space_private_users" do
@@ -81,6 +83,12 @@ module Decidim
81
83
  end
82
84
  end
83
85
 
86
+ initializer "decidim_assemblies.action_controller" do |_app|
87
+ ActiveSupport.on_load :action_controller do
88
+ helper Decidim::Assemblies::Admin::AssembliesAdminMenuHelper if respond_to?(:helper)
89
+ end
90
+ end
91
+
84
92
  initializer "decidim_assemblies.admin_assets" do |app|
85
93
  app.config.assets.precompile += %w(admin/decidim_assemblies_manifest.js)
86
94
  end
@@ -90,11 +98,33 @@ module Decidim
90
98
  menu.item I18n.t("menu.assemblies", scope: "decidim.admin"),
91
99
  decidim_admin_assemblies.assemblies_path,
92
100
  icon_name: "dial",
93
- position: 3.5,
101
+ position: 2.2,
94
102
  active: :inclusive,
95
103
  if: allowed_to?(:enter, :space_area, space_name: :assemblies)
96
104
  end
97
105
  end
106
+
107
+ initializer "decidim_assemblies.admin_assemblies_menu" do
108
+ Decidim.menu :admin_assemblies_menu do |menu|
109
+ menu.item I18n.t("menu.assemblies", scope: "decidim.admin"),
110
+ decidim_admin_assemblies.assemblies_path,
111
+ position: 1.0,
112
+ active: is_active_link?(decidim_admin_assemblies.assemblies_path),
113
+ if: allowed_to?(:read, :assembly_list)
114
+
115
+ menu.item I18n.t("menu.assemblies_types", scope: "decidim.admin"),
116
+ decidim_admin_assemblies.assemblies_types_path,
117
+ active: is_active_link?(decidim_admin_assemblies.assemblies_types_path),
118
+ position: 1.1,
119
+ if: allowed_to?(:manage, :assemblies_type)
120
+
121
+ menu.item I18n.t("menu.assemblies_settings", scope: "decidim.admin"),
122
+ decidim_admin_assemblies.edit_assemblies_settings_path,
123
+ active: is_active_link?(decidim_admin_assemblies.edit_assemblies_settings_path),
124
+ position: 1.3,
125
+ if: allowed_to?(:read, :assemblies_setting)
126
+ end
127
+ end
98
128
  end
99
129
  end
100
130
  end