decidim-admin 0.5.1 → 0.6.0

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 (113) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +0 -7
  3. data/app/assets/javascripts/decidim/admin/application.js.es6 +0 -1
  4. data/app/assets/stylesheets/decidim/admin/extra/_quill.scss +5 -0
  5. data/app/commands/decidim/admin/create_category.rb +4 -4
  6. data/app/commands/decidim/admin/create_feature.rb +7 -7
  7. data/app/commands/decidim/admin/create_managed_user.rb +0 -2
  8. data/app/commands/decidim/admin/update_organization.rb +1 -0
  9. data/app/controllers/decidim/admin/application_controller.rb +0 -2
  10. data/app/controllers/decidim/admin/categories_controller.rb +10 -10
  11. data/app/controllers/decidim/admin/exports_controller.rb +1 -2
  12. data/app/controllers/decidim/admin/feature_permissions_controller.rb +2 -3
  13. data/app/controllers/decidim/admin/features/base_controller.rb +9 -3
  14. data/app/controllers/decidim/admin/features_controller.rb +5 -7
  15. data/app/controllers/decidim/admin/moderations_controller.rb +5 -7
  16. data/app/controllers/decidim/admin/scopes_controller.rb +12 -10
  17. data/app/controllers/decidim/admin/users_controller.rb +1 -3
  18. data/app/forms/decidim/admin/category_form.rb +2 -2
  19. data/app/forms/decidim/admin/feature_form.rb +1 -18
  20. data/app/forms/decidim/admin/organization_form.rb +1 -0
  21. data/app/helpers/decidim/admin/exports_helper.rb +10 -0
  22. data/app/models/decidim/admin/abilities/admin_ability.rb +0 -3
  23. data/app/models/decidim/admin/abilities/participatory_process_admin_ability.rb +3 -3
  24. data/app/views/decidim/admin/attachments/edit.html.erb +1 -1
  25. data/app/views/decidim/admin/attachments/new.html.erb +1 -1
  26. data/app/views/decidim/admin/categories/edit.html.erb +2 -2
  27. data/app/views/decidim/admin/categories/index.html.erb +11 -11
  28. data/app/views/decidim/admin/categories/new.html.erb +3 -3
  29. data/app/views/decidim/admin/categories/show.html.erb +2 -2
  30. data/app/views/decidim/admin/exports/_dropdown.html.erb +1 -1
  31. data/app/views/decidim/admin/features/_form.html.erb +15 -15
  32. data/app/views/decidim/admin/features/edit.html.erb +1 -1
  33. data/app/views/decidim/admin/features/new.html.erb +1 -1
  34. data/app/views/decidim/admin/moderations/index.html.erb +2 -2
  35. data/app/views/decidim/admin/organization/_form.html.erb +5 -0
  36. data/app/views/decidim/admin/users/index.html.erb +1 -1
  37. data/config/locales/ca.yml +8 -195
  38. data/config/locales/en.yml +6 -197
  39. data/config/locales/es.yml +11 -198
  40. data/config/locales/eu.yml +95 -208
  41. data/config/locales/fi.yml +168 -123
  42. data/config/locales/fr.yml +114 -191
  43. data/config/locales/it.yml +150 -168
  44. data/config/locales/nl.yml +443 -0
  45. data/config/locales/pl.yml +444 -0
  46. data/config/locales/uk.yml +451 -0
  47. data/config/routes.rb +2 -46
  48. data/lib/decidim/admin/engine.rb +0 -14
  49. data/lib/decidim/admin/test/commands/create_category_examples.rb +62 -0
  50. data/lib/decidim/admin/test/commands/destroy_category_examples.rb +46 -0
  51. data/lib/decidim/admin/test/commands/update_category_examples.rb +65 -0
  52. data/lib/decidim/admin/test/forms/category_form_examples.rb +90 -0
  53. data/lib/decidim/admin/test/manage_attachments_examples.rb +2 -2
  54. data/lib/decidim/admin/test/manage_feature_permissions_examples.rb +41 -0
  55. metadata +27 -64
  56. data/app/assets/javascripts/decidim/admin/participatory_processes.js.es6 +0 -12
  57. data/app/commands/decidim/admin/activate_participatory_process_step.rb +0 -44
  58. data/app/commands/decidim/admin/copy_participatory_process.rb +0 -113
  59. data/app/commands/decidim/admin/create_participatory_process.rb +0 -78
  60. data/app/commands/decidim/admin/create_participatory_process_admin.rb +0 -93
  61. data/app/commands/decidim/admin/create_participatory_process_group.rb +0 -55
  62. data/app/commands/decidim/admin/create_participatory_process_step.rb +0 -47
  63. data/app/commands/decidim/admin/deactivate_participatory_process_step.rb +0 -36
  64. data/app/commands/decidim/admin/destroy_participatory_process_step.rb +0 -44
  65. data/app/commands/decidim/admin/publish_participatory_process.rb +0 -32
  66. data/app/commands/decidim/admin/reorder_participatory_process_steps.rb +0 -52
  67. data/app/commands/decidim/admin/unpublish_participatory_process.rb +0 -32
  68. data/app/commands/decidim/admin/update_participatory_process.rb +0 -74
  69. data/app/commands/decidim/admin/update_participatory_process_admin.rb +0 -41
  70. data/app/commands/decidim/admin/update_participatory_process_group.rb +0 -58
  71. data/app/commands/decidim/admin/update_participatory_process_step.rb +0 -49
  72. data/app/controllers/decidim/admin/concerns/participatory_process_admin.rb +0 -20
  73. data/app/controllers/decidim/admin/participatory_process_attachments_controller.rb +0 -25
  74. data/app/controllers/decidim/admin/participatory_process_copies_controller.rb +0 -33
  75. data/app/controllers/decidim/admin/participatory_process_groups_controller.rb +0 -86
  76. data/app/controllers/decidim/admin/participatory_process_publications_controller.rb +0 -43
  77. data/app/controllers/decidim/admin/participatory_process_step_activations_controller.rb +0 -37
  78. data/app/controllers/decidim/admin/participatory_process_step_ordering_controller.rb +0 -27
  79. data/app/controllers/decidim/admin/participatory_process_steps_controller.rb +0 -89
  80. data/app/controllers/decidim/admin/participatory_process_user_roles_controller.rb +0 -97
  81. data/app/controllers/decidim/admin/participatory_processes_controller.rb +0 -96
  82. data/app/forms/decidim/admin/participatory_process_copy_form.rb +0 -33
  83. data/app/forms/decidim/admin/participatory_process_form.rb +0 -69
  84. data/app/forms/decidim/admin/participatory_process_group_form.rb +0 -24
  85. data/app/forms/decidim/admin/participatory_process_step_form.rb +0 -35
  86. data/app/forms/decidim/admin/participatory_process_user_role_form.rb +0 -29
  87. data/app/helpers/decidim/admin/process_groups_for_select_helper.rb +0 -21
  88. data/app/helpers/decidim/admin/processes_for_select_helper.rb +0 -23
  89. data/app/queries/decidim/admin/process_admins.rb +0 -44
  90. data/app/views/decidim/admin/participatory_process_copies/_form.html.erb +0 -38
  91. data/app/views/decidim/admin/participatory_process_copies/new.html.erb +0 -7
  92. data/app/views/decidim/admin/participatory_process_groups/_form.html.erb +0 -17
  93. data/app/views/decidim/admin/participatory_process_groups/edit.html.erb +0 -19
  94. data/app/views/decidim/admin/participatory_process_groups/index.html.erb +0 -44
  95. data/app/views/decidim/admin/participatory_process_groups/new.html.erb +0 -13
  96. data/app/views/decidim/admin/participatory_process_groups/show.html.erb +0 -23
  97. data/app/views/decidim/admin/participatory_process_steps/_form.html.erb +0 -25
  98. data/app/views/decidim/admin/participatory_process_steps/edit.html.erb +0 -8
  99. data/app/views/decidim/admin/participatory_process_steps/index.html.erb +0 -63
  100. data/app/views/decidim/admin/participatory_process_steps/new.html.erb +0 -7
  101. data/app/views/decidim/admin/participatory_process_steps/show.html.erb +0 -18
  102. data/app/views/decidim/admin/participatory_process_user_roles/_form.html.erb +0 -22
  103. data/app/views/decidim/admin/participatory_process_user_roles/edit.html.erb +0 -7
  104. data/app/views/decidim/admin/participatory_process_user_roles/index.html.erb +0 -65
  105. data/app/views/decidim/admin/participatory_process_user_roles/new.html.erb +0 -7
  106. data/app/views/decidim/admin/participatory_processes/_form.html.erb +0 -101
  107. data/app/views/decidim/admin/participatory_processes/edit.html.erb +0 -19
  108. data/app/views/decidim/admin/participatory_processes/index.html.erb +0 -66
  109. data/app/views/decidim/admin/participatory_processes/new.html.erb +0 -11
  110. data/app/views/layouts/decidim/admin/participatory_process.html.erb +0 -64
  111. data/app/views/layouts/decidim/admin/participatory_process_groups.html.erb +0 -14
  112. data/app/views/layouts/decidim/admin/participatory_processes.html.erb +0 -14
  113. data/config/i18n-tasks.yml +0 -132
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 612edd39b9ceea98757e9849835208686b212aed
4
- data.tar.gz: 775f0d302009035a3d1d91f1b857ebb84afffecf
3
+ metadata.gz: 2c04a5698dcc71c7bda864b3e2e1ad1dc71882b6
4
+ data.tar.gz: 806b372b8d5c035db984dcde250d9124eb5aa959
5
5
  SHA512:
