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
@@ -7,8 +7,8 @@ module Decidim
7
7
  # Controller that allows managing participatory processes.
8
8
  #
9
9
  class ParticipatoryProcessesController < ApplicationController
10
- helper_method :participatory_process
11
10
  helper Decidim::OrganizationScopesHelper
11
+ helper_method :current_participatory_process
12
12
 
13
13
  def index
14
14
  authorize! :index, Decidim::ParticipatoryProcess
@@ -38,18 +38,16 @@ module Decidim
38
38
  end
39
39
 
40
40
  def edit
41
- @participatory_process = collection.find(params[:id])
42
- authorize! :update, @participatory_process
43
- @form = form(ParticipatoryProcessForm).from_model(@participatory_process)
41
+ authorize! :update, current_participatory_process
42
+ @form = form(ParticipatoryProcessForm).from_model(current_participatory_process)
44
43
  render layout: "decidim/admin/participatory_process"
45
44
  end
46
45
 
47
46
  def update
48
- @participatory_process = collection.find(params[:id])
49
- authorize! :update, @participatory_process
47
+ authorize! :update, current_participatory_process
50
48
  @form = form(ParticipatoryProcessForm).from_params(participatory_process_params)
51
49
 
52
- UpdateParticipatoryProcess.call(@participatory_process, @form) do
50
+ UpdateParticipatoryProcess.call(current_participatory_process, @form) do
53
51
  on(:ok) do |participatory_process|
54
52
  flash[:notice] = I18n.t("participatory_processes.update.success", scope: "decidim.admin")
55
53
  redirect_to edit_participatory_process_path(participatory_process)
@@ -63,14 +61,12 @@ module Decidim
63
61
  end
64
62
 
65
63
  def show
66
- @participatory_process = collection.find(params[:id])
67
- authorize! :read, @participatory_process
64
+ authorize! :read, current_participatory_process
68
65
  end
69
66
 
70
67
  def destroy
71
- @participatory_process = collection.find(params[:id])
72
- authorize! :destroy, @participatory_process
73
- @participatory_process.destroy!
68
+ authorize! :destroy, current_participatory_process
69
+ current_participatory_process.destroy!
74
70
 
75
71
  flash[:notice] = I18n.t("participatory_processes.destroy.success", scope: "decidim.admin")
76
72
 
@@ -78,22 +74,24 @@ module Decidim
78
74
  end
79
75
 
80
76
  def copy
81
- @participatory_process ||= collection.find(params[:id])
77
+ authorize! :create, Decidim::ParticipatoryProcess
82
78
  end
83
79
 
84
- private
80
+ def current_participatory_process
81
+ @current_participatory_process ||= collection.find(params[:id]) if params[:id]
82
+ end
85
83
 
86
- attr_reader :participatory_process
84
+ private
87
85
 
88
86
  def collection
89
- @collection ||= ManageableParticipatoryProcessesForUser.for(current_user)
87
+ @collection ||= Decidim::ParticipatoryProcessesWithUserRole.for(current_user)
90
88
  end
91
89
 
92
90
  def participatory_process_params
93
91
  {
94
92
  id: params[:id],
95
- hero_image: @participatory_process.hero_image,
96
- banner_image: @participatory_process.banner_image
93
+ hero_image: current_participatory_process.hero_image,
94
+ banner_image: current_participatory_process.banner_image
97
95
  }.merge(params[:participatory_process].to_unsafe_h)
98
96
  end
99
97
  end
@@ -14,7 +14,7 @@ module Decidim
14
14
 
15
15
  def new
16
16
  authorize! :new, :admin_users
17
- @form = form(InviteAdminForm).instance
17
+ @form = form(InviteUserForm).instance
18
18
  end
19
19
 
20
20
  def create
