decidim-conferences 0.24.0 → 0.25.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (104) hide show
  1. checksums.yaml +4 -4
  2. data/app/cells/decidim/conferences/conference_m_cell.rb +1 -1
  3. data/app/cells/decidim/conferences/conference_speaker/show.erb +2 -2
  4. data/app/cells/decidim/conferences/conference_speaker_cell.rb +3 -3
  5. data/app/cells/decidim/conferences/content_blocks/highlighted_conferences/show.erb +1 -1
  6. data/app/cells/decidim/conferences/partner_cell.rb +2 -2
  7. data/app/commands/decidim/conferences/admin/copy_conference.rb +9 -2
  8. data/app/commands/decidim/conferences/admin/create_conference_speaker.rb +4 -2
  9. data/app/commands/decidim/conferences/admin/update_conference.rb +5 -10
  10. data/app/commands/decidim/conferences/admin/update_conference_speaker.rb +5 -9
  11. data/app/commands/decidim/conferences/admin/update_diploma.rb +2 -2
  12. data/app/commands/decidim/conferences/admin/update_partner.rb +5 -5
  13. data/app/controllers/decidim/conferences/admin/conference_invites_controller.rb +0 -2
  14. data/app/controllers/decidim/conferences/admin/conference_registrations_controller.rb +0 -2
  15. data/app/controllers/decidim/conferences/admin/conference_speakers_controller.rb +3 -3
  16. data/app/controllers/decidim/conferences/admin/conferences_controller.rb +1 -5
  17. data/app/controllers/decidim/conferences/admin/diplomas_controller.rb +2 -4
  18. data/app/forms/decidim/conferences/admin/conference_form.rb +5 -4
  19. data/app/forms/decidim/conferences/admin/conference_speaker_form.rb +1 -1
  20. data/app/forms/decidim/conferences/admin/partner_form.rb +2 -2
  21. data/app/models/decidim/conference.rb +8 -8
  22. data/app/models/decidim/conference_speaker.rb +2 -2
  23. data/app/models/decidim/conferences/partner.rb +2 -2
  24. data/app/packs/entrypoints/decidim_conferences_admin.js +7 -0
  25. data/app/{assets/images/decidim/conferences/conference.svg → packs/images/decidim/conferences/decidim_conferences.svg} +0 -0
  26. data/app/{assets/javascripts/decidim/conferences/admin/conference_invite_form.es6 → packs/src/decidim/conferences/admin/conference_invite_form.js} +3 -3
  27. data/app/{assets/javascripts/decidim/conferences/admin/conference_speakers.js.es6 → packs/src/decidim/conferences/admin/conference_speakers.js} +3 -3
  28. data/app/packs/src/decidim/conferences/admin/conferences.js +27 -0
  29. data/app/{assets/stylesheet → packs/stylesheets}/decidim/conferences/conferences.scss +0 -0
  30. data/app/presenters/decidim/conferences/conference_stats_presenter.rb +8 -22
  31. data/app/queries/decidim/conferences/admin/admin_users.rb +24 -11
  32. data/app/uploaders/decidim/conferences/diploma_uploader.rb +4 -2
  33. data/app/uploaders/decidim/conferences/partner_logo_uploader.rb +5 -5
  34. data/app/uploaders/decidim/cw/conferences/diploma_uploader.rb +14 -0
  35. data/app/uploaders/decidim/cw/conferences/partner_logo_uploader.rb +15 -0
  36. data/app/views/decidim/conferences/admin/conference_copies/_form.html.erb +1 -1
  37. data/app/views/decidim/conferences/admin/conference_invites/_form.html.erb +1 -1
  38. data/app/views/decidim/conferences/admin/conference_invites/index.html.erb +1 -1
  39. data/app/views/decidim/conferences/admin/conference_registrations/index.html.erb +1 -1
  40. data/app/views/decidim/conferences/admin/conference_speakers/_form.html.erb +1 -1
  41. data/app/views/decidim/conferences/admin/conference_speakers/edit.html.erb +1 -1
  42. data/app/views/decidim/conferences/admin/conferences/_form.html.erb +1 -3
  43. data/app/views/decidim/conferences/admin/invite_join_conference_mailer/invite.html.erb +4 -4
  44. data/app/views/decidim/conferences/admin/partners/index.html.erb +1 -1
  45. data/app/views/decidim/conferences/admin/send_conference_diploma_mailer/diploma_user.html.erb +2 -2
  46. data/app/views/decidim/conferences/conference_program/_program_meeting.html.erb +5 -5
  47. data/app/views/decidim/conferences/conference_registration_mailer/confirmation.html.erb +3 -3
  48. data/app/views/decidim/conferences/conference_registration_mailer/pending_validation.html.erb +3 -3
  49. data/app/views/decidim/conferences/conferences/_promoted_conference.html.erb +1 -1
  50. data/app/views/decidim/conferences/conferences/show.html.erb +2 -3
  51. data/app/views/devise/mailer/join_conference.html.erb +5 -5
  52. data/app/views/layouts/decidim/_conference_hero.html.erb +1 -1
  53. data/app/views/layouts/decidim/admin/conference.html.erb +4 -106
  54. data/app/views/layouts/decidim/conference.html.erb +2 -2
  55. data/app/views/layouts/decidim/diploma.html.erb +1 -1
  56. data/config/assets.rb +9 -0
  57. data/config/locales/ar.yml +6 -18
  58. data/config/locales/ca.yml +44 -18
  59. data/config/locales/cs.yml +46 -20
  60. data/config/locales/de.yml +10 -18
  61. data/config/locales/el.yml +6 -18
  62. data/config/locales/en.yml +44 -18
  63. data/config/locales/es-MX.yml +44 -18
  64. data/config/locales/es-PY.yml +44 -18
  65. data/config/locales/es.yml +44 -18
  66. data/config/locales/eu.yml +6 -18
  67. data/config/locales/fi-plain.yml +44 -18
  68. data/config/locales/fi.yml +44 -18
  69. data/config/locales/fr-CA.yml +7 -18
  70. data/config/locales/fr-LU.yml +577 -0
  71. data/config/locales/fr.yml +7 -18
  72. data/config/locales/gl.yml +58 -18
  73. data/config/locales/hu.yml +6 -18
  74. data/config/locales/id-ID.yml +6 -18
  75. data/config/locales/it.yml +55 -18
  76. data/config/locales/ja.yml +49 -18
  77. data/config/locales/lb-LU.yml +1 -0
  78. data/config/locales/lv.yml +6 -17
  79. data/config/locales/nl.yml +176 -144
  80. data/config/locales/no.yml +6 -18
  81. data/config/locales/pl.yml +33 -26
  82. data/config/locales/pt-BR.yml +65 -18
  83. data/config/locales/pt.yml +6 -18
  84. data/config/locales/ro-RO.yml +30 -18
  85. data/config/locales/sk.yml +6 -18
  86. data/config/locales/sl.yml +0 -2
  87. data/config/locales/sv.yml +47 -17
  88. data/config/locales/tr-TR.yml +6 -18
  89. data/config/locales/zh-CN.yml +6 -18
  90. data/db/migrate/20210408204953_allow_null_logo_column_in_decidim_conferences_partners_table.rb +7 -0
  91. data/lib/decidim/api/conference_partner_type.rb +4 -0
  92. data/lib/decidim/api/conference_speaker_type.rb +4 -0
  93. data/lib/decidim/api/conference_type.rb +9 -1
  94. data/lib/decidim/conferences/admin_engine.rb +138 -8
  95. data/lib/decidim/conferences/engine.rb +6 -9
  96. data/lib/decidim/conferences/participatory_space.rb +40 -7
  97. data/lib/decidim/conferences/version.rb +1 -1
  98. metadata +27 -25
  99. data/app/assets/config/admin/decidim_conferences_manifest.js +0 -3
  100. data/app/assets/config/decidim_conferences_manifest.js +0 -2
  101. data/app/assets/javascripts/decidim/conferences/admin/conferences.js.es6 +0 -30
  102. data/app/assets/javascripts/decidim/conferences/conferences.js.es6 +0 -0
  103. data/app/views/decidim/conferences/conferences/_statistics.html.erb +0 -10
  104. data/config/locales/ja-JP.yml +0 -575
