decidim-consultations 0.18.1 → 0.19.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (84) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/config/decidim_consultations_manifest.css +0 -1
  3. data/app/assets/config/decidim_consultations_manifest.js +1 -1
  4. data/app/assets/javascripts/decidim/consultations/utils_multiple.js +21 -0
  5. data/app/assets/javascripts/decidim/consultations/vote_dialog.js +13 -0
  6. data/app/cells/decidim/consultations/consultation_m/data.erb +2 -2
  7. data/app/cells/decidim/consultations/content_blocks/highlighted_consultations_cell.rb +1 -0
  8. data/app/commands/decidim/consultations/admin/create_consultation.rb +2 -0
  9. data/app/commands/decidim/consultations/admin/create_question.rb +2 -0
  10. data/app/commands/decidim/consultations/admin/create_response.rb +1 -0
  11. data/app/commands/decidim/consultations/admin/update_consultation.rb +1 -0
  12. data/app/commands/decidim/consultations/admin/update_question.rb +1 -0
  13. data/app/commands/decidim/consultations/admin/update_question_configuration.rb +55 -0
  14. data/app/commands/decidim/consultations/admin/update_response.rb +1 -0
  15. data/app/commands/decidim/consultations/multiple_vote_question.rb +47 -0
  16. data/app/controllers/concerns/decidim/consultations/admin/question_admin.rb +1 -0
  17. data/app/controllers/concerns/decidim/consultations/needs_question.rb +24 -2
  18. data/app/controllers/concerns/decidim/consultations/orderable.rb +1 -21
  19. data/app/controllers/decidim/consultations/admin/consultations_controller.rb +7 -1
  20. data/app/controllers/decidim/consultations/admin/question_configuration_controller.rb +54 -0
  21. data/app/controllers/decidim/consultations/admin/question_permissions_controller.rb +36 -0
  22. data/app/controllers/decidim/consultations/admin/questions_controller.rb +1 -0
  23. data/app/controllers/decidim/consultations/authorization_vote_modals_controller.rb +26 -0
  24. data/app/controllers/decidim/consultations/consultations_controller.rb +1 -1
  25. data/app/controllers/decidim/consultations/question_multiple_votes_controller.rb +39 -0
  26. data/app/controllers/decidim/consultations/question_votes_controller.rb +1 -1
  27. data/app/forms/decidim/consultations/admin/question_configuration_form.rb +27 -0
  28. data/app/forms/decidim/consultations/multi_vote_form.rb +41 -0
  29. data/app/forms/decidim/consultations/vote_form.rb +1 -0
  30. data/app/helpers/decidim/consultations/questions_helper.rb +25 -4
  31. data/app/models/decidim/consultation.rb +9 -7
  32. data/app/models/decidim/consultations/question.rb +26 -7
  33. data/app/models/decidim/consultations/vote.rb +11 -1
  34. data/app/permissions/decidim/consultations/admin/permissions.rb +1 -1
  35. data/app/permissions/decidim/consultations/permissions.rb +10 -0
  36. data/app/views/decidim/consultations/admin/consultations/edit.html.erb +4 -1
  37. data/app/views/decidim/consultations/admin/consultations/index.html.erb +2 -2
  38. data/app/views/decidim/consultations/admin/consultations/results.html.erb +42 -0
  39. data/app/views/decidim/consultations/admin/question_configuration/_form.html.erb +19 -0
  40. data/app/views/decidim/consultations/admin/question_configuration/edit.html.erb +12 -0
  41. data/app/views/decidim/consultations/admin/questions/edit.html.erb +1 -0
  42. data/app/views/decidim/consultations/admin/questions/index.html.erb +6 -2
  43. data/app/views/decidim/consultations/consultations/_consultations.html.erb +1 -1
  44. data/app/views/decidim/consultations/consultations/_highlighted_questions.html.erb +7 -5
  45. data/app/views/decidim/consultations/question_multiple_votes/_form.html.erb +14 -0
  46. data/app/views/decidim/consultations/question_multiple_votes/_results_rules.html.erb +14 -0
  47. data/app/views/decidim/consultations/question_multiple_votes/_voting_rules.html.erb +29 -0
  48. data/app/views/decidim/consultations/question_multiple_votes/show.html.erb +36 -0
  49. data/app/views/decidim/consultations/question_votes/update_vote_button.js.erb +9 -0
  50. data/app/views/decidim/consultations/questions/_results.html.erb +4 -0
  51. data/app/views/decidim/consultations/questions/_vote_button.html.erb +29 -4
  52. data/app/views/decidim/consultations/questions/_vote_modal_confirm.html.erb +1 -0
  53. data/app/views/decidim/consultations/questions/show.html.erb +1 -1
  54. data/app/views/layouts/decidim/_question_header.html.erb +2 -14
  55. data/app/views/layouts/decidim/_question_header_buttons.html.erb +11 -0
  56. data/app/views/layouts/decidim/admin/consultation.html.erb +4 -0
  57. data/app/views/layouts/decidim/admin/question.html.erb +66 -44
  58. data/app/views/layouts/decidim/question.html.erb +3 -3
  59. data/app/views/layouts/decidim/question_multivote.html.erb +9 -0
  60. data/config/locales/ar.yml +8 -0
  61. data/config/locales/ca.yml +51 -0
  62. data/config/locales/cs.yml +51 -0
  63. data/config/locales/en.yml +51 -0
  64. data/config/locales/es-MX.yml +13 -0
  65. data/config/locales/es-PY.yml +13 -0
  66. data/config/locales/es.yml +51 -0
  67. data/config/locales/fi-plain.yml +51 -0
  68. data/config/locales/fi.yml +51 -0
  69. data/config/locales/fr.yml +50 -0
  70. data/config/locales/hu.yml +51 -0
  71. data/config/locales/it.yml +15 -0
  72. data/config/locales/nl.yml +52 -1
  73. data/config/locales/sv.yml +9 -0
  74. data/config/locales/tr-TR.yml +5 -0
  75. data/db/migrate/20190702162755_add_options_to_decidim_consultations_questions.rb +8 -0
  76. data/db/migrate/20190710121122_add_free_instructions_field_to_consultations_questions.rb +7 -0
  77. data/lib/decidim/consultations/admin_engine.rb +3 -0
  78. data/lib/decidim/consultations/engine.rb +4 -0
  79. data/lib/decidim/consultations/participatory_space.rb +5 -0
  80. data/lib/decidim/consultations/test/factories.rb +5 -0
  81. data/lib/decidim/consultations/version.rb +1 -1
  82. metadata +29 -11
  83. data/app/assets/javascripts/decidim/consultations/social_share.js +0 -2
  84. data/app/assets/stylesheets/decidim/consultations/social_share.css.scss +0 -18
