decidim-admin 0.4.0 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of decidim-admin might be problematic. Click here for more details.

Files changed (54) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/stylesheets/decidim/admin/_variables.scss +2 -0
  3. data/app/assets/stylesheets/decidim/admin/extra/_cards.scss +6 -0
  4. data/app/assets/stylesheets/decidim/admin/modules/_typography.scss +4 -0
  5. data/app/commands/decidim/admin/create_participatory_process_admin.rb +3 -5
  6. data/app/constraints/decidim/admin/organization_dashboard_constraint.rb +1 -1
  7. data/app/controllers/decidim/admin/application_controller.rb +1 -1
  8. data/app/controllers/decidim/admin/categories_controller.rb +9 -9
  9. data/app/controllers/decidim/admin/concerns/participatory_process_admin.rb +1 -8
  10. data/app/controllers/decidim/admin/exports_controller.rb +2 -2
  11. data/app/controllers/decidim/admin/feature_permissions_controller.rb +2 -2
  12. data/app/controllers/decidim/admin/features/base_controller.rb +0 -5
  13. data/app/controllers/decidim/admin/features_controller.rb +4 -4
  14. data/app/controllers/decidim/admin/moderations_controller.rb +1 -1
  15. data/app/controllers/decidim/admin/participatory_process_attachments_controller.rb +2 -2
  16. data/app/controllers/decidim/admin/participatory_process_copies_controller.rb +3 -9
  17. data/app/controllers/decidim/admin/participatory_process_publications_controller.rb +4 -4
  18. data/app/controllers/decidim/admin/participatory_process_step_activations_controller.rb +2 -2
  19. data/app/controllers/decidim/admin/participatory_process_step_ordering_controller.rb +2 -2
  20. data/app/controllers/decidim/admin/participatory_process_steps_controller.rb +6 -6
  21. data/app/controllers/decidim/admin/participatory_process_user_roles_controller.rb +13 -15
  22. data/app/controllers/decidim/admin/participatory_processes_controller.rb +16 -18
  23. data/app/controllers/decidim/admin/users_controller.rb +4 -4
  24. data/app/forms/decidim/admin/participatory_process_user_role_form.rb +2 -2
  25. data/app/models/decidim/admin/abilities/{admin_user.rb → admin_ability.rb} +3 -6
  26. data/app/models/decidim/admin/abilities/{base.rb → base_ability.rb} +1 -4
  27. data/app/models/decidim/admin/abilities/{participatory_process_admin.rb → participatory_process_admin_ability.rb} +18 -28
  28. data/app/models/decidim/admin/abilities/participatory_process_collaborator_ability.rb +19 -0
  29. data/app/models/decidim/admin/abilities/participatory_process_moderator_ability.rb +23 -0
  30. data/app/queries/decidim/admin/process_admins.rb +1 -1
  31. data/app/views/decidim/admin/categories/index.html.erb +9 -9
  32. data/app/views/decidim/admin/categories/new.html.erb +1 -1
  33. data/app/views/decidim/admin/features/_form.html.erb +1 -1
  34. data/app/views/decidim/admin/features/edit.html.erb +1 -1
  35. data/app/views/decidim/admin/features/new.html.erb +1 -1
  36. data/app/views/decidim/admin/participatory_process_copies/new.html.erb +1 -1
  37. data/app/views/decidim/admin/participatory_process_groups/index.html.erb +5 -1
  38. data/app/views/decidim/admin/participatory_process_steps/index.html.erb +9 -9
  39. data/app/views/decidim/admin/participatory_process_user_roles/index.html.erb +6 -6
  40. data/app/views/decidim/admin/participatory_processes/edit.html.erb +6 -6
  41. data/app/views/decidim/admin/participatory_processes/index.html.erb +11 -1
  42. data/app/views/layouts/decidim/admin/participatory_process.html.erb +18 -18
  43. data/config/locales/ca.yml +4 -3
  44. data/config/locales/en.yml +1 -0
  45. data/config/locales/es.yml +1 -2
  46. data/db/migrate/20170714083651_rename_participatory_process_user_roles_table.rb +7 -0
  47. data/lib/decidim/admin/engine.rb +8 -6
  48. data/lib/decidim/admin/test/factories.rb +1 -1
  49. metadata +12 -14
  50. data/app/models/decidim/admin/abilities/collaborator_user.rb +0 -20
  51. data/app/models/decidim/admin/participatory_process_user_role.rb +0 -15
  52. data/app/queries/decidim/admin/manageable_participatory_processes_for_user.rb +0 -42
  53. data/app/queries/decidim/admin/process_admin_roles_for_process.rb +0 -36
  54. data/db/seeds.rb +0 -24
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 47c26318821b198a5abef8cc9514114d9be1a543
4
- data.tar.gz: b78c4f9d445ee587ffc20fad6cdd935884f8ae2e
3
+ metadata.gz: 42620ebd8e29a49fbf096b8ae94aa58b2173cabf
4
+ data.tar.gz: 292d295cd03650b353e3a54fb2bc2f84bfb9dba7
5
5
  SHA512:
6
- metadata.gz: dbb45517bed3f266030d3ac5ece8adc8cd387040bf34def83bc72bebde4eb6457d989ac6d591a7d42fc08264251b40a2d626a0f03c868ab6ef3af0f7b9680c20
7
- data.tar.gz: 0e26714cb55d3f073cf0dbeb58584d2413016b2fbb9edd49fcf861bd9e0d2737f73a252334c2b1f853fb8c4c2b1457d9f6fe49824d05958eabc6b8b5b1d98b0c
6
+ metadata.gz: 574157f3e93f0b28797202df966d6ba3cea21a174caf6db438eb15b827f7c20738da96db32e9fd8d4f2bef79abf80582e8b2bdc3cb9ac1ca7630d4aea432a666
7
+ data.tar.gz: 3ebf17d827c28f0f4268265c58c4b188d40a39b67969758595acdbc8debe099eb7f6b217acde0725fa7622bc3e0a39a1792d640ca2145a1f9f4fb3a73daf1bb1
@@ -5,3 +5,5 @@ $brand: #9675ce !default;
5
5
  $twitter: #55acee !default;
6
6
  $facebook: #3b5998 !default;
7
7
  $google: #dd4b39 !default;
8
+
9
+ $secondary: #599aa6 !default;
@@ -4,3 +4,9 @@
4
4
  float: right;
5
5
  }
6
6
  }
7
+
8
+ form {
9
+ .card {
10
+ overflow: initial;
11
+ }
12
+ }
@@ -13,3 +13,7 @@
13
13
  .text-alert{
14
14
  color: $alert-color;
15
15
  }
16
+
17
+ .text-info{
18
+ color: $secondary;
19
+ }
@@ -41,7 +41,7 @@ module Decidim
41
41
  attr_reader :form, :participatory_process, :current_user, :user
42
42
 
43
43
  def create_role
