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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '0871028476cb2a15f8d4920d8a0ea89f5999be102074b8175e3283366ec5ab02'
4
- data.tar.gz: d6032d10fb1d83ee2916bacd59a31dfa2ec0f72835a26075cb26c9560288a9bc
3
+ metadata.gz: ac2a4967f65889f20e67fcfea32386f57484e8eb0f61172f335b690e4298ab4b
4
+ data.tar.gz: e971f03e20bd78cf6e246869133eaea933edb61bee15ef48d12ca0aae082e1c4
5
5
  SHA512:
6
- metadata.gz: 619c70c7a005fac00201dd21ff0f7a4e4a815760faf79c96a95e2046a2446999aec0f03758348a1aaa4fefca523153323bfce49e7c5b3535fad16b03ca002c5e
7
- data.tar.gz: 74ff353cabf1d670bf32365cdbed9f93eb4365bcefc1d7cf54b92b574918e7c81ae69477e66b6395f2d9c206e7254e220516f720204a93b81dc95c065a4b6b9a
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(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.
@@ -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.
@@ -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
+ 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.4"
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.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-09-29 00:00:00.000000000 Z
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.3
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.3
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.3
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.3
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.3
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.3
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