decidim-consultations 0.26.10 → 0.27.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (125) hide show
  1. checksums.yaml +4 -4
  2. data/app/cells/decidim/consultations/consultation_m_cell.rb +3 -1
  3. data/app/cells/decidim/consultations/content_blocks/highlighted_consultations/show.erb +2 -2
  4. data/app/commands/decidim/consultations/admin/create_consultation.rb +1 -1
  5. data/app/commands/decidim/consultations/admin/create_question.rb +1 -1
  6. data/app/commands/decidim/consultations/admin/create_response.rb +1 -1
  7. data/app/commands/decidim/consultations/admin/create_response_group.rb +1 -1
  8. data/app/commands/decidim/consultations/admin/destroy_response_group.rb +1 -1
  9. data/app/commands/decidim/consultations/admin/publish_consultation.rb +1 -1
  10. data/app/commands/decidim/consultations/admin/publish_consultation_results.rb +1 -1
  11. data/app/commands/decidim/consultations/admin/publish_question.rb +1 -1
  12. data/app/commands/decidim/consultations/admin/unpublish_consultation.rb +1 -1
  13. data/app/commands/decidim/consultations/admin/unpublish_consultation_results.rb +1 -1
  14. data/app/commands/decidim/consultations/admin/unpublish_question.rb +1 -1
  15. data/app/commands/decidim/consultations/admin/update_consultation.rb +1 -1
  16. data/app/commands/decidim/consultations/admin/update_question.rb +1 -1
  17. data/app/commands/decidim/consultations/admin/update_question_configuration.rb +1 -1
  18. data/app/commands/decidim/consultations/admin/update_response.rb +1 -1
  19. data/app/commands/decidim/consultations/admin/update_response_group.rb +1 -1
  20. data/app/commands/decidim/consultations/multiple_vote_question.rb +1 -1
  21. data/app/commands/decidim/consultations/unvote_question.rb +1 -1
  22. data/app/commands/decidim/consultations/vote_question.rb +1 -1
  23. data/app/controllers/decidim/consultations/consultations_controller.rb +5 -12
  24. data/app/forms/decidim/consultations/admin/consultation_form.rb +1 -1
  25. data/app/helpers/decidim/consultations/consultations_helper.rb +1 -1
  26. data/app/helpers/decidim/consultations/questions_helper.rb +3 -3
  27. data/app/models/decidim/consultation.rb +9 -3
  28. data/app/permissions/decidim/consultations/permissions.rb +1 -3
  29. data/app/presenters/decidim/consultations/question_stats_presenter.rb +4 -2
  30. data/app/queries/decidim/consultations/admin/admin_users.rb +1 -1
  31. data/app/queries/decidim/consultations/organization_active_consultations.rb +1 -1
  32. data/app/queries/decidim/consultations/organization_consultations.rb +1 -1
  33. data/app/queries/decidim/consultations/organization_questions.rb +1 -1
  34. data/app/views/decidim/consultations/_consultation.html.erb +1 -1
  35. data/app/views/decidim/consultations/admin/consultations/_form.html.erb +1 -1
  36. data/app/views/decidim/consultations/admin/consultations/edit.html.erb +0 -1
  37. data/app/views/decidim/consultations/admin/consultations/index.html.erb +0 -2
  38. data/app/views/decidim/consultations/admin/consultations/new.html.erb +0 -1
  39. data/app/views/decidim/consultations/admin/question_configuration/_form.html.erb +1 -1
  40. data/app/views/decidim/consultations/admin/questions/_form.html.erb +3 -3
  41. data/app/views/decidim/consultations/admin/questions/edit.html.erb +0 -1
  42. data/app/views/decidim/consultations/admin/questions/index.html.erb +0 -2
  43. data/app/views/decidim/consultations/admin/questions/new.html.erb +0 -1
  44. data/app/views/decidim/consultations/admin/responses/edit.html.erb +0 -1
  45. data/app/views/decidim/consultations/admin/responses/index.html.erb +0 -1
  46. data/app/views/decidim/consultations/admin/responses/new.html.erb +0 -1
  47. data/app/views/decidim/consultations/consultations/_consultation_card.html.erb +1 -1
  48. data/app/views/decidim/consultations/consultations/_consultation_details.html.erb +2 -2
  49. data/app/views/decidim/consultations/consultations/_filters.html.erb +4 -4
  50. data/app/views/decidim/consultations/consultations/_question.html.erb +2 -2
  51. data/app/views/decidim/consultations/consultations/index.html.erb +3 -1
  52. data/app/views/decidim/consultations/question_multiple_votes/_voting_rules.html.erb +3 -1
  53. data/app/views/decidim/consultations/questions/_vote_button.html.erb +3 -1
  54. data/app/views/decidim/consultations/questions/_vote_modal.html.erb +1 -1
  55. data/app/views/decidim/consultations/questions/_vote_modal_confirm.html.erb +1 -0
  56. data/app/views/decidim/consultations/questions/show.html.erb +6 -4
  57. data/app/views/layouts/decidim/_consultation_header.html.erb +1 -1
  58. data/app/views/layouts/decidim/_question_header.html.erb +2 -2
  59. data/config/locales/am-ET.yml +1 -0
  60. data/config/locales/ar.yml +2 -22
  61. data/config/locales/bg.yml +1 -0
  62. data/config/locales/ca.yml +2 -5
  63. data/config/locales/cs.yml +3 -6
  64. data/config/locales/da.yml +1 -0
  65. data/config/locales/de.yml +5 -8
  66. data/config/locales/el.yml +1 -11
  67. data/config/locales/en.yml +1 -5
  68. data/config/locales/eo.yml +1 -0
  69. data/config/locales/es-MX.yml +2 -5
  70. data/config/locales/es-PY.yml +2 -5
  71. data/config/locales/es.yml +2 -5
  72. data/config/locales/et.yml +1 -0
  73. data/config/locales/eu.yml +47 -51
  74. data/config/locales/fi-plain.yml +2 -5
  75. data/config/locales/fi.yml +9 -12
  76. data/config/locales/fr-CA.yml +3 -6
  77. data/config/locales/fr.yml +4 -7
  78. data/config/locales/ga-IE.yml +1 -1
  79. data/config/locales/gl.yml +2 -1
  80. data/config/locales/hr.yml +1 -0
  81. data/config/locales/hu.yml +2 -11
  82. data/config/locales/id-ID.yml +1 -1
  83. data/config/locales/is-IS.yml +2 -1
  84. data/config/locales/it.yml +1 -1
  85. data/config/locales/ja.yml +2 -5
  86. data/config/locales/ko.yml +1 -0
  87. data/config/locales/lb.yml +1 -3
  88. data/config/locales/lt.yml +1 -398
  89. data/config/locales/lv.yml +1 -1
  90. data/config/locales/mt.yml +1 -0
  91. data/config/locales/nl.yml +2 -2
  92. data/config/locales/no.yml +1 -1
  93. data/config/locales/om-ET.yml +1 -0
  94. data/config/locales/pl.yml +1 -5
  95. data/config/locales/pt-BR.yml +2 -2
  96. data/config/locales/pt.yml +1 -1
  97. data/config/locales/ro-RO.yml +2 -5
  98. data/config/locales/ru.yml +1 -3
  99. data/config/locales/si-LK.yml +1 -0
  100. data/config/locales/sk.yml +1 -1
  101. data/config/locales/sl.yml +1 -0
  102. data/config/locales/so-SO.yml +1 -0
  103. data/config/locales/sr-CS.yml +1 -0
  104. data/config/locales/sv.yml +2 -5
  105. data/config/locales/sw-KE.yml +1 -0
  106. data/config/locales/ti-ER.yml +1 -0
  107. data/config/locales/tr-TR.yml +1 -1
  108. data/config/locales/uk.yml +1 -3
  109. data/config/locales/val-ES.yml +1 -0
  110. data/config/locales/vi.yml +1 -0
  111. data/config/locales/zh-CN.yml +1 -1
  112. data/config/locales/zh-TW.yml +1 -368
  113. data/lib/decidim/consultations/participatory_space.rb +7 -7
  114. data/lib/decidim/consultations/version.rb +1 -1
  115. metadata +14 -24
  116. data/app/scrubbers/decidim/consultations/question_title_scrubber.rb +0 -17
  117. data/app/services/decidim/consultations/consultation_search.rb +0 -51
  118. data/config/locales/fa-IR.yml +0 -1
  119. data/config/locales/gn-PY.yml +0 -1
  120. data/config/locales/ka-GE.yml +0 -1
  121. data/config/locales/kaa.yml +0 -15
  122. data/config/locales/lo-LA.yml +0 -1
  123. data/config/locales/oc-FR.yml +0 -1
  124. data/config/locales/sq-AL.yml +0 -1
  125. data/config/locales/th-TH.yml +0 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e22dd2e51512ae29d59f4a5880408a182ff91f678ccc89726496f4b9de04a4bb
