decidim-consultations 0.26.0 → 0.27.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (100) hide show
  1. checksums.yaml +4 -4
  2. data/app/cells/decidim/consultations/content_blocks/highlighted_consultations/show.erb +1 -1
  3. data/app/commands/decidim/consultations/admin/create_consultation.rb +1 -1
  4. data/app/commands/decidim/consultations/admin/create_question.rb +1 -1
  5. data/app/commands/decidim/consultations/admin/create_response.rb +1 -1
  6. data/app/commands/decidim/consultations/admin/create_response_group.rb +1 -1
  7. data/app/commands/decidim/consultations/admin/destroy_response_group.rb +1 -1
  8. data/app/commands/decidim/consultations/admin/publish_consultation.rb +1 -1
  9. data/app/commands/decidim/consultations/admin/publish_consultation_results.rb +1 -1
  10. data/app/commands/decidim/consultations/admin/publish_question.rb +1 -1
  11. data/app/commands/decidim/consultations/admin/unpublish_consultation.rb +1 -1
  12. data/app/commands/decidim/consultations/admin/unpublish_consultation_results.rb +1 -1
  13. data/app/commands/decidim/consultations/admin/unpublish_question.rb +1 -1
  14. data/app/commands/decidim/consultations/admin/update_consultation.rb +1 -1
  15. data/app/commands/decidim/consultations/admin/update_question.rb +1 -1
  16. data/app/commands/decidim/consultations/admin/update_question_configuration.rb +1 -1
  17. data/app/commands/decidim/consultations/admin/update_response.rb +1 -1
  18. data/app/commands/decidim/consultations/admin/update_response_group.rb +1 -1
  19. data/app/commands/decidim/consultations/multiple_vote_question.rb +1 -1
  20. data/app/commands/decidim/consultations/unvote_question.rb +1 -1
  21. data/app/commands/decidim/consultations/vote_question.rb +1 -1
  22. data/app/controllers/concerns/decidim/consultations/needs_consultation.rb +1 -1
  23. data/app/controllers/concerns/decidim/consultations/needs_question.rb +3 -1
  24. data/app/controllers/decidim/consultations/consultations_controller.rb +5 -12
  25. data/app/forms/decidim/consultations/admin/consultation_form.rb +1 -1
  26. data/app/helpers/decidim/consultations/consultations_helper.rb +1 -1
  27. data/app/helpers/decidim/consultations/questions_helper.rb +3 -3
  28. data/app/models/decidim/consultation.rb +9 -3
  29. data/app/permissions/decidim/consultations/permissions.rb +1 -3
  30. data/app/presenters/decidim/consultations/question_stats_presenter.rb +4 -2
  31. data/app/queries/decidim/consultations/admin/admin_users.rb +1 -1
  32. data/app/queries/decidim/consultations/organization_active_consultations.rb +1 -1
  33. data/app/queries/decidim/consultations/organization_consultations.rb +1 -1
  34. data/app/queries/decidim/consultations/organization_questions.rb +1 -1
  35. data/app/views/decidim/consultations/consultations/_filters.html.erb +4 -4
  36. data/app/views/decidim/consultations/consultations/index.html.erb +3 -1
  37. data/app/views/decidim/consultations/question_multiple_votes/_voting_rules.html.erb +3 -1
  38. data/app/views/decidim/consultations/questions/_vote_button.html.erb +3 -1
  39. data/app/views/decidim/consultations/questions/_vote_modal_confirm.html.erb +1 -0
  40. data/app/views/decidim/consultations/questions/show.html.erb +7 -5
  41. data/app/views/layouts/decidim/_question_components.html.erb +19 -34
  42. data/app/views/layouts/decidim/_question_header.html.erb +2 -2
  43. data/config/locales/am-ET.yml +1 -0
  44. data/config/locales/ar.yml +15 -2
  45. data/config/locales/bg.yml +1 -0
  46. data/config/locales/ca.yml +2 -2
  47. data/config/locales/cs.yml +2 -2
  48. data/config/locales/da.yml +1 -0
  49. data/config/locales/de.yml +3 -2
  50. data/config/locales/el.yml +1 -2
  51. data/config/locales/en.yml +1 -2
  52. data/config/locales/eo.yml +1 -0
  53. data/config/locales/es-MX.yml +2 -2
  54. data/config/locales/es-PY.yml +2 -2
  55. data/config/locales/es.yml +2 -2
  56. data/config/locales/et.yml +1 -0
  57. data/config/locales/eu.yml +1 -2
  58. data/config/locales/fi-plain.yml +2 -2
  59. data/config/locales/fi.yml +2 -2
  60. data/config/locales/fr-CA.yml +2 -2
  61. data/config/locales/fr.yml +2 -2
  62. data/config/locales/ga-IE.yml +1 -5
  63. data/config/locales/gl.yml +2 -2
  64. data/config/locales/hr.yml +1 -0
  65. data/config/locales/hu.yml +2 -2
  66. data/config/locales/id-ID.yml +1 -2
  67. data/config/locales/is-IS.yml +2 -2
  68. data/config/locales/it.yml +1 -2
  69. data/config/locales/ja.yml +2 -2
  70. data/config/locales/ko.yml +1 -0
  71. data/config/locales/lb.yml +1 -2
  72. data/config/locales/lt.yml +1 -0
  73. data/config/locales/lv.yml +1 -2
  74. data/config/locales/mt.yml +1 -0
  75. data/config/locales/nl.yml +1 -2
  76. data/config/locales/no.yml +1 -2
  77. data/config/locales/om-ET.yml +1 -0
  78. data/config/locales/pl.yml +1 -2
  79. data/config/locales/pt-BR.yml +2 -3
  80. data/config/locales/pt.yml +1 -2
  81. data/config/locales/ro-RO.yml +2 -2
  82. data/config/locales/ru.yml +1 -2
  83. data/config/locales/si-LK.yml +1 -0
  84. data/config/locales/sk.yml +1 -2
  85. data/config/locales/sl.yml +1 -0
  86. data/config/locales/so-SO.yml +1 -0
  87. data/config/locales/sr-CS.yml +1 -0
  88. data/config/locales/sv.yml +2 -2
  89. data/config/locales/sw-KE.yml +1 -0
  90. data/config/locales/ti-ER.yml +1 -0
  91. data/config/locales/tr-TR.yml +1 -2
  92. data/config/locales/uk.yml +1 -2
  93. data/config/locales/val-ES.yml +1 -0
  94. data/config/locales/vi.yml +1 -0
  95. data/config/locales/zh-CN.yml +1 -2
  96. data/config/locales/zh-TW.yml +1 -0
  97. data/lib/decidim/consultations/participatory_space.rb +7 -7
  98. data/lib/decidim/consultations/version.rb +1 -1
  99. metadata +14 -15
  100. data/app/services/decidim/consultations/consultation_search.rb +0 -51
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 430cbcb1070cb14328cf12a1537ec077224271351181b4862d182bf7f4609ae0
4
- data.tar.gz: 99beaff5b1d41354f2f20834c3ad13451cea285e040fd89e998386bad680d2d8
3
+ metadata.gz: ed2b64c4b2a1e4fe0318cc12cfab14df6d0d890bd1a92cfd67dd00fdb6333d18
4
+ data.tar.gz: 9d68171ea724aa3f93c18a9e9f2d4b88da2bc8f3dd244cdc2d223fc69f7929d3
5
5
  SHA512:
6
- metadata.gz: af792d4208dc86cc8e6e72e6487b03de2ee003a9974f17d4fea3884d8c01d114d7cf06cd0b9fde43793938fe8ad5f492ca77c619f8b521e69e9e562c906cfdf1
7
- data.tar.gz: d9a8def4b310e358fe87cdd0e7d82c59c97b4f567de180ee678f3318a44d52a380e88beee488f936ff1ad771a52ecd7374c59e0b717db38b4298a7087bb12bf2
6
+ metadata.gz: 387ce250a35f9dcc9d9023097e98299c39eb0ad03244c3a34aee94b78b38df109f6e08f892321f80a151a94550377932d3c6f618e51b9429e843bab4d12c8f60
7
+ data.tar.gz: 5ec9a304e767896b408bcc7df7f59de3c33804bcc7b8002d9c2beac84f346b3e18c1bead3cbd45441e14878f619622de5768ef6bbd1afee25cd37771a93c366a
@@ -1,4 +1,4 @@
1
- <section class="wrapper-home home-section">
1
+ <section id="highlighted_consultations" class="wrapper-home home-section">
2
2
  <div class="row" id="highlighted-consultations">
3
3
  <h3 class="section-heading"><%= t("active_consultations", scope: i18n_scope) %></h3>
4
4
  <div class="row collapse">