@@ -22,6 +22,12 @@ sk:
22
22
  slogan: Slogan
23
23
  slug: URL krátky odkaz
24
24
  title: Názov
25
+ conference_media_link:
26
+ weight: Váha
27
+ conference_partner:
28
+ weight: Váha
29
+ conference_registration_type:
30
+ weight: Váha
25
31
  conference_speaker:
26
32
  full_name: Meno a priezvisko
27
33
  conference_user_role:
@@ -212,7 +218,6 @@ sk:
212
218
  price: Cena
213
219
  registrations_count: Počet registrácií
214
220
  title: Názov
215
- weight: Váha
216
221
  name: Typ registrácie
217
222
  partners:
218
223
  create:
@@ -494,23 +499,6 @@ sk:
494
499
  related_assemblies: Súvisiace zhromaždenia
495
500
  related_consultations: Súvisiace Konzultácie
496
501
  related_participatory_processes: Súvisiace participatívne procesy
497
- statistics:
498
- answers_count: Odpovede
499
- comments_count: Komentáre
500
- conference_count: Konferencie
501
- debates_count: Debaty
502
- endorsements_count: Schválenia
503
- headline: Aktivita
504
- meetings_count: Stretnutia
505
- orders_count: Podporenia
506
- pages_count: Stránky
507
- posts_count: Príspevky
508
- projects_count: Projekty
509
- proposals_count: Návrhy
510
- results_count: Výsledky
511
- surveys_count: Prieskumy
512
- users_count: Účastníci
513
- votes_count: Podporenia
514
502
  events:
515
503
  conferences:
516
504
  conference_registration_confirmed:
@@ -38,5 +38,3 @@ sl:
38
38
  go_to_twitter: Pojdi na Twitter
39
39
  show:
40
40
  related_assemblies: Povezane združbe
41
- statistics:
42
- meetings_count: Sestanki
@@ -3,6 +3,7 @@ sv:
3
3
  attributes:
4
4
  conference:
5
5
  assemblies_ids: Relaterade grupper
6
+ available_slots: Tillgängliga platser
6
7
  banner_image: Bannerbild
7
8
  consultations_ids: Relaterade samråd
8
9
  copy_categories: Kopiera kategorier
@@ -10,20 +11,59 @@ sv:
10
11
  copy_features: Kopiera funktioner
11
12
  decidim_scope_id: Omfång
12
13
  description: Beskrivning
14
+ end_date: Slutdatum
13
15
  hashtag: Hashtag
14
16
  hero_image: Bild till startsida
17
+ location: Plats
18
+ main_logo: Huvudbild
19
+ objectives: Mål
15
20
  participatory_processes_ids: Relaterade dialoger
16
21
  promoted: Uppmärksammad
17
22
  published_at: Publicerad
23
+ registration_terms: Registreringsvillkor
24
+ registrations_enabled: Registrering aktiverad
18
25
  scope_id: Omfång
19
26
  scopes_enabled: Omfång aktiverat
20
27
  short_description: Kort beskrivning
21
28
  show_statistics: Visa statistik
29
+ sign_date: Underskriftsdatum
30
+ signature: Underskrift
31
+ signature_name: signaturnamn
22
32
  slogan: Slogan
23
33
  slug: URL-slug
34
+ start_date: Startdatum
35
+ title: Titel
36
+ conference_media_link:
37
+ date: Datum
38
+ link: Länk
39
+ title: Titel
40
+ weight: Vikt
41
+ conference_partner:
42
+ link: Länk
43
+ logo: Logga
44
+ name: Namn
45
+ partner_type: Typ av partner
46
+ weight: Vikt
47
+ conference_registration_invite:
48
+ email: E-post
49
+ name: Namn
50
+ registration_type_id: Registreringstyp
51
+ user_id: Användare
52
+ conference_registration_type:
53
+ description: Beskrivning
54
+ price: Pris
24
55
  title: Titel
56
+ weight: Vikt
25
57
  conference_speaker:
58
+ affiliation: Anknytning
59
+ avatar: Avatar
60
+ conference_meeting_ids: Relaterade möten
26
61
  full_name: Fullständigt namn
62
+ personal_url: Personlig URL
63
+ position: Plats
64
+ short_bio: Kort biographi
65
+ twitter_handle: Twitternamn
66
+ user_id: Användare
27
67
  conference_user_role:
28
68
  email: E-post
29
69
  name: Namn
@@ -266,6 +306,10 @@ sv:
266
306
  conferences:
267
307
  conference_registration:
268
308
  confirm: "%{user_name} bekräftade en konferensregistrering till konferensen %{resource_name}"