6
- metadata.gz: 4c68dbac4e15f09abb37c9156bd601f7e89d3f46d8c31831cf8cfc3a8874225fafa7d8deaec3766e24a3bdc7f1912514b6c1963e6479e4c82b2be8f39772f445
7
- data.tar.gz: b1dcb942f19bc1aec661b7c4db5585b80f4a9383214b3017a3e076e8398f9f8063c250898b64e0bd411cebd7caf6cfa5b0dd4e2b3a840b0253c8103d90b21705
6
+ metadata.gz: e4e78726fdbeffba1faec39969af27b2be307b23d429106493a79ee324b7c57cc24a279ae715b4f47f0b7477ce898499d4ffdb53323e6a9391ed6615a12dd805
7
+ data.tar.gz: 56b59193bec6a7c7a189cbce4a465fa202653edc9320c85194d555deebbedac1452e3e0a62a8987666e3f0bbb5c6a1c156c21df5beb1ea4f3aa99348562c7739
data/README.md CHANGED
@@ -21,13 +21,6 @@ $ bundle
21
21
 
22
22
  ## Features
23
23
 
24
- ### Participatory process
25
-
26
- Here you can manage participatory processes.
27
-
28
- TODO: Elaborate on this.
29
-
30
-
31
24
  ### Static pages