@@ -5,7 +5,7 @@ module Decidim
5
5
  module Admin
6
6
  # A command with all the business logic when creating a new participatory
7
7
  # consultation in the system.
8
- class CreateConsultation < Rectify::Command
8
+ class CreateConsultation < Decidim::Command
9
9
  # Public: Initializes the command.
10
10
  #
11
11
  # form - A form object with the params.
@@ -4,7 +4,7 @@ module Decidim
4
4
  module Consultations
5
5
  module Admin
6
6
  # A command with all the business logic when creating a new question
7
- class CreateQuestion < Rectify::Command
7
+ class CreateQuestion < Decidim::Command
8
8
  # Public: Initializes the command.
9
9
  #
10
10
  # form - A form object with the params.
@@ -4,7 +4,7 @@ module Decidim
4
4
  module Consultations
5
5
  module Admin
6
6
  # A command with all the business logic when creating a new response
7
- class CreateResponse < Rectify::Command
7
+ class CreateResponse < Decidim::Command
8
8
  # Public: Initializes the command.
9
9
  #
10
10
  # form - A form object with the params.
@@ -4,7 +4,7 @@ module Decidim
4
4
  module Consultations
5
5
  module Admin
6
6
  # A command with all the business logic when creating a new response group
7
- class CreateResponseGroup < Rectify::Command
7
+ class CreateResponseGroup < Decidim::Command
8
8
  # Public: Initializes the command.
9
9
  #
10
10
  # form - A form object with the params.
@@ -5,7 +5,7 @@ module Decidim
5
5
  module Admin
6
6
  # A command with all the business logic to destroy a response group in the
7
7
  # system.
8
- class DestroyResponseGroup < Rectify::Command
8
+ class DestroyResponseGroup < Decidim::Command
9
9
  # Public: Initializes the command.
10
10
  #
11
11
  # response_group - A ResponseGroup that will be destroyed
@@ -4,7 +4,7 @@ module Decidim
4
4
  module Consultations
5
5
  module Admin
6
6
  # A command that sets a consultation as published.
7
- class PublishConsultation < Rectify::Command
7
+ class PublishConsultation < Decidim::Command
8
8
  # Public: Initializes the command.
9
9
  #
10
10
  # consultation - A Consultation that will be published
@@ -4,7 +4,7 @@ module Decidim
4
4
  module Consultations
5
5
  module Admin
6
6
  # A command that sets a consultation results as published.
7
- class PublishConsultationResults < Rectify::Command
7
+ class PublishConsultationResults < Decidim::Command
8
8
  # Public: Initializes the command.
9
9
  #
10
10
  # consultation - A Consultation that will get its results published
@@ -4,7 +4,7 @@ module Decidim
4
4
  module Consultations
5
5
  module Admin
6
6
  # A command that sets a question as published.
7
- class PublishQuestion < Rectify::Command
7
+ class PublishQuestion < Decidim::Command
8
8
  # Public: Initializes the command.
9
9
  #
10
10
  # question - A Question that will be published
@@ -4,7 +4,7 @@ module Decidim
4
4
  module Consultations
5
5
  module Admin
6
6
  # A command that sets a consultation as unpublished.
7
- class UnpublishConsultation < Rectify::Command
7
+ class UnpublishConsultation < Decidim::Command
8
8
  # Public: Initializes the command.
9
9
  #
10
10
  # consultation - A Consultation that will be unpublished
@@ -4,7 +4,7 @@ module Decidim
4
4
  module Consultations
5
5
  module Admin
6
6
  # A command that sets a consultation results as unpublished.
7
- class UnpublishConsultationResults < Rectify::Command
7
+ class UnpublishConsultationResults < Decidim::Command
8
8
  # Public: Initializes the command.
9
9
  #
10
10
  # consultation - A Consultation that will get its results unpublished
@@ -4,7 +4,7 @@ module Decidim
4
4
  module Consultations
5
5
  module Admin
6
6
  # A command that sets a question as unpublished.
7
- class UnpublishQuestion < Rectify::Command
7
+ class UnpublishQuestion < Decidim::Command
8
8
  # Public: Initializes the command.
9
9
  #
10
10
  # question - A Question that will be unpublished
@@ -5,7 +5,7 @@ module Decidim
5
5
  module Admin
6
6
  # A command with all the business logic when updating an existing participatory
7
7
  # consultation in the system.