309
+ partner:
310
+ create: "%{user_name} skapade partnern %{resource_name} i konferensen %{space_name}"
311
+ delete: "%{user_name} tog bort partnern %{resource_name} från konferensen %{space_name}"
312
+ update: "%{user_name} uppdaterade partnern %{resource_name} i konferensen %{space_name}"
269
313
  registration_type:
270
314
  create: "%{user_name} skapade registreringstypen %{resource_name} på konferensen %{space_name}"
271
315
  publish: "%{user_name} publicerade registreringstypen %{resource_name} till konferensen %{space_name}"
@@ -398,6 +442,7 @@ sv:
398
442
  personal_website: Personlig hemsida
399
443
  show:
400
444
  more_info: mer information
445
+ speaking_at: Talar vid
401
446
  conference_speaker_cell:
402
447
  personal_url:
403
448
  personal_website: Personlig hemsida
@@ -487,23 +532,6 @@ sv:
487
532
  related_assemblies: Relaterade grupper
488
533
  related_consultations: Relaterade samråd
489
534
  related_participatory_processes: Relaterade dialoger
490
- statistics:
491
- answers_count: Svar
492
- comments_count: Kommentarer
493
- conference_count: Konferenser
494
- debates_count: Debatter
495
- endorsements_count: Instämmanden
496
- headline: Aktivitet
497
- meetings_count: Möten
498
- orders_count: Stöd
499
- pages_count: Sidor
500
- posts_count: Inlägg
501
- projects_count: Projekt
502
- proposals_count: Förslag
503
- results_count: Resultat
504
- surveys_count: Undersökningar
505
- users_count: Deltagare
506
- votes_count: Stöd
507
535
  events:
508
536
  conferences:
509
537
  conference_registration_confirmed:
@@ -551,6 +579,8 @@ sv:
551
579
  title: Media och länkar
552
580
  menu:
553
581
  conferences: Konferenser
582
+ statistics:
583
+ conferences_count: Konferenser
554
584
  devise:
555
585
  mailer:
556
586
  join_conference:
@@ -22,6 +22,12 @@ tr:
22
22
  slogan: Slogan
23
23
  slug: URL özel bilgisi
24
24
  title: Başlık
25
+ conference_media_link:
26
+ weight: Ağırlık
27
+ conference_partner:
28
+ weight: Ağırlık
29
+ conference_registration_type:
30
+ weight: Ağırlık
25
31
  conference_speaker:
26
32
  full_name: Ad Soyad
27
33
  conference_user_role:
@@ -206,7 +212,6 @@ tr:
206
212
  price: Fiyat
207
213
  registrations_count: Kayıt sayısı
208
214
  title: Başlık
209
- weight: Ağırlık
210
215
  name: Kayıt Türü
211
216
  partners:
212
217
  create:
@@ -488,23 +493,6 @@ tr:
488
493
  related_assemblies: İlgili montajlar
489
494
  related_consultations: İlgili istişareler
490
495
  related_participatory_processes: İlgili Katılımcı Süreçler
491
- statistics:
492
- answers_count: Cevaplar
493
- comments_count: Yorumlar
494
- conference_count: Konferanslar
495
- debates_count: Tartışmalar
496
- endorsements_count: Cirolar
497
- headline: Aktivite
498
- meetings_count: Toplantılar
499
- orders_count: oy
500
- pages_count: Sayfalar
501
- posts_count: Mesajlar
502
- projects_count: Projeler
503
- proposals_count: Teklif
504
- results_count: Sonuçlar
505
- surveys_count: Anketler
506
- users_count: Katılımcılar
507
- votes_count: oy
508
496
  events:
509
497
  conferences:
510
498
  conference_registration_confirmed:
@@ -22,6 +22,12 @@ zh-CN:
22
22
  slogan: 斯洛根文
23
23
  slug: URL 名称
24
24
  title: 标题
25
+ conference_media_link:
26
+ weight: 权重
27
+ conference_partner:
28
+ weight: 权重
29
+ conference_registration_type:
30
+ weight: 权重
25
31
  conference_speaker:
26
32
  full_name: 全名
27
33
  conference_user_role:
@@ -203,7 +209,6 @@ zh-CN:
203
209
  price: 价格
204
210
  registrations_count: 注册次数
205
211
  title: 标题
206
- weight: 权重
207
212
  name: 注册类型
208
213
  partners:
209
214
  create:
@@ -483,23 +488,6 @@ zh-CN:
483
488
  related_assemblies: 相关的会议
