decidim-assemblies 0.27.9 → 0.28.0.rc4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/cells/decidim/assemblies/assemblies/show.erb +16 -0
- data/app/cells/decidim/assemblies/assemblies_cell.rb +24 -0
- data/app/cells/decidim/assemblies/assembly_cell.rb +7 -2
- data/app/cells/decidim/assemblies/assembly_dropdown_metadata_cell.rb +19 -0
- data/app/cells/decidim/assemblies/assembly_g_cell.rb +23 -0
- data/app/cells/decidim/assemblies/assembly_member/data.erb +19 -0
- data/app/cells/decidim/assemblies/assembly_member/name_and_position.erb +11 -0
- data/app/cells/decidim/assemblies/assembly_member/show.erb +8 -52
- data/app/cells/decidim/assemblies/assembly_metadata_g_cell.rb +46 -0
- data/app/cells/decidim/assemblies/assembly_s_cell.rb +15 -0
- data/app/cells/decidim/assemblies/content_block_cell.rb +21 -0
- data/app/cells/decidim/assemblies/content_blocks/children_assemblies_cell.rb +27 -0
- data/app/cells/decidim/assemblies/content_blocks/dates_metadata_cell.rb +23 -0
- data/app/cells/decidim/assemblies/content_blocks/extra_data_cell.rb +39 -0
- data/app/cells/decidim/assemblies/content_blocks/highlighted_assemblies_cell.rb +15 -23
- data/app/cells/decidim/assemblies/content_blocks/highlighted_assemblies_settings_form/show.erb +1 -1
- data/app/cells/decidim/assemblies/content_blocks/main_data_cell.rb +52 -0
- data/app/cells/decidim/assemblies/content_blocks/metadata_cell.rb +23 -0
- data/app/cells/decidim/assemblies/content_blocks/related_assemblies/content.erb +1 -0
- data/app/cells/decidim/assemblies/content_blocks/related_assemblies_cell.rb +34 -0
- data/app/cells/decidim/assemblies/content_blocks/stats_cell.rb +15 -0
- data/app/commands/decidim/assemblies/admin/copy_assembly.rb +2 -2
- data/app/commands/decidim/assemblies/admin/create_assemblies_type.rb +1 -1
- data/app/commands/decidim/assemblies/admin/create_assembly.rb +2 -1
- data/app/commands/decidim/assemblies/admin/create_assembly_member.rb +3 -3
- data/app/commands/decidim/assemblies/admin/destroy_assemblies_type.rb +1 -1
- data/app/commands/decidim/assemblies/admin/destroy_assembly_member.rb +1 -1
- data/app/commands/decidim/assemblies/admin/import_assembly.rb +1 -1
- data/app/commands/decidim/assemblies/admin/update_assemblies_type.rb +1 -1
- data/app/commands/decidim/assemblies/admin/update_assembly.rb +1 -1
- data/app/commands/decidim/assemblies/admin/update_assembly_member.rb +1 -1
- data/app/constraints/decidim/assemblies/current_assembly.rb +1 -1
- data/app/controllers/concerns/decidim/assemblies/admin/assembly_context.rb +1 -1
- data/app/controllers/concerns/decidim/assemblies/admin/assembly_members/filterable.rb +39 -0
- data/app/controllers/concerns/decidim/assemblies/assembly_breadcrumb.rb +36 -0
- data/app/controllers/decidim/assemblies/admin/assemblies_controller.rb +1 -0
- data/app/controllers/decidim/assemblies/admin/assemblies_types_controller.rb +1 -1
- data/app/controllers/decidim/assemblies/admin/assembly_attachment_collections_controller.rb +5 -0
- data/app/controllers/decidim/assemblies/admin/assembly_attachments_controller.rb +5 -0
- data/app/controllers/decidim/assemblies/admin/assembly_imports_controller.rb +2 -0
- data/app/controllers/decidim/assemblies/admin/assembly_landing_page_content_blocks_controller.rb +35 -0
- data/app/controllers/decidim/assemblies/admin/assembly_landing_page_controller.rb +37 -0
- data/app/controllers/decidim/assemblies/admin/assembly_members_controller.rb +2 -6
- data/app/controllers/decidim/assemblies/admin/assembly_publications_controller.rb +9 -29
- data/app/controllers/decidim/assemblies/admin/assembly_user_roles_controller.rb +8 -91
- data/app/controllers/decidim/assemblies/admin/concerns/assembly_admin.rb +1 -1
- data/app/controllers/decidim/assemblies/assemblies_controller.rb +12 -7
- data/app/controllers/decidim/assemblies/assembly_members_controller.rb +2 -0
- data/app/events/decidim/assemblies/create_assembly_member_event.rb +1 -1
- data/app/events/decidim/role_assigned_to_assembly_event.rb +11 -6
- data/app/forms/decidim/assemblies/admin/assembly_copy_form.rb +1 -1
- data/app/forms/decidim/assemblies/admin/assembly_form.rb +1 -1
- data/app/forms/decidim/assemblies/admin/assembly_import_form.rb +1 -1
- data/app/forms/decidim/assemblies/admin/assembly_user_role_form.rb +2 -18
- data/app/helpers/decidim/assemblies/admin/assembly_members_helper.rb +11 -0
- data/app/helpers/decidim/assemblies/application_helper.rb +12 -0
- data/app/helpers/decidim/assemblies/assemblies_helper.rb +21 -19
- data/app/helpers/decidim/assemblies/filter_assemblies_helper.rb +15 -30
- data/app/models/decidim/assembly.rb +6 -5
- data/app/models/decidim/assembly_user_role.rb +5 -33
- data/app/packs/entrypoints/decidim_assemblies.js +0 -1
- data/app/packs/src/decidim/assemblies/admin/assemblies.js +2 -2
- data/app/packs/src/decidim/assemblies/orgchart.js +0 -701
- data/app/permissions/decidim/assemblies/permissions.rb +14 -27
- data/app/presenters/decidim/assemblies/admin_log/assemblies_setting_presenter.rb +2 -2
- data/app/presenters/decidim/assemblies/admin_log/assemblies_type_presenter.rb +2 -2
- data/app/presenters/decidim/assemblies/admin_log/assembly_member_presenter.rb +2 -2
- data/app/presenters/decidim/assemblies/admin_log/assembly_presenter.rb +2 -2
- data/app/presenters/decidim/assemblies/admin_log/assembly_user_role_presenter.rb +2 -2
- data/app/presenters/decidim/assemblies/assembly_presenter.rb +38 -0
- data/app/presenters/decidim/assemblies/assembly_stats_presenter.rb +2 -41
- data/app/presenters/decidim/assembly_member_presenter.rb +18 -4
- data/app/queries/decidim/assemblies/admin/admin_users.rb +1 -1
- data/app/queries/decidim/assemblies/assemblies_with_user_role.rb +2 -2
- data/app/serializers/decidim/assemblies/assembly_importer.rb +3 -3
- data/app/serializers/decidim/assemblies/assembly_serializer.rb +1 -1
- data/app/views/decidim/assemblies/admin/assemblies/_form.html.erb +218 -176
- data/app/views/decidim/assemblies/admin/assemblies/edit.html.erb +25 -11
- data/app/views/decidim/assemblies/admin/assemblies/index.html.erb +105 -115
- data/app/views/decidim/assemblies/admin/assemblies/new.html.erb +16 -9
- data/app/views/decidim/assemblies/admin/assemblies_types/_form.html.erb +6 -8
- data/app/views/decidim/assemblies/admin/assemblies_types/edit.html.erb +11 -5
- data/app/views/decidim/assemblies/admin/assemblies_types/index.html.erb +34 -35
- data/app/views/decidim/assemblies/admin/assemblies_types/new.html.erb +16 -6
- data/app/views/decidim/assemblies/admin/assembly_copies/_form.html.erb +12 -20
- data/app/views/decidim/assemblies/admin/assembly_copies/new.html.erb +17 -5
- data/app/views/decidim/assemblies/admin/assembly_imports/_form.html.erb +28 -37
- data/app/views/decidim/assemblies/admin/assembly_imports/new.html.erb +17 -5
- data/app/views/decidim/assemblies/admin/assembly_members/_form.html.erb +45 -49
- data/app/views/decidim/assemblies/admin/assembly_members/edit.html.erb +17 -6
- data/app/views/decidim/assemblies/admin/assembly_members/index.html.erb +51 -88
- data/app/views/decidim/assemblies/admin/assembly_members/new.html.erb +17 -6
- data/app/views/decidim/assemblies/admin/assembly_user_roles/_form.html.erb +14 -18
- data/app/views/decidim/assemblies/admin/assembly_user_roles/edit.html.erb +17 -6
- data/app/views/decidim/assemblies/admin/assembly_user_roles/index.html.erb +54 -55
- data/app/views/decidim/assemblies/admin/assembly_user_roles/new.html.erb +17 -6
- data/app/views/decidim/assemblies/assemblies/_collection.html.erb +7 -0
- data/app/views/decidim/assemblies/assemblies/index.html.erb +20 -19
- data/app/views/decidim/assemblies/assemblies/index.js.erb +1 -8
- data/app/views/decidim/assemblies/assemblies/show.html.erb +17 -207
- data/app/views/decidim/assemblies/assembly_members/index.html.erb +7 -5
- data/app/views/decidim/assemblies/pages/user_profile/_member_of.html.erb +6 -9
- data/app/views/layouts/decidim/admin/_manage_assemblies.html.erb +36 -0
- data/app/views/layouts/decidim/admin/assemblies.html.erb +13 -11
- data/app/views/layouts/decidim/admin/assemblies_imports.html.erb +9 -0
- data/app/views/layouts/decidim/admin/assemblies_types.html.erb +17 -0
- data/app/views/layouts/decidim/admin/assembly.html.erb +12 -13
- data/app/views/layouts/decidim/assembly.html.erb +7 -14
- data/config/locales/ar.yml +7 -68
- data/config/locales/bg.yml +0 -466
- data/config/locales/ca.yml +62 -71
- data/config/locales/cs.yml +59 -66
- data/config/locales/de.yml +60 -69
- data/config/locales/el.yml +11 -61
- data/config/locales/en.yml +57 -66
- data/config/locales/es-MX.yml +57 -66
- data/config/locales/es-PY.yml +57 -66
- data/config/locales/es.yml +63 -72
- data/config/locales/eu.yml +57 -70
- data/config/locales/fi-plain.yml +58 -67
- data/config/locales/fi.yml +57 -66
- data/config/locales/fr-CA.yml +57 -66
- data/config/locales/fr.yml +57 -66
- data/config/locales/ga-IE.yml +4 -15
- data/config/locales/gl.yml +4 -62
- data/config/locales/hu.yml +33 -65
- data/config/locales/id-ID.yml +6 -47
- data/config/locales/is-IS.yml +5 -40
- data/config/locales/it.yml +5 -62
- data/config/locales/ja.yml +51 -66
- data/config/locales/kaa.yml +0 -8
- data/config/locales/ko.yml +0 -92
- data/config/locales/lb.yml +5 -61
- data/config/locales/lt.yml +40 -63
- data/config/locales/lv.yml +5 -57
- data/config/locales/nl.yml +4 -62
- data/config/locales/no.yml +5 -62
- data/config/locales/pl.yml +3 -93
- data/config/locales/pt-BR.yml +77 -132
- data/config/locales/pt.yml +5 -62
- data/config/locales/ro-RO.yml +20 -63
- data/config/locales/ru.yml +4 -44
- data/config/locales/sk.yml +0 -26
- data/config/locales/sl.yml +5 -48
- data/config/locales/sq-AL.yml +0 -364
- data/config/locales/sr-CS.yml +0 -5
- data/config/locales/sv.yml +132 -193
- data/config/locales/tr-TR.yml +8 -69
- data/config/locales/uk.yml +4 -44
- data/config/locales/zh-CN.yml +5 -60
- data/config/locales/zh-TW.yml +7 -63
- data/db/migrate/20200108123050_migrate_decidim_assembly_types.rb +1 -1
- data/lib/decidim/api/assemblies_type_type.rb +1 -1
- data/lib/decidim/api/assembly_member_type.rb +1 -1
- data/lib/decidim/api/assembly_type.rb +1 -1
- data/lib/decidim/assemblies/admin_engine.rb +21 -126
- data/lib/decidim/assemblies/content_blocks/registry_manager.rb +184 -0
- data/lib/decidim/assemblies/engine.rb +15 -21
- data/lib/decidim/assemblies/menu.rb +161 -0
- data/lib/decidim/assemblies/participatory_space.rb +7 -229
- data/lib/decidim/assemblies/query_extensions.rb +6 -6
- data/lib/decidim/assemblies/seeds.rb +161 -0
- data/lib/decidim/assemblies/test/factories.rb +47 -55
- data/lib/decidim/assemblies/version.rb +1 -1
- metadata +54 -51
- data/app/cells/decidim/assemblies/assembly_m/footer.erb +0 -15
- data/app/cells/decidim/assemblies/assembly_m/tags.erb +0 -1
- data/app/cells/decidim/assemblies/assembly_m_cell.rb +0 -77
- data/app/cells/decidim/assemblies/content_blocks/highlighted_assemblies/show.erb +0 -30
- data/app/commands/decidim/assemblies/admin/create_assembly_admin.rb +0 -54
- data/app/commands/decidim/assemblies/admin/destroy_assembly_admin.rb +0 -58
- data/app/commands/decidim/assemblies/admin/notify_role_assigned_to_assembly.rb +0 -22
- data/app/commands/decidim/assemblies/admin/publish_assembly.rb +0 -39
- data/app/commands/decidim/assemblies/admin/unpublish_assembly.rb +0 -39
- data/app/commands/decidim/assemblies/admin/update_assemblies_setting.rb +0 -46
- data/app/commands/decidim/assemblies/admin/update_assembly_admin.rb +0 -53
- data/app/controllers/decidim/assemblies/admin/assemblies_settings_controller.rb +0 -49
- data/app/controllers/decidim/assemblies/widgets_controller.rb +0 -33
- data/app/forms/decidim/assemblies/admin/assemblies_setting_form.rb +0 -14
- data/app/models/decidim/assemblies_setting.rb +0 -17
- data/app/queries/decidim/assemblies/admin/assembly_members.rb +0 -56
- data/app/views/decidim/assemblies/_filter_by_type.html.erb +0 -19
- data/app/views/decidim/assemblies/admin/assemblies_settings/_form.html.erb +0 -10
- data/app/views/decidim/assemblies/admin/assemblies_settings/edit.html.erb +0 -7
- data/app/views/decidim/assemblies/assemblies/_count.html.erb +0 -1
- data/app/views/decidim/assemblies/assemblies/_nav_breadcumb.html.erb +0 -11
- data/app/views/decidim/assemblies/assemblies/_parent_assemblies.html.erb +0 -15
- data/app/views/decidim/assemblies/assemblies/_promoted_assembly.html.erb +0 -27
- data/app/views/layouts/decidim/_assembly_header.html.erb +0 -27
- data/app/views/layouts/decidim/_assembly_navigation.html.erb +0 -24
- data/app/views/layouts/decidim/admin/assembly_members.html.erb +0 -18
- data/config/locales/he-IL.yml +0 -110
- data/db/seeds/Exampledocument.pdf +0 -0
- data/db/seeds/city.jpeg +0 -0
- data/db/seeds/city2.jpeg +0 -0
- data/db/seeds/homepage_image.jpg +0 -0
- data/decidim-assemblies.gemspec +0 -32
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
module Decidim
|
4
4
|
module Assemblies
|
5
|
-
# This type represents
|
5
|
+
# This type represents an Assembly.
|
6
6
|
class AssemblyType < Decidim::Api::Types::BaseObject
|
7
7
|
implements Decidim::Core::ParticipatorySpaceInterface
|
8
8
|
implements Decidim::Core::AttachableInterface
|
@@ -4,6 +4,7 @@ require "rails"
|
|
4
4
|
require "active_support/all"
|
5
5
|
|
6
6
|
require "decidim/core"
|
7
|
+
require "decidim/assemblies/menu"
|
7
8
|
|
8
9
|
module Decidim
|
9
10
|
module Assemblies
|
@@ -16,7 +17,6 @@ module Decidim
|
|
16
17
|
|
17
18
|
routes do
|
18
19
|
resources :assemblies_types
|
19
|
-
resource :assemblies_settings, only: [:edit, :update], controller: "assemblies_settings"
|
20
20
|
|
21
21
|
resources :assemblies, param: :slug, except: [:show, :destroy] do
|
22
22
|
resource :publish, controller: "assembly_publications", only: [:create, :destroy]
|
@@ -29,18 +29,22 @@ module Decidim
|
|
29
29
|
end
|
30
30
|
end
|
31
31
|
|
32
|
-
resources :attachment_collections, controller: "assembly_attachment_collections"
|
33
|
-
resources :attachments, controller: "assembly_attachments"
|
32
|
+
resources :attachment_collections, controller: "assembly_attachment_collections", except: [:show]
|
33
|
+
resources :attachments, controller: "assembly_attachments", except: [:show]
|
34
34
|
|
35
35
|
resource :export, controller: "assembly_exports", only: :create
|
36
36
|
|
37
37
|
collection do
|
38
38
|
resources :imports, controller: "assembly_imports", only: [:new, :create]
|
39
39
|
end
|
40
|
+
|
41
|
+
resource :landing_page, only: [:edit, :update], controller: "assembly_landing_page" do
|
42
|
+
resources :content_blocks, only: [:edit, :update, :destroy, :create], controller: "assembly_landing_page_content_blocks"
|
43
|
+
end
|
40
44
|
end
|
41
45
|
|
42
46
|
scope "/assemblies/:assembly_slug" do
|
43
|
-
resources :categories
|
47
|
+
resources :categories, except: [:show]
|
44
48
|
|
45
49
|
resources :components do
|
46
50
|
resource :permissions, controller: "component_permissions"
|
@@ -88,7 +92,7 @@ module Decidim
|
|
88
92
|
end
|
89
93
|
end
|
90
94
|
|
91
|
-
initializer "
|
95
|
+
initializer "decidim_assemblies_admin.action_controller" do |app|
|
92
96
|
app.config.to_prepare do
|
93
97
|
ActiveSupport.on_load :action_controller do
|
94
98
|
helper Decidim::Assemblies::Admin::AssembliesAdminMenuHelper if respond_to?(:helper)
|
@@ -96,133 +100,24 @@ module Decidim
|
|
96
100
|
end
|
97
101
|
end
|
98
102
|
|
99
|
-
initializer "
|
100
|
-
Decidim.
|
101
|
-
menu.add_item :assemblies,
|
102
|
-
I18n.t("menu.assemblies", scope: "decidim.admin"),
|
103
|
-
decidim_admin_assemblies.assemblies_path,
|
104
|
-
icon_name: "dial",
|
105
|
-
position: 2.2,
|
106
|
-
active: is_active_link?(decidim_admin_assemblies.assemblies_path) ||
|
107
|
-
is_active_link?(decidim_admin_assemblies.assemblies_types_path) ||
|
108
|
-
is_active_link?(decidim_admin_assemblies.edit_assemblies_settings_path),
|
109
|
-
if: allowed_to?(:enter, :space_area, space_name: :assemblies)
|
110
|
-
end
|
103
|
+
initializer "decidim_assemblies_admin.menu" do
|
104
|
+
Decidim::Assemblies::Menu.register_admin_menu_modules!
|
111
105
|
end
|
112
106
|
|
113
|
-
initializer "
|
114
|
-
Decidim.
|
115
|
-
menu.add_item :assembly_attachment_collections,
|
116
|
-
I18n.t("attachment_collections", scope: "decidim.admin.menu.assemblies_submenu"),
|
117
|
-
decidim_admin_assemblies.assembly_attachment_collections_path(current_participatory_space),
|
118
|
-
active: is_active_link?(decidim_admin_assemblies.assembly_attachment_collections_path(current_participatory_space)),
|
119
|
-
if: allowed_to?(:read, :attachment_collection, assembly: current_participatory_space)
|
120
|
-
|
121
|
-
menu.add_item :assembly_attachments,
|
122
|
-
I18n.t("attachment_files", scope: "decidim.admin.menu.assemblies_submenu"),
|
123
|
-
decidim_admin_assemblies.assembly_attachments_path(current_participatory_space),
|
124
|
-
active: is_active_link?(decidim_admin_assemblies.assembly_attachments_path(current_participatory_space)),
|
125
|
-
if: allowed_to?(:read, :attachment, assembly: current_participatory_space)
|
126
|
-
end
|
107
|
+
initializer "decidim_assemblies_admin.attachments_menu" do
|
108
|
+
Decidim::Assemblies::Menu.register_assemblies_admin_attachments_menu!
|
127
109
|
end
|
128
|
-
initializer "decidim_assemblies.admin_assemblies_components_menu" do
|
129
|
-
Decidim.menu :admin_assemblies_components_menu do |menu|
|
130
|
-
current_participatory_space.components.each do |component|
|
131
|
-
caption = decidim_escape_translated(component.name)
|
132
|
-
if component.primary_stat.present?
|
133
|
-
caption += content_tag(:span, component.primary_stat, class: component.primary_stat.zero? ? "component-counter component-counter--off" : "component-counter")
|
134
|
-
end
|
135
110
|
|
136
|
-
|
137
|
-
|
138
|
-
manage_component_path(component),
|
139
|
-
active: is_active_link?(manage_component_path(component)) ||
|
140
|
-
is_active_link?(decidim_admin_assemblies.edit_component_path(current_participatory_space, component)) ||
|
141
|
-
is_active_link?(decidim_admin_assemblies.edit_component_permissions_path(current_participatory_space, component)) ||
|
142
|
-
participatory_space_active_link?(component),
|
143
|
-
if: component.manifest.admin_engine && user_role_config.component_is_accessible?(component.manifest_name)
|
144
|
-
end
|
145
|
-
end
|
111
|
+
initializer "decidim_assemblies_admin.components_menu" do
|
112
|
+
Decidim::Assemblies::Menu.register_admin_assemblies_components_menu!
|
146
113
|
end
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
I18n.t("info", scope: "decidim.admin.menu.assemblies_submenu"),
|
151
|
-
decidim_admin_assemblies.edit_assembly_path(current_participatory_space),
|
152
|
-
position: 1,
|
153
|
-
if: allowed_to?(:update, :assembly, assembly: current_participatory_space),
|
154
|
-
active: is_active_link?(decidim_admin_assemblies.edit_assembly_path(current_participatory_space))
|
155
|
-
|
156
|
-
menu.add_item :components,
|
157
|
-
I18n.t("components", scope: "decidim.admin.menu.assemblies_submenu"),
|
158
|
-
decidim_admin_assemblies.components_path(current_participatory_space),
|
159
|
-
active: is_active_link?(decidim_admin_assemblies.components_path(current_participatory_space)),
|
160
|
-
if: allowed_to?(:read, :component, assembly: current_participatory_space),
|
161
|
-
submenu: { target_menu: :admin_assemblies_components_menu, options: { container_options: { id: "components-list" } } }
|
162
|
-
|
163
|
-
menu.add_item :categories,
|
164
|
-
I18n.t("categories", scope: "decidim.admin.menu.assemblies_submenu"),
|
165
|
-
decidim_admin_assemblies.categories_path(current_participatory_space),
|
166
|
-
if: allowed_to?(:read, :category, assembly: current_participatory_space),
|
167
|
-
active: is_active_link?(decidim_admin_assemblies.categories_path(current_participatory_space))
|
168
|
-
|
169
|
-
menu.add_item :attachments,
|
170
|
-
I18n.t("attachments", scope: "decidim.admin.menu.assemblies_submenu"),
|
171
|
-
"#",
|
172
|
-
active: is_active_link?(decidim_admin_assemblies.assembly_attachment_collections_path(current_participatory_space)) ||
|
173
|
-
is_active_link?(decidim_admin_assemblies.assembly_attachments_path(current_participatory_space)),
|
174
|
-
if: allowed_to?(:read, :attachment_collection, assembly: current_participatory_space) ||
|
175
|
-
allowed_to?(:read, :attachment, assembly: current_participatory_space),
|
176
|
-
submenu: { target_menu: :assemblies_admin_attachments_menu }
|
177
|
-
|
178
|
-
menu.add_item :assembly_members,
|
179
|
-
I18n.t("assembly_members", scope: "decidim.admin.menu.assemblies_submenu"),
|
180
|
-
decidim_admin_assemblies.assembly_members_path(current_participatory_space),
|
181
|
-
if: allowed_to?(:read, :assembly_member, assembly: current_participatory_space),
|
182
|
-
active: is_active_link?(decidim_admin_assemblies.assembly_members_path(current_participatory_space))
|
183
|
-
|
184
|
-
menu.add_item :assembly_user_roles,
|
185
|
-
I18n.t("assembly_admins", scope: "decidim.admin.menu.assemblies_submenu"),
|
186
|
-
decidim_admin_assemblies.assembly_user_roles_path(current_participatory_space),
|
187
|
-
if: allowed_to?(:read, :assembly_user_role, assembly: current_participatory_space),
|
188
|
-
active: is_active_link?(decidim_admin_assemblies.assembly_user_roles_path(current_participatory_space))
|
189
|
-
|
190
|
-
menu.add_item :participatory_space_private_users,
|
191
|
-
I18n.t("private_users", scope: "decidim.admin.menu.assemblies_submenu"),
|
192
|
-
decidim_admin_assemblies.participatory_space_private_users_path(current_participatory_space),
|
193
|
-
if: allowed_to?(:read, :space_private_user, assembly: current_participatory_space),
|
194
|
-
active: is_active_link?(decidim_admin_assemblies.participatory_space_private_users_path(current_participatory_space))
|
195
|
-
|
196
|
-
menu.add_item :moderations,
|
197
|
-
I18n.t("moderations", scope: "decidim.admin.menu.assemblies_submenu"),
|
198
|
-
decidim_admin_assemblies.moderations_path(current_participatory_space),
|
199
|
-
if: allowed_to?(:read, :moderation, assembly: current_participatory_space),
|
200
|
-
active: is_active_link?(decidim_admin_assemblies.moderations_path(current_participatory_space))
|
201
|
-
end
|
114
|
+
|
115
|
+
initializer "decidim_assemblies_admin.assembly_menu" do
|
116
|
+
Decidim::Assemblies::Menu.register_admin_assembly_menu!
|
202
117
|
end
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
I18n.t("menu.assemblies", scope: "decidim.admin"),
|
207
|
-
decidim_admin_assemblies.assemblies_path,
|
208
|
-
position: 1.0,
|
209
|
-
active: is_active_link?(decidim_admin_assemblies.assemblies_path),
|
210
|
-
if: allowed_to?(:read, :assembly_list)
|
211
|
-
|
212
|
-
menu.add_item :assemblies_types,
|
213
|
-
I18n.t("menu.assemblies_types", scope: "decidim.admin"),
|
214
|
-
decidim_admin_assemblies.assemblies_types_path,
|
215
|
-
active: is_active_link?(decidim_admin_assemblies.assemblies_types_path),
|
216
|
-
position: 1.1,
|
217
|
-
if: allowed_to?(:manage, :assemblies_type)
|
218
|
-
|
219
|
-
menu.add_item :edit_assemblies_settings,
|
220
|
-
I18n.t("menu.assemblies_settings", scope: "decidim.admin"),
|
221
|
-
decidim_admin_assemblies.edit_assemblies_settings_path,
|
222
|
-
active: is_active_link?(decidim_admin_assemblies.edit_assemblies_settings_path),
|
223
|
-
position: 1.3,
|
224
|
-
if: allowed_to?(:read, :assemblies_setting)
|
225
|
-
end
|
118
|
+
|
119
|
+
initializer "decidim_assemblies_admin.assemblies_menu" do
|
120
|
+
Decidim::Assemblies::Menu.register_admin_assemblies_menu!
|
226
121
|
end
|
227
122
|
end
|
228
123
|
end
|
@@ -0,0 +1,184 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module Assemblies
|
5
|
+
module ContentBlocks
|
6
|
+
class RegistryManager
|
7
|
+
def self.register!
|
8
|
+
Decidim.content_blocks.register(:homepage, :highlighted_assemblies) do |content_block|
|
9
|
+
content_block.cell = "decidim/assemblies/content_blocks/highlighted_assemblies"
|
10
|
+
content_block.public_name_key = "decidim.assemblies.content_blocks.highlighted_assemblies.name"
|
11
|
+
content_block.settings_form_cell = "decidim/assemblies/content_blocks/highlighted_assemblies_settings_form"
|
12
|
+
|
13
|
+
content_block.settings do |settings|
|
14
|
+
settings.attribute :max_results, type: :integer, default: 6
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
Decidim.content_blocks.register(:assembly_homepage, :html) do |content_block|
|
19
|
+
content_block.cell = "decidim/content_blocks/html"
|
20
|
+
content_block.public_name_key = "decidim.content_blocks.html.name"
|
21
|
+
content_block.settings_form_cell = "decidim/content_blocks/html_settings_form"
|
22
|
+
|
23
|
+
content_block.settings do |settings|
|
24
|
+
settings.attribute :html_content, type: :text, translated: true
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
Decidim.content_blocks.register(:assembly_homepage, :hero) do |content_block|
|
29
|
+
content_block.cell = "decidim/content_blocks/participatory_space_hero"
|
30
|
+
content_block.public_name_key = "decidim.content_blocks.hero.name"
|
31
|
+
end
|
32
|
+
|
33
|
+
Decidim.content_blocks.register(:assembly_homepage, :announcement) do |content_block|
|
34
|
+
content_block.cell = "decidim/content_blocks/participatory_space_announcement"
|
35
|
+
content_block.public_name_key = "decidim.content_blocks.announcement.name"
|
36
|
+
end
|
37
|
+
|
38
|
+
Decidim.content_blocks.register(:assembly_homepage, :main_data) do |content_block|
|
39
|
+
content_block.cell = "decidim/assemblies/content_blocks/main_data"
|
40
|
+
content_block.public_name_key = "decidim.content_blocks.main_data.name"
|
41
|
+
content_block.default!
|
42
|
+
end
|
43
|
+
|
44
|
+
Decidim.content_blocks.register(:assembly_homepage, :extra_data) do |content_block|
|
45
|
+
content_block.cell = "decidim/assemblies/content_blocks/extra_data"
|
46
|
+
content_block.public_name_key = "decidim.assemblies.content_blocks.extra_data.name"
|
47
|
+
end
|
48
|
+
|
49
|
+
Decidim.content_blocks.register(:assembly_homepage, :metadata) do |content_block|
|
50
|
+
content_block.cell = "decidim/assemblies/content_blocks/metadata"
|
51
|
+
content_block.public_name_key = "decidim.content_blocks.metadata.name"
|
52
|
+
content_block.default!
|
53
|
+
end
|
54
|
+
|
55
|
+
Decidim.content_blocks.register(:assembly_homepage, :dates_metadata) do |content_block|
|
56
|
+
content_block.cell = "decidim/assemblies/content_blocks/dates_metadata"
|
57
|
+
content_block.public_name_key = "decidim.assemblies.content_blocks.dates_metadata.name"
|
58
|
+
end
|
59
|
+
|
60
|
+
Decidim.content_blocks.register(:assembly_homepage, :social_networks_metadata) do |content_block|
|
61
|
+
content_block.cell = "decidim/content_blocks/participatory_space_social_networks"
|
62
|
+
content_block.public_name_key = "decidim.content_blocks.social_networks_metadata.name"
|
63
|
+
end
|
64
|
+
|
65
|
+
Decidim.content_blocks.register(:assembly_homepage, :last_activity) do |content_block|
|
66
|
+
content_block.cell = "decidim/content_blocks/participatory_space_last_activity"
|
67
|
+
content_block.public_name_key = "decidim.content_blocks.last_activity.name"
|
68
|
+
content_block.settings_form_cell = "decidim/content_blocks/last_activity_settings_form"
|
69
|
+
content_block.settings do |settings|
|
70
|
+
settings.attribute :max_last_activity_users, type: :integer, default: Decidim::ContentBlocks::ParticipatorySpaceLastActivityCell::DEFAULT_MAX_LAST_ACTIVITY_USERS
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
Decidim.content_blocks.register(:assembly_homepage, :stats) do |content_block|
|
75
|
+
content_block.cell = "decidim/assemblies/content_blocks/stats"
|
76
|
+
content_block.public_name_key = "decidim.content_blocks.participatory_space_stats.name"
|
77
|
+
end
|
78
|
+
|
79
|
+
Decidim.content_blocks.register(:assembly_homepage, :related_assemblies) do |content_block|
|
80
|
+
content_block.cell = "decidim/assemblies/content_blocks/children_assemblies"
|
81
|
+
content_block.settings_form_cell = "decidim/assemblies/content_blocks/highlighted_assemblies_settings_form"
|
82
|
+
content_block.public_name_key = "decidim.assemblies.content_blocks.related_assemblies.name"
|
83
|
+
|
84
|
+
content_block.settings do |settings|
|
85
|
+
settings.attribute :max_results, type: :integer, default: 6
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
89
|
+
Decidim.content_blocks.register(:assembly_homepage, :related_documents) do |content_block|
|
90
|
+
content_block.cell = "decidim/content_blocks/participatory_space_documents"
|
91
|
+
content_block.public_name_key = "decidim.application.documents.related_documents"
|
92
|
+
end
|
93
|
+
|
94
|
+
Decidim.content_blocks.register(:assembly_homepage, :related_images) do |content_block|
|
95
|
+
content_block.cell = "decidim/content_blocks/participatory_space_images"
|
96
|
+
content_block.public_name_key = "decidim.application.photos.related_photos"
|
97
|
+
end
|
98
|
+
|
99
|
+
register_highlighted_meetings
|
100
|
+
register_highlighted_posts
|
101
|
+
register_highlighted_proposals
|
102
|
+
register_highlighted_results
|
103
|
+
register_related_processes
|
104
|
+
end
|
105
|
+
|
106
|
+
def self.register_highlighted_meetings
|
107
|
+
return unless Decidim.module_installed?(:meetings)
|
108
|
+
|
109
|
+
Decidim.content_blocks.register(:assembly_homepage, :highlighted_meetings) do |content_block|
|
110
|
+
content_block.cell = "decidim/meetings/content_blocks/highlighted_meetings"
|
111
|
+
content_block.settings_form_cell = "decidim/content_blocks/highlighted_elements_for_component_settings_form"
|
112
|
+
content_block.public_name_key = "decidim.meetings.content_blocks.upcoming_meetings.name"
|
113
|
+
content_block.component_manifest_name = "meetings"
|
114
|
+
|
115
|
+
content_block.settings do |settings|
|
116
|
+
settings.attribute :component_id, type: :select, default: nil
|
117
|
+
end
|
118
|
+
end
|
119
|
+
end
|
120
|
+
|
121
|
+
def self.register_highlighted_posts
|
122
|
+
return unless Decidim.module_installed?(:blogs)
|
123
|
+
|
124
|
+
Decidim.content_blocks.register(:assembly_homepage, :highlighted_posts) do |content_block|
|
125
|
+
content_block.cell = "decidim/blogs/content_blocks/highlighted_posts"
|
126
|
+
content_block.settings_form_cell = "decidim/content_blocks/highlighted_elements_for_component_settings_form"
|
127
|
+
content_block.public_name_key = "decidim.blogs.content_blocks.highlighted_posts.name"
|
128
|
+
content_block.component_manifest_name = "blogs"
|
129
|
+
|
130
|
+
content_block.settings do |settings|
|
131
|
+
settings.attribute :component_id, type: :select, default: nil
|
132
|
+
end
|
133
|
+
end
|
134
|
+
end
|
135
|
+
|
136
|
+
def self.register_highlighted_proposals
|
137
|
+
return unless Decidim.module_installed?(:proposals)
|
138
|
+
|
139
|
+
Decidim.content_blocks.register(:assembly_homepage, :highlighted_proposals) do |content_block|
|
140
|
+
content_block.cell = "decidim/proposals/content_blocks/highlighted_proposals"
|
141
|
+
content_block.settings_form_cell = "decidim/content_blocks/highlighted_elements_for_component_settings_form"
|
142
|
+
content_block.public_name_key = "decidim.proposals.content_blocks.highlighted_proposals.name"
|
143
|
+
content_block.component_manifest_name = "proposals"
|
144
|
+
|
145
|
+
content_block.settings do |settings|
|
146
|
+
settings.attribute :order, type: :enum, default: "recent", choices: %w(random recent)
|
147
|
+
settings.attribute :component_id, type: :select, default: nil
|
148
|
+
end
|
149
|
+
end
|
150
|
+
end
|
151
|
+
|
152
|
+
def self.register_highlighted_results
|
153
|
+
return unless Decidim.module_installed?(:accountability)
|
154
|
+
|
155
|
+
Decidim.content_blocks.register(:assembly_homepage, :highlighted_results) do |content_block|
|
156
|
+
content_block.cell = "decidim/accountability/content_blocks/highlighted_results"
|
157
|
+
content_block.settings_form_cell = "decidim/content_blocks/highlighted_elements_for_component_settings_form"
|
158
|
+
content_block.public_name_key = "decidim.accountability.content_blocks.highlighted_results.results"
|
159
|
+
content_block.component_manifest_name = "accountability"
|
160
|
+
|
161
|
+
content_block.settings do |settings|
|
162
|
+
settings.attribute :order, type: :enum, default: "random", choices: %w(random recent)
|
163
|
+
settings.attribute :component_id, type: :select, default: nil
|
164
|
+
end
|
165
|
+
end
|
166
|
+
end
|
167
|
+
|
168
|
+
def self.register_related_processes
|
169
|
+
return unless Decidim.module_installed?(:participatory_processes)
|
170
|
+
|
171
|
+
Decidim.content_blocks.register(:assembly_homepage, :related_processes) do |content_block|
|
172
|
+
content_block.cell = "decidim/participatory_processes/content_blocks/related_processes"
|
173
|
+
content_block.settings_form_cell = "decidim/participatory_processes/content_blocks/highlighted_processes_settings_form"
|
174
|
+
content_block.public_name_key = "decidim.participatory_processes.content_blocks.related_processes.name"
|
175
|
+
|
176
|
+
content_block.settings do |settings|
|
177
|
+
settings.attribute :max_results, type: :integer, default: 6
|
178
|
+
end
|
179
|
+
end
|
180
|
+
end
|
181
|
+
end
|
182
|
+
end
|
183
|
+
end
|
184
|
+
end
|
@@ -5,6 +5,8 @@ require "active_support/all"
|
|
5
5
|
|
6
6
|
require "decidim/core"
|
7
7
|
require "decidim/assemblies/query_extensions"
|
8
|
+
require "decidim/assemblies/content_blocks/registry_manager"
|
9
|
+
require "decidim/assemblies/menu"
|
8
10
|
|
9
11
|
module Decidim
|
10
12
|
module Assemblies
|
@@ -25,7 +27,6 @@ module Decidim
|
|
25
27
|
|
26
28
|
resources :assemblies, only: [:index, :show], param: :slug, path: "assemblies" do
|
27
29
|
resources :assembly_members, only: :index, path: "members"
|
28
|
-
resource :widget, only: :show, path: "embed"
|
29
30
|
end
|
30
31
|
|
31
32
|
scope "/assemblies/:assembly_slug/f/:component_id" do
|
@@ -39,26 +40,27 @@ module Decidim
|
|
39
40
|
end
|
40
41
|
end
|
41
42
|
|
43
|
+
initializer "decidim_assemblies.register_icons" do
|
44
|
+
Decidim.icons.register(name: "Decidim::Assembly", icon: "government-line", description: "Assembly", category: "activity", engine: :assemblies)
|
45
|
+
Decidim.icons.register(name: "assembly_type", icon: "group-2-line", description: "Type", category: "assemblies", engine: :assemblies)
|
46
|
+
|
47
|
+
Decidim.icons.register(name: "group-2-line", icon: "group-2-line", category: "system", description: "", engine: :assemblies)
|
48
|
+
end
|
49
|
+
|
42
50
|
initializer "decidim_assemblies.add_cells_view_paths" do
|
43
51
|
Cell::ViewModel.view_paths << File.expand_path("#{Decidim::Assemblies::Engine.root}/app/cells")
|
44
52
|
Cell::ViewModel.view_paths << File.expand_path("#{Decidim::Assemblies::Engine.root}/app/views") # for partials
|
45
53
|
end
|
46
54
|
|
47
|
-
initializer "
|
55
|
+
initializer "decidim_assemblies.stats" do
|
48
56
|
Decidim.stats.register :assemblies_count, priority: StatsRegistry::HIGH_PRIORITY do |organization, _start_at, _end_at|
|
49
|
-
Decidim::Assembly.where(organization:
|
57
|
+
Decidim::Assembly.where(organization:).public_spaces.count
|
50
58
|
end
|
51
59
|
end
|
52
60
|
|
53
61
|
initializer "decidim_assemblies.menu" do
|
54
|
-
Decidim.
|
55
|
-
|
56
|
-
I18n.t("menu.assemblies", scope: "decidim"),
|
57
|
-
decidim_assemblies.assemblies_path,
|
58
|
-
position: 2.2,
|
59
|
-
if: OrganizationPublishedAssemblies.new(current_organization, current_user).any?,
|
60
|
-
active: :inclusive
|
61
|
-
end
|
62
|
+
Decidim::Assemblies::Menu.register_menu!
|
63
|
+
Decidim::Assemblies::Menu.register_home_content_block_menu!
|
62
64
|
end
|
63
65
|
|
64
66
|
initializer "decidim_assemblies.view_hooks" do
|
@@ -77,22 +79,14 @@ module Decidim
|
|
77
79
|
view_context.render(
|
78
80
|
partial: "decidim/assemblies/pages/user_profile/member_of",
|
79
81
|
locals: {
|
80
|
-
assemblies:
|
82
|
+
assemblies:
|
81
83
|
}
|
82
84
|
)
|
83
85
|
end
|
84
86
|
end
|
85
87
|
|
86
88
|
initializer "decidim_assemblies.content_blocks" do
|
87
|
-
Decidim.
|
88
|
-
content_block.cell = "decidim/assemblies/content_blocks/highlighted_assemblies"
|
89
|
-
content_block.public_name_key = "decidim.assemblies.content_blocks.highlighted_assemblies.name"
|
90
|
-
content_block.settings_form_cell = "decidim/assemblies/content_blocks/highlighted_assemblies_settings_form"
|
91
|
-
|
92
|
-
content_block.settings do |settings|
|
93
|
-
settings.attribute :max_results, type: :integer, default: 4
|
94
|
-
end
|
95
|
-
end
|
89
|
+
Decidim::Assemblies::ContentBlocks::RegistryManager.register!
|
96
90
|
end
|
97
91
|
|
98
92
|
initializer "decidim_assemblies.register_metrics" do
|
@@ -0,0 +1,161 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module Assemblies
|
5
|
+
class Menu
|
6
|
+
def self.register_menu!
|
7
|
+
Decidim.menu :menu do |menu|
|
8
|
+
menu.add_item :assemblies,
|
9
|
+
I18n.t("menu.assemblies", scope: "decidim"),
|
10
|
+
decidim_assemblies.assemblies_path,
|
11
|
+
position: 2.2,
|
12
|
+
if: OrganizationPublishedAssemblies.new(current_organization, current_user).any?,
|
13
|
+
active: :inclusive
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
def self.register_home_content_block_menu!
|
18
|
+
Decidim.menu :home_content_block_menu do |menu|
|
19
|
+
menu.add_item :assemblies,
|
20
|
+
I18n.t("menu.assemblies", scope: "decidim"),
|
21
|
+
decidim_assemblies.assemblies_path,
|
22
|
+
position: 20,
|
23
|
+
if: OrganizationPublishedAssemblies.new(current_organization, current_user).any?,
|
24
|
+
active: :inclusive
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
def self.register_admin_menu_modules!
|
29
|
+
Decidim.menu :admin_menu_modules do |menu|
|
30
|
+
menu.add_item :assemblies,
|
31
|
+
I18n.t("menu.assemblies", scope: "decidim.admin"),
|
32
|
+
decidim_admin_assemblies.assemblies_path,
|
33
|
+
icon_name: "government-line",
|
34
|
+
position: 2.2,
|
35
|
+
active: is_active_link?(decidim_admin_assemblies.assemblies_path) ||
|
36
|
+
is_active_link?(decidim_admin_assemblies.assemblies_types_path),
|
37
|
+
if: allowed_to?(:enter, :space_area, space_name: :assemblies)
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
def self.register_assemblies_admin_attachments_menu!
|
42
|
+
Decidim.menu :assemblies_admin_attachments_menu do |menu|
|
43
|
+
menu.add_item :assembly_attachments,
|
44
|
+
I18n.t("attachment_files", scope: "decidim.admin.menu.assemblies_submenu"),
|
45
|
+
decidim_admin_assemblies.assembly_attachments_path(current_participatory_space),
|
46
|
+
active: is_active_link?(decidim_admin_assemblies.assembly_attachments_path(current_participatory_space)),
|
47
|
+
if: allowed_to?(:read, :attachment, assembly: current_participatory_space),
|
48
|
+
icon_name: "attachment-line"
|
49
|
+
menu.add_item :assembly_attachment_collections,
|
50
|
+
I18n.t("attachment_collections", scope: "decidim.admin.menu.assemblies_submenu"),
|
51
|
+
decidim_admin_assemblies.assembly_attachment_collections_path(current_participatory_space),
|
52
|
+
active: is_active_link?(decidim_admin_assemblies.assembly_attachment_collections_path(current_participatory_space)),
|
53
|
+
if: allowed_to?(:read, :attachment_collection, assembly: current_participatory_space),
|
54
|
+
icon_name: "folder-line"
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
def self.register_admin_assemblies_components_menu!
|
59
|
+
Decidim.menu :admin_assemblies_components_menu do |menu|
|
60
|
+
current_participatory_space.components.each do |component|
|
61
|
+
caption = translated_attribute(component.name)
|
62
|
+
if component.primary_stat.present?
|
63
|
+
caption += content_tag(:span, component.primary_stat, class: component.primary_stat.zero? ? "component-counter component-counter--off" : "component-counter")
|
64
|
+
end
|
65
|
+
|
66
|
+
menu.add_item [component.manifest_name, component.id].join("_"),
|
67
|
+
caption.html_safe,
|
68
|
+
manage_component_path(component),
|
69
|
+
active: is_active_link?(manage_component_path(component)) ||
|
70
|
+
is_active_link?(decidim_admin_assemblies.edit_component_path(current_participatory_space, component)) ||
|
71
|
+
is_active_link?(decidim_admin_assemblies.edit_component_permissions_path(current_participatory_space, component)) ||
|
72
|
+
participatory_space_active_link?(component),
|
73
|
+
if: component.manifest.admin_engine && user_role_config.component_is_accessible?(component.manifest_name)
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
def self.register_admin_assembly_menu!
|
79
|
+
Decidim.menu :admin_assembly_menu do |menu|
|
80
|
+
menu.add_item :edit_assembly,
|
81
|
+
I18n.t("info", scope: "decidim.admin.menu.assemblies_submenu"),
|
82
|
+
decidim_admin_assemblies.edit_assembly_path(current_participatory_space),
|
83
|
+
position: 1,
|
84
|
+
icon_name: "information-line",
|
85
|
+
if: allowed_to?(:update, :assembly, assembly: current_participatory_space)
|
86
|
+
|
87
|
+
menu.add_item :edit_assembly_landing_page,
|
88
|
+
I18n.t("landing_page", scope: "decidim.admin.menu.assemblies_submenu"),
|
89
|
+
decidim_admin_assemblies.edit_assembly_landing_page_path(current_participatory_space),
|
90
|
+
icon_name: "layout-masonry-line",
|
91
|
+
if: allowed_to?(:update, :assembly, assembly: current_participatory_space)
|
92
|
+
|
93
|
+
menu.add_item :components,
|
94
|
+
I18n.t("components", scope: "decidim.admin.menu.assemblies_submenu"),
|
95
|
+
decidim_admin_assemblies.components_path(current_participatory_space),
|
96
|
+
icon_name: "tools-line",
|
97
|
+
active: is_active_link?(decidim_admin_assemblies.components_path(current_participatory_space), ["decidim/assemblies/admin/components", %w(index new edit)]),
|
98
|
+
if: allowed_to?(:read, :component, assembly: current_participatory_space),
|
99
|
+
submenu: { target_menu: :admin_assemblies_components_menu }
|
100
|
+
|
101
|
+
menu.add_item :categories,
|
102
|
+
I18n.t("categories", scope: "decidim.admin.menu.assemblies_submenu"),
|
103
|
+
decidim_admin_assemblies.categories_path(current_participatory_space),
|
104
|
+
icon_name: "price-tag-3-line",
|
105
|
+
if: allowed_to?(:read, :category, assembly: current_participatory_space)
|
106
|
+
|
107
|
+
menu.add_item :attachments,
|
108
|
+
I18n.t("attachments", scope: "decidim.admin.menu.assemblies_submenu"),
|
109
|
+
decidim_admin_assemblies.assembly_attachments_path(current_participatory_space),
|
110
|
+
icon_name: "attachment-2",
|
111
|
+
active: is_active_link?(decidim_admin_assemblies.assembly_attachments_path(current_participatory_space)) ||
|
112
|
+
is_active_link?(decidim_admin_assemblies.assembly_attachment_collections_path(current_participatory_space)),
|
113
|
+
if: allowed_to?(:read, :attachment_collection, assembly: current_participatory_space) ||
|
114
|
+
allowed_to?(:read, :attachment, assembly: current_participatory_space)
|
115
|
+
|
116
|
+
menu.add_item :assembly_members,
|
117
|
+
I18n.t("assembly_members", scope: "decidim.admin.menu.assemblies_submenu"),
|
118
|
+
decidim_admin_assemblies.assembly_members_path(current_participatory_space),
|
119
|
+
icon_name: "user-settings-line",
|
120
|
+
if: allowed_to?(:read, :assembly_member, assembly: current_participatory_space)
|
121
|
+
|
122
|
+
menu.add_item :assembly_user_roles,
|
123
|
+
I18n.t("assembly_admins", scope: "decidim.admin.menu.assemblies_submenu"),
|
124
|
+
decidim_admin_assemblies.assembly_user_roles_path(current_participatory_space),
|
125
|
+
icon_name: "user-settings-line",
|
126
|
+
if: allowed_to?(:read, :assembly_user_role, assembly: current_participatory_space)
|
127
|
+
|
128
|
+
menu.add_item :participatory_space_private_users,
|
129
|
+
I18n.t("private_users", scope: "decidim.admin.menu.assemblies_submenu"),
|
130
|
+
decidim_admin_assemblies.participatory_space_private_users_path(current_participatory_space),
|
131
|
+
icon_name: "spy-line",
|
132
|
+
if: allowed_to?(:read, :space_private_user, current_participatory_space:)
|
133
|
+
|
134
|
+
menu.add_item :moderations,
|
135
|
+
I18n.t("moderations", scope: "decidim.admin.menu.assemblies_submenu"),
|
136
|
+
decidim_admin_assemblies.moderations_path(current_participatory_space),
|
137
|
+
icon_name: "flag-line",
|
138
|
+
if: allowed_to?(:read, :moderation, assembly: current_participatory_space)
|
139
|
+
end
|
140
|
+
end
|
141
|
+
|
142
|
+
def self.register_admin_assemblies_menu!
|
143
|
+
Decidim.menu :admin_assemblies_menu do |menu|
|
144
|
+
menu.add_item :assemblies,
|
145
|
+
I18n.t("menu.assemblies", scope: "decidim.admin"),
|
146
|
+
decidim_admin_assemblies.assemblies_path,
|
147
|
+
position: 1.0,
|
148
|
+
active: is_active_link?(decidim_admin_assemblies.assemblies_path),
|
149
|
+
if: allowed_to?(:read, :assembly_list)
|
150
|
+
|
151
|
+
menu.add_item :assemblies_types,
|
152
|
+
I18n.t("menu.assemblies_types", scope: "decidim.admin"),
|
153
|
+
decidim_admin_assemblies.assemblies_types_path,
|
154
|
+
active: is_active_link?(decidim_admin_assemblies.assemblies_types_path),
|
155
|
+
position: 1.1,
|
156
|
+
if: allowed_to?(:manage, :assemblies_type)
|
157
|
+
end
|
158
|
+
end
|
159
|
+
end
|
160
|
+
end
|
161
|
+
end
|