decidim-forms 0.28.5 → 0.29.0.rc1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. checksums.yaml +4 -4
  2. data/app/cells/decidim/forms/question_readonly_cell.rb +0 -2
  3. data/app/cells/decidim/forms/step_navigation/show.erb +3 -3
  4. data/app/cells/decidim/forms/step_navigation_cell.rb +2 -3
  5. data/app/commands/decidim/forms/answer_questionnaire.rb +4 -4
  6. data/app/controllers/decidim/forms/concerns/has_questionnaire.rb +1 -1
  7. data/app/forms/decidim/forms/admin/questionnaire_form.rb +2 -2
  8. data/app/forms/decidim/forms/answer_form.rb +2 -2
  9. data/app/forms/decidim/forms/questionnaire_form.rb +1 -1
  10. data/app/helpers/decidim/forms/application_helper.rb +2 -2
  11. data/app/models/decidim/forms/answer_choice.rb +0 -2
  12. data/app/models/decidim/forms/answer_option.rb +1 -1
  13. data/app/models/decidim/forms/display_condition.rb +11 -3
  14. data/app/models/decidim/forms/question_matrix_row.rb +1 -1
  15. data/app/presenters/decidim/forms/admin/questionnaire_participant_presenter.rb +7 -7
  16. data/app/views/decidim/forms/admin/questionnaires/_answer_option.html.erb +1 -1
  17. data/app/views/decidim/forms/admin/questionnaires/_display_condition.html.erb +2 -2
  18. data/app/views/decidim/forms/admin/questionnaires/_matrix_row.html.erb +1 -1
  19. data/app/views/decidim/forms/admin/questionnaires/_question.html.erb +4 -4
  20. data/app/views/decidim/forms/admin/questionnaires/_separator.html.erb +4 -4
  21. data/app/views/decidim/forms/admin/questionnaires/_title_and_description.html.erb +4 -4
  22. data/app/views/decidim/forms/questionnaires/_answer.html.erb +1 -11
  23. data/config/initializers/wicked_pdf.rb +6 -4
  24. data/config/locales/ar.yml +2 -4
  25. data/config/locales/bg.yml +6 -2
  26. data/config/locales/ca.yml +4 -4
  27. data/config/locales/cs.yml +0 -1
  28. data/config/locales/de.yml +5 -5
  29. data/config/locales/el.yml +5 -2
  30. data/config/locales/en.yml +2 -2
  31. data/config/locales/es-MX.yml +5 -5
  32. data/config/locales/es-PY.yml +5 -5
  33. data/config/locales/es.yml +5 -5
  34. data/config/locales/eu.yml +8 -8
  35. data/config/locales/fi-plain.yml +4 -4
  36. data/config/locales/fi.yml +5 -5
  37. data/config/locales/fr-CA.yml +3 -3
  38. data/config/locales/fr.yml +3 -3
  39. data/config/locales/gl.yml +3 -1
  40. data/config/locales/hu.yml +6 -4
  41. data/config/locales/id-ID.yml +2 -1
  42. data/config/locales/it.yml +4 -1
  43. data/config/locales/ja.yml +6 -1
  44. data/config/locales/lb.yml +4 -1
  45. data/config/locales/lt.yml +5 -2
  46. data/config/locales/lv.yml +3 -1
  47. data/config/locales/nl.yml +5 -1
  48. data/config/locales/no.yml +5 -1
  49. data/config/locales/pl.yml +6 -1
  50. data/config/locales/pt-BR.yml +5 -1
  51. data/config/locales/pt.yml +4 -1
  52. data/config/locales/ro-RO.yml +5 -3
  53. data/config/locales/sk.yml +2 -1
  54. data/config/locales/sv.yml +31 -44
  55. data/config/locales/tr-TR.yml +4 -1
  56. data/config/locales/val-ES.yml +2 -0
  57. data/config/locales/zh-CN.yml +4 -1
  58. data/config/locales/zh-TW.yml +5 -2
  59. data/db/migrate/20240402092039_add_answer_options_counter_cache_to_questions.rb +16 -0
  60. data/db/migrate/20240402095253_add_matrix_row_counter_cache_to_questions.rb +16 -0
  61. data/db/migrate/20240416111953_add_display_conditions_counter_cache_to_questions.rb +16 -0
  62. data/db/migrate/20240416113926_add_display_conditions_for_other_questions_counter_cache_to_questions.rb +16 -0
  63. data/decidim-forms.gemspec +3 -2
  64. data/lib/decidim/forms/test/shared_examples/has_questionnaire.rb +44 -70
  65. data/lib/decidim/forms/test/shared_examples/manage_questionnaire_answers.rb +12 -12
  66. data/lib/decidim/forms/test/shared_examples/manage_questionnaires/add_display_conditions.rb +10 -10
  67. data/lib/decidim/forms/test/shared_examples/manage_questionnaires/add_questions.rb +85 -85
  68. data/lib/decidim/forms/test/shared_examples/manage_questionnaires/update_display_conditions.rb +8 -8
  69. data/lib/decidim/forms/test/shared_examples/manage_questionnaires/update_questions.rb +82 -82
  70. data/lib/decidim/forms/test/shared_examples/manage_questionnaires.rb +9 -9
  71. data/lib/decidim/forms/user_answers_serializer.rb +1 -1
  72. data/lib/decidim/forms/version.rb +1 -1
  73. metadata +31 -15
  74. data/config/locales/bn-BD.yml +0 -1
  75. data/config/locales/bs-BA.yml +0 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4bf104fe1ce831d58e8bc9fe97d78fcd2a940bbf93e3c2d2aa54fb8d66c6d987
