decidim-forms 0.31.8 → 0.32.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.
- checksums.yaml +4 -4
- data/README.md +3 -1
- data/app/cells/decidim/forms/step_navigation_cell.rb +1 -2
- data/app/commands/decidim/forms/response_questionnaire.rb +3 -3
- data/app/controllers/decidim/forms/admin/concerns/has_questionnaire.rb +22 -39
- data/app/controllers/decidim/forms/admin/concerns/has_questionnaire_responses.rb +2 -4
- data/app/controllers/decidim/forms/concerns/has_questionnaire.rb +1 -5
- data/app/forms/decidim/forms/questionnaire_form.rb +1 -1
- data/app/forms/decidim/forms/response_form.rb +7 -7
- data/app/models/decidim/forms/question.rb +2 -2
- data/app/models/decidim/forms/response.rb +1 -1
- data/app/packs/src/decidim/forms/admin/collapsible_questions.js +10 -0
- data/app/packs/src/decidim/forms/display_conditions.component.js +0 -27
- data/app/views/decidim/forms/admin/questionnaires/_question.html.erb +1 -1
- data/app/views/decidim/forms/admin/questionnaires/edit.html.erb +1 -1
- data/app/views/decidim/forms/admin/questionnaires/edit_questions.html.erb +1 -1
- data/app/views/decidim/forms/admin/questionnaires/responses/index.html.erb +3 -1
- data/app/views/decidim/forms/admin/questionnaires/responses/show.html.erb +3 -1
- data/app/views/decidim/forms/questionnaires/_questionnaire.html.erb +2 -2
- data/app/views/decidim/forms/questionnaires/responses/_files.html.erb +1 -1
- data/app/views/decidim/forms/questionnaires/show.html.erb +1 -1
- data/config/locales/ar.yml +0 -4
- data/config/locales/bg.yml +0 -4
- data/config/locales/ca-IT.yml +5 -5
- data/config/locales/ca.yml +5 -5
- data/config/locales/cs.yml +3 -4
- data/config/locales/de.yml +2 -5
- data/config/locales/el.yml +0 -4
- data/config/locales/en.yml +3 -2
- data/config/locales/es-MX.yml +4 -4
- data/config/locales/es-PY.yml +4 -4
- data/config/locales/es.yml +3 -3
- data/config/locales/eu.yml +14 -14
- data/config/locales/fi-plain.yml +4 -4
- data/config/locales/fi.yml +3 -3
- data/config/locales/fr-CA.yml +4 -6
- data/config/locales/fr.yml +4 -6
- data/config/locales/ga-IE.yml +0 -1
- data/config/locales/gl.yml +0 -171
- data/config/locales/hu.yml +0 -4
- data/config/locales/id-ID.yml +0 -4
- data/config/locales/it.yml +0 -4
- data/config/locales/ja.yml +3 -3
- data/config/locales/kaa.yml +0 -1
- data/config/locales/lb.yml +0 -4
- data/config/locales/lt.yml +0 -4
- data/config/locales/lv.yml +0 -4
- data/config/locales/nl.yml +0 -4
- data/config/locales/no.yml +0 -4
- data/config/locales/pl.yml +0 -4
- data/config/locales/pt-BR.yml +3 -4
- data/config/locales/pt.yml +0 -4
- data/config/locales/ro-RO.yml +0 -4
- data/config/locales/ru.yml +0 -4
- data/config/locales/sk.yml +0 -186
- data/config/locales/sv.yml +3 -3
- data/config/locales/tr-TR.yml +0 -4
- data/config/locales/val-ES.yml +0 -1
- data/config/locales/zh-CN.yml +0 -4
- data/config/locales/zh-TW.yml +0 -4
- data/decidim-forms.gemspec +6 -8
- data/lib/decidim/api/questionnaire_entity_interface.rb +1 -0
- data/lib/decidim/forms/download_your_data_user_responses_serializer.rb +1 -0
- data/lib/decidim/forms/test/factories.rb +9 -5
- data/lib/decidim/forms/test/shared_examples/has_questionnaire.rb +23 -23
- data/lib/decidim/forms/test/shared_examples/manage_questionnaires/add_display_conditions.rb +1 -1
- data/lib/decidim/forms/test/shared_examples/manage_questionnaires/add_questions.rb +4 -9
- data/lib/decidim/forms/test/shared_examples/manage_questionnaires/update_display_conditions.rb +1 -1
- data/lib/decidim/forms/test/shared_examples/manage_questionnaires/update_questions.rb +9 -11
- data/lib/decidim/forms/version.rb +1 -1
- metadata +10 -18
- data/app/packs/src/decidim/forms/display_conditions.component.test.js +0 -142
- data/app/packs/src/decidim/forms/display_conditions_hidden_responses.test.js +0 -224
- data/db/data/20260616144141_rename_answers_to_responses.rb +0 -31
- data/lib/decidim/forms/test/shared_examples/questionnaire_admin_access.rb +0 -95
- data/lib/decidim/forms/test/shared_examples/questionnaire_admin_controller_permissions.rb +0 -41
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 18fed0b0314ee79c04d1a36d62204f4355dcb73cc502b2b01a9a3dab3b5ceda6
|
|
4
|
+
data.tar.gz: d68ec90f7e93ec48e82dd38f4db613f28c243ab970a8b3f81e884bce3b186c28
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 383d83fb7d21ed05daa0a895c49d48379c4566c462026337d2d52e7369e53679609e8b908a8a6b5f044490b3c4fc1efe0f4783ec0d965e816f876b0bf7552edb
|
|
7
|
+
data.tar.gz: 97646d70d6c51357cf32a0e27c6e472b4327c17a6219217c9d4747e03a8e852e0ba2fc87e60fe7820cd7dc4b95bdbf109eda8e79b912da47a9a9b53a7d70973f
|
data/README.md
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
#
|
|
1
|
+
# decidim-forms
|
|
2
2
|
|
|
3
3
|
This gem encapsulates the logic to create and manage forms, so it can be reused in other modules, like surveys and meetings.
|
|
4
4
|
|
|
5
|
+
This is a module oriented for developers, as a building block to be used by other modules.
|
|
6
|
+
|
|
5
7
|
A `Decidim::Forms::Question` must be of one of the types:
|
|
6
8
|
|
|
7
9
|
- short_response
|
|
@@ -59,7 +59,7 @@ module Decidim
|
|
|
59
59
|
# of this problem.
|
|
60
60
|
def reset_form_attachments
|
|
61
61
|
@form.responses.each do |response|
|
|
62
|
-
response.errors.add(:
|
|
62
|
+
response.errors.add(:add_documents, :needs_to_be_reattached) if response.has_attachments? || response.has_error_in_attachments?
|
|
63
63
|
end
|
|
64
64
|
end
|
|
65
65
|
|
|
@@ -79,7 +79,7 @@ module Decidim
|
|
|
79
79
|
end
|
|
80
80
|
|
|
81
81
|
def clear_responses!
|
|
82
|
-
Response.where(questionnaire
|
|
82
|
+
Response.where(questionnaire:, user: current_user, session_token: form.context.session_token, ip_hash: form.context.ip_hash).destroy_all
|
|
83
83
|
end
|
|
84
84
|
|
|
85
85
|
def response_questionnaire
|
|
@@ -116,7 +116,7 @@ module Decidim
|
|
|
116
116
|
end
|
|
117
117
|
|
|
118
118
|
create_attachments if process_attachments?
|
|
119
|
-
|
|
119
|
+
document_cleanup!
|
|
120
120
|
end
|
|
121
121
|
|
|
122
122
|
@form = @main_form
|
|
@@ -20,8 +20,22 @@ module Decidim
|
|
|
20
20
|
helper_method :questionnaire_for, :questionnaire, :blank_question, :blank_response_option, :blank_matrix_row,
|
|
21
21
|
:blank_display_condition, :question_types, :display_condition_types, :update_url, :public_url, :response_options_url, :edit_questionnaire_title
|
|
22
22
|
|
|
23
|
+
if defined?(Decidim::Templates::Admin::Concerns::Templatable)
|
|
24
|
+
include Decidim::Templates::Admin::Concerns::Templatable
|
|
25
|
+
|
|
26
|
+
helper Decidim::DatalistSelectHelper
|
|
27
|
+
|
|
28
|
+
def templatable_type
|
|
29
|
+
"Decidim::Forms::Questionnaire"
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
def templatable
|
|
33
|
+
questionnaire
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
|
|
23
37
|
def edit
|
|
24
|
-
enforce_permission_to(:update,
|
|
38
|
+
enforce_permission_to(:update, :questionnaire, questionnaire:)
|
|
25
39
|
|
|
26
40
|
@form = form(Admin::QuestionnaireForm).from_model(questionnaire)
|
|
27
41
|
|
|
@@ -29,7 +43,7 @@ module Decidim
|
|
|
29
43
|
end
|
|
30
44
|
|
|
31
45
|
def update
|
|
32
|
-
enforce_permission_to(:update,
|
|
46
|
+
enforce_permission_to(:update, :questionnaire, questionnaire:)
|
|
33
47
|
|
|
34
48
|
@form = form(Admin::QuestionnaireForm).from_params(params)
|
|
35
49
|
|
|
@@ -43,14 +57,12 @@ module Decidim
|
|
|
43
57
|
on(:invalid) do
|
|
44
58
|
# i18n-tasks-use t("decidim.forms.admin.questionnaires.update.invalid")
|
|
45
59
|
flash.now[:alert] = I18n.t("update.invalid", scope: i18n_flashes_scope)
|
|
46
|
-
render template: edit_template, status: :
|
|
60
|
+
render template: edit_template, status: :unprocessable_content
|
|
47
61
|
end
|
|
48
62
|
end
|
|
49
63
|
end
|
|
50
64
|
|
|
51
65
|
def edit_questions
|
|
52
|
-
enforce_permission_to(:update, permission_subject, questionnaire:)
|
|
53
|
-
|
|
54
66
|
@form = form(Admin::QuestionsForm).from_model(questionnaire)
|
|
55
67
|
|
|
56
68
|
render template: edit_questions_template
|
|
@@ -59,8 +71,6 @@ module Decidim
|
|
|
59
71
|
# i18n-tasks-use t("decidim.forms.admin.questionnaires.questions_form.update.success")
|
|
60
72
|
# i18n-tasks-use t("decidim.forms.admin.questionnaires.update.invalid")
|
|
61
73
|
def update_questions
|
|
62
|
-
enforce_permission_to(:update, permission_subject, questionnaire:)
|
|
63
|
-
|
|
64
74
|
@form = form(Admin::QuestionsForm).from_params(params)
|
|
65
75
|
Admin::UpdateQuestions.call(@form, questionnaire) do
|
|
66
76
|
on(:ok) do
|
|
@@ -70,46 +80,23 @@ module Decidim
|
|
|
70
80
|
|
|
71
81
|
on(:invalid) do
|
|
72
82
|
flash.now[:alert] = I18n.t("update.invalid", scope: i18n_flashes_scope)
|
|
73
|
-
render template: edit_questions_template, status: :
|
|
83
|
+
render template: edit_questions_template, status: :unprocessable_content
|
|
74
84
|
end
|
|
75
85
|
end
|
|
76
86
|
end
|
|
77
87
|
|
|
78
|
-
# This endpoint is only used by the questions form rendered by the
|
|
79
|
-
# already authorized "edit_questions" action. The host controllers
|
|
80
|
-
# resolve their resource from params (e.g. "params[:id]") that have
|
|
81
|
-
# a different meaning in this request, so the authorization cannot
|
|
82
|
-
# be delegated to "questionnaire_for" here. Access is already
|
|
83
|
-
# restricted by the admin dashboard routing constraint.
|
|
84
|
-
# rubocop:disable Decidim/EnforcePermissionTo
|
|
85
88
|
def response_options
|
|
86
89
|
respond_to do |format|
|
|
87
90
|
format.json do
|
|
88
91
|
question_id = params["id"]
|
|
89
|
-
question =
|
|
92
|
+
question = Question.find_by(id: question_id)
|
|
90
93
|
render json: question.response_options.map { |response_option| ResponseOptionPresenter.new(response_option).as_json } if question.present?
|
|
91
94
|
end
|
|
92
95
|
end
|
|
93
96
|
end
|
|
94
|
-
# rubocop:enable Decidim/EnforcePermissionTo
|
|
95
|
-
|
|
96
|
-
protected
|
|
97
97
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
helper Decidim::DatalistSelectHelper
|
|
102
|
-
|
|
103
|
-
def templatable_type
|
|
104
|
-
"Decidim::Forms::Questionnaire"
|
|
105
|
-
end
|
|
106
|
-
|
|
107
|
-
def templatable
|
|
108
|
-
questionnaire
|
|
109
|
-
end
|
|
110
|
-
end
|
|
111
|
-
|
|
112
|
-
# You need to return the object that will hold the questionnaire.
|
|
98
|
+
# Public: The only method to be implemented at the controller. You need to
|
|
99
|
+
# return the object that will hold the questionnaire.
|
|
113
100
|
def questionnaire_for
|
|
114
101
|
raise "#{self.class.name} is expected to implement #questionnaire_for"
|
|
115
102
|
end
|
|
@@ -165,7 +152,7 @@ module Decidim
|
|
|
165
152
|
end
|
|
166
153
|
|
|
167
154
|
def questionnaire
|
|
168
|
-
@questionnaire ||= Questionnaire.find_by(questionnaire_for:)
|
|
155
|
+
@questionnaire ||= Questionnaire.find_by(questionnaire_for:)
|
|
169
156
|
end
|
|
170
157
|
|
|
171
158
|
def blank_question
|
|
@@ -195,10 +182,6 @@ module Decidim
|
|
|
195
182
|
[condition_type, I18n.t("decidim.forms.admin.questionnaires.display_condition.condition_types.#{condition_type}")]
|
|
196
183
|
end
|
|
197
184
|
end
|
|
198
|
-
|
|
199
|
-
def permission_subject
|
|
200
|
-
:questionnaire
|
|
201
|
-
end
|
|
202
185
|
end
|
|
203
186
|
end
|
|
204
187
|
end
|
|
@@ -57,11 +57,9 @@ module Decidim
|
|
|
57
57
|
|
|
58
58
|
flash[:notice] = t("decidim.admin.exports.notice")
|
|
59
59
|
|
|
60
|
-
|
|
60
|
+
redirect_back_or_to(questionnaire_participant_responses_url(session_token))
|
|
61
61
|
end
|
|
62
62
|
|
|
63
|
-
protected
|
|
64
|
-
|
|
65
63
|
# Public: The only method to be implemented at the controller. You need to
|
|
66
64
|
# return the object that will hold the questionnaire.
|
|
67
65
|
def questionnaire_for
|
|
@@ -79,7 +77,7 @@ module Decidim
|
|
|
79
77
|
end
|
|
80
78
|
|
|
81
79
|
def questionnaire
|
|
82
|
-
@questionnaire ||= Questionnaire.find_by(questionnaire_for:)
|
|
80
|
+
@questionnaire ||= Questionnaire.find_by(questionnaire_for:)
|
|
83
81
|
end
|
|
84
82
|
|
|
85
83
|
def participants_query
|
|
@@ -22,8 +22,6 @@ module Decidim
|
|
|
22
22
|
invisible_captcha on_spam: :spam_detected
|
|
23
23
|
|
|
24
24
|
def show
|
|
25
|
-
enforce_permission_to :read, :component
|
|
26
|
-
|
|
27
25
|
@form = form(Decidim::Forms::QuestionnaireForm).from_model(questionnaire)
|
|
28
26
|
render template:
|
|
29
27
|
end
|
|
@@ -43,13 +41,11 @@ module Decidim
|
|
|
43
41
|
|
|
44
42
|
on(:invalid) do
|
|
45
43
|
flash.now[:alert] = I18n.t("response.invalid", scope: i18n_flashes_scope)
|
|
46
|
-
render template:, status: :
|
|
44
|
+
render template:, status: :unprocessable_content
|
|
47
45
|
end
|
|
48
46
|
end
|
|
49
47
|
end
|
|
50
48
|
|
|
51
|
-
private
|
|
52
|
-
|
|
53
49
|
def template
|
|
54
50
|
"decidim/forms/questionnaires/show"
|
|
55
51
|
end
|
|
@@ -30,7 +30,7 @@ module Decidim
|
|
|
30
30
|
|
|
31
31
|
def add_responses!(questionnaire:, session_token:, ip_hash:)
|
|
32
32
|
self.responses = questionnaire.questions.map do |question|
|
|
33
|
-
ResponseForm.from_model(Decidim::Forms::Response.where(question:, user: current_user, session_token:, ip_hash:).first_or_initialize)
|
|
33
|
+
ResponseForm.from_model(Decidim::Forms::Response.where(question:, user: current_user, session_token:, ip_hash:).first_or_initialize)
|
|
34
34
|
end
|
|
35
35
|
end
|
|
36
36
|
|
|
@@ -12,7 +12,7 @@ module Decidim
|
|
|
12
12
|
attribute :choices, Array[ResponseChoiceForm]
|
|
13
13
|
attribute :matrix_choices, Array[ResponseChoiceForm]
|
|
14
14
|
|
|
15
|
-
attachments_attribute :
|
|
15
|
+
attachments_attribute :documents
|
|
16
16
|
|
|
17
17
|
validates :body, presence: true, if: :mandatory_body?
|
|
18
18
|
validates :selected_choices, presence: true, if: :mandatory_choices?
|
|
@@ -20,7 +20,7 @@ module Decidim
|
|
|
20
20
|
validate :max_choices, if: -> { question.max_choices }
|
|
21
21
|
validate :all_choices, if: :sorting?
|
|
22
22
|
validate :min_choices, if: -> { question.matrix? && question.mandatory? }
|
|
23
|
-
validate :
|
|
23
|
+
validate :documents_present, if: -> { question.question_type == "files" && question.mandatory? }
|
|
24
24
|
validate :max_characters, if: -> { question.max_characters.positive? }
|
|
25
25
|
|
|
26
26
|
delegate :mandatory_body?, :mandatory_choices?, :matrix?, to: :question
|
|
@@ -44,7 +44,7 @@ module Decidim
|
|
|
44
44
|
def map_model(model)
|
|
45
45
|
self.question_id = model.decidim_question_id
|
|
46
46
|
self.question = model.question
|
|
47
|
-
self.
|
|
47
|
+
self.documents = model.attachments
|
|
48
48
|
|
|
49
49
|
self.choices = model.choices.map do |choice|
|
|
50
50
|
ResponseChoiceForm.from_model(choice)
|
|
@@ -82,11 +82,11 @@ module Decidim
|
|
|
82
82
|
end
|
|
83
83
|
|
|
84
84
|
def has_attachments?
|
|
85
|
-
question.has_attachments? && errors[:
|
|
85
|
+
question.has_attachments? && errors[:add_documents].empty? && add_documents.present?
|
|
86
86
|
end
|
|
87
87
|
|
|
88
88
|
def has_error_in_attachments?
|
|
89
|
-
errors[:
|
|
89
|
+
errors[:add_documents].present?
|
|
90
90
|
end
|
|
91
91
|
|
|
92
92
|
def sorting?
|
|
@@ -141,8 +141,8 @@ module Decidim
|
|
|
141
141
|
I18n.t("questionnaires.question.max_choices", scope: "decidim.forms", n: question.max_choices)
|
|
142
142
|
end
|
|
143
143
|
|
|
144
|
-
def
|
|
145
|
-
errors.add(:
|
|
144
|
+
def documents_present
|
|
145
|
+
errors.add(:add_documents, :blank) if add_documents.empty? && errors[:add_documents].empty?
|
|
146
146
|
end
|
|
147
147
|
end
|
|
148
148
|
end
|
|
@@ -39,13 +39,13 @@ module Decidim
|
|
|
39
39
|
class_name: "DisplayCondition",
|
|
40
40
|
foreign_key: "decidim_condition_question_id",
|
|
41
41
|
dependent: :destroy,
|
|
42
|
-
inverse_of: :
|
|
42
|
+
inverse_of: :question,
|
|
43
43
|
counter_cache: :display_conditions_for_other_questions_count
|
|
44
44
|
|
|
45
45
|
# Questions which have display conditions based on the value of this question's response
|
|
46
46
|
has_many :conditioned_questions,
|
|
47
47
|
through: :display_conditions_for_other_questions,
|
|
48
|
-
|
|
48
|
+
foreign_key: "decidim_condition_question_id",
|
|
49
49
|
class_name: "Question"
|
|
50
50
|
|
|
51
51
|
has_many :responses,
|
|
@@ -1,4 +1,14 @@
|
|
|
1
1
|
document.addEventListener("turbo:load", () => {
|
|
2
|
+
const getButtons = document.querySelectorAll("button.question--collapse");
|
|
3
|
+
|
|
4
|
+
setTimeout(() => {
|
|
5
|
+
getButtons.forEach((button) => {
|
|
6
|
+
if (button.classList.contains("question-error")) {
|
|
7
|
+
button.click();
|
|
8
|
+
}
|
|
9
|
+
});
|
|
10
|
+
}, 100);
|
|
11
|
+
|
|
2
12
|
document.querySelector("button.collapse-all")?.addEventListener("click", () => {
|
|
3
13
|
document.querySelectorAll("[id$=field] button.question--collapse[aria-expanded='true']").
|
|
4
14
|
forEach((button) => button.click());
|
|
@@ -15,23 +15,12 @@ class DisplayCondition {
|
|
|
15
15
|
bindEvent() {
|
|
16
16
|
this.checkCondition();
|
|
17
17
|
this.getInputsToListen().on("change", this.checkCondition.bind(this));
|
|
18
|
-
|
|
19
|
-
const conditionWrapper = document.querySelector(`.question[data-question-id='${this.conditionQuestion}']`);
|
|
20
|
-
conditionWrapper?.addEventListener("display-conditions:visibility", this.checkCondition.bind(this));
|
|
21
18
|
}
|
|
22
19
|
|
|
23
20
|
getInputValue() {
|
|
24
21
|
const $conditionWrapperField = $(`.question[data-question-id='${this.conditionQuestion}']`);
|
|
25
22
|
const $textInput = $conditionWrapperField.find("textarea, input[type='text']:not([name$=\\[custom_body\\]])");
|
|
26
23
|
|
|
27
|
-
// A hidden question counts as unanswered, like the server sees it: its inputs are
|
|
28
|
-
// disabled, so it submits nothing. The response itself is left alone.
|
|
29
|
-
if ($conditionWrapperField.is("[data-condition-hidden]")) {
|
|
30
|
-
return $textInput.length
|
|
31
|
-
? ""
|
|
32
|
-
: [];
|
|
33
|
-
}
|
|
34
|
-
|
|
35
24
|
if ($textInput.length) {
|
|
36
25
|
return $textInput.val();
|
|
37
26
|
}
|
|
@@ -192,7 +181,6 @@ class DisplayConditionsComponent {
|
|
|
192
181
|
this.wrapperField.fadeIn();
|
|
193
182
|
this.wrapperField.find("input, textarea").prop("disabled", null);
|
|
194
183
|
this.showCount++;
|
|
195
|
-
this.setHidden(false);
|
|
196
184
|
}
|
|
197
185
|
|
|
198
186
|
hideQuestion() {
|
|
@@ -204,21 +192,6 @@ class DisplayConditionsComponent {
|
|
|
204
192
|
}
|
|
205
193
|
|
|
206
194
|
this.wrapperField.find("input, textarea").prop("disabled", "disabled");
|
|
207
|
-
this.setHidden(true);
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
// A hidden question stops counting as answered, so questions conditioned on this
|
|
211
|
-
// one have to re-evaluate, which the visibility event asks them to do. Only a real
|
|
212
|
-
// change is propagated, so the cascade settles after one pass and cannot loop.
|
|
213
|
-
setHidden(hidden) {
|
|
214
|
-
const [wrapper] = this.wrapperField;
|
|
215
|
-
|
|
216
|
-
if (wrapper.hasAttribute("data-condition-hidden") === hidden) {
|
|
217
|
-
return;
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
wrapper.toggleAttribute("data-condition-hidden", hidden);
|
|
221
|
-
wrapper.dispatchEvent(new CustomEvent("display-conditions:visibility"));
|
|
222
195
|
}
|
|
223
196
|
}
|
|
224
197
|
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
</span>
|
|
13
13
|
|
|
14
14
|
<span class="ml-auto flex flex-row-reverse items-center gap-2">
|
|
15
|
-
<button type="button" class="question--collapse" data-controls="panel-<%= id %>-question-card"
|
|
15
|
+
<button type="button" class="question--collapse <%= "question-error" if is_expanded %>" data-controls="panel-<%= id %>-question-card">
|
|
16
16
|
<span class="icon-collapse">
|
|
17
17
|
<%== icon("arrow-up-s-line", aria_label: t(".collapse"), role: "img") %>
|
|
18
18
|
</span>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<% add_decidim_page_title(t("
|
|
1
|
+
<% add_decidim_page_title(t(".title")) %>
|
|
2
2
|
|
|
3
3
|
<% if templates_defined? && choose_template? %>
|
|
4
4
|
<%= render partial: "decidim/templates/admin/questionnaire_templates/choose", locals: { target: questionnaire, form_title: t("decidim.forms.admin.questionnaires.edit.title"), show_buttons: true } %>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<% add_decidim_page_title(t("
|
|
1
|
+
<% add_decidim_page_title(t(".title")) %>
|
|
2
2
|
|
|
3
3
|
<% if templates_defined? && choose_template? %>
|
|
4
4
|
<%= render partial: "decidim/templates/admin/questionnaire_templates/choose", locals: { target: questionnaire, form_title: t("decidim.forms.admin.questionnaires.edit.title"), show_buttons: true } %>
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
<% add_decidim_page_title(t(".title", total: @total)) %>
|
|
2
|
+
|
|
1
3
|
<div class="card" id="responses">
|
|
2
4
|
<div class="item_show__header">
|
|
3
5
|
<h1 class="item_show__header-title">
|
|
4
|
-
<%= t
|
|
6
|
+
<%= t(".title", total: @total) %>
|
|
5
7
|
<%= link_to t("actions.back", scope: "decidim.forms.admin.questionnaires"), questionnaire_url, class: "button button__sm button__secondary new" %>
|
|
6
8
|
</h1>
|
|
7
9
|
</div>
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
<% add_decidim_page_title(t(".title", number: current_idx)) %>
|
|
2
|
+
|
|
1
3
|
<div class="card" id="responses">
|
|
2
4
|
<div class="item_show__header">
|
|
3
5
|
<h1 class="item_show__header-title">
|
|
4
|
-
<%= t
|
|
6
|
+
<%= t(".title", number: current_idx) %>
|
|
5
7
|
|
|
6
8
|
<%= link_to t("actions.next", scope: "decidim.forms.admin.questionnaires.responses").html_safe, next_url, rel: "next", class: "button button__sm button__secondary next" unless last? %>
|
|
7
9
|
<%= link_to t("actions.previous", scope: "decidim.forms.admin.questionnaires.responses").html_safe, prev_url, rel: "prev", class: "button button__sm button__secondary prev" unless first? %>
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
</noscript>
|
|
4
4
|
|
|
5
5
|
<% unless current_participatory_space.can_participate?(current_user) %>
|
|
6
|
-
<%= cell("decidim/announcement", { title: t("decidim.forms.questionnaires.show.
|
|
6
|
+
<%= cell("decidim/announcement", { title: t("decidim.forms.questionnaires.show.questionnaire_for_members.title"), body: t("decidim.forms.questionnaires.show.questionnaire_for_members.body") }, callout_class: "alert") %>
|
|
7
7
|
<% end %>
|
|
8
8
|
|
|
9
9
|
<% if questionnaire_for.respond_to?(:announcement) and questionnaire_for.announcement.present? %>
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
<%= invisible_captcha %>
|
|
19
19
|
<% response_idx = 0 %>
|
|
20
20
|
<% @form.responses_by_step.each_with_index do |step_responses, step_index| %>
|
|
21
|
-
<div id="step-<%= step_index %>" class="response-questionnaire__step" <%= "hidden" if step_index.
|
|
21
|
+
<div id="step-<%= step_index %>" class="response-questionnaire__step" <%= "hidden" if !step_index.zero? %>>
|
|
22
22
|
|
|
23
23
|
<% if @form.total_steps > 1 %>
|
|
24
24
|
<p class="response-questionnaire__step-counter">
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<%= response_form.upload :
|
|
1
|
+
<%= response_form.upload :add_documents, attachments: response.documents, label: false, multiple: true, id: field_id, disabled:, button_class: "button button__lg button__transparent-secondary w-full" %>
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
<% else %>
|
|
40
40
|
<% body = t("decidim.forms.questionnaires.show.questionnaire_responded.body") %>
|
|
41
41
|
<% end %>
|
|
42
|
-
<%= cell("decidim/announcement", { title: t("decidim.forms.questionnaires.show.questionnaire_responded.title"), body:
|
|
42
|
+
<%= cell("decidim/announcement", { title: t("decidim.forms.questionnaires.show.questionnaire_responded.title"), body: }) %>
|
|
43
43
|
<% else %>
|
|
44
44
|
<% if @form.responses_by_step.flatten.empty? %>
|
|
45
45
|
<%= cell("decidim/announcement", t("decidim.forms.questionnaires.show.empty")) %>
|
data/config/locales/ar.yml
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
---
|
|
2
1
|
ar:
|
|
3
2
|
activemodel:
|
|
4
3
|
attributes:
|
|
@@ -45,9 +44,6 @@ ar:
|
|
|
45
44
|
show:
|
|
46
45
|
questionnaire_closed:
|
|
47
46
|
title: شكل مغلق
|
|
48
|
-
questionnaire_for_private_users:
|
|
49
|
-
body: النموذج متاح فقط للمستخدمين من القطاع الخاص
|
|
50
|
-
title: شكل مغلق
|
|
51
47
|
tos_agreement: من خلال المشاركة ، فإنك تقبل شروط الخدمة
|
|
52
48
|
step_navigation:
|
|
53
49
|
show:
|
data/config/locales/bg.yml
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
---
|
|
2
1
|
bg:
|
|
3
2
|
activemodel:
|
|
4
3
|
attributes:
|
|
@@ -95,9 +94,6 @@ bg:
|
|
|
95
94
|
of_total_steps: от %{total_steps}
|
|
96
95
|
questionnaire_closed:
|
|
97
96
|
title: Формулярът е затворен
|
|
98
|
-
questionnaire_for_private_users:
|
|
99
|
-
body: Формулярът е налице само за частни потребители
|
|
100
|
-
title: Формулярът е затворен
|
|
101
97
|
questionnaire_js_disabled:
|
|
102
98
|
body: Някои от функциите на формуляра ще бъдат деактивирани. За да подобрите практическата си работа, моля, активирайте JavaScript в браузъра си.
|
|
103
99
|
title: JavaScript е деактивиран
|
data/config/locales/ca-IT.yml
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
---
|
|
2
1
|
ca-IT:
|
|
3
2
|
activemodel:
|
|
4
3
|
attributes:
|
|
@@ -181,6 +180,7 @@ ca-IT:
|
|
|
181
180
|
response:
|
|
182
181
|
invalid: S'han produït un error en respondre el formulari.
|
|
183
182
|
max_choices_alert: Has seleccionat massa opcions
|
|
183
|
+
spam_detected: Hi ha hagut un problema responent el formulari. Potser has anat massa ràpid, ho pots tornar a intentar?
|
|
184
184
|
success: El formulari s'ha respost correctament.
|
|
185
185
|
show:
|
|
186
186
|
current_step: Pas %{step}
|
|
@@ -188,10 +188,10 @@ ca-IT:
|
|
|
188
188
|
of_total_steps: de %{total_steps}
|
|
189
189
|
questionnaire_closed:
|
|
190
190
|
body: El formulari està tancat i no es pot respondre.
|
|
191
|
-
title:
|
|
192
|
-
|
|
193
|
-
body: El formulari només està disponible per a
|
|
194
|
-
title:
|
|
191
|
+
title: S'ha tancat el formulari
|
|
192
|
+
questionnaire_for_members:
|
|
193
|
+
body: El formulari només està disponible per a membres
|
|
194
|
+
title: S'ha tancat el formulari
|
|
195
195
|
questionnaire_js_disabled:
|
|
196
196
|
body: Algunes de les característiques d'aquest formulari es deshabilitaran. Per millorar la teva experiència, si us plau, habilita JavaScript al teu navegador.
|
|
197
197
|
title: JavaScript està desactivat
|
data/config/locales/ca.yml
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
---
|
|
2
1
|
ca:
|
|
3
2
|
activemodel:
|
|
4
3
|
attributes:
|
|
@@ -181,6 +180,7 @@ ca:
|
|
|
181
180
|
response:
|
|
182
181
|
invalid: S'han produït un error en respondre el formulari.
|
|
183
182
|
max_choices_alert: Has seleccionat massa opcions
|
|
183
|
+
spam_detected: Hi ha hagut un problema responent el formulari. Potser has anat massa ràpid, ho pots tornar a intentar?
|
|
184
184
|
success: El formulari s'ha respost correctament.
|
|
185
185
|
show:
|
|
186
186
|
current_step: Pas %{step}
|
|
@@ -188,10 +188,10 @@ ca:
|
|
|
188
188
|
of_total_steps: de %{total_steps}
|
|
189
189
|
questionnaire_closed:
|
|
190
190
|
body: El formulari està tancat i no es pot respondre.
|
|
191
|
-
title:
|
|
192
|
-
|
|
193
|
-
body: El formulari només està disponible per a
|
|
194
|
-
title:
|
|
191
|
+
title: S'ha tancat el formulari
|
|
192
|
+
questionnaire_for_members:
|
|
193
|
+
body: El formulari només està disponible per a membres
|
|
194
|
+
title: S'ha tancat el formulari
|
|
195
195
|
questionnaire_js_disabled:
|
|
196
196
|
body: Algunes de les característiques d'aquest formulari es deshabilitaran. Per millorar la teva experiència, si us plau, habilita JavaScript al teu navegador.
|
|
197
197
|
title: JavaScript està desactivat
|
data/config/locales/cs.yml
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
---
|
|
2
1
|
cs:
|
|
3
2
|
activemodel:
|
|
4
3
|
attributes:
|
|
@@ -186,9 +185,9 @@ cs:
|
|
|
186
185
|
questionnaire_closed:
|
|
187
186
|
body: Formulář je uzavřen a nelze jej odpovědět.
|
|
188
187
|
title: Dotazník byl uzavřen
|
|
189
|
-
|
|
190
|
-
body:
|
|
191
|
-
title:
|
|
188
|
+
questionnaire_for_members:
|
|
189
|
+
body: Formulář je k dispozici pouze pro členy
|
|
190
|
+
title: Formulář uzavřen
|
|
192
191
|
questionnaire_js_disabled:
|
|
193
192
|
body: Některé funkce tohoto formuláře budou zakázány. Pro zlepšení použití formuláře povolte JavaScript ve vašem prohlížeči.
|
|
194
193
|
title: JavaScript je zakázán
|
data/config/locales/de.yml
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
---
|
|
2
1
|
de:
|
|
3
2
|
activemodel:
|
|
4
3
|
attributes:
|
|
@@ -44,7 +43,6 @@ de:
|
|
|
44
43
|
allow_editing_responses: Registrierten Benutzern die Bearbeitung eigener Umfrageantworten ermöglichen
|
|
45
44
|
allow_responses: Antworten erlauben
|
|
46
45
|
allow_unregistered: Teilnahme an der Umfrage ohne Registrierung erlauben
|
|
47
|
-
allow_unregistered_help: Wenn aktiviert, ist keine Anmeldung erforderlich, um die Umfrage zu beantworten. Dies kann zu ungenauen oder unzuverlässigen Daten führen und macht die Umfrage anfälliger für automatisierte Angriffe. Mit Vorsicht verwenden! Beachten Sie, dass dieselbe Umfrage von einer teilnehmenden Person mehrfach beantwortet werden kann, etwa durch die Verwendung unterschiedlicher Browser oder der Funktion "Privates Surfen" des Webbrowsers.
|
|
48
46
|
announcement: Ankündigung
|
|
49
47
|
clean_after_publish: Antworten beim Veröffentlichen der Umfrage löschen
|
|
50
48
|
description: Beschreibung
|
|
@@ -189,9 +187,8 @@ de:
|
|
|
189
187
|
questionnaire_closed:
|
|
190
188
|
body: Das Formular ist geschlossen und kann nicht beantwortet werden.
|
|
191
189
|
title: Fragebogen geschlossen
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
title: Fragebogen geschlossen
|
|
190
|
+
questionnaire_for_members:
|
|
191
|
+
title: Formular geschlossen
|
|
195
192
|
questionnaire_js_disabled:
|
|
196
193
|
body: Manche Funktionen des Formulars werden deaktiviert sein. Aktivieren Sie JavaScript in Ihrem Browser für eine bessere Erfahrung.
|
|
197
194
|
title: JavaScript ist deaktiviert
|
data/config/locales/el.yml
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
---
|
|
2
1
|
el:
|
|
3
2
|
activemodel:
|
|
4
3
|
attributes:
|
|
@@ -94,9 +93,6 @@ el:
|
|
|
94
93
|
of_total_steps: από %{total_steps}
|
|
95
94
|
questionnaire_closed:
|
|
96
95
|
title: Η φόρμα έκλεισε
|
|
97
|
-
questionnaire_for_private_users:
|
|
98
|
-
body: Η φόρμα είναι διαθέσιμη μόνο για ιδιωτικούς χρήστες
|
|
99
|
-
title: Η φόρμα έκλεισε
|
|
100
96
|
questionnaire_js_disabled:
|
|
101
97
|
body: Ορισμένες από τις δυνατότητες αυτής της φόρμας θα απενεργοποιηθούν. Για να βελτιώσετε την εμπειρία σας, ενεργοποιήστε την JavaScript στο πρόγραμμα περιήγησης.
|
|
102
98
|
title: Η JavaScript είναι απενεργοποιημένη
|
data/config/locales/en.yml
CHANGED
|
@@ -181,6 +181,7 @@ en:
|
|
|
181
181
|
response:
|
|
182
182
|
invalid: There was a problem responding the form.
|
|
183
183
|
max_choices_alert: There are too many choices selected
|
|
184
|
+
spam_detected: There was a problem responding the form. Maybe you have been too quick, can you try again?
|
|
184
185
|
success: Form successfully responded.
|
|
185
186
|
show:
|
|
186
187
|
current_step: Step %{step}
|
|
@@ -189,8 +190,8 @@ en:
|
|
|
189
190
|
questionnaire_closed:
|
|
190
191
|
body: The form is closed and cannot be responded.
|
|
191
192
|
title: Form closed
|
|
192
|
-
|
|
193
|
-
body: The form is available only for
|
|
193
|
+
questionnaire_for_members:
|
|
194
|
+
body: The form is available only for members
|
|
194
195
|
title: Form closed
|
|
195
196
|
questionnaire_js_disabled:
|
|
196
197
|
body: Some of this form's features will be disabled. To improve your experience, please enable JavaScript in your browser.
|