decidim-forms 0.26.3 → 0.26.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '0871028476cb2a15f8d4920d8a0ea89f5999be102074b8175e3283366ec5ab02'
4
- data.tar.gz: d6032d10fb1d83ee2916bacd59a31dfa2ec0f72835a26075cb26c9560288a9bc
3
+ metadata.gz: b6df56449acac204d34f8bad230ad0a2cae629af70a31264acde00221f695ef0
4
+ data.tar.gz: 888dc6011799c1642aacb1c8cf22a1322fe97a45cb447056df11e41091a89aa7
5
5
  SHA512:
6
- metadata.gz: 619c70c7a005fac00201dd21ff0f7a4e4a815760faf79c96a95e2046a2446999aec0f03758348a1aaa4fefca523153323bfce49e7c5b3535fad16b03ca002c5e
7
- data.tar.gz: 74ff353cabf1d670bf32365cdbed9f93eb4365bcefc1d7cf54b92b574918e7c81ae69477e66b6395f2d9c206e7254e220516f720204a93b81dc95c065a4b6b9a
6
+ metadata.gz: 952d931f29537a6d12a0136e242753b20d5ad8cfc82d78f9c97bca3c653fea17b27922269aab291016be23571f12a9175dff042beaae9b42390be724d4af6c9c
7
+ data.tar.gz: 6d3862f0951ca14ae8ad9a9760ae8d280ee40c868ffd198aafde23d08cf97036661efd49a54a006823c071caf81d112323005884da9ab1a273d7fa7a3952b1cd
@@ -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(translated_attribute(attachment.title), attachment.url) +
50
- " " +
51
- content_tag(:small) do
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
@@ -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.
@@ -172,7 +174,7 @@ ca:
172
174
  tos_agreement: En participar acceptes els Termes i condicions d'ús
173
175
  step_navigation:
174
176
  show:
175
- are_you_sure: Aquesta acció no es pot desfer i no podràs editar les teves respostes. Estàs segura?
177
+ are_you_sure: Aquesta acció no es pot desfer i no podràs editar les teves respostes. Segur?
176
178
  back: Enrere
177
179
  continue: Continuar
178
180
  submit: Enviar respostes
@@ -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.
@@ -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.
@@ -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.
@@ -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.
@@ -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.
@@ -9,7 +9,7 @@ eu:
9
9
  max_choices: Gehienezko aukera kopurua
10
10
  question_type: Mota
11
11
  questionnaire_question:
12
- mandatory: derrigorrezko
12
+ mandatory: Derrigorrezkoa
13
13
  max_characters: Karaktereen muga (utzi 0 mugarik ez badago)
14
14
  errors:
15
15
  models:
@@ -29,7 +29,7 @@ eu:
29
29
  admin:
30
30
  models:
31
31
  components:
32
- description: deskribapena
32
+ description: Deskribapena
33
33
  tos: Zerbitzu-baldintzak
34
34
  questionnaires:
35
35
  actions:
@@ -39,7 +39,7 @@ eu:
39
39
  answer_option: Erantzun aukera
40
40
  free_text: Testu librea
41
41
  remove: Kendu
42
- statement: adierazpena
42
+ statement: Adierazpena
43
43
  answers:
44
44
  actions:
45
45
  back: Itzuli erantzunetara
@@ -74,12 +74,13 @@ eu:
74
74
  select_condition_question: Hautatu galdera bat
75
75
  select_condition_type: Hautatu baldintza mota bat
76
76
  edit:
77
- save: Save
77
+ save: Gorde
78
78
  title: Editatu galdetegia
79
79
  form:
80
80
  add_question: Gehitu galdera
81
81
  add_separator: Gehitu banatzailea
82
- already_answered_warning: Galdetegia dagoeneko erantzun dio erabiltzaile batzuek, beraz, ezin dituzu bere galderak aldatu.
82
+ add_title_and_description: Editatu izenburua eta deskribapena
83
+ already_answered_warning: Formularioa erabiltzaile batzuek erantzuten dute, beraz, ezin dira galderak aldatu.
83
84
  collapse: Bildu galdera guztiak
84
85
  expand: Zabaldu galdera guztiak
85
86
  preview: Aurreikusi
@@ -88,7 +89,7 @@ eu:
88
89
  matrix_row:
89
90
  matrix_row: Errenkada
90
91
  remove: Kendu
91
- statement: adierazpena
92
+ statement: Adierazpena
92
93
  question:
93
94
  add_answer_option: Gehitu erantzun aukera
94
95
  add_display_condition: Gehitu bistaratzeko baldintza
@@ -108,12 +109,21 @@ eu:
108
109
  remove: Kendu
109
110
  separator: Bereizlea
110
111
  up: Igo
