decidim-forms 0.26.2 → 0.26.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/commands/decidim/forms/answer_questionnaire.rb +2 -2
- data/app/forms/decidim/forms/answer_form.rb +4 -0
- data/app/packs/src/decidim/forms/admin/forms.js +3 -0
- data/app/presenters/decidim/forms/admin/questionnaire_answer_presenter.rb +6 -3
- data/app/views/decidim/forms/questionnaires/show.html.erb +1 -1
- data/config/locales/ca.yml +2 -0
- data/config/locales/cs.yml +2 -0
- data/config/locales/en.yml +2 -0
- data/config/locales/es-MX.yml +2 -0
- data/config/locales/es-PY.yml +2 -0
- data/config/locales/es.yml +2 -0
- data/config/locales/fi-plain.yml +2 -0
- data/config/locales/fi.yml +2 -0
- data/config/locales/fr-CA.yml +2 -0
- data/config/locales/fr.yml +2 -0
- data/config/locales/gn-PY.yml +1 -0
- data/config/locales/ja.yml +2 -0
- data/config/locales/lo-LA.yml +1 -0
- data/config/locales/lt.yml +188 -0
- data/config/locales/oc-FR.yml +1 -0
- data/config/locales/pl.yml +5 -4
- data/config/locales/ro-RO.yml +2 -0
- data/lib/decidim/forms/test/shared_examples/manage_questionnaire_answers.rb +25 -2
- data/lib/decidim/forms/version.rb +1 -1
- metadata +11 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ac2a4967f65889f20e67fcfea32386f57484e8eb0f61172f335b690e4298ab4b
|
4
|
+
data.tar.gz: e971f03e20bd78cf6e246869133eaea933edb61bee15ef48d12ca0aae082e1c4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3b9fb3129e380b1aeeb0b801296518256b0be19b46799b69031f588dfeac69f2c7e3bd69aa91306a34826f005f85158bc6a0f433589b209399b88ccab60d240c
|
7
|
+
data.tar.gz: 68d5bab8bd439145111c49c9a4f8d39a4d99b97acf34bec6e4b072f83691e92ab29e23645fed2cf5c4b08e5caf7fc271f9522b2686076d1f74d2479ca56b2565
|
@@ -43,7 +43,7 @@ module Decidim
|
|
43
43
|
# of this problem.
|
44
44
|
def reset_form_attachments
|
45
45
|
@form.responses.each do |answer|
|
46
|
-
answer.errors.add(:add_documents, :needs_to_be_reattached) if answer.has_attachments?
|
46
|
+
answer.errors.add(:add_documents, :needs_to_be_reattached) if answer.has_attachments? || answer.has_error_in_attachments?
|
47
47
|
end
|
48
48
|
end
|
49
49
|
|
@@ -51,7 +51,7 @@ module Decidim
|
|
51
51
|
@main_form = @form
|
52
52
|
@errors = nil
|
53
53
|
|
54
|
-
Answer.transaction do
|
54
|
+
Answer.transaction(requires_new: true) do
|
55
55
|
form.responses_by_step.flatten.select(&:display_conditions_fulfilled?).each do |form_answer|
|
56
56
|
answer = Answer.new(
|
57
57
|
user: @current_user,
|
@@ -11,6 +11,7 @@ import createSortList from "src/decidim/admin/sort_list.component"
|
|
11
11
|
import createDynamicFields from "src/decidim/admin/dynamic_fields.component"
|
12
12
|
import createFieldDependentInputs from "src/decidim/admin/field_dependent_inputs.component"
|
13
13
|
import createQuillEditor from "src/decidim/editor"
|
14
|
+
import initLanguageChangeSelect from "src/decidim/admin/choose_language"
|
14
15
|
|
15
16
|
export default function createEditableForm() {
|
16
17
|
const wrapperSelector = ".questionnaire-questions";
|
@@ -392,6 +393,8 @@ export default function createEditableForm() {
|
|
392
393
|
|
393
394
|
autoLabelByPosition.run();
|
394
395
|
autoButtonsByPosition.run();
|
396
|
+
|
397
|
+
initLanguageChangeSelect($field.find("select.language-change").toArray());
|
395
398
|
},
|
396
399
|
onRemoveField: ($field) => {
|
397
400
|
autoLabelByPosition.run();
|
@@ -46,11 +46,14 @@ module Decidim
|
|
46
46
|
# rubocop:disable Style/StringConcatenation
|
47
47
|
# Interpolating strings that are `html_safe` is problematic with Rails.
|
48
48
|
content_tag :li do
|
49
|
-
link_to(
|
50
|
-
|
51
|
-
|
49
|
+
link_to(attachment.url, target: "_blank", rel: "noopener noreferrer") do
|
50
|
+
content_tag(:span) do
|
51
|
+
translated_attribute(attachment.title).presence ||
|
52
|
+
I18n.t("download_attachment", scope: "decidim.forms.questionnaire_answer_presenter")
|
53
|
+
end + " " + content_tag(:small) do
|
52
54
|
"#{attachment.file_type} #{number_to_human_size(attachment.file_size)}"
|
53
55
|
end
|
56
|
+
end
|
54
57
|
end
|
55
58
|
# rubocop:enable Style/StringConcatenation
|
56
59
|
end
|
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
<% columns = allow_answers? && visitor_can_answer? && @form.responses.map(&:question).any?(&:matrix?) ? 9 : 6 %>
|
7
7
|
|
8
|
-
<%= render partial: "decidim/shared/component_announcement" %>
|
8
|
+
<%= render partial: "decidim/shared/component_announcement" if current_component.manifest_name == "surveys" %>
|
9
9
|
|
10
10
|
<div class="row columns">
|
11
11
|
<h2 class="section-heading"><%= translated_attribute questionnaire.title %></h2>
|
data/config/locales/ca.yml
CHANGED
@@ -142,6 +142,8 @@ ca:
|
|
142
142
|
single_option: Opció única
|
143
143
|
sorting: Ordenació
|
144
144
|
title_and_description: Títol i descripció
|
145
|
+
questionnaire_answer_presenter:
|
146
|
+
download_attachment: Descarregar l'arxiu adjunt
|
145
147
|
questionnaires:
|
146
148
|
answer:
|
147
149
|
invalid: S'han produït un error en respondre el formulari.
|
data/config/locales/cs.yml
CHANGED
@@ -142,6 +142,8 @@ cs:
|
|
142
142
|
single_option: Jedna možnost
|
143
143
|
sorting: Třídění
|
144
144
|
title_and_description: Název a popis
|
145
|
+
questionnaire_answer_presenter:
|
146
|
+
download_attachment: Stáhnout přílohu
|
145
147
|
questionnaires:
|
146
148
|
answer:
|
147
149
|
invalid: Při odpovědi na dotazník došlo k chybám.
|
data/config/locales/en.yml
CHANGED
@@ -143,6 +143,8 @@ en:
|
|
143
143
|
single_option: Single option
|
144
144
|
sorting: Sorting
|
145
145
|
title_and_description: Title and description
|
146
|
+
questionnaire_answer_presenter:
|
147
|
+
download_attachment: Download attachment
|
146
148
|
questionnaires:
|
147
149
|
answer:
|
148
150
|
invalid: There was a problem answering the form.
|
data/config/locales/es-MX.yml
CHANGED
@@ -142,6 +142,8 @@ es-MX:
|
|
142
142
|
single_option: Opción única
|
143
143
|
sorting: Ordenación
|
144
144
|
title_and_description: Titulo y descripción
|
145
|
+
questionnaire_answer_presenter:
|
146
|
+
download_attachment: Descargar el archivo adjunto
|
145
147
|
questionnaires:
|
146
148
|
answer:
|
147
149
|
invalid: Ha habido errores al responder al cuestionario.
|
data/config/locales/es-PY.yml
CHANGED
@@ -142,6 +142,8 @@ es-PY:
|
|
142
142
|
single_option: Opción única
|
143
143
|
sorting: Ordenación
|
144
144
|
title_and_description: Titulo y descripción
|
145
|
+
questionnaire_answer_presenter:
|
146
|
+
download_attachment: Descargar el archivo adjunto
|
145
147
|
questionnaires:
|
146
148
|
answer:
|
147
149
|
invalid: Ha habido errores al responder al cuestionario.
|
data/config/locales/es.yml
CHANGED
@@ -142,6 +142,8 @@ es:
|
|
142
142
|
single_option: Opción única
|
143
143
|
sorting: Ordenación
|
144
144
|
title_and_description: Titulo y descripción
|
145
|
+
questionnaire_answer_presenter:
|
146
|
+
download_attachment: Descargar el archivo adjunto
|
145
147
|
questionnaires:
|
146
148
|
answer:
|
147
149
|
invalid: Se ha producido un error al responder el formulario.
|
data/config/locales/fi-plain.yml
CHANGED
@@ -142,6 +142,8 @@ fi-pl:
|
|
142
142
|
single_option: Yksi vaihtoehto
|
143
143
|
sorting: Järjestäminen
|
144
144
|
title_and_description: Otsikko ja kuvaus
|
145
|
+
questionnaire_answer_presenter:
|
146
|
+
download_attachment: Lataa liite
|
145
147
|
questionnaires:
|
146
148
|
answer:
|
147
149
|
invalid: Kyselylomakkeeseen vastatessa tapahtui virheitä.
|
data/config/locales/fi.yml
CHANGED
@@ -142,6 +142,8 @@ fi:
|
|
142
142
|
single_option: Yksi vaihtoehto
|
143
143
|
sorting: Järjestäminen
|
144
144
|
title_and_description: Otsikko ja kuvaus
|
145
|
+
questionnaire_answer_presenter:
|
146
|
+
download_attachment: Lataa liite
|
145
147
|
questionnaires:
|
146
148
|
answer:
|
147
149
|
invalid: Kyselylomakkeeseen vastaaminen epäonnistui.
|
data/config/locales/fr-CA.yml
CHANGED
@@ -142,6 +142,8 @@ fr-CA:
|
|
142
142
|
single_option: Option unique
|
143
143
|
sorting: Tri
|
144
144
|
title_and_description: Titre et description
|
145
|
+
questionnaire_answer_presenter:
|
146
|
+
download_attachment: Télécharger la pièce jointe
|
145
147
|
questionnaires:
|
146
148
|
answer:
|
147
149
|
invalid: Il y a eu des erreurs en répondant au questionnaire.
|
data/config/locales/fr.yml
CHANGED
@@ -142,6 +142,8 @@ fr:
|
|
142
142
|
single_option: Option unique
|
143
143
|
sorting: Tri
|
144
144
|
title_and_description: Titre et description
|
145
|
+
questionnaire_answer_presenter:
|
146
|
+
download_attachment: Télécharger la pièce jointe
|
145
147
|
questionnaires:
|
146
148
|
answer:
|
147
149
|
invalid: Il y a eu des erreurs en répondant au questionnaire.
|
@@ -0,0 +1 @@
|
|
1
|
+
gn:
|
data/config/locales/ja.yml
CHANGED
@@ -0,0 +1 @@
|
|
1
|
+
lo:
|
data/config/locales/lt.yml
CHANGED
@@ -1 +1,189 @@
|
|
1
1
|
lt:
|
2
|
+
activemodel:
|
3
|
+
attributes:
|
4
|
+
answer:
|
5
|
+
body: Atsakymas
|
6
|
+
choices: Pasirinkimai
|
7
|
+
selected_choices: Pasirinkti pasirinkimai
|
8
|
+
question:
|
9
|
+
max_choices: Maksimalus pasirinkimų skaičius
|
10
|
+
question_type: Tipas
|
11
|
+
questionnaire_question:
|
12
|
+
mandatory: Privaloma
|
13
|
+
max_characters: Simbolių limitas (palikti 0 jei limito nėra)
|
14
|
+
errors:
|
15
|
+
models:
|
16
|
+
answer:
|
17
|
+
attributes:
|
18
|
+
add_documents:
|
19
|
+
needs_to_be_reattached: Reikia pridėti iš naujo
|
20
|
+
body:
|
21
|
+
too_long: per ilgas
|
22
|
+
choices:
|
23
|
+
missing: nepilnas - trūksta elementų
|
24
|
+
too_many: per daug
|
25
|
+
questionnaire:
|
26
|
+
request_invalid: Tvarkant prašymą įvyko klaida. Bandykite dar kartą
|
27
|
+
decidim:
|
28
|
+
forms:
|
29
|
+
admin:
|
30
|
+
models:
|
31
|
+
components:
|
32
|
+
description: Aprašymas
|
33
|
+
tos: Paslaugų teikimo sąlygos
|
34
|
+
questionnaires:
|
35
|
+
actions:
|
36
|
+
back: Grįžti į klausimus
|
37
|
+
show: Rodyti atsakymus
|
38
|
+
answer_option:
|
39
|
+
answer_option: Atsakymo variantas
|
40
|
+
free_text: Laisva forma
|
41
|
+
remove: Pašalinti
|
42
|
+
statement: Pareiškimas
|
43
|
+
answers:
|
44
|
+
actions:
|
45
|
+
back: Grįžti į atsakymus
|
46
|
+
export: Eksportuoti
|
47
|
+
show: Rodyti atsakymus
|
48
|
+
empty: Atsakymų dar nėra
|
49
|
+
export:
|
50
|
+
answer:
|
51
|
+
title: 'Atsakymas #%{number}'
|
52
|
+
export_response:
|
53
|
+
title: apklausa_naudotoju_atsakymai_%{token}
|
54
|
+
index:
|
55
|
+
title: "%{total} iš viso atsakymų"
|
56
|
+
show:
|
57
|
+
title: 'Atsakymas #%{number}'
|
58
|
+
display_condition:
|
59
|
+
answer_option: Atsakymo variantas
|
60
|
+
condition_question: Klausimas
|
61
|
+
condition_type: Sąlyga
|
62
|
+
condition_types:
|
63
|
+
answered: Atsakyta
|
64
|
+
equal: Lygu
|
65
|
+
match: Įskaitant tekstą
|
66
|
+
not_answered: Neatsakyta
|
67
|
+
not_equal: Nelygu
|
68
|
+
condition_value: Įskaitytas tekstas
|
69
|
+
display_condition: Rodymo sąlyga
|
70
|
+
mandatory: Ši sąlyga turi būti patenkinta visada, neatsižvelgiant į kitų sąlygų statusą
|
71
|
+
remove: Pašalinti
|
72
|
+
save_warning: Prieš konfigūruodami rodymo sąlygas, nepamirškite išsaugoti formos
|
73
|
+
select_answer_option: Pasirinkite atsakymo variantą
|
74
|
+
select_condition_question: Pasirinkite klausimą
|
75
|
+
select_condition_type: Pasirinkti sąlygos tipą
|
76
|
+
edit:
|
77
|
+
save: Išsaugoti
|
78
|
+
title: Redaguoti klausimyną
|
79
|
+
form:
|
80
|
+
add_question: Pridėti klausimą
|
81
|
+
add_separator: Pridėti skyriklį
|
82
|
+
add_title_and_description: Pridėti pavadinimą ir aprašymą
|
83
|
+
already_answered_warning: Kai kurie naudotojai jau atsakė į formos klausimus, todėl jos klausimų keisti nebegalite.
|
84
|
+
collapse: Suskleisti visus klausimus
|
85
|
+
expand: Išskleisti visus klausimus
|
86
|
+
preview: Peržiūra
|
87
|
+
title: Taisyti %{questionnaire_for} formą
|
88
|
+
unpublished_warning: Forma nepaskelbta. Galite keisti klausimus, tačiau tai darydami pašalinsite esamus atsakymus.
|
89
|
+
matrix_row:
|
90
|
+
matrix_row: Eilutė
|
91
|
+
remove: Pašalinti
|
92
|
+
statement: Pareiškimas
|
93
|
+
question:
|
94
|
+
add_answer_option: Pridėti atsakymo variantą
|
95
|
+
add_display_condition: Pridėti rodymo sąlygą
|
96
|
+
add_display_condition_info: Išsaugokite formą, kad galėtumėt konfiguruoti rodymo sąlygas
|
97
|
+
add_matrix_row: Pridėti eilutę
|
98
|
+
any: Bet koks
|
99
|
+
collapse: Suskleisti
|
100
|
+
description: Aprašymas
|
101
|
+
down: Žemyn
|
102
|
+
expand: Išplėsti
|
103
|
+
question: Klausimas
|
104
|
+
remove: Pašalinti
|
105
|
+
statement: Pareiškimas
|
106
|
+
up: Į viršų
|
107
|
+
separator:
|
108
|
+
down: Žemyn
|
109
|
+
remove: Pašalinti
|
110
|
+
separator: Skirtukas
|
111
|
+
up: Į viršų
|
112
|
+
title_and_description:
|
113
|
+
collapse: Suskleisti
|
114
|
+
description: Aprašymas
|
115
|
+
down: Žemyn
|
116
|
+
expand: Išplėsti
|
117
|
+
remove: Pašalinti
|
118
|
+
title: Pavadinimas
|
119
|
+
title_and_description: Pavadinimas ir aprašymas
|
120
|
+
up: Aukštyn
|
121
|
+
update:
|
122
|
+
invalid: Išsaugant šią formą iškilo problema.
|
123
|
+
success: Forma sėkmingai išsaugota.
|
124
|
+
errors:
|
125
|
+
answer:
|
126
|
+
body: Pagrindinė dalis negali būti tuščia
|
127
|
+
files:
|
128
|
+
extension_allowlist: 'Priimtini formatai:'
|
129
|
+
images:
|
130
|
+
dimensions: "%{width} x %{height} px"
|
131
|
+
dimensions_info: 'Šis vaizdas bus:'
|
132
|
+
processors:
|
133
|
+
resize_and_pad: Pakeisto dydžio ir užpildytas iki
|
134
|
+
resize_to_fit: Pakeistas dydis, kad tilptų
|
135
|
+
question_types:
|
136
|
+
files: Dokumentai
|
137
|
+
long_answer: Ilgas atsakymas
|
138
|
+
matrix_multiple: Matrica (su keliais variantais)
|
139
|
+
matrix_single: Matrica (vienas variantas)
|
140
|
+
multiple_option: Keli variantai
|
141
|
+
short_answer: Trumpas atsakymas
|
142
|
+
single_option: Vienas variantas
|
143
|
+
sorting: Rūšiavimas
|
144
|
+
title_and_description: Pavadinimas ir aprašymas
|
145
|
+
questionnaires:
|
146
|
+
answer:
|
147
|
+
invalid: Atsakant į šią formą iškilo problema.
|
148
|
+
max_choices_alert: Per daug pasirinktų variantų
|
149
|
+
success: Į formos klausimus atsakyta.
|
150
|
+
question:
|
151
|
+
max_choices: 'Didžiausias pasirinkčių skaičius: %{n}'
|
152
|
+
show:
|
153
|
+
answer_questionnaire:
|
154
|
+
anonymous_user_message: <a href="%{sign_in_link}">Prisijunkite su savo paskyra</a> arba <a href="%{sign_up_link}">užsiregistruokite</a> norėdami užpildyti formą.
|
155
|
+
title: Atsakyti į formos klausimus
|
156
|
+
current_step: Žingsnis %{step}
|
157
|
+
of_total_steps: iš%{total_steps}
|
158
|
+
questionnaire_answered:
|
159
|
+
body: Jau atsakėte iš šios formos klausimus.
|
160
|
+
title: Jau atsakyta
|
161
|
+
questionnaire_closed:
|
162
|
+
body: Forma uždaryta ir į ją atsakyti negalima.
|
163
|
+
title: Forma uždaryta
|
164
|
+
questionnaire_for_private_users:
|
165
|
+
body: Forma pateikiama tik privatiems naudotojams
|
166
|
+
title: Forma uždaryta
|
167
|
+
questionnaire_js_disabled:
|
168
|
+
body: Kai kurie šios formos funkcionalumai bus neaktyvūs. Kad pagerintumėte naudojimo patirtį, naršyklėje įjunkite „JavaScript“.
|
169
|
+
title: '„JavaScript“ išjungta'
|
170
|
+
questionnaire_not_published:
|
171
|
+
body: Ši forma dar nepaskelbta.
|
172
|
+
tos_agreement: Dalyvaudami sutinkate su paslaugos teikimo sąlygomis
|
173
|
+
step_navigation:
|
174
|
+
show:
|
175
|
+
are_you_sure: Šio veiksmo atšaukti negalima ir savo atsakymų keisti negalėsite. Ar esate įsitikinę?
|
176
|
+
back: Atgal
|
177
|
+
continue: Tęsti
|
178
|
+
submit: Pateikti
|
179
|
+
user_answers_serializer:
|
180
|
+
body: Atsakymas
|
181
|
+
completion: Užbaigimas
|
182
|
+
created_at: Atsakyta
|
183
|
+
id: Atsakymo ID
|
184
|
+
ip_hash: IP adreso "hash" kodas
|
185
|
+
question: Klausimas
|
186
|
+
registered: Užregistruota
|
187
|
+
session_token: Naudotojo identifikatorius
|
188
|
+
unregistered: Neregistruoti
|
189
|
+
user_status: Naudotojo būsena
|
@@ -0,0 +1 @@
|
|
1
|
+
oc:
|
data/config/locales/pl.yml
CHANGED
@@ -7,10 +7,10 @@ pl:
|
|
7
7
|
selected_choices: Wybrane opcje
|
8
8
|
question:
|
9
9
|
max_choices: Maksymalna liczba opcji do wyboru
|
10
|
-
question_type: Typ
|
10
|
+
question_type: Typ odpowiedzi
|
11
11
|
questionnaire_question:
|
12
|
-
mandatory:
|
13
|
-
max_characters: Limit znaków (zostaw 0 jeśli nie chcesz ustawiać limitu)
|
12
|
+
mandatory: Odpowiedź wymagana
|
13
|
+
max_characters: Limit znaków (zostaw 0, jeśli nie chcesz ustawiać limitu)
|
14
14
|
errors:
|
15
15
|
models:
|
16
16
|
answer:
|
@@ -37,7 +37,7 @@ pl:
|
|
37
37
|
show: Pokaż odpowiedzi
|
38
38
|
answer_option:
|
39
39
|
answer_option: Opcja odpowiedzi
|
40
|
-
free_text:
|
40
|
+
free_text: Możliwość wpisania dowolnego tekstu
|
41
41
|
remove: Usuń
|
42
42
|
statement: Komunikat
|
43
43
|
answers:
|
@@ -131,6 +131,7 @@ pl:
|
|
131
131
|
short_answer: Krótka odpowiedź
|
132
132
|
single_option: Jedna opcja
|
133
133
|
sorting: Sortowanie
|
134
|
+
title_and_description: Tytuł i opis
|
134
135
|
questionnaires:
|
135
136
|
answer:
|
136
137
|
invalid: Podczas wypełniania formularza wystąpiły błędy.
|
data/config/locales/ro-RO.yml
CHANGED
@@ -142,6 +142,8 @@ ro:
|
|
142
142
|
single_option: Opțiune unică
|
143
143
|
sorting: Sortare
|
144
144
|
title_and_description: Titlu și descriere
|
145
|
+
questionnaire_answer_presenter:
|
146
|
+
download_attachment: Descărcare atașament
|
145
147
|
questionnaires:
|
146
148
|
answer:
|
147
149
|
invalid: A apărut o problemă la completarea chestionarului.
|
@@ -10,8 +10,11 @@ shared_examples_for "manage questionnaire answers" do
|
|
10
10
|
let!(:second) do
|
11
11
|
create :questionnaire_question, questionnaire: questionnaire, position: 2, question_type: "single_option"
|
12
12
|
end
|
13
|
+
let!(:third) do
|
14
|
+
create :questionnaire_question, questionnaire: questionnaire, position: 3, question_type: "files"
|
15
|
+
end
|
13
16
|
let(:questions) do
|
14
|
-
[first, second]
|
17
|
+
[first, second, third]
|
15
18
|
end
|
16
19
|
|
17
20
|
context "when there are no answers" do
|
@@ -25,6 +28,7 @@ shared_examples_for "manage questionnaire answers" do
|
|
25
28
|
let!(:answer1) { create :answer, questionnaire: questionnaire, question: first }
|
26
29
|
let!(:answer2) { create :answer, body: "second answer", questionnaire: questionnaire, question: first }
|
27
30
|
let!(:answer3) { create :answer, questionnaire: questionnaire, question: second }
|
31
|
+
let!(:file_answer) { create :answer, :with_attachments, questionnaire: questionnaire, question: third, body: nil, user: answer3.user, session_token: answer3.session_token }
|
28
32
|
|
29
33
|
it "shows the answer admin link" do
|
30
34
|
visit questionnaire_edit_path
|
@@ -45,7 +49,7 @@ shared_examples_for "manage questionnaire answers" do
|
|
45
49
|
end
|
46
50
|
|
47
51
|
it "shows the percentage" do
|
48
|
-
expect(page).to have_content("
|
52
|
+
expect(page).to have_content("33%")
|
49
53
|
end
|
50
54
|
|
51
55
|
it "has a detail link" do
|
@@ -121,6 +125,25 @@ shared_examples_for "manage questionnaire answers" do
|
|
121
125
|
expect(page).not_to have_link("Next ›")
|
122
126
|
expect(page).to have_link("‹ Prev")
|
123
127
|
end
|
128
|
+
|
129
|
+
it "third answer has download link for the attachments" do
|
130
|
+
click_link answer3.session_token, match: :first
|
131
|
+
expect(page).to have_content(translated(file_answer.attachments.first.title))
|
132
|
+
expect(page).to have_content(translated(file_answer.attachments.second.title))
|
133
|
+
end
|
134
|
+
|
135
|
+
context "when the file answer does not have a title for the attachment" do
|
136
|
+
let!(:file_answer) { create :answer, questionnaire: questionnaire, question: third, body: nil, user: answer3.user, session_token: answer3.session_token }
|
137
|
+
|
138
|
+
before do
|
139
|
+
create :attachment, :with_image, attached_to: file_answer, title: {}, description: {}
|
140
|
+
end
|
141
|
+
|
142
|
+
it "third answer has download link for the attachments" do
|
143
|
+
click_link answer3.session_token, match: :first
|
144
|
+
expect(page).to have_content("Download attachment")
|
145
|
+
end
|
146
|
+
end
|
124
147
|
end
|
125
148
|
end
|
126
149
|
end
|
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.26.
|
4
|
+
version: 0.26.4
|
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: 2022-
|
14
|
+
date: 2022-11-15 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: decidim-core
|
@@ -19,14 +19,14 @@ dependencies:
|
|
19
19
|
requirements:
|
20
20
|
- - '='
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: 0.26.
|
22
|
+
version: 0.26.4
|
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.26.
|
29
|
+
version: 0.26.4
|
30
30
|
- !ruby/object:Gem::Dependency
|
31
31
|
name: wicked_pdf
|
32
32
|
requirement: !ruby/object:Gem::Requirement
|
@@ -61,28 +61,28 @@ dependencies:
|
|
61
61
|
requirements:
|
62
62
|
- - '='
|
63
63
|
- !ruby/object:Gem::Version
|
64
|
-
version: 0.26.
|
64
|
+
version: 0.26.4
|
65
65
|
type: :development
|
66
66
|
prerelease: false
|
67
67
|
version_requirements: !ruby/object:Gem::Requirement
|
68
68
|
requirements:
|
69
69
|
- - '='
|
70
70
|
- !ruby/object:Gem::Version
|
71
|
-
version: 0.26.
|
71
|
+
version: 0.26.4
|
72
72
|
- !ruby/object:Gem::Dependency
|
73
73
|
name: decidim-dev
|
74
74
|
requirement: !ruby/object:Gem::Requirement
|
75
75
|
requirements:
|
76
76
|
- - '='
|
77
77
|
- !ruby/object:Gem::Version
|
78
|
-
version: 0.26.
|
78
|
+
version: 0.26.4
|
79
79
|
type: :development
|
80
80
|
prerelease: false
|
81
81
|
version_requirements: !ruby/object:Gem::Requirement
|
82
82
|
requirements:
|
83
83
|
- - '='
|
84
84
|
- !ruby/object:Gem::Version
|
85
|
-
version: 0.26.
|
85
|
+
version: 0.26.4
|
86
86
|
description: A forms gem for decidim.
|
87
87
|
email:
|
88
88
|
- josepjaume@gmail.com
|
@@ -216,6 +216,7 @@ files:
|
|
216
216
|
- config/locales/fr.yml
|
217
217
|
- config/locales/ga-IE.yml
|
218
218
|
- config/locales/gl.yml
|
219
|
+
- config/locales/gn-PY.yml
|
219
220
|
- config/locales/hr-HR.yml
|
220
221
|
- config/locales/hr.yml
|
221
222
|
- config/locales/hu.yml
|
@@ -228,6 +229,7 @@ files:
|
|
228
229
|
- config/locales/ko.yml
|
229
230
|
- config/locales/lb-LU.yml
|
230
231
|
- config/locales/lb.yml
|
232
|
+
- config/locales/lo-LA.yml
|
231
233
|
- config/locales/lt-LT.yml
|
232
234
|
- config/locales/lt.yml
|
233
235
|
- config/locales/lv.yml
|
@@ -235,6 +237,7 @@ files:
|
|
235
237
|
- config/locales/mt.yml
|
236
238
|
- config/locales/nl.yml
|
237
239
|
- config/locales/no.yml
|
240
|
+
- config/locales/oc-FR.yml
|
238
241
|
- config/locales/om-ET.yml
|
239
242
|
- config/locales/pl.yml
|
240
243
|
- config/locales/pt-BR.yml
|