32
25
 
33
26
  This feature allows an admin to create pages to serve static content. Some
@@ -10,7 +10,6 @@
10
10
  // = require moment.min
11
11
  // = require ./select2
12
12
  // = require ./scopes
13
- // = require ./participatory_processes
14
13
  // = require_self
15
14
 
16
15
  window.Decidim = window.Decidim || {};
@@ -0,0 +1,5 @@
1
+ .ql-disabled {
2
+ .ql-editor {
3
+ background: #eee;
4
+ }
5
+ }
@@ -8,11 +8,11 @@ module Decidim
8
8
  # Public: Initializes the command.
9
9
  #
10
10
  # form - A form object with the params.
11
- # participatory_process - The ParticipatoryProcess that will hold the
11
+ # participatory_space - The participatory space that will hold the
12
12
  # category
13
- def initialize(form, participatory_process)
13
+ def initialize(form, participatory_space)
14
14
  @form = form
15
- @participatory_process = participatory_process
15
+ @participatory_space = participatory_space
16
16
  end
17
17
 
18
18
  # Executes the command. Broadcasts these events:
@@ -37,7 +37,7 @@ module Decidim
37
37
  name: form.name,
38
38
  description: form.description,
39
39
  parent_id: form.parent_id,
40
- participatory_process: @participatory_process
40
+ participatory_space: @participatory_space
41
41
  )