112
+ title_and_description:
113
+ collapse: Tolestu
114
+ description: Deskribapena
115
+ down: Behera
116
+ expand: Zabaldu
117
+ remove: Kendu
118
+ title: Izenburua
119
+ title_and_description: Izenburua eta deskribapena
120
+ up: Gora
111
121
  update:
112
122
  invalid: Akatsik egon da galdeketa gordetzean.
113
123
  success: Galdetegia zuzen gorde da.
114
124
  errors:
115
125
  answer:
116
- body: Gorputza ezin da hutsik egon
126
+ body: Testua ezin da hutsik egon
117
127
  files:
118
128
  extension_allowlist: 'Onartutako formatuak:'
119
129
  images:
@@ -131,6 +141,9 @@ eu:
131
141
  short_answer: Erantzun laburra
132
142
  single_option: Aukera bakarra
133
143
  sorting: Lazcoz
144
+ title_and_description: Izenburua eta deskribapena
145
+ questionnaire_answer_presenter:
146
+ download_attachment: Deskargatu eranskina
134
147
  questionnaires:
135
148
  answer:
136
149
  invalid: Akatsik egon da galdeketa erantzutean.
@@ -146,7 +159,7 @@ eu:
146
159
  of_total_steps: '%{total_steps} etik'
147
160
  questionnaire_answered:
148
161
  body: Galdeketa honi erantzun dio.
149
- title: Dagoeneko erantzun
162
+ title: Dagoeneko erantzunda
150
163
  questionnaire_closed:
151
164
  body: Galdetegia itxita dago eta ezin da erantzun.
152
165
  title: Galdeketa itxia
@@ -156,7 +169,9 @@ eu:
156
169
  questionnaire_js_disabled:
157
170
  body: Galdetegi honen ezaugarri batzuk desaktibatu egingo dira. Zure esperientzia hobetzeko, gaitu JavaScript zure nabigatzailean.
158
171
  title: Javascript desaktibatuta dago
159
- tos_agreement: Zerbitzu-baldintzak onartzen dituzunean parte hartuz
172
+ questionnaire_not_published:
173
+ body: Argitalpen hau oraindik ez da argitaratu.
174
+ tos_agreement: Parte hartzean, haren zerbitzu-baldintzak onartzen dituzu
160
175
  step_navigation:
161
176
  show:
162
177
  are_you_sure: Ekintza hau ezin da desegin eta ezin izango dituzu zure erantzunak editatu. Ziur zaude?
@@ -166,7 +181,7 @@ eu:
166
181
  user_answers_serializer:
167
182
  body: Erantzuna
168
183
  completion: Amaiera
169
- created_at: Erantzuna
184
+ created_at: Erantzunda
170
185
  id: Erantzun IDa
171
186
  ip_hash: IP Helbidearen Hash
172
187
  question: Galdera
@@ -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ä.
@@ -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.
@@ -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.
@@ -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:
@@ -142,6 +142,8 @@ ja:
142
142
  single_option: 単一オプション
143
143
  sorting: 並び替え
144
144
  title_and_description: タイトルと説明
145
+ questionnaire_answer_presenter:
146
+ download_attachment: 添付ファイルをダウンロード
145
147
  questionnaires:
146
148
  answer:
147
149
  invalid: フォームの回答に問題がありました。
@@ -0,0 +1 @@
1
+ ka:
@@ -0,0 +1 @@
1
+ lo:
@@ -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: Obowiązkowy
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: Dowolny tekst
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.
@@ -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("50%")
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
@@ -4,7 +4,7 @@ module Decidim
4
4
  # This holds the decidim-forms version.
5
5
  module Forms
6
6
  def self.version
7
- "0.26.3"
7
+ "0.26.5"
8
8
  end
9
9
  end
10
10
  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.3
4
+ version: 0.26.5
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-09-29 00:00:00.000000000 Z
14
+ date: 2023-02-13 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.3
22
+ version: 0.26.5
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.3
29
+ version: 0.26.5
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.3
64
+ version: 0.26.5
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.3
71
+ version: 0.26.5
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.3
78
+ version: 0.26.5
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.3
85
+ version: 0.26.5
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
@@ -224,10 +225,12 @@ files:
224
225
  - config/locales/is.yml
225
226
  - config/locales/it.yml
226
227
  - config/locales/ja.yml
228
+ - config/locales/ka-GE.yml
227
229
  - config/locales/ko-KR.yml
228
230
  - config/locales/ko.yml
229
231
  - config/locales/lb-LU.yml
230
232
  - config/locales/lb.yml
233
+ - config/locales/lo-LA.yml
231
234
  - config/locales/lt-LT.yml
232
235
  - config/locales/lt.yml
233
236
  - config/locales/lv.yml