decidim-participatory_processes 0.24.0 → 0.25.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (109) hide show
  1. checksums.yaml +4 -4
  2. data/app/cells/decidim/participatory_process_groups/content_blocks/highlighted_participatory_processes/filters.erb +0 -1
  3. data/app/cells/decidim/participatory_process_groups/content_blocks/statistics_cell.rb +16 -0
  4. data/app/cells/decidim/participatory_process_groups/content_blocks/title/show.erb +1 -1
  5. data/app/cells/decidim/participatory_processes/content_blocks/highlighted_processes/single_process.erb +1 -1
  6. data/app/cells/decidim/participatory_processes/process_group_m_cell.rb +1 -1
  7. data/app/cells/decidim/participatory_processes/process_group_s_cell.rb +2 -2
  8. data/app/cells/decidim/participatory_processes/process_m_cell.rb +1 -1
  9. data/app/cells/decidim/participatory_processes/process_s_cell.rb +2 -2
  10. data/app/commands/decidim/participatory_processes/admin/copy_participatory_process.rb +9 -2
  11. data/app/commands/decidim/participatory_processes/admin/update_participatory_process.rb +5 -10
  12. data/app/commands/decidim/participatory_processes/admin/update_participatory_process_group.rb +3 -3
  13. data/app/controllers/decidim/participatory_processes/admin/participatory_process_groups_controller.rb +3 -3
  14. data/app/controllers/decidim/participatory_processes/admin/participatory_processes_controller.rb +1 -5
  15. data/app/forms/decidim/participatory_processes/admin/participatory_process_form.rb +2 -2
  16. data/app/forms/decidim/participatory_processes/admin/participatory_process_group_form.rb +1 -1
  17. data/app/forms/decidim/participatory_processes/admin/participatory_process_import_form.rb +1 -0
  18. data/app/helpers/decidim/participatory_processes/participatory_process_helper.rb +1 -1
  19. data/app/models/decidim/participatory_process.rb +9 -5
  20. data/app/models/decidim/participatory_process_group.rb +2 -2
  21. data/app/packs/entrypoints/decidim_participatory_processes.js +4 -0
  22. data/app/packs/entrypoints/decidim_participatory_processes_admin.js +1 -0
  23. data/app/{assets/images/decidim/participatory_processes/process.svg → packs/images/decidim/participatory_processes/decidim_participatory_processes.svg} +0 -0
  24. data/app/packs/src/decidim/participatory_processes/admin/participatory_processes.js +18 -0
  25. data/app/packs/src/decidim/participatory_processes/filters.js +28 -0
  26. data/app/presenters/decidim/participatory_processes/participatory_process_group_presenter.rb +1 -6
  27. data/app/presenters/decidim/participatory_processes/participatory_process_group_stats_presenter.rb +3 -13
  28. data/app/presenters/decidim/participatory_processes/participatory_process_presenter.rb +2 -9
  29. data/app/presenters/decidim/participatory_processes/participatory_process_stats_presenter.rb +3 -13
  30. data/app/queries/decidim/participatory_processes/admin/admin_users.rb +23 -10
  31. data/app/queries/decidim/participatory_processes/admin/moderators.rb +24 -11
  32. data/app/queries/decidim/participatory_processes/stats_participants_count.rb +9 -0
  33. data/app/serializers/decidim/participatory_processes/participatory_process_serializer.rb +2 -1
  34. data/app/views/decidim/participatory_processes/admin/participatory_process_copies/_form.html.erb +0 -2
  35. data/app/views/decidim/participatory_processes/admin/participatory_process_groups/index.html.erb +6 -4
  36. data/app/views/decidim/participatory_processes/admin/participatory_process_groups/show.html.erb +2 -2
  37. data/app/views/decidim/participatory_processes/admin/participatory_process_imports/_form.html.erb +0 -2
  38. data/app/views/decidim/participatory_processes/admin/participatory_process_steps/_form.html.erb +0 -2
  39. data/app/views/decidim/participatory_processes/admin/participatory_processes/_form.html.erb +1 -3
  40. data/app/views/decidim/participatory_processes/admin/participatory_processes/index.html.erb +4 -2
  41. data/app/views/decidim/participatory_processes/participatory_process_groups/show.html.erb +2 -2
  42. data/app/views/decidim/participatory_processes/participatory_processes/_promoted_process.html.erb +1 -1
  43. data/app/views/decidim/participatory_processes/participatory_processes/_promoted_process_group.html.erb +1 -1
  44. data/app/views/decidim/participatory_processes/participatory_processes/index.html.erb +2 -2
  45. data/app/views/decidim/participatory_processes/participatory_processes/show.html.erb +2 -2
  46. data/app/views/layouts/decidim/_process_header.html.erb +1 -1
  47. data/app/views/layouts/decidim/_process_header_steps.html.erb +1 -1
  48. data/app/views/layouts/decidim/admin/participatory_process.html.erb +2 -76
  49. data/app/views/layouts/decidim/admin/participatory_process_group.html.erb +1 -1
  50. data/app/views/layouts/decidim/participatory_process.html.erb +2 -2
  51. data/config/assets.rb +9 -0
  52. data/config/locales/ar.yml +0 -19
  53. data/config/locales/ca.yml +4 -20
  54. data/config/locales/cs.yml +15 -31
  55. data/config/locales/de.yml +5 -21
  56. data/config/locales/el.yml +0 -19
  57. data/config/locales/en.yml +4 -20
  58. data/config/locales/es-MX.yml +4 -20
  59. data/config/locales/es-PY.yml +4 -20
  60. data/config/locales/es.yml +4 -20
  61. data/config/locales/eu.yml +0 -17
  62. data/config/locales/fi-plain.yml +4 -20
  63. data/config/locales/fi.yml +4 -20
  64. data/config/locales/fr-CA.yml +2 -21
  65. data/config/locales/fr-LU.yml +484 -0
  66. data/config/locales/fr.yml +2 -21
  67. data/config/locales/gl.yml +17 -20
  68. data/config/locales/hu.yml +0 -19
  69. data/config/locales/id-ID.yml +0 -17
  70. data/config/locales/is-IS.yml +0 -15
  71. data/config/locales/it.yml +52 -20
  72. data/config/locales/ja.yml +55 -19
  73. data/config/locales/lb-LU.yml +1 -0
  74. data/config/locales/lv.yml +0 -18
  75. data/config/locales/nl.yml +4 -19
  76. data/config/locales/no.yml +0 -19
  77. data/config/locales/pl.yml +6 -24
  78. data/config/locales/pt-BR.yml +103 -17
  79. data/config/locales/pt.yml +0 -19
  80. data/config/locales/ro-RO.yml +8 -23
  81. data/config/locales/ru.yml +0 -17
  82. data/config/locales/sk.yml +0 -19
  83. data/config/locales/sr-CS.yml +0 -4
  84. data/config/locales/sv.yml +39 -19
  85. data/config/locales/tr-TR.yml +1 -20
  86. data/config/locales/uk.yml +0 -17
  87. data/config/locales/zh-CN.yml +0 -19
  88. data/db/migrate/20201006072346_fix_attachments_titles.rb +5 -8
  89. data/db/migrate/20210415163339_allow_null_file_column_in_decidim_attachments_table.rb +7 -0
  90. data/lib/decidim/api/participatory_process_group_type.rb +4 -0
  91. data/lib/decidim/api/participatory_process_type.rb +9 -1
  92. data/lib/decidim/participatory_processes/admin_engine.rb +119 -37
  93. data/lib/decidim/participatory_processes/engine.rb +7 -10
  94. data/lib/decidim/participatory_processes/participatory_space.rb +40 -7
  95. data/lib/decidim/participatory_processes/version.rb +1 -1
  96. metadata +35 -25
  97. data/app/assets/config/admin/decidim_participatory_processes_manifest.js +0 -1
  98. data/app/assets/config/decidim_participatory_processes_manifest.js +0 -2
  99. data/app/assets/javascripts/decidim/participatory_processes/admin/participatory_processes.js.es6 +0 -20
  100. data/app/assets/javascripts/decidim/participatory_processes/filters.js.es6 +0 -31
  101. data/app/cells/decidim/participatory_process_groups/content_blocks/stats/show.erb +0 -13
  102. data/app/cells/decidim/participatory_process_groups/content_blocks/stats_cell.rb +0 -17
  103. data/app/cells/decidim/participatory_processes/statistic/show.erb +0 -9
  104. data/app/cells/decidim/participatory_processes/statistic_cell.rb +0 -20
  105. data/app/cells/decidim/participatory_processes/statistics/show.erb +0 -17
  106. data/app/cells/decidim/participatory_processes/statistics_cell.rb +0 -18
  107. data/app/helpers/decidim/participatory_processes/admin/participatory_processes_menu_helper.rb +0 -23
  108. data/app/views/decidim/participatory_processes/admin/shared/_secondary_nav.html.erb +0 -3
  109. data/config/locales/ja-JP.yml +0 -445