@@ -23,13 +23,13 @@ module Decidim
23
23
  default_params = {
24
24
  organization: current_organization,
25
25
  invitation_instructions: "invite_admin",
26
- roles: %w(admin),
26
+ admin: true,
27
27
  invited_by: current_user,
28
28
  comments_notifications: true,
29
29
  replies_notifications: true
30
30
  }
31
31
 
32
- @form = form(InviteAdminForm).from_params(params.merge(default_params))
32
+ @form = form(InviteUserForm).from_params(params.merge(default_params))
33
33
 
34
34
  InviteUser.call(@form) do
35
35
  on(:ok) do
@@ -63,7 +63,7 @@ module Decidim
63
63
  def destroy
64
64
  authorize! :destroy, :admin_users
65
65
 
66
- RemoveUserRole.call(user, "admin") do
66
+ RemoveAdmin.call(user) do
67
67
  on(:ok) do
68
68
  flash[:notice] = I18n.t("users.destroy.success", scope: "decidim.admin")
69
69
  end
@@ -14,10 +14,10 @@ module Decidim
14
14
 
15
15
  validates :email, :role, presence: true
16
16
  validates :name, presence: true
17
- validates :role, inclusion: { in: ParticipatoryProcessUserRole::ROLES }
17
+ validates :role, inclusion: { in: Decidim::ParticipatoryProcessUserRole::ROLES }
18
18
 
19
19
  def roles