@@ -25,12 +25,12 @@
25
25
  <td>
26
26
  <% if allowed_to? :update, :consultation, consultation: consultation %>
27
27
  <%= link_to translated_attribute(consultation.title), edit_consultation_path(consultation) %>
28
- <br />
28
+ <br>
29
29
  <% elsif allowed_to? :preview, :consultation, consultation: consultation %>
30
30
  <%= link_to translated_attribute(consultation.title),
31
31
  decidim_consultations.consultation_path(consultation),
32
32
  target: "_blank" %>
33
- <br />
33
+ <br>
34
34
  <% else %>
35
35
  <%= translated_attribute(consultation.title) %>
36
36
  <% end %>
@@ -0,0 +1,42 @@
1
+ <div class="card" id="consultations">
2
+ <div class="card-divider">
3
+ <h2 class="card-title">
4
+ <%= t "decidim.admin.titles.results" %>
5
+ <span class="label button--title">
6
+ <%= t "decidim.admin.consultations.results.total_votes", count: current_consultation.total_votes %>
7
+ /
8
+ <%= t "decidim.admin.consultations.results.participants", count: current_consultation.total_participants %>
9
+ </span>
10
+ </h2>
11
+ </div>
12
+ <div class="card-section">
13
+ <table class="table-list">
14
+ <% current_consultation.questions.published.includes(:responses).each do |question| %>
15
+ <% unless question.external_voting %>
16
+ <thead>
17
+ <tr>
18
+ <th><%= strip_tags translated_attribute question.title %></th>
19
+ <th class="table-list__actions">
20
+ <%= t "decidim.admin.consultations.results.total_votes", count: question.total_votes %>
21
+ /
22
+ <%= t "decidim.admin.consultations.results.participants", count: question.total_participants %>
23
+ </th>
24
+ </tr>
25
+ </thead>
26
+ <tbody>
27
+ <% if question.publishable_results? %>
28
+ <% question.sorted_results.each do |response| %>
29
+ <tr>
30
+ <td><%= strip_tags translated_attribute response.title %></td>
31
+ <td><%= response.votes_count %></td>
32
+ </tr>
33
+ <% end %>
34
+ <% else %>
35
+ <tr><td><em><%= t "decidim.admin.consultations.results.not_visible" %></em></td><td>&nbsp;</td></tr>
36
+ <% end %>
37
+ </tbody>
38
+ <% end %>
39
+ <% end %>
40
+ </table>
41
+ </div>
42
+ </div>
@@ -0,0 +1,19 @@
1
+ <%= javascript_include_tag "decidim/slug_form" %>
2
+
3
+ <div class="card">
4
+ <div class="card-divider">
5
+ <h2 class="card-title"><%= t "question_configuration.form.title", scope: "decidim.admin" %></h2>
6
+ </div>
7
+
8
+ <div class="card-section">
9
+ <%= t "question_configuration.form.help", scope: "decidim.admin" %>
10
+ </div>
11
+
12
+ <div class="card-section">
13
+ <div class="row column">
14
+ <%= form.number_field :max_votes, step: 1, min: 1 %>
15
+ <%= form.number_field :min_votes, step: 1, min: 1 %>
16
+ <%= form.translated :editor, :instructions, toolbar: :full, lines: 5 %>
17
+ </div>
18
+ </div>
19
+ </div>
@@ -0,0 +1,12 @@
1
+ <%= decidim_form_for @form,
2
+ url: question_configuration_path(current_question),
3
+ method: :patch,
4
+ html: { class: "form edit_question" } do |f| %>
5
+ <%= render partial: "form", object: f %>
6
+ <div class="button--double form-general-submit">
7
+ <%= f.submit t("questions.edit.update", scope: "decidim.admin"),
8
+ class: "button",
9
+ data: { disable_with: true } %>
10
+
11
+ </div>
12
+ <% end %>
@@ -1,5 +1,6 @@
1
1
  <%= decidim_form_for @form,
