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.
- checksums.yaml +4 -4
- data/app/assets/stylesheets/decidim/admin/_variables.scss +2 -0
- data/app/assets/stylesheets/decidim/admin/extra/_cards.scss +6 -0
- data/app/assets/stylesheets/decidim/admin/modules/_typography.scss +4 -0
- data/app/commands/decidim/admin/create_participatory_process_admin.rb +3 -5
- data/app/constraints/decidim/admin/organization_dashboard_constraint.rb +1 -1
- data/app/controllers/decidim/admin/application_controller.rb +1 -1
- data/app/controllers/decidim/admin/categories_controller.rb +9 -9
- data/app/controllers/decidim/admin/concerns/participatory_process_admin.rb +1 -8
- data/app/controllers/decidim/admin/exports_controller.rb +2 -2
- data/app/controllers/decidim/admin/feature_permissions_controller.rb +2 -2
- data/app/controllers/decidim/admin/features/base_controller.rb +0 -5
- data/app/controllers/decidim/admin/features_controller.rb +4 -4
- data/app/controllers/decidim/admin/moderations_controller.rb +1 -1
- data/app/controllers/decidim/admin/participatory_process_attachments_controller.rb +2 -2
- data/app/controllers/decidim/admin/participatory_process_copies_controller.rb +3 -9
- data/app/controllers/decidim/admin/participatory_process_publications_controller.rb +4 -4
- data/app/controllers/decidim/admin/participatory_process_step_activations_controller.rb +2 -2
- data/app/controllers/decidim/admin/participatory_process_step_ordering_controller.rb +2 -2
- data/app/controllers/decidim/admin/participatory_process_steps_controller.rb +6 -6
- data/app/controllers/decidim/admin/participatory_process_user_roles_controller.rb +13 -15
- data/app/controllers/decidim/admin/participatory_processes_controller.rb +16 -18
- data/app/controllers/decidim/admin/users_controller.rb +4 -4
- data/app/forms/decidim/admin/participatory_process_user_role_form.rb +2 -2
- data/app/models/decidim/admin/abilities/{admin_user.rb → admin_ability.rb} +3 -6
- data/app/models/decidim/admin/abilities/{base.rb → base_ability.rb} +1 -4
- data/app/models/decidim/admin/abilities/{participatory_process_admin.rb → participatory_process_admin_ability.rb} +18 -28
- data/app/models/decidim/admin/abilities/participatory_process_collaborator_ability.rb +19 -0
- data/app/models/decidim/admin/abilities/participatory_process_moderator_ability.rb +23 -0
- data/app/queries/decidim/admin/process_admins.rb +1 -1
- data/app/views/decidim/admin/categories/index.html.erb +9 -9
- data/app/views/decidim/admin/categories/new.html.erb +1 -1
- data/app/views/decidim/admin/features/_form.html.erb +1 -1
- data/app/views/decidim/admin/features/edit.html.erb +1 -1
- data/app/views/decidim/admin/features/new.html.erb +1 -1
- data/app/views/decidim/admin/participatory_process_copies/new.html.erb +1 -1
- data/app/views/decidim/admin/participatory_process_groups/index.html.erb +5 -1
- data/app/views/decidim/admin/participatory_process_steps/index.html.erb +9 -9
- data/app/views/decidim/admin/participatory_process_user_roles/index.html.erb +6 -6
- data/app/views/decidim/admin/participatory_processes/edit.html.erb +6 -6
- data/app/views/decidim/admin/participatory_processes/index.html.erb +11 -1
- data/app/views/layouts/decidim/admin/participatory_process.html.erb +18 -18
- data/config/locales/ca.yml +4 -3
- data/config/locales/en.yml +1 -0
- data/config/locales/es.yml +1 -2
- data/db/migrate/20170714083651_rename_participatory_process_user_roles_table.rb +7 -0
- data/lib/decidim/admin/engine.rb +8 -6
- data/lib/decidim/admin/test/factories.rb +1 -1
- metadata +12 -14
- data/app/models/decidim/admin/abilities/collaborator_user.rb +0 -20
- data/app/models/decidim/admin/participatory_process_user_role.rb +0 -15
- data/app/queries/decidim/admin/manageable_participatory_processes_for_user.rb +0 -42
- data/app/queries/decidim/admin/process_admin_roles_for_process.rb +0 -36
- 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
|
-
|
42
|
-
|
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
|
-
|
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(
|
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
|
-
|
67
|
-
authorize! :read, @participatory_process
|
64
|
+
authorize! :read, current_participatory_process
|
68
65
|
end
|
69
66
|
|
70
67
|
def destroy
|
71
|
-
|
72
|
-
|
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
|
-
|
77
|
+
authorize! :create, Decidim::ParticipatoryProcess
|
82
78
|
end
|
83
79
|
|
84
|
-
|
80
|
+
def current_participatory_process
|
81
|
+
@current_participatory_process ||= collection.find(params[:id]) if params[:id]
|
82
|
+
end
|
85
83
|
|
86
|
-
|
84
|
+
private
|
87
85
|
|
88
86
|
def collection
|
89
|
-
@collection ||=
|
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:
|
96
|
-
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(
|
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
|
-
|
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(
|
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
|
-
|
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::
|
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
|
9
|
-
|
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
|
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
|
13
|
-
|
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
|
-
|
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
|
-
|
24
|
+
def define_participatory_process_abilities
|
25
|
+
super
|
32
26
|
|
33
|
-
can :manage,
|
34
|
-
|
27
|
+
can :manage, Feature do |feature|
|
28
|
+
can_manage_process?(feature.participatory_process)
|
35
29
|
end
|
36
30
|
|
37
|
-
can :manage,
|
38
|
-
|
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
|
-
|
36
|
+
attachment.attached_to.is_a?(Decidim::ParticipatoryProcess) && can_manage_process?(attachment.attached_to)
|
43
37
|
end
|
44
38
|
|
45
|
-
can :manage,
|
46
|
-
|
39
|
+
can :manage, ParticipatoryProcessUserRole do |role|
|
40
|
+
can_manage_process?(role.participatory_process) && role.user != @user
|
47
41
|
end
|
48
42
|
|
49
|
-
can :manage,
|
50
|
-
|
43
|
+
can :manage, Moderation do |moderation|
|
44
|
+
can_manage_process?(moderation.participatory_process)
|
51
45
|
end
|
52
46
|
|
53
|
-
can :manage,
|
54
|
-
|
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
|
@@ -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(
|
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
|
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
|
-
<%
|
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(
|
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(
|
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(
|
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(
|
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(
|
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(
|
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(
|
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
|
-
<%
|
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([
|
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([
|
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(
|
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
|
-
|
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(
|
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
|
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(
|
24
|
-
<%
|
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(
|
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(
|
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(
|
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(
|
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>
|