484
489
  related_consultations: 相关协商
485
490
  related_participatory_processes: 相关的参与进程
486
- statistics:
487
- answers_count: 答案
488
- comments_count: 评论
489
- conference_count: 会议
490
- debates_count: 辩论
491
- endorsements_count: 授权
492
- headline: 活动
493
- meetings_count: 会议
494
- orders_count: 支持
495
- pages_count: 页 次
496
- posts_count: 员额
497
- projects_count: 项目
498
- proposals_count: 建议
499
- results_count: 成果
500
- surveys_count: 调查
501
- users_count: 参加者
502
- votes_count: 支持
503
491
  events:
504
492
  conferences:
505
493
  conference_registration_confirmed:
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ class AllowNullLogoColumnInDecidimConferencesPartnersTable < ActiveRecord::Migration[6.0]
4
+ def change
5
+ change_column_null :decidim_conferences_partners, :logo, true
6
+ end
7
+ end
@@ -14,6 +14,10 @@ module Decidim
14
14
  field :logo, GraphQL::Types::String, "Link to the partner's logo", null: true
15
15
  field :created_at, Decidim::Core::DateTimeType, "The time this partner was created", null: true
16
16
  field :updated_at, Decidim::Core::DateTimeType, "The time this partner was updated", null: true
17
+
18
+ def logo
19
+ object.attached_uploader(:logo).path
20
+ end
17
21
  end
18
22
  end
19
23
  end
@@ -18,6 +18,10 @@ module Decidim
18
18
 
19
19
  field :created_at, Decidim::Core::DateTimeType, "The time this member was created ", null: true
20
20
  field :updated_at, Decidim::Core::DateTimeType, "The time this member was updated", null: true
21
+
22
+ def avatar
23
+ object.attached_uploader(:avatar).path
24
+ end
21
25
  end
22
26
  end
23
27
  end
@@ -7,6 +7,7 @@ module Decidim
7
7
  implements Decidim::Core::ParticipatorySpaceInterface
8
8
  implements Decidim::Core::ScopableInterface
9
9
  implements Decidim::Core::AttachableInterface
10
+ implements Decidim::Core::CategoriesContainerInterface
10
11
 
11
12
  description "A conference"
12
13
 
@@ -35,8 +36,15 @@ module Decidim
35
36
 
36
37
  field :speakers, [Decidim::Conferences::ConferenceSpeakerType, { null: true }], "List of speakers in this conference", null: true
37
38
  field :partners, [Decidim::Conferences::ConferencePartnerType, { null: true }], "List of partners in this conference", null: true
38
- field :categories, [Decidim::Core::CategoryType, { null: true }], "List of categories in this conference", null: true
39
39
  field :media_links, [Decidim::Conferences::ConferenceMediaLinkType, { null: true }], "List of media links in this conference", null: true
40
+
41
+ def hero_image
42
+ object.attached_uploader(:hero_image).path
43
+ end
44
+
45
+ def banner_image
46
+ object.attached_uploader(:banner_image).path
47
+ end
40
48
  end
41
49
  end
42
50
  end
@@ -85,18 +85,148 @@ module Decidim
85
85
  end
86
86
  end
87
87
 