44
- ParticipatoryProcessUserRole.find_or_create_by!(
44
+ Decidim::ParticipatoryProcessUserRole.find_or_create_by!(
45
45
  role: form.role.to_sym,
46
46
  user: user,
47
47
  participatory_process: @participatory_process
@@ -68,9 +68,7 @@ module Decidim
68
68
  end
69
69
 
70
70
  def new_user
71
- new_user_form = user_form.dup
72
- new_user_form.roles = []
73
- @new_user ||= InviteUser.call(new_user_form) do
71
+ @new_user ||= InviteUser.call(user_form) do
74
72
  on(:ok) do |user|
75
73
  return user
76
74
  end
@@ -81,7 +79,7 @@ module Decidim
81
79
  OpenStruct.new(name: form.name,
82
80
  email: form.email.downcase,
83
81
  organization: participatory_process.organization,
84
- roles: [form.role.to_sym],
82
+ admin: false,
85
83
  invited_by: current_user,
86
84
  invitation_instructions: invitation_instructions)
87
85
  end
@@ -34,7 +34,7 @@ module Decidim
34
34
  end
35
35
 
36
36
  def ability
37
- Decidim::Admin::Abilities::Base.new(user, current_organization: organization)
37
+ Decidim::Admin::Abilities::BaseAbility.new(user, current_organization: organization)
38
38
  end
39
39
  end
40
40
  end
@@ -33,7 +33,7 @@ module Decidim
33
33
  # Overwrites `cancancan`'s method to point to the correct ability class,
34
34
  # since the gem expects the ability class to be in the root namespace.
35
35
  def current_ability_klass
36
- Decidim::Admin::Abilities::Base
36
+ Decidim::Admin::Abilities::BaseAbility
37
37
  end
38
38
  end
39
39
  end
@@ -15,17 +15,17 @@ module Decidim
15
15
 
16
16
  def new
17
17
  authorize! :create, Decidim::Category
18
- @form = form(CategoryForm).from_params({}, current_process: participatory_process)
18
+ @form = form(CategoryForm).from_params({}, current_process: current_participatory_process)
19
19
  end
20
20
 
21
21
  def create
22
22
  authorize! :create, Decidim::Category
23
- @form = form(CategoryForm).from_params(params, current_process: participatory_process)
23
+ @form = form(CategoryForm).from_params(params, current_process: current_participatory_process)
24
24
 
25
- CreateCategory.call(@form, participatory_process) do
25
+ CreateCategory.call(@form, current_participatory_process) do
26
26
  on(:ok) do
27
27
  flash[:notice] = I18n.t("categories.create.success", scope: "decidim.admin")
28
- redirect_to participatory_process_categories_path(participatory_process)
28
+ redirect_to participatory_process_categories_path(current_participatory_process)
29
29
  end
30
30
 
31
31
  on(:invalid) do
@@ -38,18 +38,18 @@ module Decidim
38
38
  def edit
39
39
  @category = collection.find(params[:id])
40
40
  authorize! :update, @category
41
- @form = form(CategoryForm).from_model(@category, current_process: participatory_process)
41
+ @form = form(CategoryForm).from_model(@category, current_process: current_participatory_process)
42
42
  end
43
43
 
44
44
  def update
45
45
  @category = collection.find(params[:id])
46
46
  authorize! :update, @category
47
- @form = form(CategoryForm).from_params(params, current_process: participatory_process)
47
+ @form = form(CategoryForm).from_params(params, current_process: current_participatory_process)
48
48
 
49
49
  UpdateCategory.call(@category, @form) do
50
50
  on(:ok) do
51
51
  flash[:notice] = I18n.t("categories.update.success", scope: "decidim.admin")
52
- redirect_to participatory_process_categories_path(participatory_process)
52
+ redirect_to participatory_process_categories_path(current_participatory_process)
53
53
  end
54
54
 
55
55
  on(:invalid) do
@@ -77,14 +77,14 @@ module Decidim
77
77
  flash[:alert] = I18n.t("categories.destroy.error", scope: "decidim.admin")
78
78
  end
79
79
 
80
- redirect_back(fallback_location: participatory_process_categories_path(participatory_process))
80
+ redirect_back(fallback_location: participatory_process_categories_path(current_participatory_process))
81
81
  end
82
82
  end
83
83
 
84
84
  private
85
85
 
86
86
  def collection
87
- @collection ||= participatory_process.categories.includes(:subcategories)
87
+ @collection ||= current_participatory_process.categories.includes(:subcategories)
88
88
  end
89
89
  end
90
90
  end
@@ -10,17 +10,10 @@ module Decidim
10
10
  extend ActiveSupport::Concern
11
11
 
12
12
  included do
13
- helper_method :participatory_process
13
+ include Decidim::NeedsParticipatoryProcess
14
14
 
15
15
  layout "decidim/admin/participatory_process"
16
16
  end
17
-
18
- private
19
-
20
- def participatory_process
21
- @participatory_process ||=
22
- current_organization.participatory_processes.find(params[:participatory_process_id])
23
- end
24
17
  end
25
18
  end
26
19
  end
@@ -23,7 +23,7 @@ module Decidim
23
23
  send(
24
24
  "decidim_admin_#{feature.manifest.name}_path",
25
25
  feature_id: feature.id,
26
- participatory_process_id: participatory_process.id
26
+ participatory_process_id: current_participatory_process.id
27
27
  )
28
28
  end
29
29
 
@@ -32,7 +32,7 @@ module Decidim
32
32
  end
33
33
 
34
34
  def feature
35
- @feature ||= participatory_process.features.find(params[:feature_id])
35
+ @feature ||= current_participatory_process.features.find(params[:feature_id])
36
36
  end
37
37
  end
38
38
  end
@@ -24,7 +24,7 @@ module Decidim
24
24
  UpdateFeaturePermissions.call(@permissions_form, feature) do
25
25
  on(:ok) do
26
26
  flash[:notice] = t("feature_permissions.update.success", scope: "decidim.admin")
27
- redirect_to participatory_process_features_path(participatory_process)
27
+ redirect_to participatory_process_features_path(current_participatory_process)
28
28
  end
29
29
 
30
30
  on(:invalid) do
@@ -53,7 +53,7 @@ module Decidim
53
53
  end
54
54
 
55
55
  def feature
56
- @feature ||= participatory_process.features.find(params[:feature_id])
56
+ @feature ||= current_participatory_process.features.find(params[:feature_id])
57
57
  end
58
58
  end
59
59
  end
@@ -13,7 +13,6 @@ module Decidim
13
13
  helper Decidim::Admin::ExportsHelper
14
14
 
15
15
  helper_method :current_feature,
16
- :current_participatory_process,
17
16
  :parent_path
18
17
 
19
18
  delegate :active_step, to: :current_participatory_process, prefix: false
@@ -30,10 +29,6 @@ module Decidim
30
29
  request.env["decidim.current_feature"]
31
30
  end
32
31
 
33
- def current_participatory_process
34
- request.env["decidim.current_participatory_process"]
35
- end
36
-
37
32
  def parent_path
38
33
  decidim_admin.participatory_process_features_path(current_participatory_process)
39
34
  end
@@ -15,7 +15,7 @@ module Decidim
15
15
  def index
16
16
  authorize! :read, Feature
17
17
  @manifests = Decidim.feature_manifests
18
- @features = participatory_process.features
18
+ @features = current_participatory_process.features
19
19
  end
20
20
 
21
21
  def new
@@ -24,7 +24,7 @@ module Decidim
24
24
  @feature = Feature.new(
25
25
  name: default_name(manifest),
26
26
  manifest_name: params[:type],
27
- participatory_process: participatory_process
27
+ participatory_process: current_participatory_process
28
28
  )
29
29
 
30
30
  @form = form(FeatureForm).from_model(@feature)
@@ -34,7 +34,7 @@ module Decidim
34
34
  @form = form(FeatureForm).from_params(params)
35
35
  authorize! :create, Feature
36
36
 
37
- CreateFeature.call(manifest, @form, participatory_process) do
37
+ CreateFeature.call(manifest, @form, current_participatory_process) do
38
38
  on(:ok) do
39
39
  flash[:notice] = I18n.t("features.create.success", scope: "decidim.admin")
40
40
  redirect_to action: :index
@@ -112,7 +112,7 @@ module Decidim
112
112
  private
113
113
 
114
114
  def query_scope
115
- participatory_process.features
115
+ current_participatory_process.features
116
116
  end
117
117
 
118
118
  def manifest
@@ -61,7 +61,7 @@ module Decidim
61
61
  end
62
62
 
63
63
  def participatory_process_moderations
64
- @participatory_process_moderations ||= Decidim::Moderation.where(participatory_process: participatory_process)
64
+ @participatory_process_moderations ||= Decidim::Moderation.where(participatory_process: current_participatory_process)
65
65
  end
66
66
  end
67
67
  end
@@ -12,11 +12,11 @@ module Decidim
12
12
  include Concerns::HasAttachments
13
13
 
14
14
  def after_destroy_path
15
- participatory_process_attachments_path(participatory_process.id)
15
+ participatory_process_attachments_path(current_participatory_process.id)
16
16
  end
17
17
 
18
18
  def attached_to
19
- participatory_process
19
+ current_participatory_process
20
20
  end
21
21
 
22
22
  def authorization_object
@@ -9,18 +9,16 @@ module Decidim
9
9
  class ParticipatoryProcessCopiesController < ApplicationController
10
10
  include Concerns::ParticipatoryProcessAdmin
11
11
 
12
- helper_method :participatory_process
13
-
14
12
  def new
15
13
  authorize! :new, Decidim::ParticipatoryProcess
16
- @form = form(ParticipatoryProcessCopyForm).from_model(participatory_process)
14
+ @form = form(ParticipatoryProcessCopyForm).from_model(current_participatory_process)
17
15
  end
18
16
 
19
17
  def create
20
18
  authorize! :create, Decidim::ParticipatoryProcess
21
19
  @form = form(ParticipatoryProcessCopyForm).from_params(params)
22
20
 
23
- CopyParticipatoryProcess.call(@form, participatory_process) do
21
+ CopyParticipatoryProcess.call(@form, current_participatory_process) do
24
22
  on(:ok) do
25
23
  flash[:notice] = I18n.t("participatory_processes_copies.create.success", scope: "decidim.admin")
26
24
  redirect_to participatory_processes_path
@@ -36,11 +34,7 @@ module Decidim
36
34
  private
37
35
 
38
36
  def collection
39
- @collection ||= ManageableParticipatoryProcessesForUser.for(current_user)
40
- end
41
-
42
- def participatory_process
43
- @participatory_process ||= collection.find(params[:participatory_process_id])
37
+ @collection ||= Decidim::ParticipatoryProcessesWithUserRole.for(current_user, :admin)
44
38
  end
45
39
  end
46
40
  end
@@ -10,9 +10,9 @@ module Decidim
10
10
  include Concerns::ParticipatoryProcessAdmin
11
11
 
12
12
  def create
13
- authorize! :publish, participatory_process
13
+ authorize! :publish, current_participatory_process
14
14
 
15
- PublishParticipatoryProcess.call(participatory_process) do
15
+ PublishParticipatoryProcess.call(current_participatory_process) do
16
16
  on(:ok) do
17
17
  flash[:notice] = I18n.t("participatory_process_publications.create.success", scope: "decidim.admin")
18
18
  end
@@ -26,9 +26,9 @@ module Decidim
26
26
  end
27
27
 
28
28
  def destroy
29
- authorize! :publish, participatory_process
29
+ authorize! :publish, current_participatory_process
30
30
 
31
- UnpublishParticipatoryProcess.call(participatory_process) do
31
+ UnpublishParticipatoryProcess.call(current_participatory_process) do
32
32
  on(:ok) do
33
33
  flash[:notice] = I18n.t("participatory_process_publications.destroy.success", scope: "decidim.admin")
34
34
  end
@@ -21,7 +21,7 @@ module Decidim
21
21
  flash.now[:alert] = I18n.t("participatory_process_step_activations.create.error", scope: "decidim.admin")
22
22
  end
23
23
 
24
- redirect_to participatory_process_steps_path(participatory_process)
24
+ redirect_to participatory_process_steps_path(current_participatory_process)
25
25
  end
26
26
  end
27
27
 
@@ -32,7 +32,7 @@ module Decidim
32
32
  end
33
33
 
34
34
  def collection
35
- participatory_process.steps
35
+ current_participatory_process.steps
36
36
  end
37
37
  end
38
38
  end
@@ -14,7 +14,7 @@ module Decidim
14
14
  ReorderParticipatoryProcessSteps.call(collection, params[:items_ids]) do
15
15
  on(:invalid) do
16
16
  flash.now[:alert] = I18n.t("participatory_process_steps.ordering.error", scope: "decidim.admin")
17
- redirect_to participatory_process_path(participatory_process)
17
+ redirect_to participatory_process_path(current_participatory_process)
18
18
  end
19
19
  end
20
20
  end
@@ -22,7 +22,7 @@ module Decidim
22
22
  private
23
23
 
24
24
  def collection
25
- participatory_process.steps
25
+ current_participatory_process.steps
26
26
  end
27
27
  end
28
28
  end
@@ -22,10 +22,10 @@ module Decidim
22
22
  authorize! :create, Decidim::ParticipatoryProcessStep
23
23
  @form = form(ParticipatoryProcessStepForm).from_params(params)
24
24
 
25
- CreateParticipatoryProcessStep.call(@form, participatory_process) do
25
+ CreateParticipatoryProcessStep.call(@form, current_participatory_process) do
26
26
  on(:ok) do
27
27
  flash[:notice] = I18n.t("participatory_process_steps.create.success", scope: "decidim.admin")
28
- redirect_to participatory_process_steps_path(participatory_process)
28
+ redirect_to participatory_process_steps_path(current_participatory_process)
29
29
  end
30
30
 
31
31
  on(:invalid) do
@@ -49,7 +49,7 @@ module Decidim
49
49
  UpdateParticipatoryProcessStep.call(@participatory_process_step, @form) do
50
50
  on(:ok) do
51
51
  flash[:notice] = I18n.t("participatory_process_steps.update.success", scope: "decidim.admin")
52
- redirect_to participatory_process_steps_path(participatory_process)
52
+ redirect_to participatory_process_steps_path(current_participatory_process)
53
53
  end
54
54
 
55
55
  on(:invalid) do
@@ -71,12 +71,12 @@ module Decidim
71
71
  DestroyParticipatoryProcessStep.call(@participatory_process_step) do
72
72
  on(:ok) do
73
73
  flash[:notice] = I18n.t("participatory_process_steps.destroy.success", scope: "decidim.admin")
74
- redirect_to participatory_process_steps_path(participatory_process)
74
+ redirect_to participatory_process_steps_path(current_participatory_process)
75
75
  end
76
76
 
77
77
  on(:invalid) do |reason|
78
78
  flash[:alert] = I18n.t("participatory_process_steps.destroy.error.#{reason}", scope: "decidim.admin")
79
- redirect_to participatory_process_steps_path(participatory_process)
79
+ redirect_to participatory_process_steps_path(current_participatory_process)
80
80
  end
81
81
  end
82
82
  end
@@ -84,7 +84,7 @@ module Decidim
84
84
  private
85
85
 
86
86
  def collection
87
- @collection ||= participatory_process.steps
87
+ @collection ||= current_participatory_process.steps
88
88
  end
89
89
  end
90
90
  end
@@ -9,22 +9,21 @@ module Decidim
9
9
  class ParticipatoryProcessUserRolesController < ApplicationController
10
10
  include Concerns::ParticipatoryProcessAdmin
11
11
 
12
- helper_method :participatory_process, :process_admin_roles
13
-
14
12
  def index
15
- authorize! :read, Decidim::Admin::ParticipatoryProcessUserRole
13
+ authorize! :read, Decidim::ParticipatoryProcessUserRole
14
+ @participatory_process_user_roles = collection
16
15
  end
17
16
 
18
17
  def new
19
- authorize! :create, Decidim::Admin::ParticipatoryProcessUserRole
18
+ authorize! :create, Decidim::ParticipatoryProcessUserRole
20
19
  @form = form(ParticipatoryProcessUserRoleForm).instance
21
20
  end
22
21
 
23
22
  def create
24
- authorize! :create, Decidim::Admin::ParticipatoryProcessUserRole
23
+ authorize! :create, Decidim::ParticipatoryProcessUserRole
25
24
  @form = form(ParticipatoryProcessUserRoleForm).from_params(params)
26
25
 
27
- CreateParticipatoryProcessAdmin.call(@form, current_user, participatory_process) do
26
+ CreateParticipatoryProcessAdmin.call(@form, current_user, current_participatory_process) do
28
27
  on(:ok) do
29
28
  flash[:notice] = I18n.t("participatory_process_user_roles.create.success", scope: "decidim.admin")
30
29
  end
@@ -32,14 +31,14 @@ module Decidim
32
31
  on(:invalid) do
33
32
  flash[:alert] = I18n.t("participatory_process_user_roles.create.error", scope: "decidim.admin")
34
33
  end
35
- redirect_to participatory_process_user_roles_path(participatory_process)
34
+ redirect_to participatory_process_user_roles_path(current_participatory_process)
36
35
  end
37
36
  end
38
37
 
39
38
  def edit
40
39
  @user_role = collection.find(params[:id])
41
40
  authorize! :update, @user_role
42
- @form = form(ParticipatoryProcessUserRoleForm).from_model(@user_role.user, current_process: participatory_process)
41
+ @form = form(ParticipatoryProcessUserRoleForm).from_model(@user_role.user, current_process: current_participatory_process)
43
42
  end
44
43
 
45
44
  def update
@@ -50,7 +49,7 @@ module Decidim
50
49
  UpdateParticipatoryProcessAdmin.call(@form, @user_role) do
51
50
  on(:ok) do
52
51
  flash[:notice] = I18n.t("participatory_process_user_roles.update.success", scope: "decidim.admin")
53
- redirect_to participatory_process_user_roles_path(participatory_process)
52
+ redirect_to participatory_process_user_roles_path(current_participatory_process)
54
53
  end
55
54
 
56
55
  on(:invalid) do
@@ -84,17 +83,16 @@ module Decidim
84
83
  end
85
84
  end
86
85
 
87
- redirect_to participatory_process_user_roles_path(participatory_process)
86
+ redirect_to participatory_process_user_roles_path(current_participatory_process)
88
87
  end
89
88
 
90
89
  private
91
90
 
92
91
  def collection
93
- @collection ||= ProcessAdminRolesForProcess.for(participatory_process)
94
- end
95
-
96
- def process_admin_roles
97
- @process_admin_roles ||= ProcessAdminRolesForProcess.for(@participatory_process)
92
+ @collection ||= Decidim::ParticipatoryProcessUserRole
93
+ .includes(:user)
94
+ .where(participatory_process: current_participatory_process)
95
+ .order(:role, "decidim_users.name")
98
96
  end
99
97
  end
100
98
  end