@@ -3,7 +3,7 @@
3
3
  module Decidim
4
4
  module ParticipatoryProcesses
5
5
  # A presenter to render statistics in the homepage.
6
- class ParticipatoryProcessStatsPresenter < Rectify::Presenter
6
+ class ParticipatoryProcessStatsPresenter < Decidim::StatsPresenter
7
7
  attribute :participatory_process, Decidim::ParticipatoryProcess
8
8
  include Decidim::IconHelper
9
9
 
@@ -13,22 +13,12 @@ module Decidim
13
13
  highlighted_stats.concat(process_followers_stats(priority: StatsRegistry::HIGH_PRIORITY))
14
14
  highlighted_stats.concat(component_stats(priority: StatsRegistry::HIGH_PRIORITY))
15
15
  highlighted_stats.concat(component_stats(priority: StatsRegistry::MEDIUM_PRIORITY))
16
+ highlighted_stats.concat(comments_stats(:participatory_processes))
16
17
  highlighted_stats = highlighted_stats.reject(&:empty?)
17
18
  highlighted_stats = highlighted_stats.reject { |_stat_manifest, _stat_title, stat_number| stat_number.zero? }
18
19
  grouped_highlighted_stats = highlighted_stats.group_by(&:first)
19
20
 
20
- statistics = []
21
- grouped_highlighted_stats.each do |_manifest_name, stats|
22
- stats.each_with_index.each do |stat, _index|
23
- stat.each_with_index.map do |_item, subindex|
24
- next unless (subindex % 3).zero?
25
- next if stat[subindex + 2].zero?
26
-
27
- statistics << { stat_title: stat[subindex + 1], stat_number: stat[subindex + 2] }
28
- end
29
- end
30
- end
31
- statistics
21
+ statistics(grouped_highlighted_stats)
32
22
  end
33
23
 
34
24
  private
@@ -13,33 +13,46 @@ module Decidim
13
13
  new(process).query
14
14
  end
15
15
 
16
+ # Syntactic sugar to initialize the class and return the queried objects.
17
+ #
18
+ # organization - an organization that needs to find its process admins
19
+ def self.for_organization(organization)
20
+ new(nil, organization).query
21
+ end
22
+
16
23
  # Initializes the class.
17
24
  #
18
25
  # process - a process that needs to find its process admins
19
- def initialize(process)
26
+ # organization - an organization that needs to find its process admins
27
+ def initialize(process, organization = nil)
20
28
  @process = process
29
+ @organization = process&.organization || organization
21
30
  end
22
31
 
23
32
  # Finds organization admins and the users with role admin for the given process.
24
33
  #
25
34
  # Returns an ActiveRecord::Relation.
26
35
  def query
27
- Decidim::User.where(id: organization_admins).or(process_user_admins)
36
+ organization.admins.or(processes_user_admins)
28
37
  end
29
38
 
30
39
  private
31
40
 
32
- attr_reader :process
41
+ attr_reader :process, :organization
33
42
 
34
- def organization_admins
35
- process.organization.admins
43
+ def processes_user_admins
44
+ Decidim::User.where(
45
+ id: Decidim::ParticipatoryProcessUserRole.where(participatory_process: processes, role: :admin)
46
+ .select(:decidim_user_id)
47
+ )
36
48
  end
37
49
 
38
- def process_user_admins
39
- process_user_admin_ids = Decidim::ParticipatoryProcessUserRole
40
- .where(participatory_process: process, role: :admin)
41
- .pluck(:decidim_user_id)
42
- Decidim::User.where(id: process_user_admin_ids)
50
+ def processes
51
+ if process
52
+ [process]
53
+ else
54
+ Decidim::ParticipatoryProcess.where(organization: organization)
55
+ end
43
56
  end
44
57
  end
45
58
  end
@@ -13,11 +13,20 @@ module Decidim
13
13
  new(process).query
14
14
  end
15
15
 
16
+ # Syntactic sugar to initialize the class and return the queried objects.
17
+ #
18
+ # organization - an organization that needs to find its moderators
19
+ def self.for_organization(organization)
20
+ new(nil, organization).query
21
+ end
22
+
16
23
  # Initializes the class.
17
24
  #
18
25
  # process - a process that needs to find its process admins
19
- def initialize(process)
26
+ # organization - an organization that needs to find its process admins
27
+ def initialize(process, organization = nil)
20
28
  @process = process
29
+ @organization = process&.organization || organization
21
30
  end
22
31
 
23
32
  # Finds organization admins and the users with role admin for the given
@@ -25,23 +34,27 @@ module Decidim
25
34
  #
26
35
  # Returns an ActiveRecord::Relation.
27
36
  def query
28
- Decidim::User.where(id: organization_admins + process_users)
37
+ organization.admins.or(processes_user_admins)
29
38
  end
30
39
 
31
40
  private
32
41
 
33
- attr_reader :process
42
+ attr_reader :process, :organization
34
43
 
35
- def organization_admins
36
- process.organization.admins
44
+ def processes_user_admins
45
+ Decidim::User.where(
46
+ id: Decidim::ParticipatoryProcessUserRole.where(participatory_process: processes)
47
+ .where.not(role: :collaborator)
48
+ .select(:decidim_user_id)
49
+ )
37
50
  end
38
51
 
39
- def process_users
40
- Decidim::ParticipatoryProcessUserRole
41
- .where(participatory_process: process)
42
- .where.not(role: :collaborator)
43
- .pluck(:decidim_user_id)
44
- .uniq
52
+ def processes
53
+ if process
54
+ [process]
55
+ else
56
+ Decidim::ParticipatoryProcess.where(organization: organization)
57
+ end
45
58
  end
46
59
  end
47
60
  end
