decidim-assemblies 0.29.3 → 0.30.0.rc1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/cells/decidim/assemblies/assembly_metadata_g_cell.rb +1 -14
- data/app/cells/decidim/assemblies/content_blocks/extra_data_cell.rb +2 -12
- data/app/cells/decidim/assemblies/content_blocks/highlighted_assemblies_settings_form/show.erb +1 -1
- data/app/commands/decidim/assemblies/admin/copy_assembly.rb +2 -14
- data/app/commands/decidim/assemblies/admin/create_assembly.rb +2 -2
- data/app/commands/decidim/assemblies/admin/import_assembly.rb +0 -2
- data/app/commands/decidim/assemblies/admin/update_assembly.rb +2 -2
- data/app/controllers/concerns/decidim/assemblies/admin/filterable.rb +2 -11
- data/app/controllers/decidim/assemblies/admin/assemblies_controller.rb +19 -4
- data/app/controllers/decidim/assemblies/admin/assembly_copies_controller.rb +1 -1
- data/app/controllers/decidim/assemblies/admin/assembly_share_tokens_controller.rb +18 -0
- data/app/controllers/decidim/assemblies/admin/component_share_tokens_controller.rb +18 -0
- data/app/controllers/decidim/assemblies/assemblies_controller.rb +1 -3
- data/app/controllers/decidim/assemblies/{assembly_members_controller.rb → participatory_space_private_users_controller.rb} +3 -11
- data/app/forms/decidim/assemblies/admin/assembly_copy_form.rb +0 -1
- data/app/forms/decidim/assemblies/admin/assembly_form.rb +5 -40
- data/app/forms/decidim/assemblies/admin/assembly_import_form.rb +0 -1
- data/app/helpers/decidim/assemblies/admin/assemblies_helper.rb +26 -4
- data/app/helpers/decidim/assemblies/assemblies_helper.rb +4 -4
- data/app/helpers/decidim/assemblies/filter_assemblies_helper.rb +11 -15
- data/app/models/decidim/assembly.rb +21 -11
- data/app/packs/entrypoints/decidim_assemblies_admin.js +0 -1
- data/app/packs/entrypoints/decidim_assemblies_admin_list.js +1 -0
- data/app/packs/src/decidim/assemblies/admin/assemblies_list.js +72 -0
- data/app/permissions/decidim/assemblies/permissions.rb +9 -28
- data/app/presenters/decidim/assemblies/admin_log/assembly_presenter.rb +1 -1
- data/app/presenters/decidim/assemblies/assembly_presenter.rb +0 -6
- data/app/queries/decidim/assemblies/metrics/assemblies_metric_manage.rb +2 -2
- data/app/serializers/decidim/assemblies/assembly_importer.rb +0 -35
- data/app/serializers/decidim/assemblies/assembly_serializer.rb +11 -135
- data/app/serializers/decidim/assemblies/open_data_assembly_serializer.rb +59 -0
- data/app/views/decidim/assemblies/admin/assemblies/_assemblies_thead.html.erb +19 -0
- data/app/views/decidim/assemblies/admin/assemblies/_assembly_row.html.erb +101 -0
- data/app/views/decidim/assemblies/admin/assemblies/_form.html.erb +29 -41
- data/app/views/decidim/assemblies/admin/assemblies/index.html.erb +18 -92
- data/app/views/decidim/assemblies/admin/assemblies/index.js.erb +10 -0
- data/app/views/decidim/assemblies/admin/assemblies/manage_trash.html.erb +20 -0
- data/app/views/decidim/assemblies/admin/assembly_copies/_form.html.erb +0 -4
- data/app/views/decidim/assemblies/admin/assembly_imports/_form.html.erb +0 -3
- data/app/views/decidim/assemblies/assemblies/index.html.erb +3 -1
- data/app/views/decidim/assemblies/assemblies/show.html.erb +5 -6
- data/app/views/decidim/assemblies/{assembly_members → participatory_space_private_users}/index.html.erb +6 -5
- data/config/assets.rb +2 -1
- data/config/locales/ar.yml +0 -72
- data/config/locales/bg.yml +0 -74
- data/config/locales/bs-BA.yml +0 -15
- data/config/locales/ca.yml +70 -74
- data/config/locales/cs.yml +70 -74
- data/config/locales/de.yml +70 -74
- data/config/locales/el.yml +0 -72
- data/config/locales/en.yml +71 -75
- data/config/locales/es-MX.yml +70 -74
- data/config/locales/es-PY.yml +70 -74
- data/config/locales/es.yml +70 -74
- data/config/locales/eu.yml +74 -78
- data/config/locales/fi-plain.yml +71 -75
- data/config/locales/fi.yml +71 -75
- data/config/locales/fr-CA.yml +22 -74
- data/config/locales/fr.yml +22 -74
- data/config/locales/ga-IE.yml +0 -25
- data/config/locales/gl.yml +1 -73
- data/config/locales/he-IL.yml +8 -60
- data/config/locales/hu.yml +0 -74
- data/config/locales/id-ID.yml +0 -63
- data/config/locales/is-IS.yml +0 -48
- data/config/locales/it.yml +1 -144
- data/config/locales/ja.yml +70 -74
- data/config/locales/kaa.yml +0 -9
- data/config/locales/ko.yml +0 -6
- data/config/locales/lb.yml +0 -70
- data/config/locales/lt.yml +0 -72
- data/config/locales/lv.yml +0 -74
- data/config/locales/nl.yml +0 -72
- data/config/locales/no.yml +0 -72
- data/config/locales/pl.yml +0 -75
- data/config/locales/pt-BR.yml +0 -74
- data/config/locales/pt.yml +0 -152
- data/config/locales/ro-RO.yml +14 -85
- data/config/locales/ru.yml +0 -60
- data/config/locales/sk.yml +0 -46
- data/config/locales/sl.yml +0 -54
- data/config/locales/sq-AL.yml +0 -77
- data/config/locales/sr-CS.yml +0 -15
- data/config/locales/sv.yml +71 -75
- data/config/locales/tr-TR.yml +0 -75
- data/config/locales/uk.yml +0 -60
- data/config/locales/zh-CN.yml +0 -74
- data/config/locales/zh-TW.yml +0 -72
- data/db/migrate/20190215093700_reset_negative_children_count_counters.rb +2 -2
- data/db/migrate/20210310120444_add_followable_counter_cache_to_assemblies.rb +1 -1
- data/db/migrate/20240822161222_add_deleted_at_to_decidim_assemblies.rb +8 -0
- data/db/migrate/20241016101151_migrate_assembly_members_to_private_users.rb +53 -0
- data/db/migrate/20241108141651_remove_column_show_statistics_from_assemblies.rb +7 -0
- data/decidim-assemblies.gemspec +1 -1
- data/lib/decidim/api/assemblies_type_type.rb +2 -2
- data/lib/decidim/api/assembly_type.rb +32 -34
- data/lib/decidim/assemblies/admin_engine.rb +77 -54
- data/lib/decidim/assemblies/api.rb +0 -1
- data/lib/decidim/assemblies/content_blocks/registry_manager.rb +11 -0
- data/lib/decidim/assemblies/engine.rb +9 -3
- data/lib/decidim/assemblies/menu.rb +9 -22
- data/lib/decidim/assemblies/participatory_space.rb +7 -3
- data/lib/decidim/assemblies/seeds.rb +9 -33
- data/lib/decidim/assemblies/test/factories.rb +15 -36
- data/lib/decidim/assemblies/version.rb +1 -1
- metadata +28 -49
- data/app/cells/decidim/assemblies/assembly_member/data.erb +0 -19
- data/app/cells/decidim/assemblies/assembly_member/name_and_position.erb +0 -11
- data/app/cells/decidim/assemblies/assembly_member/show.erb +0 -9
- data/app/cells/decidim/assemblies/assembly_member_cell.rb +0 -21
- data/app/commands/decidim/assemblies/admin/create_assembly_member.rb +0 -55
- data/app/commands/decidim/assemblies/admin/destroy_assembly_member.rb +0 -24
- data/app/commands/decidim/assemblies/admin/update_assembly_member.rb +0 -29
- data/app/controllers/concerns/decidim/assemblies/admin/assembly_members/filterable.rb +0 -39
- data/app/controllers/decidim/assemblies/admin/assemblies_types_controller.rb +0 -107
- data/app/controllers/decidim/assemblies/admin/assembly_members_controller.rb +0 -83
- data/app/controllers/decidim/assemblies/admin/categories_controller.rb +0 -13
- data/app/events/decidim/assemblies/create_assembly_member_event.rb +0 -17
- data/app/forms/decidim/assemblies/admin/assembly_member_form.rb +0 -64
- data/app/helpers/decidim/assemblies/admin/assembly_members_helper.rb +0 -11
- data/app/models/decidim/assembly_member.rb +0 -34
- data/app/packs/src/decidim/assemblies/admin/assembly_members.js +0 -47
- data/app/packs/src/decidim/assemblies/orgchart.js +0 -0
- data/app/presenters/decidim/admin/assembly_member_presenter.rb +0 -24
- data/app/presenters/decidim/assemblies/admin_log/assembly_member_presenter.rb +0 -51
- data/app/presenters/decidim/assemblies/admin_log/value_types/member_position_presenter.rb +0 -22
- data/app/presenters/decidim/assembly_member_presenter.rb +0 -68
- data/app/views/decidim/assemblies/admin/assemblies_types/_form.html.erb +0 -9
- data/app/views/decidim/assemblies/admin/assemblies_types/edit.html.erb +0 -13
- data/app/views/decidim/assemblies/admin/assemblies_types/index.html.erb +0 -44
- data/app/views/decidim/assemblies/admin/assemblies_types/new.html.erb +0 -18
- data/app/views/decidim/assemblies/admin/assembly_members/_form.html.erb +0 -62
- data/app/views/decidim/assemblies/admin/assembly_members/edit.html.erb +0 -18
- data/app/views/decidim/assemblies/admin/assembly_members/index.html.erb +0 -55
- data/app/views/decidim/assemblies/admin/assembly_members/new.html.erb +0 -18
- data/app/views/decidim/assembly_members/_assembly_member.html.erb +0 -1
- data/app/views/layouts/decidim/admin/assemblies_types.html.erb +0 -17
- data/config/locales/ca-IT.yml +0 -460
- data/lib/decidim/api/assembly_member_type.rb +0 -27
@@ -16,82 +16,105 @@ module Decidim
|
|
16
16
|
paths["lib/tasks"] = nil
|
17
17
|
|
18
18
|
routes do
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
member do
|
28
|
-
post :resend_invitation, to: "assembly_user_roles#resend_invitation"
|
19
|
+
constraints(->(request) { Decidim::Admin::OrganizationDashboardConstraint.new(request).matches? }) do
|
20
|
+
resources :assemblies, param: :slug, except: [:show, :destroy] do
|
21
|
+
resource :publish, controller: "assembly_publications", only: [:create, :destroy]
|
22
|
+
resources :copies, controller: "assembly_copies", only: [:new, :create]
|
23
|
+
resources :user_roles, controller: "assembly_user_roles" do
|
24
|
+
member do
|
25
|
+
post :resend_invitation, to: "assembly_user_roles#resend_invitation"
|
26
|
+
end
|
29
27
|
end
|
30
|
-
end
|
31
|
-
|
32
|
-
resources :attachment_collections, controller: "assembly_attachment_collections", except: [:show]
|
33
|
-
resources :attachments, controller: "assembly_attachments", except: [:show]
|
34
|
-
|
35
|
-
resource :export, controller: "assembly_exports", only: :create
|
36
|
-
|
37
|
-
collection do
|
38
|
-
resources :imports, controller: "assembly_imports", only: [:new, :create]
|
39
|
-
end
|
40
28
|
|
41
|
-
|
42
|
-
resources :
|
43
|
-
end
|
44
|
-
end
|
29
|
+
resources :attachment_collections, controller: "assembly_attachment_collections", except: [:show]
|
30
|
+
resources :attachments, controller: "assembly_attachments", except: [:show]
|
45
31
|
|
46
|
-
|
47
|
-
resources :categories, except: [:show]
|
32
|
+
resource :export, controller: "assembly_exports", only: :create
|
48
33
|
|
49
|
-
resources :components do
|
50
|
-
resource :permissions, controller: "component_permissions"
|
51
34
|
member do
|
52
|
-
|
53
|
-
|
54
|
-
get :share
|
35
|
+
patch :soft_delete
|
36
|
+
patch :restore
|
55
37
|
end
|
56
|
-
|
57
|
-
|
58
|
-
get :
|
38
|
+
|
39
|
+
collection do
|
40
|
+
get :manage_trash, to: "assemblies#manage_trash"
|
41
|
+
resources :imports, controller: "assembly_imports", only: [:new, :create]
|
59
42
|
end
|
60
|
-
resources :reminders, only: [:new, :create]
|
61
|
-
end
|
62
43
|
|
63
|
-
|
64
|
-
|
65
|
-
put :unreport
|
66
|
-
put :hide
|
67
|
-
put :unhide
|
44
|
+
resource :landing_page, only: [:edit, :update], controller: "assembly_landing_page" do
|
45
|
+
resources :content_blocks, only: [:edit, :update, :destroy, :create], controller: "assembly_landing_page_content_blocks"
|
68
46
|
end
|
69
|
-
resources :reports, controller: "moderations/reports", only: [:index, :show]
|
70
47
|
end
|
71
48
|
|
72
|
-
|
73
|
-
|
74
|
-
|
49
|
+
scope "/assemblies/:assembly_slug" do
|
50
|
+
resources :components do
|
51
|
+
collection do
|
52
|
+
put :reorder
|
53
|
+
end
|
54
|
+
resource :permissions, controller: "component_permissions"
|
55
|
+
member do
|
56
|
+
put :publish
|
57
|
+
put :unpublish
|
58
|
+
get :share
|
59
|
+
patch :soft_delete
|
60
|
+
patch :restore
|
61
|
+
end
|
62
|
+
collection do
|
63
|
+
get :manage_trash, to: "components#manage_trash"
|
64
|
+
put :hide
|
65
|
+
end
|
66
|
+
resources :component_share_tokens, except: [:show], path: "share_tokens", as: "share_tokens"
|
67
|
+
resources :exports, only: :create
|
68
|
+
resources :imports, only: [:new, :create] do
|
69
|
+
get :example, on: :collection
|
70
|
+
end
|
71
|
+
resources :reminders, only: [:new, :create]
|
75
72
|
end
|
76
|
-
|
77
|
-
|
78
|
-
|
73
|
+
|
74
|
+
resources :moderations do
|
75
|
+
member do
|
76
|
+
put :unreport
|
77
|
+
put :hide
|
78
|
+
put :unhide
|
79
|
+
end
|
80
|
+
patch :bulk_action, on: :collection
|
81
|
+
resources :reports, controller: "moderations/reports", only: [:index, :show]
|
82
|
+
end
|
83
|
+
|
84
|
+
resources :participatory_space_private_users, controller: "participatory_space_private_users" do
|
85
|
+
member do
|
86
|
+
post :resend_invitation, to: "participatory_space_private_users#resend_invitation"
|
87
|
+
end
|
88
|
+
collection do
|
89
|
+
resource :participatory_space_private_users_csv_imports, only: [:new, :create], path: "csv_import" do
|
90
|
+
delete :destroy_all
|
91
|
+
end
|
92
|
+
post :publish_all
|
93
|
+
post :unpublish_all
|
79
94
|
end
|
80
95
|
end
|
96
|
+
|
97
|
+
resources :assembly_share_tokens, except: [:show], path: "share_tokens"
|
81
98
|
end
|
82
|
-
end
|
83
99
|
|
84
|
-
|
85
|
-
|
86
|
-
|
100
|
+
scope "/assemblies/:assembly_slug/components/:component_id/manage" do
|
101
|
+
Decidim.component_manifests.each do |manifest|
|
102
|
+
next unless manifest.admin_engine
|
87
103
|
|
88
|
-
|
89
|
-
|
104
|
+
constraints CurrentComponent.new(manifest) do
|
105
|
+
mount manifest.admin_engine, at: "/", as: "decidim_admin_assembly_#{manifest.name}"
|
106
|
+
end
|
90
107
|
end
|
91
108
|
end
|
92
109
|
end
|
93
110
|
end
|
94
111
|
|
112
|
+
initializer "decidim_assemblies_admin.mount_routes" do
|
113
|
+
Decidim::Core::Engine.routes do
|
114
|
+
mount Decidim::Assemblies::AdminEngine, at: "/admin", as: "decidim_admin_assemblies"
|
115
|
+
end
|
116
|
+
end
|
117
|
+
|
95
118
|
initializer "decidim_assemblies_admin.action_controller" do |app|
|
96
119
|
app.config.to_prepare do
|
97
120
|
ActiveSupport.on_load :action_controller do
|
@@ -111,6 +111,7 @@ module Decidim
|
|
111
111
|
content_block.public_name_key = "decidim.application.photos.related_photos"
|
112
112
|
end
|
113
113
|
|
114
|
+
register_highlighted_debates
|
114
115
|
register_highlighted_meetings
|
115
116
|
register_highlighted_posts
|
116
117
|
register_highlighted_proposals
|
@@ -118,6 +119,16 @@ module Decidim
|
|
118
119
|
register_related_processes
|
119
120
|
end
|
120
121
|
|
122
|
+
def self.register_highlighted_debates
|
123
|
+
return unless Decidim.module_installed?(:debates)
|
124
|
+
|
125
|
+
Decidim.content_blocks.register(:assembly_homepage, :highlighted_debates) do |content_block|
|
126
|
+
content_block.cell = "decidim/debates/content_blocks/highlighted_debates"
|
127
|
+
content_block.public_name_key = "decidim.debates.content_blocks.highlighted_debates.name"
|
128
|
+
content_block.component_manifest_name = "debates"
|
129
|
+
end
|
130
|
+
end
|
131
|
+
|
121
132
|
def self.register_highlighted_meetings
|
122
133
|
return unless Decidim.module_installed?(:meetings)
|
123
134
|
|
@@ -26,7 +26,7 @@ module Decidim
|
|
26
26
|
}, constraints: { assembly_id: /[0-9]+/ }
|
27
27
|
|
28
28
|
resources :assemblies, only: [:index, :show], param: :slug, path: "assemblies" do
|
29
|
-
resources :
|
29
|
+
resources :participatory_space_private_users, only: :index, path: "members"
|
30
30
|
end
|
31
31
|
|
32
32
|
scope "/assemblies/:assembly_slug/f/:component_id" do
|
@@ -40,6 +40,12 @@ module Decidim
|
|
40
40
|
end
|
41
41
|
end
|
42
42
|
|
43
|
+
initializer "decidim_assemblies.mount_routes" do
|
44
|
+
Decidim::Core::Engine.routes do
|
45
|
+
mount Decidim::Assemblies::Engine, at: "/", as: "decidim_assemblies"
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
43
49
|
initializer "decidim_assemblies.register_icons" do
|
44
50
|
Decidim.icons.register(name: "Decidim::Assembly", icon: "government-line", description: "Assembly", category: "activity", engine: :assemblies)
|
45
51
|
Decidim.icons.register(name: "assembly_type", icon: "group-2-line", description: "Type", category: "assemblies", engine: :assemblies)
|
@@ -68,8 +74,8 @@ module Decidim
|
|
68
74
|
Decidim.view_hooks.register(:user_profile_bottom, priority: Decidim::ViewHooks::MEDIUM_PRIORITY) do |view_context|
|
69
75
|
assemblies = OrganizationPublishedAssemblies.new(view_context.current_organization, view_context.current_user)
|
70
76
|
.query.distinct
|
71
|
-
.joins(:
|
72
|
-
.merge(Decidim::
|
77
|
+
.joins(:participatory_space_private_users)
|
78
|
+
.merge(Decidim::ParticipatorySpacePrivateUser.where(user: view_context.profile_holder))
|
73
79
|
.reorder(title: :asc)
|
74
80
|
|
75
81
|
next unless assemblies.any?
|
@@ -43,8 +43,7 @@ module Decidim
|
|
43
43
|
decidim_admin_assemblies.assemblies_path,
|
44
44
|
icon_name: "government-line",
|
45
45
|
position: 2.2,
|
46
|
-
active: is_active_link?(decidim_admin_assemblies.assemblies_path)
|
47
|
-
is_active_link?(decidim_admin_assemblies.assemblies_types_path),
|
46
|
+
active: is_active_link?(decidim_admin_assemblies.assemblies_path),
|
48
47
|
if: allowed_to?(:enter, :space_area, space_name: :assemblies)
|
49
48
|
end
|
50
49
|
end
|
@@ -78,6 +77,7 @@ module Decidim
|
|
78
77
|
active: is_active_link?(manage_component_path(component)) ||
|
79
78
|
is_active_link?(decidim_admin_assemblies.edit_component_path(current_participatory_space, component)) ||
|
80
79
|
is_active_link?(decidim_admin_assemblies.edit_component_permissions_path(current_participatory_space, component)) ||
|
80
|
+
is_active_link?(decidim_admin_assemblies.component_share_tokens_path(current_participatory_space, component)) ||
|
81
81
|
participatory_space_active_link?(component),
|
82
82
|
if: component.manifest.admin_engine && user_role_config.component_is_accessible?(component.manifest_name)
|
83
83
|
end
|
@@ -107,12 +107,6 @@ module Decidim
|
|
107
107
|
if: allowed_to?(:read, :component, assembly: current_participatory_space),
|
108
108
|
submenu: { target_menu: :admin_assemblies_components_menu }
|
109
109
|
|
110
|
-
menu.add_item :categories,
|
111
|
-
I18n.t("categories", scope: "decidim.admin.menu.assemblies_submenu"),
|
112
|
-
decidim_admin_assemblies.categories_path(current_participatory_space),
|
113
|
-
icon_name: "price-tag-3-line",
|
114
|
-
if: allowed_to?(:read, :category, assembly: current_participatory_space)
|
115
|
-
|
116
110
|
menu.add_item :attachments,
|
117
111
|
I18n.t("attachments", scope: "decidim.admin.menu.assemblies_submenu"),
|
118
112
|
decidim_admin_assemblies.assembly_attachments_path(current_participatory_space),
|
@@ -122,12 +116,6 @@ module Decidim
|
|
122
116
|
if: allowed_to?(:read, :attachment_collection, assembly: current_participatory_space) ||
|
123
117
|
allowed_to?(:read, :attachment, assembly: current_participatory_space)
|
124
118
|
|
125
|
-
menu.add_item :assembly_members,
|
126
|
-
I18n.t("assembly_members", scope: "decidim.admin.menu.assemblies_submenu"),
|
127
|
-
decidim_admin_assemblies.assembly_members_path(current_participatory_space),
|
128
|
-
icon_name: "user-settings-line",
|
129
|
-
if: allowed_to?(:read, :assembly_member, assembly: current_participatory_space)
|
130
|
-
|
131
119
|
menu.add_item :assembly_user_roles,
|
132
120
|
I18n.t("assembly_admins", scope: "decidim.admin.menu.assemblies_submenu"),
|
133
121
|
decidim_admin_assemblies.assembly_user_roles_path(current_participatory_space),
|
@@ -145,6 +133,13 @@ module Decidim
|
|
145
133
|
decidim_admin_assemblies.moderations_path(current_participatory_space),
|
146
134
|
icon_name: "flag-line",
|
147
135
|
if: allowed_to?(:read, :moderation, assembly: current_participatory_space)
|
136
|
+
|
137
|
+
menu.add_item :assembly_share_tokens,
|
138
|
+
I18n.t("menu.share_tokens", scope: "decidim.admin"),
|
139
|
+
decidim_admin_assemblies.assembly_share_tokens_path(current_participatory_space),
|
140
|
+
active: is_active_link?(decidim_admin_assemblies.assembly_share_tokens_path(current_participatory_space)),
|
141
|
+
icon_name: "share-line",
|
142
|
+
if: allowed_to?(:read, :share_tokens, current_participatory_space:)
|
148
143
|
end
|
149
144
|
end
|
150
145
|
|
@@ -165,14 +160,6 @@ module Decidim
|
|
165
160
|
active: is_active_link?(decidim_admin_assemblies.new_import_path),
|
166
161
|
icon_name: "price-tag-3-line",
|
167
162
|
if: allowed_to?(:import, :assembly)
|
168
|
-
|
169
|
-
menu.add_item :assemblies_types,
|
170
|
-
I18n.t("menu.assemblies_types", scope: "decidim.admin"),
|
171
|
-
decidim_admin_assemblies.assemblies_types_path,
|
172
|
-
position: 3,
|
173
|
-
active: is_active_link?(decidim_admin_assemblies.assemblies_types_path),
|
174
|
-
icon_name: "government-line",
|
175
|
-
if: allowed_to?(:manage, :assemblies_type)
|
176
163
|
end
|
177
164
|
end
|
178
165
|
end
|
@@ -32,16 +32,20 @@ Decidim.register_participatory_space(:assemblies) do |participatory_space|
|
|
32
32
|
end
|
33
33
|
|
34
34
|
participatory_space.exports :assemblies do |export|
|
35
|
-
export.collection do
|
36
|
-
Decidim::Assembly
|
35
|
+
export.collection do
|
36
|
+
Decidim::Assembly
|
37
|
+
.public_spaces
|
38
|
+
.includes(:attachment_collections)
|
37
39
|
end
|
38
40
|
|
41
|
+
export.include_in_open_data = true
|
42
|
+
|
39
43
|
export.serializer Decidim::Assemblies::AssemblySerializer
|
44
|
+
export.open_data_serializer Decidim::Assemblies::OpenDataAssemblySerializer
|
40
45
|
end
|
41
46
|
|
42
47
|
participatory_space.register_on_destroy_account do |user|
|
43
48
|
Decidim::AssemblyUserRole.where(user:).destroy_all
|
44
|
-
Decidim::AssemblyMember.where(user:).destroy_all
|
45
49
|
end
|
46
50
|
|
47
51
|
participatory_space.seeds do
|
@@ -8,6 +8,15 @@ module Decidim
|
|
8
8
|
def call
|
9
9
|
create_content_block!
|
10
10
|
|
11
|
+
taxonomy = create_taxonomy!(name: "Assembly Types", parent: nil)
|
12
|
+
2.times do
|
13
|
+
create_taxonomy!(name: ::Faker::Lorem.word, parent: taxonomy)
|
14
|
+
end
|
15
|
+
# filters for assemblies only
|
16
|
+
create_taxonomy_filter!(root_taxonomy: taxonomy,
|
17
|
+
taxonomies: taxonomy.all_children,
|
18
|
+
participatory_space_manifests: [:assemblies])
|
19
|
+
|
11
20
|
2.times do |_n|
|
12
21
|
assembly = create_assembly!
|
13
22
|
|
@@ -20,12 +29,6 @@ module Decidim
|
|
20
29
|
|
21
30
|
create_attachments!(attached_to: current_assembly)
|
22
31
|
|
23
|
-
2.times do
|
24
|
-
create_category!(participatory_space: current_assembly)
|
25
|
-
end
|
26
|
-
|
27
|
-
create_assembly_members!(assembly: current_assembly)
|
28
|
-
|
29
32
|
seed_components_manifests!(participatory_space: current_assembly)
|
30
33
|
|
31
34
|
Decidim::ContentBlocksCreator.new(current_assembly).create_default!
|
@@ -74,7 +77,6 @@ module Decidim
|
|
74
77
|
composition: Decidim::Faker::Localized.wrapped("<p>", "</p>") do
|
75
78
|
Decidim::Faker::Localized.paragraph(sentence_count: 3)
|
76
79
|
end,
|
77
|
-
assembly_type: Decidim::AssembliesType.create!(organization:, title: Decidim::Faker::Localized.word),
|
78
80
|
creation_date: 1.day.from_now,
|
79
81
|
created_by: "others",
|
80
82
|
created_by_other: Decidim::Faker::Localized.word,
|
@@ -120,32 +122,6 @@ module Decidim
|
|
120
122
|
)
|
121
123
|
end
|
122
124
|
end
|
123
|
-
|
124
|
-
def create_assembly_members!(assembly:)
|
125
|
-
Decidim::AssemblyMember::POSITIONS.each do |position|
|
126
|
-
Decidim::AssemblyMember.create!(
|
127
|
-
full_name: ::Faker::Name.name,
|
128
|
-
gender: ::Faker::Lorem.word,
|
129
|
-
birthday: ::Faker::Date.birthday(min_age: 18, max_age: 65),
|
130
|
-
birthplace: ::Faker::Demographic.demonym,
|
131
|
-
designation_date: ::Faker::Date.between(from: 1.year.ago, to: 1.month.ago),
|
132
|
-
position:,
|
133
|
-
position_other: position == "other" ? ::Faker::Job.position : nil,
|
134
|
-
assembly:
|
135
|
-
)
|
136
|
-
end
|
137
|
-
|
138
|
-
Decidim::AssemblyMember.create!(
|
139
|
-
user: assembly.organization.users.first,
|
140
|
-
gender: ::Faker::Lorem.word,
|
141
|
-
birthday: ::Faker::Date.birthday(min_age: 18, max_age: 65),
|
142
|
-
birthplace: ::Faker::Demographic.demonym,
|
143
|
-
designation_date: ::Faker::Date.between(from: 1.year.ago, to: 1.month.ago),
|
144
|
-
position: "other",
|
145
|
-
position_other: ::Faker::Job.position,
|
146
|
-
assembly:
|
147
|
-
)
|
148
|
-
end
|
149
125
|
end
|
150
126
|
end
|
151
127
|
end
|
@@ -29,6 +29,7 @@ FactoryBot.define do
|
|
29
29
|
hero_image { Decidim::Dev.test_file("city.jpeg", "image/jpeg") } # Keep after organization
|
30
30
|
banner_image { Decidim::Dev.test_file("city2.jpeg", "image/jpeg") } # Keep after organization
|
31
31
|
published_at { Time.current }
|
32
|
+
deleted_at { nil }
|
32
33
|
meta_scope { generate_localized_word(:assembly_meta_scope, skip_injection:) }
|
33
34
|
developer_group { generate_localized_title(:assembly_developer_group, skip_injection:) }
|
34
35
|
local_area { generate_localized_title(:assembly_local_area, skip_injection:) }
|
@@ -56,10 +57,6 @@ FactoryBot.define do
|
|
56
57
|
weight { 1 }
|
57
58
|
announcement { generate_localized_title(:assembly_announcement, skip_injection:) }
|
58
59
|
|
59
|
-
trait :with_type do
|
60
|
-
assembly_type { create :assemblies_type, organization:, skip_injection: }
|
61
|
-
end
|
62
|
-
|
63
60
|
trait :promoted do
|
64
61
|
promoted { true }
|
65
62
|
end
|
@@ -72,8 +69,12 @@ FactoryBot.define do
|
|
72
69
|
published_at { Time.current }
|
73
70
|
end
|
74
71
|
|
72
|
+
trait :trashed do
|
73
|
+
deleted_at { Time.current }
|
74
|
+
end
|
75
|
+
|
75
76
|
trait :with_parent do
|
76
|
-
parent { create
|
77
|
+
parent { create(:assembly, organization:, skip_injection:) }
|
77
78
|
end
|
78
79
|
|
79
80
|
trait :public do
|
@@ -115,7 +116,7 @@ FactoryBot.define do
|
|
115
116
|
skip_injection { false }
|
116
117
|
end
|
117
118
|
user
|
118
|
-
assembly { create
|
119
|
+
assembly { create(:assembly, organization: user.organization, skip_injection:) }
|
119
120
|
role { "admin" }
|
120
121
|
end
|
121
122
|
|
@@ -129,11 +130,11 @@ FactoryBot.define do
|
|
129
130
|
admin_terms_accepted_at { Time.current }
|
130
131
|
|
131
132
|
after(:create) do |user, evaluator|
|
132
|
-
create
|
133
|
+
create(:assembly_user_role,
|
133
134
|
user:,
|
134
135
|
assembly: evaluator.assembly,
|
135
136
|
skip_injection: evaluator.skip_injection,
|
136
|
-
role: :admin
|
137
|
+
role: :admin)
|
137
138
|
end
|
138
139
|
end
|
139
140
|
|
@@ -147,11 +148,11 @@ FactoryBot.define do
|
|
147
148
|
admin_terms_accepted_at { Time.current }
|
148
149
|
|
149
150
|
after(:create) do |user, evaluator|
|
150
|
-
create
|
151
|
+
create(:assembly_user_role,
|
151
152
|
user:,
|
152
153
|
assembly: evaluator.assembly,
|
153
154
|
role: :moderator,
|
154
|
-
skip_injection: evaluator.skip_injection
|
155
|
+
skip_injection: evaluator.skip_injection)
|
155
156
|
end
|
156
157
|
end
|
157
158
|
|
@@ -165,11 +166,11 @@ FactoryBot.define do
|
|
165
166
|
admin_terms_accepted_at { Time.current }
|
166
167
|
|
167
168
|
after(:create) do |user, evaluator|
|
168
|
-
create
|
169
|
+
create(:assembly_user_role,
|
169
170
|
user:,
|
170
171
|
assembly: evaluator.assembly,
|
171
172
|
role: :collaborator,
|
172
|
-
skip_injection: evaluator.skip_injection
|
173
|
+
skip_injection: evaluator.skip_injection)
|
173
174
|
end
|
174
175
|
end
|
175
176
|
|
@@ -183,33 +184,11 @@ FactoryBot.define do
|
|
183
184
|
admin_terms_accepted_at { Time.current }
|
184
185
|
|
185
186
|
after(:create) do |user, evaluator|
|
186
|
-
create
|
187
|
+
create(:assembly_user_role,
|
187
188
|
user:,
|
188
189
|
assembly: evaluator.assembly,
|
189
190
|
role: :valuator,
|
190
|
-
skip_injection: evaluator.skip_injection
|
191
|
-
end
|
192
|
-
end
|
193
|
-
|
194
|
-
factory :assembly_member, class: "Decidim::AssemblyMember" do
|
195
|
-
transient do
|
196
|
-
skip_injection { false }
|
197
|
-
end
|
198
|
-
assembly { create(:assembly, skip_injection:) }
|
199
|
-
|
200
|
-
full_name { Faker::Name.name }
|
201
|
-
gender { Faker::Lorem.word }
|
202
|
-
birthday { Faker::Date.birthday(min_age: 18, max_age: 65) }
|
203
|
-
birthplace { Faker::Lorem.word }
|
204
|
-
position { Decidim::AssemblyMember::POSITIONS.first }
|
205
|
-
designation_date { Faker::Date.between(from: 1.year.ago, to: 1.month.ago) }
|
206
|
-
|
207
|
-
trait :ceased do
|
208
|
-
ceased_date { Faker::Date.between(from: 1.day.ago, to: 5.days.ago) }
|
209
|
-
end
|
210
|
-
|
211
|
-
trait :with_user do
|
212
|
-
user { create(:user, organization: assembly.organization, skip_injection:) }
|
191
|
+
skip_injection: evaluator.skip_injection)
|
213
192
|
end
|
214
193
|
end
|
215
194
|
end
|