42
42
  end
43
43
  end
@@ -4,17 +4,17 @@ module Decidim
4
4
  module Admin
5
5
  # This command gets called when a feature is created from the admin panel.
6
6
  class CreateFeature < Rectify::Command
7
- attr_reader :form, :manifest, :participatory_process
7
+ attr_reader :form, :manifest, :participatory_space
8
8
 
9
9
  # Public: Initializes the command.
10
10
  #
11
- # manifest - The feature's manifest to create a feature from.
12
- # form - The form from which the data in this feature comes from.
13
- # participatory_process - The participatory process that will hold this feature.
14
- def initialize(manifest, form, participatory_process)
11
+ # manifest - The feature's manifest to create a feature from.
12
+ # form - The form from which the data in this feature comes from.
13
+ # participatory_space - The participatory space that will hold this feature.
14
+ def initialize(manifest, form, participatory_space)
15
15
  @manifest = manifest
16
16
  @form = form
17
- @participatory_process = participatory_process
17
+ @participatory_space = participatory_space
18
18
  end
19
19
 
20
20
  # Public: Creates the Feature.
@@ -37,7 +37,7 @@ module Decidim
37
37
  @feature = Feature.create!(
38
38
  manifest_name: manifest.name,
39
39
  name: form.name,
40
- participatory_process: participatory_process,
40
+ participatory_space: participatory_space,
41
41
  settings: form.settings,
42
42
  default_step_settings: form.default_step_settings,
43
43
  step_settings: form.step_settings
@@ -39,8 +39,6 @@ module Decidim
39
39
  organization: form.current_organization,
40
40
  admin: false,
41
41
  managed: true,
42
- comments_notifications: true,
43
- replies_notifications: true,
44
42
  tos_agreement: true
45
43
  )
46
44
  end
@@ -65,6 +65,7 @@ module Decidim
65
65
  official_img_footer: form.official_img_footer,
66
66
  remove_official_img_footer: form.remove_official_img_footer,
67
67
  official_url: form.official_url,
68
+ header_snippets: form.header_snippets,
68
69
  show_statistics: form.show_statistics
69
70
  }
70
71
  end
@@ -13,8 +13,6 @@ module Decidim
13
13
  helper Decidim::Admin::ApplicationHelper
14
14
  helper Decidim::Admin::AttributesDisplayHelper
15
15
  helper Decidim::Admin::SettingsHelper
16
- helper Decidim::Admin::ProcessGroupsForSelectHelper
17
- helper Decidim::Admin::ProcessesForSelectHelper
18
16
  helper Decidim::Admin::IconLinkHelper
19
17
  helper Decidim::Admin::MenuHelper
20
18
  helper Decidim::Admin::ScopesHelper
@@ -5,7 +5,7 @@ module Decidim
5
5
  # Controller that allows managing categories.
6
6
  #
7
7
  class CategoriesController < Decidim::Admin::ApplicationController
8
- include Concerns::ParticipatoryProcessAdmin
8
+ helper_method :current_participatory_space
9
9
 
10
10
  def index
11
11
  authorize! :read, Decidim::Category
@@ -13,17 +13,17 @@ module Decidim
13
13
 
14
14
  def new
15
15
  authorize! :create, Decidim::Category
16
- @form = form(CategoryForm).from_params({}, current_process: current_participatory_process)
16
+ @form = form(CategoryForm).from_params({}, current_participatory_space: current_participatory_space)
17
17
  end
18
18
 
19
19
  def create
20
20
  authorize! :create, Decidim::Category
21
- @form = form(CategoryForm).from_params(params, current_process: current_participatory_process)
21
+ @form = form(CategoryForm).from_params(params, current_participatory_space: current_participatory_space)
22
22
 
23
- CreateCategory.call(@form, current_participatory_process) do
23
+ CreateCategory.call(@form, current_participatory_space) do
24
24
  on(:ok) do
25
25
  flash[:notice] = I18n.t("categories.create.success", scope: "decidim.admin")
26
- redirect_to categories_path(current_participatory_process)
26
+ redirect_to categories_path(current_participatory_space)
27
27
  end
28
28
 
29
29
  on(:invalid) do
@@ -36,18 +36,18 @@ module Decidim
36
36
  def edit
37
37
  @category = collection.find(params[:id])
38
38
  authorize! :update, @category
39
- @form = form(CategoryForm).from_model(@category, current_process: current_participatory_process)
39
+ @form = form(CategoryForm).from_model(@category, current_participatory_space: current_participatory_space)
40
40
  end
41
41
 
42
42
  def update
43
43
  @category = collection.find(params[:id])
44
44
  authorize! :update, @category
45
- @form = form(CategoryForm).from_params(params, current_process: current_participatory_process)
45
+ @form = form(CategoryForm).from_params(params, current_participatory_space: current_participatory_space)
46
46
 
47
47
  UpdateCategory.call(@category, @form) do
48
48
  on(:ok) do
49
49
  flash[:notice] = I18n.t("categories.update.success", scope: "decidim.admin")
50
- redirect_to categories_path(current_participatory_process)
50
+ redirect_to categories_path(current_participatory_space)
51
51
  end
52
52
 
53
53
  on(:invalid) do
@@ -75,14 +75,14 @@ module Decidim
75
75
  flash[:alert] = I18n.t("categories.destroy.error", scope: "decidim.admin")
76
76
  end
77
77
 
78
- redirect_back(fallback_location: categories_path(current_participatory_process))
78
+ redirect_back(fallback_location: categories_path(current_participatory_space))
79
79
  end
80
80
  end
81
81
 
82
82
  private
83
83
 
84
84
  def collection
85
- @collection ||= current_participatory_process.categories.includes(:subcategories)
85
+ @collection ||= current_participatory_space.categories.includes(:subcategories)
86
86
  end
87
87
  end
88
88
  end
@@ -4,7 +4,6 @@ module Decidim
4
4
  module Admin
5
5
  # This controller allows admins to manage proposals in a participatory process.
6
6
  class ExportsController < Decidim::Admin::ApplicationController
7
- include Concerns::ParticipatoryProcessAdmin
8
7
  include Decidim::FeaturePathHelper
9
8
 
10
9
  def create
@@ -25,7 +24,7 @@ module Decidim
25
24
  end
26
25
 
27
26
  def feature
28
- @feature ||= current_participatory_process.features.find(params[:feature_id])
27
+ @feature ||= current_participatory_space.features.find(params[:feature_id])
29
28
  end
30
29
  end
31
30
  end
@@ -5,7 +5,6 @@ module Decidim
5
5
  # Controller that allows managing feature permissions.
6
6
  #
7
7
  class FeaturePermissionsController < Decidim::Admin::ApplicationController
8
- include Concerns::ParticipatoryProcessAdmin
9
8
  helper_method :authorizations, :feature
10
9
 
11
10
  def edit
@@ -22,7 +21,7 @@ module Decidim
22
21
  UpdateFeaturePermissions.call(@permissions_form, feature) do
23
22
  on(:ok) do
24
23
  flash[:notice] = t("feature_permissions.update.success", scope: "decidim.admin")
25
- redirect_to features_path(current_participatory_process)
24
+ redirect_to features_path(current_participatory_space)
26
25
  end
27
26
 
28
27
  on(:invalid) do
@@ -51,7 +50,7 @@ module Decidim
51
50
  end
52
51
 
53
52
  def feature
54
- @feature ||= current_participatory_process.features.find(params[:feature_id])
53
+ @feature ||= current_participatory_space.features.find(params[:feature_id])
55
54
  end
56
55
  end
57
56
  end
@@ -7,16 +7,18 @@ module Decidim
7
7
  # controllers in their admin engines should inherit from.
8
8
  class BaseController < Admin::ApplicationController
9
9
  skip_authorize_resource
10
- include Concerns::ParticipatoryProcessAdmin
11
10
  include Settings
12
11
 
13
12
  helper Decidim::ResourceHelper
14
13
  helper Decidim::Admin::ExportsHelper
15
14
 
16
15
  helper_method :current_feature,
16
+ :current_participatory_space,
17
17
  :parent_path
18
18
 
19
- delegate :active_step, to: :current_participatory_process, prefix: false
19
+ before_action do
20
+ extend current_participatory_space.admin_extension_module
21
+ end
20
22
 
21
23
  before_action except: [:index, :show] do
22
24
  authorize! :manage, current_feature
@@ -30,8 +32,12 @@ module Decidim
30
32
  request.env["decidim.current_feature"]
31
33
  end
32
34
 
35
+ def current_participatory_space
36
+ current_feature.participatory_space
37
+ end
38
+
33
39
  def parent_path
34
- decidim_admin.features_path(current_participatory_process)
40
+ @parent_path ||= EngineRouter.admin_proxy(current_participatory_space).features_path
35
41
  end
36
42
  end
37
43
  end
@@ -6,14 +6,12 @@ module Decidim
6
6
  # admin panel.
7
7
  #
8
8
  class FeaturesController < Decidim::Admin::ApplicationController
9
- include Concerns::ParticipatoryProcessAdmin
10
-
11
- helper_method :manifest
9
+ helper_method :manifest, :current_participatory_space
12
10
 
13
11
  def index
14
12
  authorize! :read, Feature
15
13
  @manifests = Decidim.feature_manifests
16
- @features = current_participatory_process.features
14
+ @features = current_participatory_space.features
17
15
  end
18
16
 
19
17
  def new
@@ -22,7 +20,7 @@ module Decidim
22
20
  @feature = Feature.new(
23
21
  name: default_name(manifest),
24
22
  manifest_name: params[:type],
25
- participatory_process: current_participatory_process
23
+ participatory_space: current_participatory_space
26
24
  )
27
25
 
28
26
  @form = form(FeatureForm).from_model(@feature)
@@ -32,7 +30,7 @@ module Decidim
32
30
  @form = form(FeatureForm).from_params(params)
33
31
  authorize! :create, Feature
34
32
 
35
- CreateFeature.call(manifest, @form, current_participatory_process) do
33
+ CreateFeature.call(manifest, @form, current_participatory_space) do
36
34
  on(:ok) do
37
35
  flash[:notice] = I18n.t("features.create.success", scope: "decidim.admin")
38
36
  redirect_to action: :index
@@ -110,7 +108,7 @@ module Decidim
110
108
  private
111
109
 
112
110
  def query_scope
113
- current_participatory_process.features
111
+ current_participatory_space.features
114
112
  end
115
113
 
116
114
  def manifest
@@ -4,8 +4,6 @@ module Decidim
4
4
  module Admin
5
5
  # This controller allows admins to manage moderations in a participatory process.
6
6
  class ModerationsController < Decidim::Admin::ApplicationController
7
- include Concerns::ParticipatoryProcessAdmin
8
-
9
7
  helper_method :moderations
10
8
 
11
9
  def index
@@ -49,19 +47,19 @@ module Decidim
49
47
  def moderations
50
48
  @moderations ||= begin
51
49
  if params[:hidden]
52
- participatory_process_moderations.where.not(hidden_at: nil)
50
+ participatory_space_moderations.where.not(hidden_at: nil)
53
51
  else
54
- participatory_process_moderations.where(hidden_at: nil)
52
+ participatory_space_moderations.where(hidden_at: nil)
55
53
  end
56
54
  end
57
55
  end
58
56
 
59
57
  def reportable
60
- @reportable ||= participatory_process_moderations.find(params[:id]).reportable
58
+ @reportable ||= participatory_space_moderations.find(params[:id]).reportable
61
59
  end
62
60
 
63
- def participatory_process_moderations
64
- @participatory_process_moderations ||= Decidim::Moderation.where(participatory_process: current_participatory_process)
61
+ def participatory_space_moderations
62
+ @participatory_space_moderations ||= Decidim::Moderation.where(participatory_space: current_participatory_space)
65
63
  end
66
64
  end
67
65
  end
@@ -10,11 +10,7 @@ module Decidim
10
10
 
11
11
  def index
12
12
  authorize! :index, Scope
13
- @scopes = if parent_scope
14
- parent_scope.children
15
- else
16
- collection.top_level
17
- end
13
+ @scopes = children_scopes.order("name->'#{I18n.locale}' ASC")
18
14
  end
19
15
 
20
16
  def new
@@ -71,16 +67,22 @@ module Decidim
71
67
 
72
68
  private
73
69
 
74
- def scope
75
- @scope ||= collection.find(params[:id])
70
+ def organization_scopes
71
+ current_organization.scopes
76
72
  end
77
73
 
78
74
  def parent_scope
79
- @parent_scope ||= @scope ? @scope.parent : collection.find_by_id(params[:scope_id])
75
+ return @parent_scope if defined?(@parent_scope)
76
+ @parent_scope = scope ? scope.parent : organization_scopes.find_by_id(params[:scope_id])
80
77
  end
81
78
 
82
- def collection
83
- current_organization.scopes
79
+ def scope
80
+ return @scope if defined?(@scope)
81
+ @scope = organization_scopes.find_by_id(params[:id])
82
+ end
83
+
84
+ def children_scopes
85
+ @subscopes ||= parent_scope ? parent_scope.children : organization_scopes.top_level
84
86
  end
85
87
 
86
88
  def current_scopes_path
@@ -21,9 +21,7 @@ module Decidim
21
21
  default_params = {
22
22
  organization: current_organization,
23
23
  invitation_instructions: "invite_admin",
24
- invited_by: current_user,
25
- comments_notifications: true,
26
- replies_notifications: true
24
+ invited_by: current_user
27
25
  }
28
26
 
29
27
  @form = form(InviteUserForm).from_params(params.merge(default_params))
@@ -16,10 +16,10 @@ module Decidim
16
16
  validates :name, :description, translatable_presence: true
17
17
  validates :parent_id, inclusion: { in: :parent_categories_ids }, allow_blank: true
18
18
 
19
- delegate :current_process, to: :context, prefix: false
19
+ delegate :current_participatory_space, to: :context, prefix: false
20
20
 
21
21
  def parent_categories
22
- @parent_categories ||= current_process.categories.first_class.where.not(id: id)
22
+ @parent_categories ||= current_participatory_space.categories.first_class.where.not(id: id)
23
23
  end
24
24
 
25
25
  private
@@ -19,13 +19,7 @@ module Decidim
19
19
  attribute :weight, Integer, default: 0
20
20
 
21
21
  attribute :step_settings, Hash[String => Object]
22
- attribute :participatory_process
23
-
24
- def map_model(model)
25
- self.attributes = model.attributes
26
- self.settings = model.settings
27
- self.default_step_settings = model.default_step_settings
28
- end
22
+ attribute :participatory_space
29
23
 
30
24
  def settings?
31
25
  settings.manifest.attributes.any?
@@ -34,17 +28,6 @@ module Decidim
34
28
  def default_step_settings?
35
29
  default_step_settings.manifest.attributes.any?
36
30
  end
37
-
38
- def step_settings?
39
- return false unless participatory_process.steps.any?
40
-
41
- step_settings
42
- .values
43
- .map(&:manifest)
44
- .flat_map(&:attributes)
45
- .flat_map(&:keys)
46
- .any?
47
- end
48
31
  end
49
32
  end
50
33
  end