88
- initializer "decidim_conferences.admin_assets" do |app|
89
- app.config.assets.precompile += %w(admin/decidim_conferences_manifest.js)
88
+ initializer "decidim_conferences.admin_conferences_components_menu" do
89
+ Decidim.menu :admin_conferences_components_menu do |menu|
90
+ current_participatory_space.components.each do |component|
91
+ caption = translated_attribute(component.name)
92
+ if component.primary_stat.present?
93
+ caption += content_tag(:span, component.primary_stat, class: component.primary_stat.zero? ? "component-counter component-counter--off" : "component-counter")
94
+ end
95
+
96
+ menu.add_item [component.manifest_name, component.id].join("_"),
97
+ caption.html_safe,
98
+ manage_component_path(component),
99
+ active: is_active_link?(manage_component_path(component)) ||
100
+ is_active_link?(decidim_admin_conferences.edit_component_path(current_participatory_space, component)) ||
101
+ is_active_link?(decidim_admin_conferences.edit_component_permissions_path(current_participatory_space, component)) ||
102
+ participatory_space_active_link?(component),
103
+ if: component.manifest.admin_engine && user_role_config.component_is_accessible?(component.manifest_name)
104
+ end
105
+ end
106
+ end
107
+ initializer "decidim_conferences.conferences_admin_registrations_menu" do
108
+ Decidim.menu :conferences_admin_registrations_menu do |menu|
109
+ menu.add_item :conference_registration_types,
110
+ I18n.t("registration_types", scope: "decidim.admin.menu.conferences_submenu"),
111
+ decidim_admin_conferences.conference_registration_types_path(current_participatory_space),
112
+ active: is_active_link?(decidim_admin_conferences.conference_registration_types_path(current_participatory_space)),
113
+ if: allowed_to?(:read, :registration_type, conference: current_participatory_space)
114
+
115
+ menu.add_item :conference_conference_registrations,
116
+ I18n.t("user_registrations", scope: "decidim.admin.menu.conferences_submenu"),
117
+ decidim_admin_conferences.conference_conference_registrations_path(current_participatory_space),
118
+ active: is_active_link?(decidim_admin_conferences.conference_conference_registrations_path(current_participatory_space)),
119
+ if: allowed_to?(:read, :conference_registration, conference: current_participatory_space)
120
+
121
+ menu.add_item :conference_conference_invites,
122
+ I18n.t("conference_invites", scope: "decidim.admin.menu.conferences_submenu"),
123
+ decidim_admin_conferences.conference_conference_invites_path(current_participatory_space),
124
+ active: is_active_link?(decidim_admin_conferences.conference_conference_invites_path(current_participatory_space)),
125
+ if: allowed_to?(:read, :conference_invite, conference: current_participatory_space)
126
+
127
+ menu.add_item :edit_conference_diploma,
128
+ I18n.t("diploma", scope: "decidim.admin.menu.conferences_submenu"),
129
+ decidim_admin_conferences.edit_conference_diploma_path(current_participatory_space),
130
+ active: is_active_link?(decidim_admin_conferences.edit_conference_diploma_path(current_participatory_space)),
131
+ if: allowed_to?(:update, :conference, conference: current_participatory_space)
132
+ end
133
+ end
134
+ initializer "decidim_conferences.conferences_admin_attachments_menu" do
135
+ Decidim.menu :conferences_admin_attachments_menu do |menu|
136
+ menu.add_item :conference_attachment_collections,
137
+ I18n.t("attachment_collections", scope: "decidim.admin.menu.conferences_submenu"),
138
+ decidim_admin_conferences.conference_attachment_collections_path(current_participatory_space),
139
+ active: is_active_link?(decidim_admin_conferences.conference_attachment_collections_path(current_participatory_space)),
140
+ if: allowed_to?(:read, :attachment_collection, conference: current_participatory_space)
141
+
142
+ menu.add_item :conference_attachments,
143
+ I18n.t("attachment_files", scope: "decidim.admin.menu.conferences_submenu"),
144
+ decidim_admin_conferences.conference_attachments_path(current_participatory_space),
145
+ active: is_active_link?(decidim_admin_conferences.conference_attachments_path(current_participatory_space)),
146
+ if: allowed_to?(:read, :attachment, conference: current_participatory_space)
147
+ end
148
+ end
149
+ initializer "decidim_conferences.conferences_admin_menu" do
150
+ Decidim.menu :conferences_admin_menu do |menu|
151
+ menu.add_item :edit_conference,
152
+ I18n.t("info", scope: "decidim.admin.menu.conferences_submenu"),
153
+ decidim_admin_conferences.edit_conference_path(current_participatory_space),
154
+ position: 1,
155
+ if: allowed_to?(:update, :conference, conference: current_participatory_space),
156
+ active: is_active_link?(decidim_admin_conferences.edit_conference_path(current_participatory_space))
157
+
158
+ menu.add_item :components,
159
+ I18n.t("components", scope: "decidim.admin.menu.conferences_submenu"),
160
+ decidim_admin_conferences.components_path(current_participatory_space),
161
+ active: is_active_link?(decidim_admin_conferences.components_path(current_participatory_space)),
162
+ if: allowed_to?(:read, :component, conference: current_participatory_space),
163
+ submenu: { target_menu: :admin_conferences_components_menu, options: { container_options: { id: "components-list" } } }
164
+
165
+ menu.add_item :categories,
166
+ I18n.t("categories", scope: "decidim.admin.menu.conferences_submenu"),
167
+ decidim_admin_conferences.categories_path(current_participatory_space),
168
+ active: is_active_link?(decidim_admin_conferences.categories_path(current_participatory_space)),
169
+ if: allowed_to?(:read, :category, conference: current_participatory_space)
170
+
171
+ menu.add_item :attachments,
172
+ I18n.t("attachments", scope: "decidim.admin.menu.conferences_submenu"),
173
+ "#",
174
+ active: is_active_link?(decidim_admin_conferences.conference_attachment_collections_path(current_participatory_space)) ||
175
+ is_active_link?(decidim_admin_conferences.conference_attachments_path(current_participatory_space)),
176
+ if: allowed_to?(:read, :attachment_collection, conference: current_participatory_space) ||
177
+ allowed_to?(:read, :attachment, conference: current_participatory_space),
178
+ submenu: { target_menu: :conferences_admin_attachments_menu }
179
+
180
+ menu.add_item :conference_media_links,
181
+ I18n.t("media_links", scope: "decidim.admin.menu.conferences_submenu"),
182
+ decidim_admin_conferences.conference_media_links_path(current_participatory_space),
183
+ if: allowed_to?(:read, :media_link, conference: current_participatory_space),
184
+ active: is_active_link?(decidim_admin_conferences.conference_media_links_path(current_participatory_space))
185
+
186
+ menu.add_item :conference_partners,
187
+ I18n.t("partners", scope: "decidim.admin.menu.conferences_submenu"),
188
+ decidim_admin_conferences.conference_partners_path(current_participatory_space),
189
+ if: allowed_to?(:read, :partner, conference: current_participatory_space),
190
+ active: is_active_link?(decidim_admin_conferences.conference_partners_path(current_participatory_space))
191
+
192
+ menu.add_item :conference_speakers,
193
+ I18n.t("conference_speakers", scope: "decidim.admin.menu.conferences_submenu"),
194
+ decidim_admin_conferences.conference_speakers_path(current_participatory_space),
195
+ if: allowed_to?(:read, :conference_speaker, conference: current_participatory_space),
196
+ active: is_active_link?(decidim_admin_conferences.conference_speakers_path(current_participatory_space))
197
+
198
+ menu.add_item :registrations,
199
+ I18n.t("registrations", scope: "decidim.admin.menu.conferences_submenu"),
200
+ "#",
201
+ active: false,
202
+ if: allowed_to?(:read, :conference_invite, conference: current_participatory_space) ||
203
+ allowed_to?(:read, :registration_type, conference: current_participatory_space) ||
204
+ allowed_to?(:read, :conference_registration, conference: current_participatory_space),
205
+ submenu: { target_menu: :conferences_admin_registrations_menu }
206
+
207
+ menu.add_item :conference_user_roles,
208
+ I18n.t("conference_admins", scope: "decidim.admin.menu.conferences_submenu"),
209
+ decidim_admin_conferences.conference_user_roles_path(current_participatory_space),
210
+ if: allowed_to?(:read, :conference_user_role, conference: current_participatory_space),
211
+ active: is_active_link?(decidim_admin_conferences.conference_user_roles_path(current_participatory_space))
212
+
213
+ menu.add_item :moderations,
214
+ I18n.t("moderations", scope: "decidim.admin.menu.conferences_submenu"),
215
+ decidim_admin_conferences.moderations_path(current_participatory_space),
216
+ if: allowed_to?(:read, :moderation, conference: current_participatory_space),
217
+ active: is_active_link?(decidim_admin_conferences.moderations_path(current_participatory_space))
218
+ end
90
219
  end
91
220
 
92
221
  initializer "decidim_conferences.admin_menu" do
93
222
  Decidim.menu :admin_menu do |menu|
94
- menu.item I18n.t("menu.conferences", scope: "decidim.admin"),
95
- decidim_admin_conferences.conferences_path,
96
- icon_name: "microphone",
97
- position: 2.8,
98
- active: :inclusive,
99
- if: allowed_to?(:enter, :space_area, space_name: :conferences)
223
+ menu.add_item :conferences,
224
+ I18n.t("menu.conferences", scope: "decidim.admin"),
225
+ decidim_admin_conferences.conferences_path,
226
+ icon_name: "microphone",
227
+ position: 2.8,
228
+ active: :inclusive,
229
+ if: allowed_to?(:enter, :space_area, space_name: :conferences)
100
230
  end
101
231
  end
102
232
  end