decidim-forms 0.26.3 → 0.26.4
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/presenters/decidim/forms/admin/questionnaire_answer_presenter.rb +6 -3
- 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/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 +10 -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
|
|
@@ -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
|
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/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
|