2
2
  url: question_path(current_question),
3
+ method: :patch,
3
4
  html: { class: "form edit_question" } do |f| %>
4
5
  <%= render partial: "form", object: f %>
5
6
  <div class="button--double form-general-submit">
@@ -25,12 +25,12 @@
25
25
  <% if allowed_to? :update, :question, question: question %>
26
26
  <%= link_to decidim_sanitize(translated_attribute(question.title)),
27
27
  edit_question_path(question) %>
28
- <br />
28
+ <br>
29
29
  <% elsif allowed_to? :preview, :question, question: question %>
30
30
  <%= link_to translated_attribute(question.title),
31
31
  decidim_consultations.question_path(question),
32
32
  target: "_blank" %>
33
- <br />
33
+ <br>
34
34
  <% else %>
35
35
  <%= translated_attribute(question.title) %>
36
36
  <% end %>
@@ -50,6 +50,7 @@
50
50
  <% end %>
51
51
  </td>
52
52
  <td class="table-list__actions">
53
+
53
54
  <% if allowed_to? :update, :question, question: question %>
54
55
  <%= icon_link_to "pencil",
55
56
  edit_question_path(question),
@@ -57,6 +58,8 @@
57
58
  class: "action-icon--edit" %>
58
59
  <% end %>
59
60
 
61
+ <%= free_resource_permissions_link(question) %>
62
+
60
63
  <% if allowed_to? :preview, :question, question: question %>
61
64
  <%= icon_link_to "eye",
62
65
  decidim_consultations.question_path(question),
@@ -64,6 +67,7 @@
64
67
  class: "action-icon--preview",
65
68
  target: "_blank" %>
66
69
  <% end %>
70
+
67
71
  </td>
68
72
  </tr>
69
73
  <% end %>
@@ -13,4 +13,4 @@
13
13
  <%= card_for consultation %>
14
14
  <% end %>
15
15
  </div>
16
- <%= decidim_paginate consultations, random_seed: random_seed %>
16
+ <%= decidim_paginate consultations %>
@@ -1,10 +1,12 @@
1
1
  <% if consultation.highlighted_questions.any? %>
2
2
  <div class="row section" id="highlighted-questions">
3
- <h2 class=section-heading>
4
- <%= t "consultations.highlighted_questions.title",
5
- scope: "decidim",
6
- scope_name: translated_attribute(consultation.highlighted_scope.name) %>
7
- </h2>
3
+ <% if consultation.highlighted_scope.present? %>
4
+ <h2 class=section-heading>
5
+ <%= t "consultations.highlighted_questions.title",
6
+ scope: "decidim",
7
+ scope_name: translated_attribute(consultation.highlighted_scope.name) %>
8
+ </h2>
9
+ <% end %>
8
10
 
9
11
  <% consultation.highlighted_questions.each do |question| %>
10
12
  <%= render partial: "decidim/consultations/consultations/question", locals: { question: question } %>
@@ -0,0 +1,14 @@
1
+ <div class="row column">
2
+ <div class="large-offset-4 large-4 medium-offset-3 medium-6">
3
+ <div class="card">
4
+ <div class="card__content multiple_votes_form">
5
+ <% question.responses.each do |response| %>
6
+ <div>
7
+ <%= check_box_tag "responses[]", response.id, false, id: "vote_id_#{response.id}" %>
8
+ <%= form.label :id, translated_attribute(response.title), for: "vote_id_#{response.id}" %>
9
+ </div>
10
+ <% end %>
11
+ </div>
12
+ </div>
13
+ </div>
14
+ </div>
@@ -0,0 +1,14 @@
1
+ <div class="row column results-rules">
2
+ <div class="callout secondary">
3
+ <div class="row">
4
+ <div class="columns medium-8 large-9">
5
+ <h3 class="heading3"><%= t(".title") %></h3>
6
+ <ul>
7
+ <li><%= t(".vote_limit.description", limit: question.max_votes) %></li>
8
+ <li><%= t(".minimum_votes_per_user.description", votes: question.min_votes) %></li>
9
+ <li><%= t(".total_participants", count: question.total_participants) %></li>
10
+ </ul>
11
+ </div>
12
+ </div>
13
+ </div>
14
+ </div>
@@ -0,0 +1,29 @@
1
+ <div class="row column voting-rules">
2
+ <div class="callout secondary">
3
+ <div class="row">
4
+ <div class="columns medium-8 large-9">
5
+ <h3 class="heading3"><%= t(".title") %></h3>
6
+ <ul>
7
+ <li><%= t(".vote_limit.description", limit: question.max_votes) %></li>
8
+ <li><%= t(".minimum_votes_per_user.description", votes: question.min_votes) %></li>
9
+ </ul>
10
+ <% if question.instructions %>
11
+ <%= decidim_sanitize translated_attribute question.instructions %>
12
+ <% end %>
13
+ </div>
14
+ <div class="columns medium-4 large-3">
15
+ <div class="card card--nomargin text-center remaining-votes-counter">
16
+ <div class="card__content">
17
+ <span class="definition-data__title"><%= t(".vote_limit.left", limit: question.max_votes) %></span>
18
+ <span id="remaining-votes-count" class="extra__suport-number">
19
+ <%= question.max_votes %>
20
+ </span>
21
+ <span class="extra__suport-text"><%= t(".vote_limit.votes") %></span>
22
+ </div>
23
+ </div>
24
+ </div>
25
+ </div>
26
+ </div>
27
+ </div>
28
+
29
+ <%= javascript_include_tag "decidim/consultations/utils_multiple" %>
@@ -0,0 +1,36 @@
1
+ <%= decidim_form_for(@form,
2
+ url: decidim_consultations.question_question_multiple_votes_path(current_participatory_space),
3
+ method: :post,
4
+ html: { class: "form" }) do |f| %>
5
+
6
+ <%= render partial: "form", locals: { form: f, question: current_participatory_space } %>
7
+
8
+ <div class="section question-vote-cabin">
9
+
10
+ <div class="row column">
11
+ <div class="large-offset-4 large-4 medium-offset-3 medium-6">
12
+ <%= button_to decidim_consultations.question_question_votes_path(current_participatory_space),
13
+ method: :post,
14
+ class: "card__button button expanded",
15
+ id: "vote_button" do %>
16
+ <div class="vote-button-caption"><%= t "questions.vote_button.vote", scope: "decidim" %></div>
17
+ <% end %>
18
+ </div>
19
+
20
+ </div>
21
+
22
+ </div>
23
+ <div class="row">
24
+ <div class="column">
25
+ <%= link_to decidim_consultations.question_path(current_participatory_space),
26
+ class: "card__button button hollow float-left" do %>
27
+ &larr; <%= t("question_header.back_to_question", scope: "layouts.decidim") %>
28
+ <% end %>
29
+ </div>
30
+ </div>
31
+
32
+ <% end %>
33
+
34
+ <%= content_for :question_header_instructions do %>
35
+ <%= render partial: "decidim/consultations/question_multiple_votes/voting_rules", locals: { question: current_participatory_space } %>
36
+ <% end %>
@@ -9,4 +9,13 @@
9
9
 
10
10
  $('#question-vote-modal').foundation();
11
11
  $('#question-vote-confirm-modal').foundation();
12
+
13
+ <% if signed_in? && current_question.voted_by?(current_user) %>
14
+ $('#vote-result-callout').addClass('warning').removeClass('hide danger');
15
+ $('#vote-result-callout .callout-title').text($('#vote-result-callout').data('title-ok'));
16
+ $('#vote-result-callout .callout-message').text($('#vote-result-callout').data('message-ok'));
17
+ $('#confirm-vote-form-loader').addClass('hide');
18
+ $('#confirm-vote-form').removeClass('hide');
19
+ <% end %>
20
+
12
21
  }());
@@ -1,6 +1,10 @@
1
1
  <% if question.sorted_results.any? %>
2
+
2
3
  <div class=row>
3
4
  <h2 class=section-heading><%= t "questions.results.title", scope: "decidim" %></h2>
5
+ <% if question.multiple? %>
6
+ <%= render partial: "decidim/consultations/question_multiple_votes/results_rules", locals: { question: question } %>
7
+ <% end %>
4
8
  <div class="card card--list">
5
9
  <% question.sorted_results.each do |response| %>
6
10
  <div class=card--list__item>
@@ -1,3 +1,13 @@
1
+ <div class="row column">
2
+ <div class="callout hide" id="vote-result-callout" data-closable data-title-ok="<%= t("question_votes.create.title_success", scope: "decidim.consultations") %>" data-message-ok="<%= t("question_votes.create.success", scope: "decidim.consultations") %>" data-title-ko="<%= t("question_votes.create.title_error", scope: "decidim.consultations") %>" data-message-ko="<%= t("question_votes.create.error", scope: "decidim.consultations") %>">
3
+ <h5 class="callout-title"></h5>
4
+ <p class="callout-message"></p>
5
+ <button class="close-button" aria-label="Dismiss alert" type="button" data-close>
6
+ <span aria-hidden="true">&times;</span>
7
+ </button>
8
+ </div>
9
+ </div>
10
+
1
11
  <div class="row column question-vote-cabin">
2
12
  <div class="columns mediumlarge-4 show-for-mediumlarge previous-question">
3
13
  <%= display_next_previous_button(:previous, "float-left") %>
@@ -38,8 +48,20 @@
38
48
  </div>
39
49
  <% end %>
40
50
  <% elsif allowed_to? :vote, :question, question: question %>
41
- <%= link_to "#", class: "card__button button expanded", id: "vote_button" do %>
42
- <div class="vote-button-caption"><%= t "questions.vote_button.vote", scope: "decidim" %></div>
51
+ <% if question.multiple? %>
52
+ <%= link_to decidim_consultations.question_question_multiple_votes_path(question),
53
+ class: "card__button button expanded",
54
+ id: "multivote_button" do %>
55
+ <div class="vote-button-caption"><%= t "questions.vote_button.vote", scope: "decidim" %></div>
56
+ <% end %>
57
+ <% else %>
58
+ <%= link_to "#", class: "card__button button expanded", id: "vote_button" do %>
59
+ <div class="vote-button-caption"><%= t "questions.vote_button.vote", scope: "decidim" %></div>
60
+ <% end %>
61
+ <% end %>
62
+ <% else %>
63
+ <%= authorized_vote_modal_button(question, remote: true, class: "button expanded light button--sc") do %>
64
+ <%= t("questions.vote_button.verification_required", scope: "decidim") %>
43
65
  <% end %>
44
66
  <% end %>
45
67
  <% elsif question.consultation.active? %>
@@ -56,11 +78,14 @@
56
78
  <div class="columns mediumlarge-4 show-for-mediumlarge next-question">
57
79
  <%= display_next_previous_button(:next, "float-right") %>
58
80
  </div>
81
+ </div>
82
+
83
+ <div class="row column section hide-for-mediumlarge">
59
84
  <div class="small-buttons">
60
- <div class="columns small-6 hide-for-mediumlarge previous-question">
85
+ <div class="columns small-6 previous-question">
61
86
  <%= display_next_previous_button(:previous, "expanded") %>
62
87
  </div>
63
- <div class="columns small-6 hide-for-mediumlarge next-question">
88
+ <div class="columns small-6 next-question">
64
89
  <%= display_next_previous_button(:next, "expanded") %>
65
90
  </div>
66
91
  </div>
@@ -23,6 +23,7 @@
23
23
  class: "button expanded",
24
24
  data: { disable: true } %>
25
25
  <% end %>
26
+ <div id="confirm-vote-form-loader" class="loading-spinner hide"></div>
26
27
  </div>
27
28
  </div>
28
29
  <div class="text-center">
@@ -36,7 +36,7 @@
36
36
  <%= content_for :question_header_details do %>
37
37
  <div id="question-header-details" class="row consultations-home-intro">
38
38
  <div class="columns medium-5">
39
- <img src="<%= current_question.hero_image&.url %>" />
39
+ <img src="<%= current_question.hero_image&.url %>">
40
40
  </div>
41
41
 
42
42
  <div class="columns medium-5">
@@ -20,6 +20,8 @@
20
20
  </div>
21
21
  </div>
22
22
 
23
+ <%= yield :question_header_instructions if content_for? :question_header_instructions %>
24
+
23
25
  <div class="row column consultations-title">
24
26
  <h1 class="heading2"><%= decidim_sanitize translated_attribute question.title %></h1>
25
27
  <% unless question.hashtag.blank? %>
@@ -30,17 +32,3 @@
30
32
 
31
33
  <%= yield :question_header_details if content_for? :question_header_details %>
32
34
  </div>
33
-
34
- <% if question.external_voting %>
35
- <iframe src="<%= question.i_frame_url %>"></iframe>
36
- <% else %>
37
- <% if question.results_published? %>
38
- <%= render partial: "decidim/consultations/questions/results", locals: { question: question } %>
39
- <% else %>
40
- <div id="question-<%= question.id %>-vote-button">
41
- <%= render partial: "decidim/consultations/questions/vote_button", locals: { question: question } %>
42
- </div>
43
- <% end %>
44
- <% end %>
45
-
46
- <%= render partial: "layouts/decidim/question_components", locals: { question: question } %>
@@ -0,0 +1,11 @@
1
+ <% if question.external_voting %>
2
+ <iframe src="<%= question.i_frame_url %>"></iframe>
3
+ <% else %>
4
+ <% if question.results_published? %>
5
+ <%= render partial: "decidim/consultations/questions/results", locals: { question: question } %>
6
+ <% else %>
7
+ <div id="question-<%= question.id %>-vote-button">
8
+ <%= render partial: "decidim/consultations/questions/vote_button", locals: { question: question } %>
9
+ </div>
10
+ <% end %>
11
+ <% end %>
@@ -14,6 +14,10 @@
14
14
  <%= aria_selected_link_to t("questions", scope: "decidim.admin.menu.consultations_submenu"),
15
15
  decidim_admin_consultations.consultation_questions_path(current_consultation) %>
16
16
  </li>
17
+ <li <% if is_active_link?(decidim_admin_consultations.results_consultation_path(current_consultation)) %> class="is-active" <% end %>>
18
+ <%= aria_selected_link_to t("results", scope: "decidim.admin.menu.consultations_submenu"),
19
+ decidim_admin_consultations.results_consultation_path(current_consultation) %>
20
+ </li>
17
21
  <% end %>
18
22
  </ul>
19
23
  </div>
@@ -9,56 +9,76 @@
9
9
  </li>
10
10
  <% end %>
11
11
 
12
- <% if allowed_to?(:update, :question, question: current_participatory_space) %>
13
- <li <% if is_active_link?(decidim_admin_consultations.edit_question_path(current_participatory_space)) %> class="is-active" <% end %>>
14
- <%= aria_selected_link_to t("info", scope: "decidim.admin.menu.questions_submenu"),
15
- decidim_admin_consultations.edit_question_path(current_participatory_space) %>
16
- </li>
17
- <% end %>
12
+ <li <% if is_active_link?(decidim_admin_consultations.consultation_questions_path(current_participatory_space.consultation)) %> class="is-active" <% end %>>
13
+ <%= aria_selected_link_to t("questions", scope: "decidim.admin.menu.consultations_submenu"),
14
+ decidim_admin_consultations.consultation_questions_path(current_participatory_space.consultation) %>
18
15
 
19
- <% if allowed_to? :read, :response %>
20
- <li <% if is_active_link?(decidim_admin_consultations.responses_path(current_participatory_space)) %> class="is-active" <% end %>>
21
- <%= aria_selected_link_to t("responses", scope: "decidim.admin.menu.questions_submenu"),
22
- decidim_admin_consultations.responses_path(current_participatory_space) %>
23
- </li>
24
- <% end %>
16
+ <ul>
17
+ <% if allowed_to?(:update, :question, question: current_participatory_space) %>
18
+ <li <% if is_active_link?(decidim_admin_consultations.edit_question_path(current_participatory_space)) %> class="is-active" <% end %>>
19
+ <%= aria_selected_link_to t("info", scope: "decidim.admin.menu.questions_submenu"),
20
+ decidim_admin_consultations.edit_question_path(current_participatory_space) %>
21
+ </li>
22
+ <% end %>
25
23
 
26
- <% if allowed_to? :read, :component %>
27
- <li <% if is_active_link?(decidim_admin_consultations.components_path(current_participatory_space)) %> class="is-active" <% end %>>
28
- <%= aria_selected_link_to t("components", scope: "decidim.admin.menu.questions_submenu"),
29
- decidim_admin_consultations.components_path(current_participatory_space) %>
30
- <ul>
31
- <% current_participatory_space.components.each do |component| %>
32
- <% if component.manifest.admin_engine %>
33
- <li <% if is_active_link?(manage_component_path(component)) || is_active_link?(decidim_admin_consultations.edit_component_path(current_participatory_space, component)) || is_active_link?(decidim_admin_consultations.edit_component_permissions_path(current_participatory_space, component)) %> class="is-active" <% end %>>
34
- <%= link_to manage_component_path(component) do %>
35
- <%= translated_attribute component.name %>
36
- <% if component.primary_stat.present? %>
37
- <span class="component-counter <%= "component-counter--off" if component.primary_stat.zero? %>">
38
- <%= component.primary_stat %>
39
- </span>
24
+ <% if allowed_to?(:configure, :question, question: current_participatory_space) %>
25
+ <li <% if is_active_link?(decidim_admin_consultations.edit_question_configuration_path(current_participatory_space)) %> class="is-active" <% end %>>
26
+ <%= aria_selected_link_to t("configuration", scope: "decidim.admin.menu.questions_submenu"),
27
+ decidim_admin_consultations.edit_question_configuration_path(current_participatory_space) %>
28
+ </li>
29
+ <% end %>
30
+
31
+ <% if allowed_to? :read, :response %>
32
+ <li <% if is_active_link?(decidim_admin_consultations.responses_path(current_participatory_space)) %> class="is-active" <% end %>>
33
+ <%= aria_selected_link_to t("responses", scope: "decidim.admin.menu.questions_submenu"),
34
+ decidim_admin_consultations.responses_path(current_participatory_space) %>
35
+ </li>
36
+ <% end %>
37
+
38
+ <% if allowed_to? :read, :component %>
39
+ <li <% if is_active_link?(decidim_admin_consultations.components_path(current_participatory_space)) %> class="is-active" <% end %>>
40
+ <%= aria_selected_link_to t("components", scope: "decidim.admin.menu.questions_submenu"),
41
+ decidim_admin_consultations.components_path(current_participatory_space) %>
42
+ <ul>
43
+ <% current_participatory_space.components.each do |component| %>
44
+ <% if component.manifest.admin_engine %>
45
+ <li <% if is_active_link?(manage_component_path(component)) || is_active_link?(decidim_admin_consultations.edit_component_path(current_participatory_space, component)) || is_active_link?(decidim_admin_consultations.edit_component_permissions_path(current_participatory_space, component)) %> class="is-active" <% end %>>
46
+ <%= link_to manage_component_path(component) do %>
47
+ <%= translated_attribute component.name %>
48
+ <% if component.primary_stat.present? %>
49
+ <span class="component-counter <%= "component-counter--off" if component.primary_stat.zero? %>">
50
+ <%= component.primary_stat %>
51
+ </span>
52
+ <% end %>
40
53
  <% end %>
41
- <% end %>
42
- </li>
54
+ </li>
55
+ <% end %>
43
56
  <% end %>
44
- <% end %>
45
- </ul>
46
- </li>
47
- <% end %>
57
+ </ul>
58
+ </li>
59
+ <% end %>
48
60
 
49
- <% if allowed_to? :read, :category %>
50
- <li <% if is_active_link?(decidim_admin_consultations.categories_path(current_participatory_space)) %> class="is-active" <% end %>>
51
- <%= aria_selected_link_to t(".categories"),
52
- decidim_admin_consultations.categories_path(current_participatory_space) %>
53
- </li>
54
- <% end %>
61
+ <% if allowed_to? :read, :category %>
62
+ <li <% if is_active_link?(decidim_admin_consultations.categories_path(current_participatory_space)) %> class="is-active" <% end %>>
63
+ <%= aria_selected_link_to t(".categories"),
64
+ decidim_admin_consultations.categories_path(current_participatory_space) %>
65
+ </li>
66
+ <% end %>
67
+
68
+ <% if allowed_to? :read, :attachment %>
69
+ <li <% if is_active_link?(decidim_admin_consultations.question_attachments_path(current_participatory_space)) %> class="is-active" <% end %>>
70
+ <%= aria_selected_link_to t(".attachments"),
71
+ decidim_admin_consultations.question_attachments_path(current_participatory_space) %>
72
+ </li>
73
+ <% end %>
74
+ </ul>
75
+ </li>
76
+
77
+ <li <% if is_active_link?(decidim_admin_consultations.results_consultation_path(current_participatory_space.consultation)) %> class="is-active" <% end %>>
78
+ <%= aria_selected_link_to t("results", scope: "decidim.admin.menu.consultations_submenu"),
79
+ decidim_admin_consultations.results_consultation_path(current_participatory_space.consultation) %>
80
+ </li>
55
81
 
56
- <% if allowed_to? :read, :attachment %>
57
- <li <% if is_active_link?(decidim_admin_consultations.question_attachments_path(current_participatory_space)) %> class="is-active" <% end %>>
58
- <%= aria_selected_link_to t(".attachments"),
59
- decidim_admin_consultations.question_attachments_path(current_participatory_space) %>
60
- </li>
61
- <% end %>
62
82
  </ul>
63
83
  </div>
64
84
  <% end %>
@@ -67,6 +87,8 @@
67
87
  <div class="process-title">
68
88
  <div class="process-title-content">
69
89
  <%= link_to translated_attribute(current_participatory_space.consultation.title), decidim_consultations.consultation_path(current_participatory_space.consultation), target: "_blank" %>
90
+ &gt;
91
+ <%= strip_tags translated_attribute(current_participatory_space.title) %>
70
92
  </div>
71
93
  </div>
72
94