4
- data.tar.gz: fe56bd5264aa00ccc5061519d9eb65d931b326047ed03803cddbb6737416d208
3
+ metadata.gz: ed2b64c4b2a1e4fe0318cc12cfab14df6d0d890bd1a92cfd67dd00fdb6333d18
4
+ data.tar.gz: 9d68171ea724aa3f93c18a9e9f2d4b88da2bc8f3dd244cdc2d223fc69f7929d3
5
5
  SHA512:
6
- metadata.gz: 765f2192ee594415283d2352a506fa1434ddb0dc6157c207f2dae389fa0d8dfdad15fe68029844f06d663e641aa7e6d98b8fac75b10e1337910189fb31454aad
7
- data.tar.gz: 6bbbe197e5cc9e1652427f61c818d2bc9733cbc0eb93c7a2a1ec567e75e6e84e73fdc6c4cfe3358ad87bb4a6600994561ea57a87dcc743412fbf8fa4fe96080a
6
+ metadata.gz: 387ce250a35f9dcc9d9023097e98299c39eb0ad03244c3a34aee94b78b38df109f6e08f892321f80a151a94550377932d3c6f618e51b9429e843bab4d12c8f60
7
+ data.tar.gz: 5ec9a304e767896b408bcc7df7f59de3c33804bcc7b8002d9c2beac84f346b3e18c1bead3cbd45441e14878f619622de5768ef6bbd1afee25cd37771a93c366a
@@ -34,7 +34,9 @@ module Decidim
34
34
  # find the opening `<p>` tag and include the badge right after it. This
35
35
  # makes the layout look good.
36
36
  def description
37
- render(:badge) + truncate(strip_tags(super), length: 100)
37
+ text = super
38
+ text.sub!(/<p>/, "<p>#{render :badge}")
39
+ html_truncate(text, length: 100)
38
40
  end
39
41
 
40
42
  def resource_path
@@ -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">
@@ -7,7 +7,7 @@
7
7
  <% highlighted_consultations.each do |consultation| %>
8
8
  <div class="column">
9
9
  <%= link_to decidim_consultations.consultation_path(consultation), class: "card card--consultation card--mini" do %>
10
- <div class="card__image-top" style="background-image:url('<%= consultation.attached_uploader(:banner_image).path %>')"></div>
10
+ <div class="card__image-top" style="background-image:url(<%= consultation.attached_uploader(:banner_image).path %>)"></div>
11
11
  <div class="card__content">
12
12
  <span class="card__title card__link"><%= translated_attribute consultation.title %></span>
13
13
  <span class="card--process__small"><%= voting_ends_text_for(consultation) %></span>
@@ -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,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
@@ -1,7 +1,7 @@
1
1
  <%= link_to consultation_path(consultation), class: "consultations-banner" do %>
2
2
  <div class="consultations-header consultations-home-banner row column">
3
3
  <div class="row column consultations-header__main"
4
- style="background-image:url('<%= consultation.attached_uploader(:banner_image).path %>');">
4
+ style="background-image:url(<%= consultation.attached_uploader(:banner_image).path %>);">
5
5
  <div class="consultations-header__container row">
6
6
  <div class="columns mediumlarge-9 consultations-header__info">
7
7
  <div>
@@ -15,7 +15,7 @@
15
15
  </div>
16
16
 
17
17
  <div class="row column">
18
- <%= form.translated :editor, :description %>
18
+ <%= form.translated :editor, :description, toolbar: :full, lines: 25 %>
19
19
  </div>
20
20
 
21
21
  <div class="row">
@@ -1,4 +1,3 @@
1
- <% add_decidim_page_title(translated_attribute(current_consultation.title)) %>
2
1
  <%= decidim_form_for @form,
3
2
  method: :patch,
4
3
  url: consultation_path(current_consultation),
@@ -1,5 +1,3 @@
1
- <% add_decidim_page_title(t("consultations", scope: "decidim.admin.titles")) %>
2
-
3
1
  <div class="card with-overflow" id="consultations">
4
2
  <div class="card-divider">
5
3
  <h2 class="card-title">
@@ -1,4 +1,3 @@
1
- <% add_decidim_page_title(t("consultations.new.title", scope: "decidim.admin")) %>
2
1
  <h2 class="consultation-title-summary">
3
2
  <%= t "consultations.new.title", scope: "decidim.admin" %>
4
3
  </h2>
@@ -13,7 +13,7 @@
13
13
  <div class="row column">
14
14
  <%= form.number_field :max_votes, step: 1, min: 1 %>
15
15
  <%= form.number_field :min_votes, step: 1, min: 1 %>
16
- <%= form.translated :editor, :instructions, lines: 5, toolbar: :content %>
16
+ <%= form.translated :editor, :instructions, toolbar: :full, lines: 5 %>
17
17
  </div>
18
18
  </div>
19
19
  </div>
@@ -7,7 +7,7 @@
7
7
 
8
8
  <div class="card-section">
9
9
  <div class="row column">
10
- <%= form.translated :editor, :title, lines: 5, autofocus: true, toolbar: :basic %>
10
+ <%= form.translated :editor, :title, toolbar: :full, lines: 5, autofocus: true %>
11
11
  </div>
12
12
 