20
- Decidim::Admin::ParticipatoryProcessUserRole::ROLES.map do |role|
20
+ Decidim::ParticipatoryProcessUserRole::ROLES.map do |role|
21
21
  [
22
22
  I18n.t(role, scope: "decidim.admin.models.participatory_process_user_role.roles"),
23
23
  role
@@ -5,11 +5,9 @@ module Decidim
5
5
  module Abilities
6
6
  # Defines the abilities for a user in the admin section. Intended to be
7
7
  # used with `cancancan`.
8
- class AdminUser
9
- include CanCan::Ability
10
-
11
- def initialize(user, _context)
12
- return unless user && user.role?(:admin)
8
+ class AdminAbility < Decidim::Abilities::AdminAbility
9
+ def define_abilities
10
+ super
13
11
 
14
12
  can :manage, ParticipatoryProcess
15
13
  can :manage, ParticipatoryProcessGroup
@@ -27,7 +25,6 @@ module Decidim
27
25
  end
28
26
 
29
27
  can :manage, Feature
30
- can :read, :admin_dashboard
31
28
  can :manage, :admin_users
32
29
  can :manage, Moderation
33
30
  can :manage, Attachment
@@ -7,13 +7,10 @@ module Decidim
7
7
  # used with `cancancan`. Extended by both the base `Decidim::Ability`
8
8
  # class and other engine-only abilities, like the
9
9
  # `ParticipatoryProcessAdmin` ability class.
10
- class Base
10
+ class BaseAbility
11
11
  include CanCan::Ability
12
12
 
13
13
  def initialize(user, context)
14
- merge ::Decidim::Ability.new(user, context)
15
- merge ParticipatoryProcessAdmin.new(user, context)
16
-
17
14
  Decidim.admin_abilities.each do |ability|
18
15
  merge ability.constantize.new(user, context)
19
16
  end
@@ -9,55 +9,45 @@ module Decidim
9
9
  # Admin engine.
10
10
  #
11
11
  # This ability will not apply to organization admins.
12
- class ParticipatoryProcessAdmin
13
- include CanCan::Ability
14
-
15
- def initialize(user, _context)
16
- @user = user
17
-
18
- return unless user && !user.role?(:admin) && !user.role?(:collaborator)
19
-
20
- can :read, :admin_dashboard do
21
- participatory_processes.any?
22
- end
12
+ class ParticipatoryProcessAdminAbility < Decidim::Abilities::ParticipatoryProcessAdminAbility
13
+ def define_abilities
14
+ super
23
15
 
24
16
  can :manage, ParticipatoryProcess do |process|
25
- participatory_processes.include?(process)
17
+ can_manage_process?(process)
26
18
  end
27
19
 
28
20
  cannot :create, ParticipatoryProcess
29
21
  cannot :destroy, ParticipatoryProcess
22
+ end
30
23
 
31
- cannot :manage, :admin_users
24
+ def define_participatory_process_abilities
25
+ super
32
26
 
33
- can :manage, ParticipatoryProcessUserRole do |role|
34
- role.user != user
27
+ can :manage, Feature do |feature|
28
+ can_manage_process?(feature.participatory_process)
35
29
  end
36
30
 
37
- can :manage, Moderation do |moderation|
38
- participatory_processes.include?(moderation.participatory_process)
31
+ can :manage, Category do |category|
32
+ can_manage_process?(category.participatory_process)
39
33
  end
40
34
 
41
35
  can :manage, Attachment do |attachment|
42
- participatory_processes.include?(attachment.attached_to)
36
+ attachment.attached_to.is_a?(Decidim::ParticipatoryProcess) && can_manage_process?(attachment.attached_to)
43
37
  end
44
38
 
45
- can :manage, ParticipatoryProcessStep do |step|
46
- participatory_processes.include?(step.participatory_process)
39
+ can :manage, ParticipatoryProcessUserRole do |role|
40
+ can_manage_process?(role.participatory_process) && role.user != @user
47
41
  end
48
42
 
49
- can :manage, Feature do |feature|
50
- participatory_processes.include?(feature.participatory_process)
43
+ can :manage, Moderation do |moderation|
44
+ can_manage_process?(moderation.participatory_process)
51
45
  end
52
46
 
53
- can :manage, Category do |category|
54
- participatory_processes.include?(category.participatory_process)
47
+ can :manage, ParticipatoryProcessStep do |step|
48
+ can_manage_process?(step.participatory_process)
55
49
  end
56
50
  end
57
-
58
- def participatory_processes
59
- @participatory_processes ||= ManageableParticipatoryProcessesForUser.for(@user)
60
- end
61
51
  end
62
52
  end
63
53
  end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decidim
4
+ module Admin
5
+ module Abilities
6
+ # Defines the abilities for a collaborator user in the admin
7
+ # section. Intended to be used with `cancancan`.
8
+ class ParticipatoryProcessCollaboratorAbility < Decidim::Abilities::ParticipatoryProcessCollaboratorAbility
9
+ def define_abilities
10
+ super
11
+
12
+ can [:read, :preview], ParticipatoryProcess do |process|
13
+ can_manage_process?(process)
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decidim
4
+ module Admin
5
+ module Abilities
6
+ # Defines the abilities for a moderator user in the admin
7
+ # section. Intended to be used with `cancancan`.
8
+ class ParticipatoryProcessModeratorAbility < Decidim::Abilities::ParticipatoryProcessModeratorAbility
9
+ def define_abilities
10
+ super
11
+
12
+ can [:read], ParticipatoryProcess do |process|
13
+ can_manage_process?(process)
14
+ end
15
+
16
+ can :manage, Moderation do |moderation|
17
+ can_manage_process?(moderation.participatory_process)
18
+ end
19
+ end
20
+ end
21
+ end
22
+ end
23
+ end
@@ -35,7 +35,7 @@ module Decidim
35
35
  end
36
36
 
37
37
  def process_admins
38
- Decidim::Admin::ParticipatoryProcessUserRole
38
+ Decidim::ParticipatoryProcessUserRole
39
39
  .where(participatory_process: process, role: :admin)
40
40
  .pluck(:decidim_user_id)
41
41
  end
@@ -3,13 +3,13 @@
3
3
  <h2 class='card-title'>
4
4
  <%= t(".categories_title", scope: "decidim.admin") %>
5
5
  <% if can? :create, Decidim::Category %>
6
- <%= link_to t("actions.new", scope: "decidim.admin", name: t("models.category.name", scope: "decidim.admin")), new_participatory_process_category_path(participatory_process), class: 'button tiny button--title new' %>
6
+ <%= link_to t("actions.new", scope: "decidim.admin", name: t("models.category.name", scope: "decidim.admin")), new_participatory_process_category_path(current_participatory_process), class: 'button tiny button--title new' %>
7
7
  <% end %>
8
8
  </h2>
9
9
  </div>
10
10
 
11
11
  <div class="card-section">
12
- <% if participatory_process.categories.any? %>
12
+ <% if current_participatory_process.categories.any? %>
13
13
  <div class="table-scroll">
14
14
  <table class="table-list">
15
15
  <thead>
@@ -19,19 +19,19 @@
19
19
  </tr>
20
20
  </thead>
21
21
  <tbody>
22
- <% participatory_process.categories.first_class.each do |category| %>
22
+ <% current_participatory_process.categories.first_class.each do |category| %>
23
23
  <tr>
24
24
  <td>
25
- <%= link_to translated_attribute(category.name), edit_participatory_process_category_path(participatory_process, category) %><br />
25
+ <%= link_to translated_attribute(category.name), edit_participatory_process_category_path(current_participatory_process, category) %><br />
26
26
  </td>
27
27
  <td class="table-list__actions">
28
28
  <% if can? :update, category %>
29
- <%= icon_link_to "pencil", edit_participatory_process_category_path(participatory_process, category), t("actions.edit", scope: "decidim.admin"), class: "action-icon--edit" %>
29
+ <%= icon_link_to "pencil", edit_participatory_process_category_path(current_participatory_process, category), t("actions.edit", scope: "decidim.admin"), class: "action-icon--edit" %>
30
30
  <% end %>
31
31
 
32
32
  <% if can? :destroy, category %>
33
33
  <% if category.unused? %>
34
- <%= icon_link_to "circle-x", participatory_process_category_path(participatory_process, category), t("actions.destroy", scope: "decidim.admin"), class: "action-icon--remove", method: :delete, data: { confirm: t("actions.confirm_destroy", scope: "decidim.admin") } %>
34
+ <%= icon_link_to "circle-x", participatory_process_category_path(current_participatory_process, category), t("actions.destroy", scope: "decidim.admin"), class: "action-icon--remove", method: :delete, data: { confirm: t("actions.confirm_destroy", scope: "decidim.admin") } %>
35
35
  <% else %>
36
36
  <span class="action-icon" title="<%= t('.category_used') %>" data-tooltip="true" data-disable-hover="false">
37
37
  <%= icon "circle-x", class: "action-icon action-icon--disabled" %>
@@ -43,15 +43,15 @@
43
43
  <% category.subcategories.each do |subcategory| %>
44
44
  <tr class="extra__table-list__subcategory">
45
45
  <td>
46
- <%= link_to translated_attribute(subcategory.name), edit_participatory_process_category_path(participatory_process, subcategory) %><br />
46
+ <%= link_to translated_attribute(subcategory.name), edit_participatory_process_category_path(current_participatory_process, subcategory) %><br />
47
47
  </td>
48
48
  <td class="table-list__actions">
49
49
  <% if can? :update, subcategory %>
50
- <%= icon_link_to "pencil", edit_participatory_process_category_path(participatory_process, subcategory), t("actions.edit", scope: "decidim.admin"), class: "action-icon--edit" %>
50
+ <%= icon_link_to "pencil", edit_participatory_process_category_path(current_participatory_process, subcategory), t("actions.edit", scope: "decidim.admin"), class: "action-icon--edit" %>
51
51
  <% end %>
52
52
 
53
53
  <% if can? :destroy, subcategory %>
54
- <%= icon_link_to "circle-x", participatory_process_category_path(participatory_process, subcategory), t("actions.destroy", scope: "decidim.admin"), class: "action-icon--remove", method: :delete, data: { confirm: t("actions.confirm_destroy", scope: "decidim.admin") } %>
54
+ <%= icon_link_to "circle-x", participatory_process_category_path(current_participatory_process, subcategory), t("actions.destroy", scope: "decidim.admin"), class: "action-icon--remove", method: :delete, data: { confirm: t("actions.confirm_destroy", scope: "decidim.admin") } %>
55
55
  <% end %>
56
56
  </td>
57
57
  </tr>
@@ -1,4 +1,4 @@
1
- <%= decidim_form_for(@form, url: participatory_process_categories_path(participatory_process), html: { class: "form new_participatory_process_category" }) do |f| %>
1
+ <%= decidim_form_for(@form, url: participatory_process_categories_path(current_participatory_process), html: { class: "form new_participatory_process_category" }) do |f| %>
2
2
  <%= render partial: 'form', object: f, locals: { title: t('.title') } %>
3
3
 
4
4
  <div class="button--double form-general-submit">
@@ -35,7 +35,7 @@
35
35
  <legend><%= t ".step_settings" %></legend>
36
36
  </div>
37
37
  <div class="card-section">
38
- <% participatory_process.steps.each do |step| %>
38
+ <% current_participatory_process.steps.each do |step| %>
39
39
  <fieldset class="step-settings-<%= step.id %>">
40
40
  <legend><%= step.position + 1 %>. <%= translated_attribute step.title %></legend>
41
41
  <% step_settings = form.object.step_settings[step.id.to_s] %>
@@ -1,4 +1,4 @@
1
- <%= decidim_form_for([participatory_process, @form], url: participatory_process_feature_path(participatory_process, @feature), method: "put", html: { class: "form edit_feature" }) do |form| %>
1
+ <%= decidim_form_for([current_participatory_process, @form], url: participatory_process_feature_path(current_participatory_process, @feature), method: "put", html: { class: "form edit_feature" }) do |form| %>
2
2
  <%= render partial: 'form', object: form, locals: { feature: @feature, title: t(".title", name: t("#{@feature.manifest.name}.name", scope: "decidim.features"))} %>
3
3
 
4
4
  <div class="button--double form-general-submit">
@@ -1,5 +1,5 @@
1
1
 
2
- <%= decidim_form_for([participatory_process, @form], url: participatory_process_features_path(type: params[:type]), method: "post", html: { class: "form new_feature" }) do |form| %>
2
+ <%= decidim_form_for([current_participatory_process, @form], url: participatory_process_features_path(type: params[:type]), method: "post", html: { class: "form new_feature" }) do |form| %>
3
3
  <%= render partial: 'form', object: form, locals: { feature: @feature, title: t(".title", name: t("#{manifest.name}.name", scope: "decidim.features"))} %>
4
4
 
5
5
  <div class="button--double form-general-submit">
@@ -1,4 +1,4 @@
1
- <%= decidim_form_for(@form, url: participatory_process_copies_path(participatory_process), method: :post, html: { class: "form copy_participatory_process" }) do |f| %>
1
+ <%= decidim_form_for(@form, url: participatory_process_copies_path(current_participatory_process), method: :post, html: { class: "form copy_participatory_process" }) do |f| %>
2
2
  <%= render partial: 'form', object: f, locals: { title: t('.title'), select: t('.select')} %>
3
3
 
4
4
  <div class="button--double form-general-submit">
@@ -18,7 +18,11 @@
18
18
  <% collection.each do |group| %>
19
19
  <tr>
20
20
  <td>
21
- <%= link_to translated_attribute(group.name), ['edit', group] %><br />
21
+ <% if can? :update, group %>
22
+ <%= link_to translated_attribute(group.name), ['edit', group] %><br />
23
+ <% else %>
24
+ <%= translated_attribute(group.name) %>
25
+ <% end %>
22
26
  </td>
23
27
  <td class="table-list__actions">
24
28
  <% if can? :update, group %>
@@ -3,14 +3,14 @@
3
3
  <h2 class="card-title">
4
4
  <%= t(".steps_title", scope: "decidim.admin") %>
5
5
  <% if can? :create, Decidim::ParticipatoryProcessStep %>
6
- <%= link_to t("actions.new", scope: "decidim.admin", name: t("models.participatory_process_step.name", scope: "decidim.admin")), new_participatory_process_step_path(participatory_process), class: 'button tiny button--title' %>
6
+ <%= link_to t("actions.new", scope: "decidim.admin", name: t("models.participatory_process_step.name", scope: "decidim.admin")), new_participatory_process_step_path(current_participatory_process), class: 'button tiny button--title' %>
7
7
  <% end %>
8
8
  </h2>
9
9
  </div>
10
10
 
11
11
  <div class="card-section">
12
12
  <div class="table-scroll">
13
- <% if participatory_process.steps.any? %>
13
+ <% if current_participatory_process.steps.any? %>
14
14
  <table class="table-list">
15
15
  <thead>
16
16
  <tr>
@@ -20,15 +20,15 @@
20
20
  <th class="actions"></th>
21
21
  </tr>
22
22
  </thead>
23
- <tbody class="sortable" data-sort-url="<%= ordering_participatory_process_steps_path(participatory_process) %>">
24
- <% participatory_process.steps.each do |step| %>
23
+ <tbody class="sortable" data-sort-url="<%= ordering_participatory_process_steps_path(current_participatory_process) %>">
24
+ <% current_participatory_process.steps.each do |step| %>
25
25
  <tr data-id="<%= step.id %>">
26
26
  <td>
27
- <span class="table-list__actions"><%= icon("move", class: "action-icon") %></span>
27
+ <span class="table-list__actions"><%= icon("move", class: "action-icon") %></span>
28
28
  <% if step.active? %>
29
29
  <span class="icon-active"></span>
30
30
  <% end %>
31
- <%= link_to translated_attribute(step.title), edit_participatory_process_step_path(participatory_process, step) %><br />
31
+ <%= link_to translated_attribute(step.title), edit_participatory_process_step_path(current_participatory_process, step) %><br />
32
32
  </td>
33
33
  <td>
34
34
  <% if step.start_date %>
@@ -42,15 +42,15 @@
42
42
  </td>
43
43
  <td class="table-list__actions">
44
44
  <% if can?(:activate, step) && !step.active? %>
45
- <%= icon_link_to "circle-check", participatory_process_step_activate_path(participatory_process, step), t("actions.activate", scope: "decidim.admin"), class: "action-icon--activate", method: :post %>
45
+ <%= icon_link_to "circle-check", participatory_process_step_activate_path(current_participatory_process, step), t("actions.activate", scope: "decidim.admin"), class: "action-icon--activate", method: :post %>
46
46
  <% end %>
47
47
 
48
48
  <% if can? :update, step %>
49
- <%= icon_link_to "pencil", edit_participatory_process_step_path(participatory_process, step), t("actions.edit", scope: "decidim.admin"), class: "action-icon--edit" %>
49
+ <%= icon_link_to "pencil", edit_participatory_process_step_path(current_participatory_process, step), t("actions.edit", scope: "decidim.admin"), class: "action-icon--edit" %>
50
50
  <% end %>
51
51
 
52
52
  <% if can? :destroy, step %>
53
- <%= icon_link_to "circle-x", participatory_process_step_path(participatory_process, step), t("actions.destroy", scope: "decidim.admin"), class: "action-icon--remove", method: :delete, data: { confirm: t("actions.confirm_destroy", scope: "decidim.admin") } %>
53
+ <%= icon_link_to "circle-x", participatory_process_step_path(current_participatory_process, step), t("actions.destroy", scope: "decidim.admin"), class: "action-icon--remove", method: :delete, data: { confirm: t("actions.confirm_destroy", scope: "decidim.admin") } %>
54
54
  <% end %>
55
55
  </td>
56
56
  </tr>