4
- data.tar.gz: 60bb8c3c47ee274b1192ab2563427505f349458e127b7e00fdf16abcedfbed26
3
+ metadata.gz: 2293a9e3534dc50768b5ed1a7ac9e501ec9a531089ac49a33e31cf7c4660d7ed
4
+ data.tar.gz: da021b4ab46c20cdb1aaeaa1f5a8cd1aedd46cd411c22b74b6cfdf72c4440592
5
5
  SHA512:
6
- metadata.gz: 149592e31f688b16bb774d32e0acd8d969f4e7fe0b0543f6cca7f8fd0d8d0ea35e41a70f89be188dedb385cdd60e8077ba1aa1ac4e3ec2a23b6cf1bf23586768
7
- data.tar.gz: cd477eb26d1073f3ed51ca537ca59dfe6fca10d061a912407c146b4290cdcd5c7b2cf09ec32fc883594df40f8d37c73b39d437ca1f0d45eae27d818c76164717
6
+ metadata.gz: d72b88bb788cb143ff3c422f0f9df2a1dedeac476b30c0c393d6cee92a0664a48ab1ad4dd0ac55313a5b902c1efaa5f7b8d9a9b4086320aa35a14bb42f6d3344
7
+ data.tar.gz: d2c4966ec421a62dda538e4257934223a1708eb8f7c20b9c31947d5e87f67bf261ca669d7cd0ee790397353017df8c62936fd7a02aef6702f424c3a6a6ea58f5
@@ -4,8 +4,6 @@ module Decidim
4
4
  module Forms
5
5
  # This cell renders a question (readonly) of a questionnaire
6
6
  class QuestionReadonlyCell < Decidim::ViewModel
7
- include Decidim::SanitizeHelper
8
-
9
7
  def show
10
8
  return if model.separator?
11
9
  return render :title_and_description if model.title_and_description?
@@ -1,6 +1,6 @@
1
- <div class="form-general-submit answer-questionnaire__submit">
1
+ <div class="answer-questionnaire__submit layout-aside__ctas-buttons survey-section-buttons" data-sticky-buttons>
2
2
  <% if !first_step? %>
3
- <button type="button" class="button button__sm button__text-secondary" data-toggle="<%= [previous_step_dom_id, current_step_dom_id].join(" ") %>">
3
+ <button type="button" class="button button__sm button__transparent-secondary" data-toggle="<%= [previous_step_dom_id, current_step_dom_id].join(" ") %>" data-survey-buttons>
4
4
  <%= icon "arrow-left-line", class: "fill-current" %>
5
5
  <%= t("decidim.forms.step_navigation.show.back") %>
6
6
  </button>
@@ -14,7 +14,7 @@
14
14
  **confirm_data
15
15
  ) %>
16
16
  <% else %>
17
- <button type="button" class="button button__sm button__secondary" data-toggle="<%= [next_step_dom_id, current_step_dom_id].join(" ") %>">
17
+ <button type="button" class="button button__sm button__secondary" data-toggle="<%= [next_step_dom_id, current_step_dom_id].join(" ") %>" data-survey-buttons>
18
18
  <%= t("decidim.forms.step_navigation.show.continue") %>
19
19
  <%= icon "arrow-right-line", class: "fill-current" %>
20
20
  </button>
@@ -4,8 +4,6 @@ module Decidim
4
4
  module Forms
5
5
  # This cell renders the navigation of a questionnaire step.
6
6
  class StepNavigationCell < Decidim::ViewModel
7
- include Decidim::LayoutHelper
8
-
9
7
  def current_step_index
10
8
  model
11
9
  end
@@ -45,7 +43,8 @@ module Decidim
45
43
  def confirm_data
46
44
  { data: {
47
45
  confirm: t("decidim.forms.step_navigation.show.are_you_sure"),
48
- disable: true
46
+ disable: true,
47
+ data: "survey-buttons"
49
48
  } }
50
49
  end
51
50
  end
@@ -4,15 +4,15 @@ module Decidim
4
4
  module Forms
5
5
  # This command is executed when the user answers a Questionnaire.
6
6
  class AnswerQuestionnaire < Decidim::Command
7
+ delegate :current_user, to: :form
7
8
  include ::Decidim::MultipleAttachmentsMethods
8
9
 
9
10
  # Initializes a AnswerQuestionnaire Command.
10
11
  #
11
12
  # form - The form from which to get the data.
12
13
  # questionnaire - The current instance of the questionnaire to be answered.
13
- def initialize(form, current_user, questionnaire)
14
+ def initialize(form, questionnaire)
14
15
  @form = form
15
- @current_user = current_user
16
16
  @questionnaire = questionnaire
17
17
  end
18
18
 
@@ -34,7 +34,7 @@ module Decidim
34
34
  end
35
35
  end
36
36
 
37
- attr_reader :form, :questionnaire, :current_user
37
+ attr_reader :form, :questionnaire
38
38
 
39
39
  private
40
40
 
@@ -82,7 +82,7 @@ module Decidim
82
82
  Answer.transaction(requires_new: true) do
83
83
  form.responses_by_step.flatten.select(&:display_conditions_fulfilled?).each do |form_answer|
84
84
  answer = Answer.new(
85
- user: @current_user,
85
+ user: current_user,
86
86
  questionnaire: @questionnaire,
87
87
  question: form_answer.question,
88
88
  body: form_answer.body,
@@ -30,7 +30,7 @@ module Decidim
30
30
 
31
31
  @form = form(Decidim::Forms::QuestionnaireForm).from_params(params, session_token:, ip_hash:)
32
32
 
33
- Decidim::Forms::AnswerQuestionnaire.call(@form, current_user, questionnaire) do
33
+ Decidim::Forms::AnswerQuestionnaire.call(@form, questionnaire) do
34
34
  on(:ok) do
35
35
  # i18n-tasks-use t("decidim.forms.questionnaires.answer.success")
36
36
  flash[:notice] = I18n.t("answer.success", scope: i18n_flashes_scope)
@@ -8,8 +8,8 @@ module Decidim
8
8
  include TranslatableAttributes
9
9
 
10
10
  translatable_attribute :title, String
11
- translatable_attribute :description, Decidim::Attributes::RichText
12
- translatable_attribute :tos, Decidim::Attributes::RichText
11
+ translatable_attribute :description, String
12
+ translatable_attribute :tos, String
13
13
 
14
14
  attribute :published_at, Decidim::Attributes::TimeWithZone
15
15
  attribute :questions, Array[QuestionForm]
@@ -108,9 +108,9 @@ module Decidim
108
108
 
109
109
  def max_choices
110
110
  if matrix?
111
- errors.add(:choices, :too_many) if grouped_choices.any? { |choices| choices.count > question.max_choices }
111
+ errors.add(:choices, :too_many, count: question.max_choices) if grouped_choices.any? { |choices| choices.count > question.max_choices }
112
112
  elsif selected_choices.size > question.max_choices
113
- errors.add(:choices, :too_many)
113
+ errors.add(:choices, :too_many, count: question.max_choices)
114
114
  end
115
115
  end
116
116
 
@@ -33,7 +33,7 @@ module Decidim
33
33
  context.responses = attributes[:responses]
34
34
  end
35
35
 
36
- # Public: Splits reponses by step, keeping the separator.
36
+ # Public: Splits responses by step, keeping the separator.
37
37
  #
38
38
  # Returns an array of steps. Each step is a list of the questions in that
39
39
  # step, including the separator.
@@ -8,11 +8,11 @@ module Decidim
8
8
  def show_represent_user_group?
9
9
  model_name = questionnaire_for.model_name.element
10
10
 
11
- permited_models.include?(model_name)
11
+ permitted_models.include?(model_name)
12
12
  end
13
13
  alias show_public_participation? show_represent_user_group?
14
14
 
15
- def permited_models
15
+ def permitted_models
16
16
  %(meeting)
17
17
  end
18
18
  end
@@ -17,8 +17,6 @@ module Decidim
17
17
  optional: true
18
18
 
19
19
  validates :matrix_row, presence: true, if: -> { answer.question.matrix? }
20
-
21
- default_scope { left_outer_joins(:matrix_row).order(arel_table[:position].asc, Decidim::Forms::QuestionMatrixRow.arel_table[:position].asc, arel_table[:id].asc) }
22
20
  end
23
21
  end
24
22
  end
@@ -9,7 +9,7 @@ module Decidim
9
9
 
10
10
  translatable_fields :body
11
11
 
12
- belongs_to :question, class_name: "Question", foreign_key: "decidim_question_id"
12
+ belongs_to :question, class_name: "Question", foreign_key: "decidim_question_id", counter_cache: true
13
13
 
14
14
  has_many :display_conditions,
15
15
  class_name: "DisplayCondition",
@@ -7,16 +7,24 @@ module Decidim
7
7
  # that we want to display or hide based on some conditions, and :condition_question
8
8
  # is the question the answers of which are checked against the conditions.
9
9
  # Conditions can be whether the question is answered ("answered") or it is not ("not_answered"),
10
- # if the selected answer option is ("equal") or is not ("not_equal") a given one, or whethe
10
+ # if the selected answer option is ("equal") or is not ("not_equal") a given one, or whether
11
11
  # the text value of the answer matches a string ("match").
12
12
  class DisplayCondition < Forms::ApplicationRecord
13
13
  enum condition_type: [:answered, :not_answered, :equal, :not_equal, :match], _prefix: true
14
14
 
15
15
  # Question which will be displayed or hidden
16
- belongs_to :question, class_name: "Question", foreign_key: "decidim_question_id", inverse_of: :display_conditions
16
+ belongs_to :question,
17
+ class_name: "Question",
18
+ foreign_key: "decidim_question_id",
19
+ inverse_of: :display_conditions,
20
+ counter_cache: :display_conditions_count
17
21
 
18
22
  # Question the answers of which are checked against conditions
19
- belongs_to :condition_question, class_name: "Question", foreign_key: "decidim_condition_question_id", inverse_of: :display_conditions_for_other_questions
23
+ belongs_to :condition_question,
24
+ class_name: "Question",
25
+ foreign_key: "decidim_condition_question_id",
26
+ inverse_of: :display_conditions_for_other_questions,
27
+ counter_cache: :display_conditions_for_other_questions_count
20
28
 
21
29
  # Answer option provided to check for "equal" or "not_equal" (optional)
22
30
  belongs_to :answer_option, class_name: "AnswerOption", foreign_key: "decidim_answer_option_id", optional: true
@@ -7,7 +7,7 @@ module Decidim
7
7
  include Decidim::TranslatableResource
8
8
 
9
9
  translatable_fields :body
10
- belongs_to :question, class_name: "Question", foreign_key: "decidim_question_id"
10
+ belongs_to :question, class_name: "Question", foreign_key: "decidim_question_id", counter_cache: :matrix_rows_count
11
11
 
12
12
  delegate :answer_options, :mandatory, :max_choices, to: :question
13
13
 
@@ -34,26 +34,26 @@ module Decidim
34
34
  end
35
35
 
36
36
  def answers
37
- sibilings.map { |answer| QuestionnaireAnswerPresenter.new(answer:) }
37
+ siblings.map { |answer| QuestionnaireAnswerPresenter.new(answer:) }
38
38
  end
39
39
 
40
40
  def first_short_answer
41
- short = sibilings.where(decidim_forms_questions: { question_type: %w(short_answer) })
41
+ short = siblings.where(decidim_forms_questions: { question_type: %w(short_answer) })
42
42
  short.first
43
43
  end
44
44
 
45
45
  def completion
46
- with_body = sibilings.where(decidim_forms_questions: { question_type: %w(short_answer long_answer) })
47
- .where.not(body: "").count
48
- with_choices = sibilings.where.not("decidim_forms_questions.question_type in (?)", %w(short_answer long_answer))
49
- .where("decidim_forms_answers.id IN (SELECT decidim_answer_id FROM decidim_forms_answer_choices)").count
46
+ with_body = siblings.where(decidim_forms_questions: { question_type: %w(short_answer long_answer) })
47
+ .where.not(body: "").count
48
+ with_choices = siblings.where.not("decidim_forms_questions.question_type in (?)", %w(short_answer long_answer))
49
+ .where("decidim_forms_answers.id IN (SELECT decidim_answer_id FROM decidim_forms_answer_choices)").count
50
50
 
51
51
  (with_body + with_choices).to_f / questionnaire.questions.not_separator.not_title_and_description.count * 100
52
52
  end
53
53
 
54
54
  private
55
55
 
56
- def sibilings
56
+ def siblings
57
57
  Answer.not_separator
58
58
  .not_title_and_description
59
59
  .where(questionnaire:, session_token: participant.session_token)
@@ -5,7 +5,7 @@
5
5
  <h2 class="card-title">
6
6
  <span><%= t(".answer_option") %></span>
7
7
  <% if editable %>
8
- <button class="button button__sm button__transparent-secondary small alert hollow remove-answer-option button--title mb-2">
8
+ <button class="button button__sm button__transparent-secondary small alert remove-answer-option button--title mb-2">
9
9
  <%= icon("delete-bin-line") %>
10
10
  <%= t(".remove") %>
11
11
  </button>
@@ -5,7 +5,7 @@
5
5
  <h2 class="card-title">
6
6
  <span><%= t(".display_condition") %></span>
7
7
  <% if editable %>
8
- <button class="button button__sm button__transparent-secondary small alert hollow remove-display-condition button--title">
8
+ <button class="button button__sm button__transparent-secondary small alert remove-display-condition button--title">
9
9
  <%= icon("delete-bin-line") %>
10
10
  <%= t(".remove") %>
11
11
  </button>
@@ -14,7 +14,7 @@
14
14
  </div>
15
15
  <div class="card-section">
16
16
  <div class="row column">
17
- <small class="text-muted">
17
+ <small>
18
18
  <%= t(".save_warning") %>
19
19
  </small>
20
20
  </div>
@@ -5,7 +5,7 @@
5
5
  <h2 class="card-title">
6
6
  <span><%= t(".matrix_row") %></span>
7
7
  <% if editable %>
8
- <button class="button button__sm button__transparent-secondary small alert hollow remove-matrix-row button--title mb-2">
8
+ <button class="button button__sm button__transparent-secondary small alert remove-matrix-row button--title mb-2">
9
9
  <%= icon("delete-bin-line") %>
10
10
  <%= t(".remove") %>
11
11
  </button>
@@ -2,7 +2,7 @@
2
2
  <% is_expanded = question.errors.any? %>
3
3
  <div class="card questionnaire-question" id="accordion-<%= id %>-field">
4
4
  <div class="form__wrapper" data-component="accordion">
5
- <div class="card-divider question-divider">
5
+ <div class="card-divider">
6
6
  <h2 class="card-title flex items-center">
7
7
  <span>
8
8
  <% if editable %>
@@ -23,17 +23,17 @@
23
23
  </button>
24
24
 
25
25
  <% if editable %>
26
- <button class="button button__sm button__transparent-secondary small alert hollow move-up-question button--title">
26
+ <button class="button button__sm button__transparent-secondary small alert move-up-question button--title">
27
27
  <%= icon("arrow-up-line") %>
28
28
  <%= t(".up") %>
29
29
  </button>
30
30
 
31
- <button class="button button__sm button__transparent-secondary small alert hollow move-down-question button--title">
31
+ <button class="button button__sm button__transparent-secondary small alert move-down-question button--title">
32
32
  <%= icon("arrow-down-line") %>
33
33
  <%= t(".down") %>
34
34
  </button>
35
35
 
36
- <button class="button button__sm button__transparent-secondary small alert hollow remove-question button--title">
36
+ <button class="button button__sm button__transparent-secondary small alert remove-question button--title">
37
37
  <%= icon("delete-bin-line") %>
38
38
  <%= t(".remove") %>
39
39
  </button>
@@ -1,7 +1,7 @@
1
1
  <% question = form.object %>
2
2
 
3
3
  <div class="card questionnaire-question" id="<%= id %>-field">
4
- <div class="card-divider question-divider">
4
+ <div class="card-divider">
5
5
  <h2 class="card-title flex items-center">
6
6
  <span>
7
7
  <% if editable %>
@@ -12,15 +12,15 @@
12
12
 
13
13
  <div class="flex items-center gap-x-4 ml-auto">
14
14
  <% if editable %>
15
- <button class="button button__sm button__transparent button__transparent-secondary small alert hollow move-up-question button--title">
15
+ <button class="button button__sm button__transparent button__transparent-secondary small alert move-up-question button--title">
16
16
  <%== "#{icon("arrow-up-line")} #{t(".up")}" %>
17
17
  </button>
18
18
 
19
- <button class="button button__sm button__transparent button__transparent-secondary small alert hollow move-down-question button--title">
19
+ <button class="button button__sm button__transparent button__transparent-secondary small alert move-down-question button--title">
20
20
  <%== "#{icon("arrow-down-line")} #{t(".down")}" %>
21
21
  </button>
22
22
 
23
- <button class="button button__sm button__transparent button__transparent-secondary small alert hollow remove-question button--title">
23
+ <button class="button button__sm button__transparent button__transparent-secondary small alert remove-question button--title">
24
24
  <%= t(".remove") %>
25
25
  </button>
26
26
  <% end %>
@@ -3,7 +3,7 @@
3
3
 
4
4
  <div class="card questionnaire-question" id="accordion-<%= id %>-field">
5
5
  <div data-component="accordion">
6
- <div class="card-divider question-divider">
6
+ <div class="card-divider">
7
7
  <h2 class="card-title flex items-center">
8
8
  <span>
9
9
  <% if editable %>
@@ -23,17 +23,17 @@
23
23
  </button>
24
24
 
25
25
  <% if editable %>
26
- <button class="button button__sm button__transparent button__transparent-secondary small alert hollow move-up-question button--title">
26
+ <button class="button button__sm button__transparent button__transparent-secondary small alert move-up-question button--title">
27
27
  <%= icon("arrow-up-line") %>
28
28
  <%= t(".up") %>
29
29
  </button>
30
30
 
31
- <button class="button button__sm button__transparent button__transparent-secondary small alert hollow move-down-question button--title">
31
+ <button class="button button__sm button__transparent button__transparent-secondary small alert move-down-question button--title">
32
32
  <%= icon("arrow-down-line") %>
33
33
  <%= t(".down") %>
34
34
  </button>
35
35
 
36
- <button class="button button__sm button__transparent button__transparent-secondary small alert hollow remove-question button--title">
36
+ <button class="button button__sm button__transparent button__transparent-secondary small alert remove-question button--title">
37
37
  <%= icon("delete-bin-line") %>
38
38
  <%= t(".remove") %>
39
39
  </button>
@@ -29,17 +29,7 @@
29
29
  }
30
30
  label_options[:for] = nil if %w(matrix_single matrix_multiple single_option multiple_option).include?(answer.question.question_type)
31
31
  %>
32
-
33
- <%= label_tag field_id, **label_options do %>
34
- <%= translated_attribute(answer.question.body) %>
35
- <% if answer.question.mandatory? %>
36
- <%= answer_form.send(:required_indicator) %>
37
- <% end %>
38
- <% if answer.question.max_choices %>
39
- <%= " (#{answer.send(:max_choices_label)})" %>
40
- <% end %>
41
- <% end %>
42
-
32
+ <%= label_tag field_id, answer.label, **label_options %>
43
33
  <% if translated_attribute(answer.question.description).present? %>
44
34
  <div class="answer-questionnaire__question-description">
45
35
  <%= decidim_sanitize_editor_admin translated_attribute(answer.question.description) %>
@@ -14,12 +14,14 @@ require "wicked_pdf"
14
14
  #
15
15
  # https://github.com/mileszs/wicked_pdf/blob/master/README.md
16
16
 
17
- WickedPdf.config = {
17
+ WickedPdf.configure do |config|
18
18
  # Path to the wkhtmltopdf executable: This usually is not needed if using
19
19
  # one of the wkhtmltopdf-binary family of gems.
20
- # exe_path: '/usr/local/bin/wkhtmltopdf',
20
+ # or
21
+ # config.exe_path = '/usr/local/bin/wkhtmltopdf',
22
+ config.exe_path = Gem.bin_path("wkhtmltopdf-binary", "wkhtmltopdf")
21
23
 
22
24
  # Layout file to be used for all PDFs
23
25
  # (but can be overridden in `render :pdf` calls)
24
- # layout: 'pdf.html',
25
- }
26
+ # config.layout = 'pdf.html'
27
+ end
@@ -16,7 +16,6 @@ ar:
16
16
  attributes:
17
17
  choices:
18
18
  missing: ليست كاملة
19
- too_many: كثير جدا
20
19
  decidim:
21
20
  forms:
22
21
  admin:
@@ -30,9 +29,6 @@ ar:
30
29
  free_text: نص حر
31
30
  remove: إزالة
32
31
  statement: بيان
33
- answers:
34
- actions:
35
- export: تصدير
36
32
  display_condition:
37
33
  condition_question: سؤال
38
34
  remove: حذف
@@ -40,6 +36,7 @@ ar:
40
36
  save: حفظ
41
37
  form:
42
38
  add_question: أضف سؤال
39
+ already_answered_warning: تمت الإجابة على النموذج من قبل بعض المستخدمين حتى لا تتمكن من تعديل أسئلته.
43
40
  matrix_row:
44
41
  remove: إزالة
45
42
  statement: بيان
@@ -85,6 +82,7 @@ ar:
85
82
  tos_agreement: من خلال المشاركة ، فإنك تقبل شروط الخدمة
86
83
  step_navigation:
87
84
  show:
85
+ are_you_sure: لا يمكن التراجع عن هذا الإجراء ولن تتمكن من تعديل إجاباتك. هل أنت واثق؟
88
86
  submit: خضع
89
87
  user_answers_serializer:
90
88
  created_at: أجاب على
@@ -22,7 +22,7 @@ bg:
22
22
  too_long: твърде дълъг
23
23
  choices:
24
24
  missing: не са завършени
25
- too_many: са твърде много
25
+ too_many: Можете да изберете максимум %{count}.
26
26
  questionnaire:
27
27
  request_invalid: Възникна грешка при обработката на заявката. Моля, опитайте отново.
28
28
  decidim:
@@ -81,10 +81,14 @@ bg:
81
81
  title: Редактиране на въпросника
82
82
  form:
83
83
  add_question: Добавяне на въпрос
84
+ add_separator: Добавяне на разделител
85
+ add_title_and_description: Добавете заглавие и описание
86
+ already_answered_warning: Няколко потребители вече са попълнили въпросника, поради което не можете да промените въпросите в него.
84
87
  collapse: Свиване на всички въпроси
85
88
  expand: Разгъване на всички въпроси
86
89
  preview: Преглед
87
90
  title: Редактирайте формуляра за %{questionnaire_for}
91
+ unpublished_warning: Формулярът не е публикуван. Можете да промените въпросите в него, но така ще се изтрият текущите въпроси.
88
92
  matrix_row:
89
93
  matrix_row: Ред
90
94
  remove: Премахни
@@ -154,7 +158,6 @@ bg:
154
158
  answer_questionnaire:
155
159
  already_have_an_account?: Вече имате профил?
156
160
  are_you_new?: Нов потребител?
157
- sign_in_description: Влезте, за да участвате в анкетата
158
161
  sign_up_description: Създайте акаунт на участник, за да участвате в анкетата
159
162
  title: Попълване на отговори във формуляра
160
163
  current_step: Стъпка %{step}
@@ -177,6 +180,7 @@ bg:
177
180
  tos_agreement: С участието си приемате Условията на ползване
178
181
  step_navigation:
179
182
  show:
183
+ are_you_sure: Това действие не може да се отмени и Вие не можете да редактирате отговорите си. Сигурни ли сте?
180
184
  back: Назад
181
185
  continue: Продължи
182
186
  submit: Изпрати
@@ -22,7 +22,7 @@ ca:
22
22
  too_long: és massa llarg
23
23
  choices:
24
24
  missing: no estan complets
25
- too_many: en són masses
25
+ too_many: Pots triar un màxim de %{count} opcions.
26
26
  questionnaire:
27
27
  request_invalid: Hi ha hagut un problema gestionant la petició. Si us plau, torna-ho a provar.
28
28
  decidim:
@@ -83,12 +83,12 @@ ca:
83
83
  add_question: Afegeix una pregunta
84
84
  add_separator: Afegir separador
85
85
  add_title_and_description: Afegir títol i descripció
86
- already_answered_warning: No pots modificar les preguntes d'aquest formulari perquè algunes participants ja han respost el formulari.
86
+ already_answered_warning: No pots modificar les preguntes d'aquest formulari perquè ja ha estat contestat per algunes participants.
87
87
  collapse: Redueix totes les preguntes
88
88
  expand: Expandeix totes les preguntes
89
89
  preview: Previsualitzar
90
90
  title: Editar formulari per %{questionnaire_for}
91
- unpublished_warning: El formulari no està publicat. Pots modificar les preguntes, però en fer-ho s'esborraran les respostes actuals.
91
+ unpublished_warning: El formulari no està publicat. Pots modificar les preguntes, però al fer-ho s'esborraran les respostes actuals.
92
92
  matrix_row:
93
93
  matrix_row: Fila
94
94
  remove: Elimina
@@ -181,7 +181,7 @@ ca:
181
181
  tos_agreement: En participar acceptes els Termes i condicions d'ús
182
182
  step_navigation:
183
183
  show:
184
- are_you_sure: Aquesta acció no es pot desfer i no podràs editar les respostes. Segur que vols continuar?
184
+ are_you_sure: Aquesta acció no es pot desfer i no podràs editar les teves respostes. Segur?
185
185
  back: Enrere
186
186
  continue: Continuar
187
187
  submit: Enviar respostes
@@ -22,7 +22,6 @@ cs:
22
22
  too_long: je příliš dlouhý
23
23
  choices:
24
24
  missing: nejsou úplné
25
- too_many: jsou příliš mnoho
26
25
  questionnaire:
27
26
  request_invalid: Při zpracování požadavku došlo k chybě. Zkuste to prosím znovu.
28
27
  decidim:
@@ -22,7 +22,7 @@ de:
22
22
  too_long: ist zu lang
23
23
  choices:
24
24
  missing: sind nicht vollständig
25
- too_many: sind zu viele
25
+ too_many: Sie können ein Maximum von %{count} auswählen.
26
26
  questionnaire:
27
27
  request_invalid: Beim Bearbeiten der Anfrage ist ein Fehler aufgetreten. Bitte versuchen Sie es nochmal.
28
28
  decidim:
@@ -82,13 +82,13 @@ de:
82
82
  form:
83
83
  add_question: Frage hinzufügen
84
84
  add_separator: Trennzeichen hinzufügen
85
- add_title_and_description: Titel und Beschreibung hinzufügen
85
+ add_title_and_description: Füge Titel und Beschreibung hinzu
86
86
  already_answered_warning: Der Fragebogen wird bereits von einigen Benutzern beantwortet, sodass Sie die Fragen nicht ändern können.
87
87
  collapse: Alle Fragen einklappen
88
88
  expand: Alle Fragen ausklappen
89
89
  preview: Vorschau
90
90
  title: Formular für %{questionnaire_for} bearbeiten
91
- unpublished_warning: Das Formular ist nicht veröffentlicht. Sie können die Fragen ändern, aber dadurch werden die aktuellen Antworten gelöscht.
91
+ unpublished_warning: Das Formular ist nicht öffentlich. Sie können die Fragen ändern, dabei werden allerdings die aktuellen Antworten gelöscht.
92
92
  matrix_row:
93
93
  matrix_row: Zeile
94
94
  remove: Löschen
@@ -178,10 +178,10 @@ de:
178
178
  title: JavaScript ist deaktiviert
179
179
  questionnaire_not_published:
180
180
  body: Dieses Formular ist noch nicht veröffentlicht.
181
- tos_agreement: 'Mit Ihrer Teilnahme stimmen Sie folgenden Nutzungsbedingungen zu:'
181
+ tos_agreement: Mit der Teilnahme stimmen Sie den Nutzungsbedingungen zu
182
182
  step_navigation:
183
183
  show:
184
- are_you_sure: Diese Aktion kann nicht rückgängig gemacht werden und Sie können Ihre Antworten nicht mehr bearbeiten. Sind Sie sicher?
184
+ are_you_sure: Diese Aktion kann nicht rückgängig gemacht werden und Sie können Ihre Antworten nicht bearbeiten. Sind Sie sich sicher?
185
185
  back: Zurück
186
186
  continue: Weiter
187
187
  submit: einreichen
@@ -22,7 +22,6 @@ el:
22
22
  too_long: είναι πολύ μεγάλο
23
23
  choices:
24
24
  missing: δεν έχουν ολοκληρωθεί
25
- too_many: είναι πάρα πολλά
26
25
  questionnaire:
27
26
  request_invalid: Παρουσιάστηκε σφάλμα κατά τον χειρισμό του αιτήματος. Παρακαλώ δοκιμάστε ξανά.
28
27
  decidim:
@@ -81,10 +80,14 @@ el:
81
80
  title: Επεξεργασία ερωτηματολογίου
82
81
  form:
83
82
  add_question: Προσθήκη ερώτησης
83
+ add_separator: Προσθήκη διαχωριστικού
84
+ add_title_and_description: Προσθήκη τίτλου και περιγραφής
85
+ already_answered_warning: Η φόρμα έχει ήδη απαντηθεί από ορισμένους χρήστες, επομένως δεν μπορείτε να τροποποιήσετε τις ερωτήσεις της.
84
86
  collapse: Σύμπτυξη όλων των ερωτήσεων
85
87
  expand: Ανάπτυξη όλων των ερωτήσεων
86
88
  preview: Προεπισκόπηση
87
89
  title: Επεξεργασία φόρμας για %{questionnaire_for}
90
+ unpublished_warning: Η φόρμα δεν έχει δημοσιευτεί. Μπορείτε να τροποποιήσετε τις ερωτήσεις της, αλλά με αυτόν τον τρόπο θα διαγράψετε τις τρέχουσες απαντήσεις.
88
91
  matrix_row:
89
92
  matrix_row: Γραμμή
90
93
  remove: Κατάργηση
@@ -154,7 +157,6 @@ el:
154
157
  answer_questionnaire:
155
158
  already_have_an_account?: Έχετε ήδη λογαριασμό;
156
159
  are_you_new?: Νέος χρήστης;
157
- sign_in_description: Συνδεθείτε για να πραγματοποιήσετε την έρευνα
158
160
  sign_up_description: Δημιουργήστε ένα λογαριασμό συμμετέχοντα για να κάνετε την έρευνα
159
161
  title: Απαντήστε στη φόρμα
160
162
  current_step: Βήμα %{step}
@@ -176,6 +178,7 @@ el:
176
178
  tos_agreement: Με τη συμμετοχή σας, αποδέχεστε τους Όρους παροχής υπηρεσίας
177
179
  step_navigation:
178
180
  show:
181
+ are_you_sure: Αυτή η ενέργεια δεν μπορεί να αναιρεθεί και δεν θα μπορείτε να επεξεργαστείτε τις απαντήσεις σας. Είστε βέβαιοι;
179
182
  back: Πίσω
180
183
  continue: Συνέχεια
181
184
  submit: Υποβολή
@@ -22,7 +22,7 @@ en:
22
22
  too_long: is too long
23
23
  choices:
24
24
  missing: are not complete
25
- too_many: are too many
25
+ too_many: You can choose a maximum of %{count}.
26
26
  questionnaire:
27
27
  request_invalid: There was an error handling the request. Please try again.
28
28
  decidim:
@@ -158,7 +158,7 @@ en:
158
158
  answer_questionnaire:
159
159
  already_have_an_account?: Already have an account?
160
160
  are_you_new?: New user?
161
- sign_in_description: Login to take the survey
161
+ sign_in_description: Log in to take the survey
162
162
  sign_up_description: Create a participant account to take the survey
163
163
  title: Answer the form
164
164
  current_step: Step %{step}