13
13
  <div class="row column">
@@ -23,11 +23,11 @@
23
23
  </div>
24
24
 
25
25
  <div class="row column">
26
- <%= form.translated :editor, :question_context %>
26
+ <%= form.translated :editor, :question_context, toolbar: :full, lines: 25 %>
27
27
  </div>
28
28
 
29
29
  <div class="row column">
30
- <%= form.translated :editor, :what_is_decided %>
30
+ <%= form.translated :editor, :what_is_decided, toolbar: :full, lines: 25 %>
31
31
  </div>
32
32
 
33
33
  <div class="row column">
@@ -1,4 +1,3 @@
1
- <% add_decidim_page_title(translated_attribute(current_question.title)) %>
2
1
  <%= decidim_form_for @form,
3
2
  url: question_path(current_question),
4
3
  method: :patch,
@@ -1,5 +1,3 @@
1
- <% add_decidim_page_title(t("questions", scope: "decidim.admin.titles")) %>
2
-
3
1
  <div class="card" id="questions">
4
2
  <div class="card-divider">
5
3
  <h2 class="card-title">
@@ -1,4 +1,3 @@
1
- <% add_decidim_page_title(t("questions.new.title", scope: "decidim.admin")) %>
2
1
  <h2 class="questions-title-summary">
3
2
  <%= t "questions.new.title", scope: "decidim.admin" %>
4
3
  </h2>
@@ -1,4 +1,3 @@
1
- <% add_decidim_page_title(translated_attribute(current_question.title)) %>
2
1
  <%= decidim_form_for @form,
3
2
  url: response_path(current_question, current_response),
4
3
  html: { class: "form edit_response" } do |f| %>
@@ -1,4 +1,3 @@
1
- <% add_decidim_page_title(t("responses", scope: "decidim.admin.titles")) %>
2
1
  <div class="card" id="questions">
3
2
  <div class="card-divider">
4
3
  <h2 class="card-title">
@@ -1,4 +1,3 @@
1
- <% add_decidim_page_title(t("responses.new.title", scope: "decidim.admin")) %>
2
1
  <h2 class="questions-title-summary">
3
2
  <%= t "responses.new.title", scope: "decidim.admin" %>
4
3
  </h2>
@@ -2,7 +2,7 @@
2
2
  <div class="card card--process">
3
3
  <%= link_to consultation_path(consultation), class: "card__link" do %>
4
4
  <div class="card__image-top"
5
- style="background-image:url('<%= consultation.attached_uploader(:banner_image).path %>')"></div>
5
+ style="background-image:url(<%= consultation.attached_uploader(:banner_image).path %>)"></div>
6
6
  <% end %>
7
7
  <div class="card__content">
8
8
  <%= link_to consultation_path(consultation), class: "card__link" do %>
@@ -1,11 +1,11 @@
1
1
  <div class="row section" id="consultation-details">
2
2
  <div class="columns medium-6 large-5 large-push-1">
3
- <p class="lead"><%= decidim_sanitize_editor_admin translated_attribute(consultation.description) %></p>
3
+ <p class="lead"><%= decidim_sanitize_editor translated_attribute(consultation.description) %></p>
4
4
  </div>
5
5
  <div class="columns medium-6 large-5 large-pull-1">
6
6
  <% if consultation.introductory_video_url.blank? %>
7
7
  <div class="card--full__image consultations-card__image introductory-image"
8
- style="background-image: url('<%= consultation.attached_uploader(:introductory_image).path %>');">
8
+ style="background-image: url(<%= consultation.attached_uploader(:introductory_image).path %>);">
9
9
  </div>
10
10
  <% else %>
11
11
  <div class="embed-container">
@@ -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" %>
@@ -3,7 +3,7 @@
3
3
  <div class="columns mediumlarge-8 large-9 card--process__column">
4
4
  <div class="card__content">
5
5
  <%= link_to decidim_consultations.question_path(question), class: "card__link" do %>
6
- <h2 class="heading5"><%= decidim_sanitize translated_attribute(question.title), strip_tags: true %></h2>
6
+ <h2 class="heading5"><%= decidim_sanitize translated_attribute question.title %></h2>
7
7
  <% end %>
8
8
  <p><%= translated_attribute question.subtitle %></p>
9
9
  </div>
@@ -11,7 +11,7 @@
11
11
 
12
12
  <div class="columns mediumlarge-8 large-3 card--process__column">
13
13
  <div class="card--full__image consultations-card__image"
14
- style="background-image: url('<%= question.banner_image_url %>')">
14
+ style="background-image: url(<%= question.banner_image_url %>)">
15
15
  <div class="card__content row collapse">
16
16
  <div class="columns large-10 large-push-1">
17
17
  <% if question.results_published? %>
@@ -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 %>