decidim-forms 0.31.0 → 0.31.2
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/app/forms/decidim/forms/admin/display_condition_form.rb +1 -1
- data/app/forms/decidim/forms/questionnaire_form.rb +7 -10
- data/app/packs/src/decidim/forms/admin/forms.js +16 -13
- data/app/presenters/decidim/forms/admin/questionnaire_response_presenter.rb +30 -5
- data/app/views/decidim/forms/admin/questionnaires/_questions_form.html.erb +1 -30
- data/config/locales/de.yml +2 -1
- data/config/locales/eu.yml +7 -7
- data/config/locales/pt-BR.yml +121 -0
- data/config/locales/ro-RO.yml +1 -1
- data/config/locales/sk.yml +1 -1
- data/config/locales/sv.yml +2 -2
- data/lib/decidim/exporters/form_pdf.rb +10 -2
- data/lib/decidim/forms/version.rb +1 -1
- metadata +8 -8
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 533c98f5bea9b27f56b1b38e31f566288c01c47d811c5ccd3b7ede29743162d5
|
|
4
|
+
data.tar.gz: b5f8f7382b27174aec69cbbef6f114ebe11d72d0e3db13d51037d369f3dd404f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a041e17927a8135ccaf698d1572598969e5998f3627a24b08291cc495672fb46a4238e42e70a4e06a04a5431a319f0781b2a8ddb6704e47358e2a4b8e5a1029b
|
|
7
|
+
data.tar.gz: dac22d94c860656ba92a5461bb594a819a924627df74f3f654739fae8c529ff5e1a44979e7ae031bb08135273e03ccd21f93287aed5164d7fe198132674809ca
|
|
@@ -41,18 +41,15 @@ module Decidim
|
|
|
41
41
|
|
|
42
42
|
# Public: Splits responses by step, keeping the separator.
|
|
43
43
|
#
|
|
44
|
-
# Returns an array of steps.
|
|
45
|
-
#
|
|
44
|
+
# Returns an array of steps. Splits responses at each separator.
|
|
45
|
+
# Allowing only steps with questions to be counted, excluding the separators.
|
|
46
46
|
def responses_by_step
|
|
47
|
-
@responses_by_step ||=
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
!a.question.separator? || b.question.separator?
|
|
51
|
-
end.to_a
|
|
52
|
-
|
|
53
|
-
steps = [[]] if steps == []
|
|
54
|
-
steps
|
|
47
|
+
@responses_by_step ||= begin
|
|
48
|
+
steps = responses.slice_before { |response| response.question.separator? }.map do |group|
|
|
49
|
+
group.reject { |response| response.question.separator? }
|
|
55
50
|
end
|
|
51
|
+
steps.reject(&:empty?)
|
|
52
|
+
end
|
|
56
53
|
end
|
|
57
54
|
|
|
58
55
|
def total_steps
|
|
@@ -7,10 +7,8 @@ import AutoSelectOptionsFromUrl from "src/decidim/forms/admin/auto_select_option
|
|
|
7
7
|
import createLiveTextUpdateComponent from "src/decidim/forms/admin/live_text_update.component"
|
|
8
8
|
import AutoButtonsByPositionComponent from "src/decidim/admin/auto_buttons_by_position.component"
|
|
9
9
|
import AutoLabelByPositionComponent from "src/decidim/admin/auto_label_by_position.component"
|
|
10
|
-
import createSortList from "src/decidim/admin/sort_list.component"
|
|
11
10
|
import createDynamicFields from "src/decidim/admin/dynamic_fields.component"
|
|
12
11
|
import createFieldDependentInputs from "src/decidim/admin/field_dependent_inputs.component"
|
|
13
|
-
import initLanguageChangeSelect from "src/decidim/admin/choose_language"
|
|
14
12
|
|
|
15
13
|
export default function createEditableForm() {
|
|
16
14
|
const wrapperSelector = ".questionnaire-questions";
|
|
@@ -99,16 +97,16 @@ export default function createEditableForm() {
|
|
|
99
97
|
})
|
|
100
98
|
};
|
|
101
99
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
onSortUpdate: () => {
|
|
100
|
+
// Listen for sortupdate events from html5sortable (initialized by draggable-table.js)
|
|
101
|
+
const setupSortUpdateListener = () => {
|
|
102
|
+
const container = document.querySelector(".questionnaire-questions-list:not(.published)");
|
|
103
|
+
if (container && !container.dataset.sortListenerAttached) {
|
|
104
|
+
container.addEventListener("sortupdate", () => {
|
|
108
105
|
autoLabelByPosition.run();
|
|
109
106
|
autoButtonsByPosition.run();
|
|
110
|
-
}
|
|
111
|
-
|
|
107
|
+
});
|
|
108
|
+
container.dataset.sortListenerAttached = "true";
|
|
109
|
+
}
|
|
112
110
|
};
|
|
113
111
|
|
|
114
112
|
const createDynamicQuestionTitle = (fieldId) => {
|
|
@@ -386,12 +384,17 @@ export default function createEditableForm() {
|
|
|
386
384
|
moveDownFieldButtonSelector: ".move-down-question",
|
|
387
385
|
onAddField: ($field) => {
|
|
388
386
|
setupInitialQuestionAttributes($field);
|
|
389
|
-
|
|
387
|
+
setupSortUpdateListener();
|
|
390
388
|
|
|
391
389
|
autoLabelByPosition.run();
|
|
392
390
|
autoButtonsByPosition.run();
|
|
393
391
|
|
|
394
|
-
|
|
392
|
+
const fieldElement = $field[0];
|
|
393
|
+
if (fieldElement) {
|
|
394
|
+
fieldElement.querySelectorAll("select.language-change").forEach((container) => {
|
|
395
|
+
window.deprecate(container, "language-change", "select.language-change")
|
|
396
|
+
});
|
|
397
|
+
}
|
|
395
398
|
|
|
396
399
|
// instead of initialize specific stuff, we send an event, with the DOM fragment we wanna update/refresh/bind
|
|
397
400
|
document.dispatchEvent(new CustomEvent("ajax:loaded", { detail: $field[0] }));
|
|
@@ -422,7 +425,7 @@ export default function createEditableForm() {
|
|
|
422
425
|
}
|
|
423
426
|
});
|
|
424
427
|
|
|
425
|
-
|
|
428
|
+
setupSortUpdateListener();
|
|
426
429
|
|
|
427
430
|
$(fieldSelector).each((idx, el) => {
|
|
428
431
|
const $target = $(el);
|
|
@@ -28,17 +28,38 @@ module Decidim
|
|
|
28
28
|
return attachments if response.attachments.any?
|
|
29
29
|
return "-" if response.choices.empty?
|
|
30
30
|
|
|
31
|
-
choices =
|
|
31
|
+
choices = build_choices
|
|
32
|
+
|
|
33
|
+
render_choices_list(choices)
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
private
|
|
37
|
+
|
|
38
|
+
def build_choices
|
|
39
|
+
response.choices.map do |choice|
|
|
40
|
+
matrix_row_body = matrix_row_body_for(choice)
|
|
32
41
|
{
|
|
33
42
|
response_option_body: choice.try(:response_option).try(:translated_body),
|
|
34
|
-
choice_body: body_or_custom_body(choice)
|
|
43
|
+
choice_body: body_or_custom_body(choice),
|
|
44
|
+
matrix_row_body:
|
|
35
45
|
}
|
|
36
46
|
end
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
def matrix_row_body_for(choice)
|
|
50
|
+
return unless response.question.matrix?
|
|
51
|
+
return unless choice.matrix_row&.body
|
|
37
52
|
|
|
38
|
-
|
|
53
|
+
translated_attribute(choice.matrix_row.body)
|
|
54
|
+
end
|
|
39
55
|
|
|
56
|
+
def render_choices_list(choices)
|
|
40
57
|
content_tag(:ul) do
|
|
41
|
-
|
|
58
|
+
if response.question.question_type == "single_option"
|
|
59
|
+
choice(choices.first)
|
|
60
|
+
else
|
|
61
|
+
safe_join(choices.map { |c| choice(c) })
|
|
62
|
+
end
|
|
42
63
|
end
|
|
43
64
|
end
|
|
44
65
|
|
|
@@ -68,7 +89,11 @@ module Decidim
|
|
|
68
89
|
|
|
69
90
|
def choice(choice_hash)
|
|
70
91
|
content_tag :li do
|
|
71
|
-
|
|
92
|
+
if choice_hash[:matrix_row_body].present?
|
|
93
|
+
content_tag(:strong, choice_hash[:matrix_row_body]) + ": " + render_body_for(choice_hash) # rubocop:disable Style/StringConcatenation
|
|
94
|
+
else
|
|
95
|
+
render_body_for choice_hash
|
|
96
|
+
end
|
|
72
97
|
end
|
|
73
98
|
end
|
|
74
99
|
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
<%= cell("decidim/announcement", t(".already_responded_warning"), callout_class: "warning" ) %>
|
|
41
41
|
<% end %>
|
|
42
42
|
|
|
43
|
-
<div class="questionnaire-questions-list flex flex-col py-6 gap-6 last:pb-0" data-draggable-table data-sort-url="#" id="questionnaire-questions-list">
|
|
43
|
+
<div class="questionnaire-questions-list flex flex-col py-6 gap-6 last:pb-0" data-draggable-table data-sort-url="#" data-draggable-handle=".card-divider" id="questionnaire-questions-list">
|
|
44
44
|
<% @form.questions.each_with_index do |question, index| %>
|
|
45
45
|
<%= fields_for "questions[questions][]", question do |question_form| %>
|
|
46
46
|
<% if question.separator? %>
|
|
@@ -76,35 +76,6 @@
|
|
|
76
76
|
<script>
|
|
77
77
|
document.addEventListener("turbo:load", function () {
|
|
78
78
|
window.Decidim.createEditableForm();
|
|
79
|
-
|
|
80
|
-
// Function to initialize the sortable functionality
|
|
81
|
-
function initializeSortable() {
|
|
82
|
-
const container = document.querySelector("#questionnaire-questions-list");
|
|
83
|
-
const questionCards = container?.querySelectorAll(".card.questionnaire-question");
|
|
84
|
-
|
|
85
|
-
if (!container || !questionCards?.length) return;
|
|
86
|
-
|
|
87
|
-
questionCards.forEach(card => {
|
|
88
|
-
card.setAttribute("draggable", "true");
|
|
89
|
-
card.setAttribute("role", "option");
|
|
90
|
-
card.setAttribute("aria-grabbed", "false");
|
|
91
|
-
});
|
|
92
|
-
|
|
93
|
-
window.Decidim?.createSortableList?.("#questionnaire-questions-list");
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
// Initialize on load and when new options such as questions etc are added
|
|
97
|
-
initializeSortable();
|
|
98
|
-
|
|
99
|
-
const observer = new MutationObserver(() => {
|
|
100
|
-
clearTimeout(observer.timer);
|
|
101
|
-
observer.timer = setTimeout(initializeSortable, 500);
|
|
102
|
-
});
|
|
103
|
-
|
|
104
|
-
const container = document.querySelector("#questionnaire-questions-list");
|
|
105
|
-
if (container) {
|
|
106
|
-
observer.observe(container, { childList: true, subtree: true });
|
|
107
|
-
}
|
|
108
79
|
});
|
|
109
80
|
</script>
|
|
110
81
|
<% end %>
|
data/config/locales/de.yml
CHANGED
|
@@ -54,6 +54,7 @@ de:
|
|
|
54
54
|
tos: Nutzungsbedingungen
|
|
55
55
|
questionnaires:
|
|
56
56
|
actions:
|
|
57
|
+
back: Zurück zu den Antworten
|
|
57
58
|
publish_responses: Antworten veröffentlichen
|
|
58
59
|
show: Antworten
|
|
59
60
|
display_condition:
|
|
@@ -215,7 +216,7 @@ de:
|
|
|
215
216
|
back: Zurück
|
|
216
217
|
continue: Weiter
|
|
217
218
|
disallowed: Sie dürfen Ihre Antworten nicht bearbeiten.
|
|
218
|
-
submit:
|
|
219
|
+
submit: Absenden
|
|
219
220
|
user_responses_serializer:
|
|
220
221
|
body: Antwort
|
|
221
222
|
completion: Abschluss
|
data/config/locales/eu.yml
CHANGED
|
@@ -15,7 +15,7 @@ eu:
|
|
|
15
15
|
errors:
|
|
16
16
|
models:
|
|
17
17
|
questionnaire:
|
|
18
|
-
request_invalid: Arazo bat izan da eskaera kudeatzean. Mesedez, saiatu
|
|
18
|
+
request_invalid: Arazo bat izan da eskaera kudeatzean. Mesedez, berriro saiatu.
|
|
19
19
|
response:
|
|
20
20
|
attributes:
|
|
21
21
|
add_documents:
|
|
@@ -30,7 +30,7 @@ eu:
|
|
|
30
30
|
help:
|
|
31
31
|
responses:
|
|
32
32
|
id: Erantzunaren identifikatzaile bakarra
|
|
33
|
-
question: Erantzun
|
|
33
|
+
question: Erantzun den galdera
|
|
34
34
|
questionnaire: Erantzun zen galdetegia
|
|
35
35
|
response: Galderaren erantzuna
|
|
36
36
|
user: Inkesta erantzun duen parte-hartzailea
|
|
@@ -51,12 +51,12 @@ eu:
|
|
|
51
51
|
ends_at: Erantzunak noiz arte onartuta
|
|
52
52
|
ends_at_help: Utzi zuriz data zehatzik ez badago
|
|
53
53
|
starts_at: Erantzunak noiztik onartuta
|
|
54
|
-
starts_at_help:
|
|
54
|
+
starts_at_help: Zuriz utzi data zehatzik ez badago
|
|
55
55
|
tos: Zerbitzu-baldintzak
|
|
56
56
|
questionnaires:
|
|
57
57
|
actions:
|
|
58
|
-
back:
|
|
59
|
-
publish_responses:
|
|
58
|
+
back: Erantzunetara itzuli
|
|
59
|
+
publish_responses: Erantzunak argitura
|
|
60
60
|
show: Erantzunak
|
|
61
61
|
display_condition:
|
|
62
62
|
condition_question: Galdera
|
|
@@ -72,7 +72,7 @@ eu:
|
|
|
72
72
|
mandatory: Baldintza hau beti bete behar da, beste baldintza batzuen egoera edozein dela ere
|
|
73
73
|
remove: Kendu
|
|
74
74
|
response_option: Erantzuteko aukera
|
|
75
|
-
save_warning: Gogoratu formularioa gorde behar duzula
|
|
75
|
+
save_warning: Gogoratu formularioa gorde behar duzula bistaratzeko baldintzak konfiguratu aurretik
|
|
76
76
|
select_condition_question: Hautatu galdera bat
|
|
77
77
|
select_condition_type: Hautatu baldintza mota bat
|
|
78
78
|
select_response_option: Hautatu erantzuteko aukera
|
|
@@ -96,7 +96,7 @@ eu:
|
|
|
96
96
|
remove: Kendu
|
|
97
97
|
statement: Adierazpena
|
|
98
98
|
question:
|
|
99
|
-
add_display_condition:
|
|
99
|
+
add_display_condition: Bistaratzeko baldintza gehitu
|
|
100
100
|
add_display_condition_info: Gorde galdetegia bistaratzeko baldintzak konfiguratzeko
|
|
101
101
|
add_matrix_row: Gehitu errenkada
|
|
102
102
|
add_response_option: Erantsi erantzuteko aukera
|
data/config/locales/pt-BR.yml
CHANGED
|
@@ -8,14 +8,56 @@ pt-BR:
|
|
|
8
8
|
questionnaire_question:
|
|
9
9
|
mandatory: Obrigatório
|
|
10
10
|
max_characters: Limite de caracteres (deixe para 0 se não houver limite)
|
|
11
|
+
response:
|
|
12
|
+
body: Resposta
|
|
13
|
+
choices: Escolhas
|
|
14
|
+
selected_choices: Escolhas selecionadas
|
|
15
|
+
errors:
|
|
16
|
+
models:
|
|
17
|
+
questionnaire:
|
|
18
|
+
request_invalid: Houve um problema ao lidar com a solicitação. Por favor, tente novamente.
|
|
19
|
+
response:
|
|
20
|
+
attributes:
|
|
21
|
+
add_documents:
|
|
22
|
+
needs_to_be_reattached: Precisa ser reanexado
|
|
23
|
+
body:
|
|
24
|
+
too_long: é muito longo
|
|
25
|
+
choices:
|
|
26
|
+
missing: não estão completos
|
|
27
|
+
too_many: Você pode escolher um máximo de %{count}.
|
|
11
28
|
decidim:
|
|
29
|
+
download_your_data:
|
|
30
|
+
help:
|
|
31
|
+
responses:
|
|
32
|
+
id: O identificador único da resposta
|
|
33
|
+
question: A pergunta respondida
|
|
34
|
+
questionnaire: O formulário respondido
|
|
35
|
+
response: A resposta para a pergunta
|
|
36
|
+
user: O usuário que respondeu ao formulário
|
|
37
|
+
show:
|
|
38
|
+
responses: Exportação de respostas
|
|
39
|
+
survey_user_responses: Respostas do usuário da pesquisa
|
|
12
40
|
forms:
|
|
13
41
|
admin:
|
|
14
42
|
models:
|
|
15
43
|
components:
|
|
44
|
+
allow_editing_responses: Permitir que usuários registrados editem suas próprias respostas à pesquisa
|
|
45
|
+
allow_responses: Permitir respostas
|
|
46
|
+
allow_unregistered: Permitir que usuários não registrados respondam à pesquisa
|
|
47
|
+
allow_unregistered_help: Se ativo, nenhum login será necessário para responder à pesquisa. Isso pode levar a dados ruins ou não confiáveis e será mais vulnerável a ataques automatizados. Usar com cuidado! Lembre-se de que um usuário pode responder à mesma pesquisa várias vezes, usando diferentes navegadores ou a função "navegação privada" de seu navegador.
|
|
48
|
+
announcement: Anúncio
|
|
49
|
+
clean_after_publish: Excluir respostas ao publicar a pesquisa
|
|
16
50
|
description: Descrição
|
|
51
|
+
ends_at: Respostas aceitas até
|
|
52
|
+
ends_at_help: Deixe em branco para nenhuma data específica
|
|
53
|
+
starts_at: Respostas aceitas de
|
|
54
|
+
starts_at_help: Deixe em branco para nenhuma data específica
|
|
17
55
|
tos: Termos de serviço
|
|
18
56
|
questionnaires:
|
|
57
|
+
actions:
|
|
58
|
+
back: Voltar para respostas
|
|
59
|
+
publish_responses: Publicar respostas
|
|
60
|
+
show: Respostas
|
|
19
61
|
display_condition:
|
|
20
62
|
condition_question: Questão
|
|
21
63
|
condition_type: Condição
|
|
@@ -23,16 +65,26 @@ pt-BR:
|
|
|
23
65
|
equal: Igual
|
|
24
66
|
match: Incluir texto
|
|
25
67
|
not_equal: Diferente
|
|
68
|
+
not_responded: Não respondeu
|
|
69
|
+
responded: Respondeu
|
|
26
70
|
condition_value: Incluir texto
|
|
27
71
|
display_condition: Exibir condição
|
|
28
72
|
mandatory: Esta condição precisa ser sempre satisfeita independentemente do status de outras condições
|
|
29
73
|
remove: Remover
|
|
74
|
+
response_option: Opção de resposta
|
|
30
75
|
save_warning: Lembre-se de salvar o formulário antes de configurar condições de exibição
|
|
31
76
|
select_condition_question: Selecione uma pergunta
|
|
32
77
|
select_condition_type: Selecione um tipo de condição
|
|
78
|
+
select_response_option: Selecionar opção de resposta
|
|
33
79
|
edit:
|
|
34
80
|
save: Salvar
|
|
35
81
|
title: Editar questionário
|
|
82
|
+
edit_questions:
|
|
83
|
+
add_question: Adicionar pergunta
|
|
84
|
+
add_separator: Adicionar separador
|
|
85
|
+
add_title_and_description: Adicionar título e descrição
|
|
86
|
+
save: Salvar
|
|
87
|
+
title: Perguntas
|
|
36
88
|
form:
|
|
37
89
|
add_question: Adicionar pergunta
|
|
38
90
|
collapse: Recolher todas as questões
|
|
@@ -47,6 +99,7 @@ pt-BR:
|
|
|
47
99
|
add_display_condition: Adicionar condição de exibição
|
|
48
100
|
add_display_condition_info: Salve o formulário para configurar condições de exibição
|
|
49
101
|
add_matrix_row: Adicionar linha
|
|
102
|
+
add_response_option: Adicionar opção de resposta
|
|
50
103
|
any: Qualquer
|
|
51
104
|
collapse: Recolher
|
|
52
105
|
description: Descrição
|
|
@@ -54,9 +107,35 @@ pt-BR:
|
|
|
54
107
|
question: Questão
|
|
55
108
|
remove: Remover
|
|
56
109
|
statement: Declaração
|
|
110
|
+
questions_form:
|
|
111
|
+
already_responded_warning: O formulário já foi respondido por alguns usuários então você não pode modificar suas perguntas.
|
|
112
|
+
collapse: Recolher todas as perguntas
|
|
113
|
+
expand: Expandir todas as perguntas
|
|
114
|
+
unpublished_warning: O formulário não foi publicado. Você pode modificar suas perguntas, mas ao fazê-lo apagará as respostas atuais.
|
|
115
|
+
update:
|
|
116
|
+
success: Perguntas da pesquisa salvas com sucesso.
|
|
117
|
+
response_option:
|
|
118
|
+
free_text: Texto livre
|
|
119
|
+
remove: Excluir
|
|
120
|
+
response_option: Opção de resposta
|
|
121
|
+
statement: Instrução
|
|
57
122
|
responses:
|
|
58
123
|
actions:
|
|
124
|
+
back: Voltar para respostas
|
|
125
|
+
export: Exportar
|
|
126
|
+
next: Próximo ›
|
|
127
|
+
previous: "‹ Anterior"
|
|
59
128
|
show: Mostrar respostas
|
|
129
|
+
empty: Ainda não há respostas
|
|
130
|
+
export:
|
|
131
|
+
response:
|
|
132
|
+
title: 'Resposta #%{number}'
|
|
133
|
+
export_response:
|
|
134
|
+
title: pesquisa_respostas_do_usuário_%{token}
|
|
135
|
+
index:
|
|
136
|
+
title: "Total de respostas de %{total}"
|
|
137
|
+
show:
|
|
138
|
+
title: 'Resposta #%{number}'
|
|
60
139
|
separator:
|
|
61
140
|
remove: Remover
|
|
62
141
|
separator: Separador
|
|
@@ -71,8 +150,14 @@ pt-BR:
|
|
|
71
150
|
invalid: Houve erros ao salvar o questionário.
|
|
72
151
|
success: Formulário salvo com sucesso.
|
|
73
152
|
admin_log:
|
|
153
|
+
question:
|
|
154
|
+
publish_responses: "%{user_name} publicou as respostas da pergunta %{resource_name} no espaço %{space_name}"
|
|
155
|
+
unpublish_responses: "%{user_name} não publicou as respostas da pergunta %{resource_name} no espaço %{space_name}"
|
|
74
156
|
questionnaire:
|
|
75
157
|
update: "%{user_name} atualizou o questionário %{resource_name}"
|
|
158
|
+
errors:
|
|
159
|
+
response:
|
|
160
|
+
body: Corpo não pode estar em branco
|
|
76
161
|
images:
|
|
77
162
|
dimensions: "%{width} x %{height} px"
|
|
78
163
|
processors:
|
|
@@ -80,19 +165,29 @@ pt-BR:
|
|
|
80
165
|
resize_to_fit: Esta imagem será redimensionada para caber %{dimensions}.
|
|
81
166
|
question_types:
|
|
82
167
|
files: Arquivos
|
|
168
|
+
long_response: Resposta longa
|
|
83
169
|
matrix_multiple: Matriz (Múltipla opção)
|
|
84
170
|
matrix_single: Matriz (opção única)
|
|
85
171
|
multiple_option: Opção múltipla
|
|
172
|
+
short_response: Resposta curta
|
|
86
173
|
single_option: Opção única
|
|
87
174
|
sorting: Classificação
|
|
88
175
|
title_and_description: Título e descrição
|
|
176
|
+
questionnaire_response_presenter:
|
|
177
|
+
download_attachment: Baixar anexo
|
|
89
178
|
questionnaires:
|
|
90
179
|
question:
|
|
91
180
|
max_choices: 'Escolhas máximas: %{n}'
|
|
181
|
+
response:
|
|
182
|
+
invalid: Houve um problema ao responder o formulário.
|
|
183
|
+
max_choices_alert: Há muitas opções selecionadas
|
|
184
|
+
success: Formulário respondido com sucesso.
|
|
92
185
|
show:
|
|
93
186
|
current_step: Passo %{step}
|
|
187
|
+
empty: Nenhuma pergunta configurada para este formulário ainda.
|
|
94
188
|
of_total_steps: de %{total_steps}
|
|
95
189
|
questionnaire_closed:
|
|
190
|
+
body: O formulário está fechado e não pode ser respondido.
|
|
96
191
|
title: Questionário fechado
|
|
97
192
|
questionnaire_for_private_users:
|
|
98
193
|
body: O questionário está disponível apenas para usuários particulares
|
|
@@ -102,9 +197,35 @@ pt-BR:
|
|
|
102
197
|
title: JavaScript está desativado
|
|
103
198
|
questionnaire_not_published:
|
|
104
199
|
body: Este formulário ainda não foi publicado.
|
|
200
|
+
questionnaire_responded:
|
|
201
|
+
body: Você já respondeu a este formulário.
|
|
202
|
+
title: Já respondido
|
|
203
|
+
questionnaire_responded_edit:
|
|
204
|
+
body: Você já respondeu a este formulário. %{link}
|
|
205
|
+
edit: Edite suas respostas
|
|
206
|
+
response_questionnaire:
|
|
207
|
+
already_have_an_account?: Já tem uma conta?
|
|
208
|
+
are_you_new?: Usuário novo?
|
|
209
|
+
sign_in_description: Faça ‘login’ para participar da pesquisa
|
|
210
|
+
sign_up_description: Crie uma conta de participante para responder à pesquisa
|
|
211
|
+
title: Responda ao formulário
|
|
105
212
|
tos_agreement: Ao participar você aceita seus Termos de Serviço
|
|
106
213
|
step_navigation:
|
|
107
214
|
show:
|
|
215
|
+
are_you_sure_edit_guest: Se você quiser poder editar suas respostas posteriormente, precisará fazer ‘login’ ou criar uma conta.
|
|
216
|
+
are_you_sure_no_edit: Esta ação não pode ser desfeita e você não poderá editar suas respostas. Tem certeza?
|
|
108
217
|
back: Voltar
|
|
109
218
|
continue: Continuar
|
|
219
|
+
disallowed: Você não tem permissão para editar suas respostas.
|
|
110
220
|
submit: Enviar
|
|
221
|
+
user_responses_serializer:
|
|
222
|
+
body: Resposta
|
|
223
|
+
completion: Conclusão
|
|
224
|
+
created_at: Respondeu em
|
|
225
|
+
id: ID resposta
|
|
226
|
+
ip_hash: IP 'Hash'
|
|
227
|
+
question: Pergunta
|
|
228
|
+
registered: Registrado
|
|
229
|
+
session_token: Identificador do usuário
|
|
230
|
+
unregistered: Não registrado
|
|
231
|
+
user_status: '''Status'' do usuário'
|
data/config/locales/ro-RO.yml
CHANGED
|
@@ -124,7 +124,7 @@ ro:
|
|
|
124
124
|
title: Formular închis
|
|
125
125
|
questionnaire_for_private_users:
|
|
126
126
|
body: Chestionarul este disponibil doar pentru utilizatorii privați
|
|
127
|
-
title:
|
|
127
|
+
title: Formular închis
|
|
128
128
|
questionnaire_js_disabled:
|
|
129
129
|
body: Unele dintre funcționalitățile acestui chestionar vor fi dezactivate. Pentru a îți îmbunătăți experiența, te rugăm să activezi JavaScript în browser-ul tău.
|
|
130
130
|
title: JavaScript este dezactivat
|
data/config/locales/sk.yml
CHANGED
|
@@ -42,7 +42,7 @@ sk:
|
|
|
42
42
|
title: Formulár je uzavretý.
|
|
43
43
|
questionnaire_for_private_users:
|
|
44
44
|
body: Formulár je otvorený len pre súkromných používateľov
|
|
45
|
-
title: Formulár je
|
|
45
|
+
title: Formulár je uzavretý.
|
|
46
46
|
tos_agreement: Účasťou súhlasíte s našimi Podmienkami použitia
|
|
47
47
|
step_navigation:
|
|
48
48
|
show:
|
data/config/locales/sv.yml
CHANGED
|
@@ -43,8 +43,8 @@ sv:
|
|
|
43
43
|
components:
|
|
44
44
|
allow_editing_responses: Tillåt registrerade användare att redigera egna enkätsvar
|
|
45
45
|
allow_responses: Tillåt svar
|
|
46
|
-
allow_unregistered: Tillåt oregistrerade användare att
|
|
47
|
-
allow_unregistered_help: Om aktiv kommer ingen inloggning att krävas för att besvara enkäten. Detta kan leda till dålig eller opålitlig data och det kommer att vara mer sårbart för automatiserade attacker. Använd med försiktighet! Tänk på att en deltagare
|
|
46
|
+
allow_unregistered: Tillåt oregistrerade användare att svara på enkäten
|
|
47
|
+
allow_unregistered_help: Om aktiv kommer ingen inloggning att krävas för att besvara enkäten. Detta kan leda till dålig eller opålitlig data och det kommer att vara mer sårbart för automatiserade attacker. Använd med försiktighet! Tänk på att en deltagare kunde svara på samma enkät flera gånger, genom att använda olika webbläsare eller "privat surfning" i sin webbläsare.
|
|
48
48
|
announcement: Meddelande
|
|
49
49
|
clean_after_publish: Ta bort svar vid publicering av enkäten
|
|
50
50
|
description: Beskrivning
|
|
@@ -12,7 +12,14 @@ module Decidim
|
|
|
12
12
|
|
|
13
13
|
class QuestionnaireResponsePresenter < Decidim::Forms::Admin::QuestionnaireResponsePresenter
|
|
14
14
|
def choice(choice_hash)
|
|
15
|
-
|
|
15
|
+
if choice_hash[:matrix_row_body].present?
|
|
16
|
+
row_text = choice_hash[:matrix_row_body]
|
|
17
|
+
option_text = choice_hash[:response_option_body]
|
|
18
|
+
custom_text = choice_hash[:choice_body].present? ? " (#{choice_hash[:choice_body]})" : ""
|
|
19
|
+
"#{row_text}: #{option_text}#{custom_text}"
|
|
20
|
+
else
|
|
21
|
+
render_body_for choice_hash
|
|
22
|
+
end
|
|
16
23
|
end
|
|
17
24
|
|
|
18
25
|
delegate :attachments, to: :response
|
|
@@ -25,7 +32,8 @@ module Decidim
|
|
|
25
32
|
choices = response.choices.map do |choice|
|
|
26
33
|
{
|
|
27
34
|
response_option_body: choice.try(:response_option).try(:translated_body),
|
|
28
|
-
choice_body: body_or_custom_body(choice)
|
|
35
|
+
choice_body: body_or_custom_body(choice),
|
|
36
|
+
matrix_row_body: choice.try(:matrix_row).try(:body) ? translated_attribute(choice.matrix_row.body) : nil
|
|
29
37
|
}
|
|
30
38
|
end
|
|
31
39
|
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: decidim-forms
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.31.
|
|
4
|
+
version: 0.31.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Josep Jaume Rey Peroy
|
|
@@ -11,7 +11,7 @@ authors:
|
|
|
11
11
|
autorequire:
|
|
12
12
|
bindir: bin
|
|
13
13
|
cert_chain: []
|
|
14
|
-
date:
|
|
14
|
+
date: 2026-02-26 00:00:00.000000000 Z
|
|
15
15
|
dependencies:
|
|
16
16
|
- !ruby/object:Gem::Dependency
|
|
17
17
|
name: decidim-core
|
|
@@ -19,42 +19,42 @@ dependencies:
|
|
|
19
19
|
requirements:
|
|
20
20
|
- - '='
|
|
21
21
|
- !ruby/object:Gem::Version
|
|
22
|
-
version: 0.31.
|
|
22
|
+
version: 0.31.2
|
|
23
23
|
type: :runtime
|
|
24
24
|
prerelease: false
|
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
|
26
26
|
requirements:
|
|
27
27
|
- - '='
|
|
28
28
|
- !ruby/object:Gem::Version
|
|
29
|
-
version: 0.31.
|
|
29
|
+
version: 0.31.2
|
|
30
30
|
- !ruby/object:Gem::Dependency
|
|
31
31
|
name: decidim-admin
|
|
32
32
|
requirement: !ruby/object:Gem::Requirement
|
|
33
33
|
requirements:
|
|
34
34
|
- - '='
|
|
35
35
|
- !ruby/object:Gem::Version
|
|
36
|
-
version: 0.31.
|
|
36
|
+
version: 0.31.2
|
|
37
37
|
type: :development
|
|
38
38
|
prerelease: false
|
|
39
39
|
version_requirements: !ruby/object:Gem::Requirement
|
|
40
40
|
requirements:
|
|
41
41
|
- - '='
|
|
42
42
|
- !ruby/object:Gem::Version
|
|
43
|
-
version: 0.31.
|
|
43
|
+
version: 0.31.2
|
|
44
44
|
- !ruby/object:Gem::Dependency
|
|
45
45
|
name: decidim-dev
|
|
46
46
|
requirement: !ruby/object:Gem::Requirement
|
|
47
47
|
requirements:
|
|
48
48
|
- - '='
|
|
49
49
|
- !ruby/object:Gem::Version
|
|
50
|
-
version: 0.31.
|
|
50
|
+
version: 0.31.2
|
|
51
51
|
type: :development
|
|
52
52
|
prerelease: false
|
|
53
53
|
version_requirements: !ruby/object:Gem::Requirement
|
|
54
54
|
requirements:
|
|
55
55
|
- - '='
|
|
56
56
|
- !ruby/object:Gem::Version
|
|
57
|
-
version: 0.31.
|
|
57
|
+
version: 0.31.2
|
|
58
58
|
description: A forms gem for decidim.
|
|
59
59
|
email:
|
|
60
60
|
- josepjaume@gmail.com
|