8
- class UpdateConsultation < Rectify::Command
8
+ class UpdateConsultation < Decidim::Command
9
9
  include ::Decidim::AttachmentAttributesMethods
10
10
 
11
11
  # Public: Initializes the command.
@@ -5,7 +5,7 @@ module Decidim
5
5
  module Admin
6
6
  # A command with all the business logic when updating an existing participatory
7
7
  # question in the system.
8
- class UpdateQuestion < Rectify::Command
8
+ class UpdateQuestion < Decidim::Command
9
9
  include ::Decidim::AttachmentAttributesMethods
10
10
 
11
11
  # Public: Initializes the command.
@@ -4,7 +4,7 @@ module Decidim
4
4
  module Consultations
5
5
  module Admin
6
6
  # A command that configures how many and how much questions can be voted.
7
- class UpdateQuestionConfiguration < Rectify::Command
7
+ class UpdateQuestionConfiguration < Decidim::Command
8
8
  # Public: Initializes the command.
9
9
  #
10
10
  # question - the Question to update
@@ -4,7 +4,7 @@ module Decidim
4
4
  module Consultations
5
5
  module Admin
6
6
  # A command with all the business logic when updating an response in the system.
7
- class UpdateResponse < Rectify::Command
7
+ class UpdateResponse < Decidim::Command
8
8
  # Public: Initializes the command.
9
9
  #
10
10
  # response - the response to update
@@ -4,7 +4,7 @@ module Decidim
4
4
  module Consultations
5
5
  module Admin
6
6
  # A command with all the business logic when updating a new response group
7
- class UpdateResponseGroup < Rectify::Command
7
+ class UpdateResponseGroup < Decidim::Command
8
8
  # Public: Initializes the command.
9
9
  #
10
10
  # response_group - the response group to update
@@ -3,7 +3,7 @@
3
3
  module Decidim
4
4
  module Consultations
5
5
  # A command with all the business logic when a user votes a multivote question.
6
- class MultipleVoteQuestion < Rectify::Command
6
+ class MultipleVoteQuestion < Decidim::Command
7
7
  # Public: Initializes the command.
8
8
  #
9
9
  # form - A Decidim::Consultations::MultiVoteForm object.
@@ -3,7 +3,7 @@
3
3
  module Decidim
4
4
  module Consultations
5
5
  # A command with all the business logic when a user unvotes a question.
6
- class UnvoteQuestion < Rectify::Command
6
+ class UnvoteQuestion < Decidim::Command
7
7
  # Public: Initializes the command.
8
8
  #
9
9
  # question - A Decidim::Consultations::Question object.
@@ -3,7 +3,7 @@
3
3
  module Decidim
4
4
  module Consultations
5
5
  # A command with all the business logic when a user votes a question.
6
- class VoteQuestion < Rectify::Command
6
+ class VoteQuestion < Decidim::Command
7
7
  # Public: Initializes the command.
8
8
  #
9
9
  # form - A Decidim::Consultations::VoteForm object.
@@ -38,7 +38,7 @@ module Decidim
38
38
 
39
39
  def detect_consultation
40
40
  request.env["current_consultation"] ||
41
- organization_consultations.find_by(slug: params[:consultation_slug] || params[:slug])
41
+ organization_consultations.find_by!(slug: params[:consultation_slug] || params[:slug])
42
42
  end
43
43
 
44
44
  def organization_consultations
@@ -82,8 +82,10 @@ module Decidim
82
82
  private
83
83
 
84
84
  def detect_question
85
+ return unless request.env["current_question"] || params[:question_slug] || params[:slug]
86
+
85
87
  request.env["current_question"] ||
86
- OrganizationQuestions.for(current_organization).find_by(slug: params[:question_slug] || params[:slug])
88
+ OrganizationQuestions.for(current_organization).find_by!(slug: params[:question_slug] || params[:slug])
87
89
  end
88
90
 
89
91
  def detect_consultation
@@ -38,28 +38,21 @@ module Decidim
38
38
  end
39
39
 
40
40
  def consultations
41
- @consultations = search.results
41
+ @consultations = search.result
42
42
  @consultations = reorder(@consultations)
43
43
  @consultations = paginate(@consultations)
44
44
  end
45
45
 
46
46
  alias collection consultations
47
47
 
48
- def search_klass
49
- ConsultationSearch
48
+ def search_collection
49
+ Consultation.where(organization: current_organization).published
50
50
  end
51
51
 
52
52
  def default_filter_params