@@ -20,6 +20,7 @@ module Decidim
20
20
  [
21
21
  comments_query,
22
22
  debates_query,
23
+ meetings_query,
23
24
  endorsements_query,
24
25
  project_supports_query,
25
26
  proposals_query,
@@ -58,6 +59,14 @@ module Decidim
58
59
  .uniq
59
60
  end
60
61
 
62
+ def meetings_query
63
+ meetings = Decidim::Meetings::Meeting.where(component: space_components).not_hidden
64
+ registrations = Decidim::Meetings::Registration.where(decidim_meeting_id: meetings).distinct.pluck(:decidim_user_id)
65
+ organizers = meetings.where(decidim_author_type: Decidim::UserBaseEntity.name).distinct.pluck(:decidim_author_id)
66
+
67
+ [registrations, organizers].flatten.uniq
68
+ end
69
+
61
70
  def endorsements_query
62
71
  Decidim::Endorsement
63
72
  .where(resource: space_components)
@@ -67,6 +67,7 @@ module Decidim
67
67
  private
68
68
 
69
69
  attr_reader :participatory_process
70
+ alias resource participatory_process
70
71
 
71
72
  def serialize_participatory_process_steps
72
73
  return unless participatory_process.steps.any?
@@ -147,7 +148,7 @@ module Decidim
147
148
 
148
149
  def serialize_components
149
150
  serializer = Decidim::Exporters::ParticipatorySpaceComponentsSerializer.new(@participatory_process)
150
- serializer.serialize
151
+ serializer.run
151
152
  end
152
153
  end
153
154
  end
@@ -1,5 +1,3 @@
1
- <%= javascript_include_tag "decidim/slug_form" %>
2
-
3
1
  <div class="card" id="processes">
4
2
  <div class="card-divider">
5
3
  <h2 class="card-title"><%= title %></h2>
@@ -1,4 +1,6 @@
1
- <%= render partial: "decidim/participatory_processes/admin/shared/secondary_nav" %>
1
+ <% content_for :sidebar_menu_nav do %>
2
+ <%= sidebar_menu(:admin_participatory_processes_menu).render %>
3
+ <% end %>
2
4
 
3
5
  <div class="process-title">
4
6
  <div class="process-title-content">
@@ -10,7 +12,7 @@
10
12
  <div class="card-divider">
11
13
  <h2 class="card-title">
12
14
  <%= t "decidim.admin.titles.participatory_process_groups" %>
13
- <%= link_to t("actions.new_process_group", scope: "decidim.admin"), ["new", "participatory_process_group"], class: "button tiny button--title new" if allowed_to? :create, :process_group %>
15
+ <%= link_to t("actions.new_process_group", scope: "decidim.admin"), [:new, :participatory_process_group], class: "button tiny button--title new" if allowed_to? :create, :process_group %>
14
16
  </h2>
15
17
  </div>
16
18
  <div class="card-section">
@@ -32,14 +34,14 @@
32
34
  </span>
33
35
  <% end %>
34
36
  <% if allowed_to? :update, :process_group, process_group: group %>
35
- <%= link_to translated_attribute(group.title), ["edit", group] %><br>
37
+ <%= link_to translated_attribute(group.title), [:edit, group] %><br>
36
38
  <% else %>
37
39
  <%= translated_attribute(group.title) %>
38
40
  <% end %>
39
41
  </td>
40
42
  <td class="table-list__actions">
41
43
  <% if allowed_to? :update, :process_group, process_group: group %>
42
- <%= icon_link_to "pencil", ["edit", group], t("actions.edit", scope: "decidim.admin"), class: "action-icon--edit" %>
44
+ <%= icon_link_to "pencil", [:edit, group], t("actions.edit", scope: "decidim.admin"), class: "action-icon--edit" %>
43
45
  <% else %>
44
46
  <span class="action-space icon"></span>
45
47
  <% end %>
@@ -23,8 +23,8 @@
23
23
  <% end %>
24
24
  <dt><%= display_label(participatory_process_group, :hero_image) %></dt>
25
25
  <dd>
26
- <% if participatory_process_group.hero_image? %>
27
- <%= image_tag participatory_process_group.hero_image.url.to_s %>
26
+ <% if participatory_process_group.hero_image.attached? %>
27
+ <%= image_tag participatory_process_group.attached_uploader(:hero_image).path %>
28
28
  <% end %>
29
29
  </dd>
30
30
  </dl>
@@ -1,5 +1,3 @@
1
- <%= javascript_include_tag "decidim/slug_form" %>
2
-
3
1
  <div class="card" id="processes">
4
2
  <div class="card-divider">
5
3
  <h2 class="card-title"><%= title %></h2>
@@ -1,5 +1,3 @@
1
- <%= javascript_include_tag "decidim/slug_form" %>
2
-
3
1
  <div class="card">
4
2
  <div class="card-divider">
5
3
  <h2 class="card-title"><%= title %></h2>
@@ -1,5 +1,3 @@
1
- <%= javascript_include_tag "decidim/slug_form" %>
2
-
3
1
  <div class="card">
4
2
  <div class="card-divider">
5
3
  <h2 class="card-title"><%= t(".title") %></h2>
@@ -193,4 +191,4 @@
193
191
  </div>
194
192
  </div>
195
193
 
196
- <%= javascript_include_tag "decidim/participatory_processes/admin/participatory_processes" %>
194
+ <%= javascript_pack_tag "decidim_participatory_processes_admin" %>
@@ -1,6 +1,8 @@
1
1
  <% add_decidim_page_title(t("participatory_processes", scope: "decidim.admin.titles")) %>
2
2
 
3
- <%= render partial: "decidim/participatory_processes/admin/shared/secondary_nav" %>
3
+ <% content_for :sidebar_menu_nav do %>
4
+ <%= sidebar_menu(:admin_participatory_processes_menu).render %>
5
+ <% end %>
4
6
 
5
7
  <div class="card with-overflow" id="processes">
6
8
  <div class="card-divider">
@@ -9,7 +11,7 @@
9
11
 
10
12
  <% if allowed_to? :create, :process %>
11
13
  <%= link_to t("actions.new_process", scope: "decidim.admin"),
12
- ["new", "participatory_process"],
14
+ [:new, :participatory_process],
13
15
  class: "button tiny button--title" %>
14
16
  <% end %>
15
17
 
@@ -18,5 +18,5 @@
18
18
  <% end %>
19
19
  </div>
20
20
  </div>
21
- <%= javascript_include_tag "decidim/participatory_processes/filters" %>
22
- <%= javascript_include_tag "decidim/filters" %>
21
+
22
+ <%= javascript_pack_tag "decidim_participatory_processes" %>
@@ -14,7 +14,7 @@
14
14
  </div>
15
15
  <div class="columns mediumlarge-8 large-6 card--process__column">
16
16
  <div class="card--full__image"
17
- style="background-image:url(<%= promoted_process.hero_image.url %>)">
17
+ style="background-image:url(<%= promoted_process.attached_uploader(:hero_image).path %>)">
18
18
  <div class="card__content row collapse">
19
19
  <div class="large-6 large-offset-6 columns">
20
20
  <%= link_to participatory_process_cta_path(promoted_process), class: "button expanded button--sc" do %>
@@ -14,7 +14,7 @@
14
14
  </div>
15
15
  </div>
16
16
  <div class="columns mediumlarge-8 large-6 card--process__column">
17
- <div class="card--full__image" style="background-image:url(<%= cta_settings&.image_url || promoted_process_group.hero_image&.url %>)">
17
+ <div class="card--full__image" style="background-image:url(<%= cta_settings&.image_url || promoted_process_group.attached_uploader(:hero_image).path %>)">
18
18
  <% if cta_settings.present? %>
19
19
  <div class="card__content row collapse">
20
20
  <div class="large-6 large-offset-6 columns">
@@ -29,5 +29,5 @@ edit_link(
29
29
  </div>
30
30
  </section>
31
31
  <% end %>
32
- <%= javascript_include_tag "decidim/participatory_processes/filters" %>
33
- <%= javascript_include_tag "decidim/filters" %>
32
+
33
+ <%= javascript_pack_tag "decidim_participatory_processes" %>
@@ -1,5 +1,5 @@
1
1
  <% add_decidim_meta_tags({
2
- image_url: current_participatory_space.hero_image.url,
2
+ image_url: current_participatory_space.attached_uploader(:hero_image).path,
3
3
  description: translated_attribute(current_participatory_space.short_description),
4
4
  url: participatory_process_url(current_participatory_space),
5
5
  twitter_handler: current_organization.twitter_handler
@@ -143,7 +143,7 @@
143
143
  </div>
144
144
 
145
145
  <% if current_participatory_space.show_statistics? %>
146
- <%= cell "decidim/participatory_processes/statistics", stats.collection %>
146
+ <%= cell "decidim/statistics", stats.collection %>
147
147
  <% end %>
148
148
 
149
149
  <% if current_participatory_space.show_metrics? %>
@@ -1,7 +1,7 @@
1
1
  <div class="process-header">
2
2
  <div class="process-header__inner">
3
3
  <div class="row column process-header__main"
4
- style="background-image:url(<%= current_participatory_space.banner_image.url %>);">
4
+ style="background-image:url(<%= current_participatory_space.attached_uploader(:banner_image).path %>);">
5
5
  </div>
6
6
  <div class="process-header__container row collapse column">
7
7
  <div class="columns mediumlarge-8 process-header__info">
@@ -23,7 +23,7 @@
23
23
  </div>
24
24
  <% cta_text = translated_attribute(participatory_process.active_step.cta_text) %>
25
25
  <% if participatory_process.active_step.cta_path.present? && cta_text.present? %>
26
- <%= link_to t(".view_steps"), decidim_participatory_processes.participatory_process_participatory_process_steps_path(current_participatory_space) %>
26
+ <%= link_to t(".view_steps"), decidim_participatory_processes.participatory_process_participatory_process_steps_path(current_participatory_space), class: "clear button secondary tiny show-for-medium" %>
27
27
  <%= link_to(
28
28
  cta_text,
29
29
  step_cta_url(participatory_process),
@@ -1,82 +1,8 @@
1
1
  <% add_decidim_page_title(translated_attribute(current_participatory_space.title)) %>
2
-
3
- <% content_for :secondary_nav do %>
4
- <%#= participatory_process_menu.render do
2
+ <% content_for :sidebar_menu_nav do %>
3
+ <%= sidebar_menu(:admin_participatory_process_menu).render do
5
4
  public_page_link decidim_participatory_processes.participatory_process_path(current_participatory_space)
6
5
  end %>
7
-
8
- <div class="secondary-nav secondary-nav--subnav">
9
- <ul>
10
- <%= public_page_link decidim_participatory_processes.participatory_process_path(current_participatory_space) %>
11
- <% if allowed_to? :update, :process, process: current_participatory_space %>
12
- <li <% if is_active_link?(decidim_admin_participatory_processes.edit_participatory_process_path(current_participatory_space)) %> class="is-active" <% end %>>
13
- <%= aria_selected_link_to t("info", scope: "decidim.admin.menu.participatory_processes_submenu"), decidim_admin_participatory_processes.edit_participatory_process_path(current_participatory_space) %>
14
- </li>
15
- <% end %>
16
- <% if allowed_to? :read, :process_step %>
17
- <li <% if is_active_link?(decidim_admin_participatory_processes.participatory_process_steps_path(current_participatory_space)) %> class="is-active" <% end %>>
18
- <%= aria_selected_link_to t("steps", scope: "decidim.admin.menu.participatory_processes_submenu"), decidim_admin_participatory_processes.participatory_process_steps_path(current_participatory_space) %>
19
- </li>
20
- <% end %>
21
- <% if allowed_to? :read, :component %>
22
- <li <% if is_active_link?(decidim_admin_participatory_processes.components_path(current_participatory_space)) %> class="is-active" <% end %>>
23
- <%= aria_selected_link_to t("components", scope: "decidim.admin.menu.participatory_processes_submenu"), decidim_admin_participatory_processes.components_path(current_participatory_space) %>
24
- <ul id="components-list">
25
- <% current_participatory_space.components.each do |component| %>
26
- <% if component.manifest.admin_engine && user_role_config.component_is_accessible?(component.manifest_name) %>
27
- <li <% if is_active_link?(manage_component_path(component)) || is_active_link?(decidim_admin_participatory_processes.edit_component_path(current_participatory_space, component)) || is_active_link?(decidim_admin_participatory_processes.edit_component_permissions_path(current_participatory_space, component)) || participatory_space_active_link?(component) %> class="is-active" <% end %>>
28
- <%= link_to manage_component_path(component) do %>
29
- <%= translated_attribute component.name %>
30
- <% if component.primary_stat.present? %>
31
- <span class="component-counter <%= "component-counter--off" if component.primary_stat.zero? %>"><%= component.primary_stat %></span>
32
- <% end %>
33
- <% end %>
34
- </li>
35
- <% end %>
36
- <% end %>
37
- </ul>
38
- </li>
39
- <% end %>
40
- <% if allowed_to? :read, :category %>
41
- <li <% if is_active_link?(decidim_admin_participatory_processes.categories_path(current_participatory_space)) %> class="is-active" <% end %>>
42
- <%= aria_selected_link_to t("categories", scope: "decidim.admin.menu.participatory_processes_submenu"), decidim_admin_participatory_processes.categories_path(current_participatory_space) %>
43
- </li>
44
- <% end %>
45
- <% if allowed_to?(:read, :attachment_collection) || allowed_to?(:read, :attachment) %>
46
- <li>
47
- <span class="secondary-nav__subtitle"><%= t("attachments", scope: "decidim.admin.menu.participatory_processes_submenu") %></span>
48
- <ul>
49
- <% if allowed_to? :read, :attachment_collection %>
50
- <li <% if is_active_link?(decidim_admin_participatory_processes.participatory_process_attachment_collections_path(current_participatory_space)) %> class="is-active" <% end %>>
51
- <%= aria_selected_link_to t("attachment_collections", scope: "decidim.admin.menu.participatory_processes_submenu"), decidim_admin_participatory_processes.participatory_process_attachment_collections_path(current_participatory_space) %>
52
- </li>
53
- <% end %>
54
- <% if allowed_to? :read, :attachment %>
55
- <li <% if is_active_link?(decidim_admin_participatory_processes.participatory_process_attachments_path(current_participatory_space)) %> class="is-active" <% end %>>
56
- <%= aria_selected_link_to t("attachment_files", scope: "decidim.admin.menu.participatory_processes_submenu"), decidim_admin_participatory_processes.participatory_process_attachments_path(current_participatory_space) %>
57
- </li>
58
- <% end %>
59
- </ul>
60
- </li>
61
- <% end %>
62
- <% if allowed_to? :read, :process_user_role %>
63
- <li <% if is_active_link?(decidim_admin_participatory_processes.participatory_process_user_roles_path(current_participatory_space)) %> class="is-active" <% end %>>
64
- <%= aria_selected_link_to t("process_admins", scope: "decidim.admin.menu.participatory_processes_submenu"), decidim_admin_participatory_processes.participatory_process_user_roles_path(current_participatory_space) %>
65
- </li>
66
- <% end %>
67
- <% if allowed_to? :read, :space_private_user %>
68
- <li <% if is_active_link?(decidim_admin_participatory_processes.participatory_space_private_users_path(current_participatory_space)) %> class="is-active" <% end %>>
69
- <%= aria_selected_link_to t("private_users", scope: "decidim.admin.menu.participatory_processes_submenu"), decidim_admin_participatory_processes.participatory_space_private_users_path(current_participatory_space) %>
70
- </li>
71
- <% end %>
72
- <% if allowed_to? :read, :moderation %>
73
- <li <% if is_active_link?(decidim_admin_participatory_processes.moderations_path(current_participatory_space)) %> class="is-active" <% end %>>
74
- <%= aria_selected_link_to t("moderations", scope: "decidim.admin.menu.participatory_processes_submenu"), decidim_admin_participatory_processes.moderations_path(current_participatory_space) %>
75
- </li>
76
- <% end %>
77
- <%= Decidim::Admin.view_hooks.render(:admin_secondary_nav, deep_dup) %>
78
- </ul>
79
- </div>
80
6
  <% end %>
81
7
 
82
8
  <%= render "layouts/decidim/admin/application" do %>