53
53
  {
54
- search_text: "",
55
- state: "all"
56
- }
57
- end
58
-
59
- def context_params
60
- {
61
- organization: current_organization,
62
- current_user: current_user
54
+ search_text_cont: "",
55
+ with_any_date: "all"
63
56
  }
64
57
  end
65
58
  end
@@ -17,7 +17,7 @@ module Decidim
17
17
  attribute :banner_image
18
18
  attribute :remove_banner_image, Boolean, default: false
19
19
  attribute :introductory_video_url, String
20
- attribute :introductory_image, String
20
+ attribute :introductory_image
21
21
  attribute :remove_introductory_image, Boolean, default: false
22
22
  attribute :decidim_highlighted_scope_id, Integer
23
23
  attribute :start_voting_date, Decidim::Attributes::LocalizedDate
@@ -4,7 +4,7 @@ module Decidim
4
4
  module Consultations
5
5
  module ConsultationsHelper
6
6
  # Returns options for state filter selector.
7
- def options_for_state_filter
7
+ def options_for_date_filter
8
8
  [
9
9
  ["all", t("consultations.filters.all", scope: "decidim")],
10
10
  ["active", t("consultations.filters.active", scope: "decidim")],
@@ -34,11 +34,11 @@ module Decidim
34
34
  tag = "button"
35
35
  html_options ||= {}
36
36
 
37
- if !current_user
38
- html_options["data-open"] = "loginModal"
39
- else
37
+ if current_user
40
38
  html_options["data-open"] = "authorizationModal"
41
39
  html_options["data-open-url"] = decidim_consultations.authorization_vote_modal_question_path(question)
40
+ else
41
+ html_options["data-open"] = "loginModal"
42
42
  end
43
43
 
44
44
  html_options["onclick"] = "event.preventDefault();"
@@ -14,6 +14,7 @@ module Decidim
14
14
  include Decidim::Searchable
15
15
  include Decidim::HasUploadValidations
16
16
  include Decidim::TranslatableResource
17
+ include Decidim::FilterableResource
17
18
 
18
19
  translatable_fields :title, :subtitle, :description
19
20
 
@@ -51,6 +52,8 @@ module Decidim
51
52
  scope :finished, -> { published.where("end_voting_date < ?", Time.now.utc) }
52
53
  scope :order_by_most_recent, -> { order(created_at: :desc) }
53
54
 
55
+ scope_search_multi :with_any_date, [:active, :upcoming, :finished]
56
+
54
57
  searchable_fields({
55
58
  participatory_space: :itself,
56
59
  A: :title,
@@ -106,9 +109,12 @@ module Decidim
106
109
  !active?
107
110
  end
108
111
 
109
- # Allow ransacker to search for a key in a hstore column (`title`.`en`)
110
- ransacker :title do |parent|
111
- Arel::Nodes::InfixOperation.new("->>", parent.table[:title], Arel::Nodes.build_quoted(I18n.locale.to_s))
112
+ # Create i18n ransackers for :title, :subtitle and :description.
113
+ # Create the :search_text ransacker alias for searching from all of these.
114
+ ransacker_i18n_multi :search_text, [:title, :subtitle, :description]
115
+
116
+ def self.ransackable_scopes(_auth_object = nil)
117
+ [:with_any_date]
112
118
  end
113
119
  end
114
120
  end
@@ -36,14 +36,12 @@ module Decidim
36
36
  return unless permission_action.scope == :public
37
37
 
38
38
  case permission_action.subject
39
- when :consultation_list
39
+ when :consultation_list, :participatory_space
40
40
  allow!
41
41
  when :consultation
42
42
  toggle_allow(consultation.published? || user&.admin?)
43
43
  when :question
44
44
  toggle_allow(question.published? || user&.admin?)
45
- when :participatory_space
46
- allow!
47
45
  end
48
46
  end
49
47
 
@@ -3,8 +3,10 @@
3
3
  module Decidim
4
4
  module Consultations
5
5
  # A presenter to render statistics in the homepage.
6
- class QuestionStatsPresenter < Rectify::Presenter
7
- attribute :question, Decidim::Consultations::Question
6
+ class QuestionStatsPresenter < SimpleDelegator
7
+ def question
8
+ __getobj__.fetch(:question)
9
+ end
8
10
 
9
11
  def supports_count
10
12
  question.votes_count
@@ -4,7 +4,7 @@ module Decidim
4
4
  module Consultations
5
5
  module Admin
6
6
  # A class used to find the admins for a consultation or an organization consultations.
7
- class AdminUsers < Rectify::Query
7
+ class AdminUsers < Decidim::Query
8
8
  # Syntactic sugar to initialize the class and return the queried objects.
9
9
  #
10
10
  # consultation - a consultation that needs to find its consultation admins
@@ -3,7 +3,7 @@
3
3
  module Decidim
4
4
  module Consultations
5
5
  # This query class filters all consultations given an organization.
6
- class OrganizationActiveConsultations < Rectify::Query
6
+ class OrganizationActiveConsultations < Decidim::Query
7
7
  def self.for(organization)
8
8
  new(organization).query
9
9
  end
@@ -3,7 +3,7 @@
3
3
  module Decidim
4
4
  module Consultations
5
5
  # This query class filters all consultations given an organization.
6
- class OrganizationConsultations < Rectify::Query
6
+ class OrganizationConsultations < Decidim::Query
7
7
  def self.for(organization)
8
8
  new(organization).query
9
9
  end
@@ -3,7 +3,7 @@
3
3
  module Decidim
4
4
  module Consultations
5
5
  # This query class filters all questions given an organization.
6
- class OrganizationQuestions < Rectify::Query
6
+ class OrganizationQuestions < Decidim::Query
7
7
  def self.for(organization)
8
8
  new(organization).query
9
9
  end
@@ -4,7 +4,7 @@
4
4
  <div class="filters__section">
5
5
  <div class="filters__search">
6
6
  <div class="input-group">
7
- <%= form.search_field :search_text,
7
+ <%= form.search_field :search_text_cont,
8
8
  label: false,
9
9
  class: "input-group-field",
10
10
  placeholder: t("consultations.filters.search", scope: "decidim"),
@@ -20,11 +20,11 @@
20
20
  </div>
21
21
  </div>
22
22
 
23
- <%= form.collection_radio_buttons :state,
24
- options_for_state_filter,
23
+ <%= form.collection_radio_buttons :with_any_date,
24
+ options_for_date_filter,
25
25
  :first,
26
26
  :last,
27
- { legend_title: t("consultations.filters.state", scope: "decidim") },
27
+ { legend_title: t("consultations.filters.date", scope: "decidim") },
28
28
  "aria-controls": "consultations" %>
29
29
 
30
30
  <%= hidden_field_tag :order, order, id: nil, class: "order_filter" %>
@@ -31,4 +31,6 @@ edit_link(
31
31
  </div>
32
32
  <% end %>
33
33
 
34
- <%= javascript_pack_tag "decidim_consultations" %>
34
+ <% content_for :js_content do %>
35
+ <%= javascript_pack_tag "decidim_consultations" %>
36
+ <% end %>
@@ -26,4 +26,6 @@
26
26
  </div>
27
27
  </div>
28
28
 
29
- <%= javascript_pack_tag "decidim_consultations" %>
29
+ <% content_for :js_content do %>
30
+ <%= javascript_pack_tag "decidim_consultations" %>
31
+ <% end %>
@@ -96,4 +96,6 @@
96
96
 
97
97
  <%= render partial: "decidim/consultations/questions/vote_modal", locals: { question: question } %>
98
98
  <%= render partial: "decidim/consultations/questions/vote_modal_confirm", locals: { question: question } %>
99
- <%= javascript_pack_tag "decidim_consultations" %>
99
+ <% content_for :js_content do %>
100
+ <%= javascript_pack_tag "decidim_consultations" %>
101
+ <% end %>
@@ -17,6 +17,7 @@
17
17
  <div class="row">
18
18
  <div class="columns medium-8 medium-offset-2">
19
19
  <%= form_with url: decidim_consultations.question_question_votes_path(question),
20
+ local: false,
20
21
  id: "confirm-vote-form" do |form| %>
21
22
  <%= form.hidden_field :decidim_consultations_response_id, id: "decidim_consultations_response_id" %>
22
23
  <%= form.submit t("questions.vote_modal_confirm.confirm", scope: "decidim"),
@@ -40,20 +40,22 @@
40
40
 
41
41
  <div class="columns medium-5">
42
42
  <% unless translated_attribute(current_question.origin_scope).blank? %>
43
- <h4 class="heading6"><%= t "question.origin_scope", scope: "activemodel.attributes" %></h4>
43
+ <h3 class="heading6"><%= t "question.origin_scope", scope: "activemodel.attributes" %></h3>
44
44
  <p><%= translated_attribute current_question.origin_scope %></p>
45
45
  <% end %>
46
46
 
47
- <h4 class="heading6"><%= t "question.promoter_group", scope: "activemodel.attributes" %></h4>
47
+ <h3 class="heading6"><%= t "question.promoter_group", scope: "activemodel.attributes" %></h3>
48
48
  <p><%= translated_attribute current_question.promoter_group %></p>
49
49
 
50
- <h4 class="heading6"><%= t "question.scope", scope: "activemodel.attributes" %></h4>
50
+ <h3 class="heading6"><%= t "question.scope", scope: "activemodel.attributes" %></h3>
51
51
  <p><%= translated_attribute current_question.scope.name %></p>
52
52
 
53
- <h4 class="heading6"><%= t "question.participatory_scope", scope: "activemodel.attributes" %></h4>
53
+ <h3 class="heading6"><%= t "question.participatory_scope", scope: "activemodel.attributes" %></h3>
54
54
  <p><%= translated_attribute current_question.participatory_scope %></p>
55
55
  </div>
56
56
  </div>
57
57
  <% end %>
58
58
 
59
- <%= javascript_pack_tag "decidim_consultations" %>
59
+ <% content_for :js_content do %>
60
+ <%= javascript_pack_tag "decidim_consultations" %>
61
+ <% end %>
@@ -1,36 +1,21 @@
1
- <div class="row column">
2
- <div class="process-nav consultations-nav">
3
- <button class="process-nav__trigger hide-for-medium" data-toggle="process-nav-content">
4
- <%= icon "caret-bottom", class: "icon--small process-nav__trigger__icon", aria_label: t(".unfold"), role: "img" %>
5
- <span class="process-nav__link">
6
- <% if self.try(:current_component) %>
7
- <%= component_icon(current_component) %>
8
- <%= translated_attribute(current_component.name) %>
9
- <% else %>
10
- <%= external_icon "media/images/decidim_pages.svg", role: "img", "aria-hidden": true %>
11
- <%= t ".question_menu_item" %>
12
- <% end %>
13
- </span>
14
- </button>
1
+ <div class="row column consultations-nav">
2
+ <%
3
+ components = question.components.published.or(Decidim::Component.where(id: self.try(:current_component)))
4
+ %>
15
5
 
16
- <%
17
- components = question.components.published.or(Decidim::Component.where(id: self.try(:current_component)))
18
- %>
19
-
20
- <%=
21
- extended_navigation_bar([
22
- {
23
- name: t(".question_menu_item"),
24
- url: decidim_consultations.question_path(question),
25
- active: is_active_link?(decidim_consultations.question_path(question), :exclusive)
26
- }
27
- ] + components.map do |component|
28
- {
29
- name: translated_attribute(component.name),
30
- url: main_component_path(component),
31
- active: is_active_link?(main_component_path(component), :inclusive)
32
- }
33
- end)
34
- %>
35
- </div>
6
+ <%=
7
+ extended_navigation_bar([
8
+ {
9
+ name: t(".question_menu_item"),
10
+ url: decidim_consultations.question_path(question),
11
+ active: is_active_link?(decidim_consultations.question_path(question), :exclusive)
12
+ }
13
+ ] + components.map do |component|
14
+ {
15
+ name: translated_attribute(component.name),
16
+ url: main_component_path(component),
17
+ active: is_active_link?(main_component_path(component), :inclusive)
18
+ }
19
+ end)
20
+ %>
36
21
  </div>
@@ -23,10 +23,10 @@
23
23
  <%= yield :question_header_instructions if content_for? :question_header_instructions %>
24
24
 
25
25
  <div class="row column consultations-title">
26
- <h1 class="heading2"><%= decidim_sanitize translated_attribute question.title %></h1>
26
+ <h2 class="heading2"><%= decidim_sanitize translated_attribute question.title %></h2>
27
27
  <% unless question.hashtag.blank? %>
28
28
  <div class="text-center">
29
- <%= link_to "##{question.hashtag}", "https://twitter.com/hashtag/#{question.hashtag}", target: "_blank" %>
29
+ <%= link_to "##{question.hashtag}", twitter_hashtag_url(question.hashtag), target: "_blank" %>
30
30
  </div>
31
31
  <% end %>
32
32
 
@@ -1 +1,2 @@
1
+ ---
1
2
  am: