decidim-proposals 0.23.2 → 0.23.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bf8436d8e7bd0abece36dfae02bcf16ca734ec265801f7303a230c2437985597
4
- data.tar.gz: 2cdc0f69b70b20c4fbc6d25348ffbd8468f5ef5124b701efe52ade54ec1d4a8c
3
+ metadata.gz: 407b694b48340b459b9487e1b7680f71c7f39fd120acb8f953253f0e6f6131b3
4
+ data.tar.gz: b5af213b89c045c25c5c3e65958938f9ccd61b8dcc2b092a399c34de39290827
5
5
  SHA512:
6
- metadata.gz: b42188e0710db1ddd09f9c017b90175d13c9ac0f668ecb21c054f058d4594916d3754fa20d77e5a9b7e8b31d647a9910cd67b85ff4bda70d9463bda2362753a2
7
- data.tar.gz: 07fd952489969582cc240213e1a96e25c173bad7f3950263b5bdaa7b3c0c02b093df5fb5f02f1dce924ff4794e46ef149e76a231fc6649f154a75178ede10a25
6
+ metadata.gz: 0151a8ebc561f6c2b00f05315770f7dd18c80230a5562d8a7ac02d6d6efaaefea1eeb2f40cd335a17e7c1148753ad659050593ebd2db8d16900283096558995e
7
+ data.tar.gz: 9c07d17862f60743fee23f7662bd7e5d9681c23e7674ba2ef6ce7fb61b035399c5ea58c132a82821702051ad1a7555798f878cb695f976a8ea69c22c00e99187
@@ -28,6 +28,8 @@ module Decidim
28
28
  def call
29
29
  return broadcast(:invalid) if form.invalid?
30
30
 
31
+ delete_attachment(form.attachment) if delete_attachment?
32
+
31
33
  if process_attachments?
32
34
  @proposal.attachments.destroy_all
33
35
 
@@ -124,13 +124,13 @@ module Decidim
124
124
  def edit
125
125
  enforce_permission_to :edit, :proposal, proposal: proposal
126
126
  @form = form(Admin::ProposalForm).from_model(proposal)
127
- @form.attachment = form(AttachmentForm).from_params({})
128
127
  end
129
128
 
130
129
  def update
131
130
  enforce_permission_to :edit, :proposal, proposal: proposal
132
131
 
133
132
  @form = form(Admin::ProposalForm).from_params(params)
133
+
134
134
  Admin::UpdateProposal.call(@form, @proposal) do
135
135
  on(:ok) do |_proposal|
136
136
  flash[:notice] = t("proposals.update.success", scope: "decidim")
@@ -20,6 +20,11 @@ module Decidim
20
20
 
21
21
  self.title = presenter.title(all_locales: title.is_a?(Hash))
22
22
  self.body = presenter.body(all_locales: body.is_a?(Hash))
23
+ self.attachment = if model.documents.first.present?
24
+ { file: model.documents.first.file, title: translated_attribute(model.documents.first.title) }
25
+ else
26
+ {}
27
+ end
23
28
  end
24
29
  end
25
30
  end
@@ -84,6 +84,12 @@
84
84
 
85
85
  <div class="row column">
86
86
  <%= form.upload :file, optional: false %>
87
+ <% if params[:id].present? %>
88
+ <% if proposal.documents.present? %>
89
+ <%= form.hidden_field :id, value: proposal.documents.first.id %>
90
+ <%= form.check_box :delete_file, label: t(".delete_attachment"), value: proposal.documents.first.id %>
91
+ <% end %>
92
+ <% end %>
87
93
  </div>
88
94
  <% end %>
89
95
  </fieldset>
@@ -423,6 +423,7 @@ ca:
423
423
  form:
424
424
  attachment_legend: "(Opcional) Afegiu un fitxer adjunt"
425
425
  created_in_meeting: Aquesta proposta prové d'una trobada
426
+ delete_attachment: Suprimeix l'adjunt
426
427
  select_a_category: Selecciona una categoria
427
428
  select_a_meeting: Selecciona una trobada
428
429
  index:
@@ -391,7 +391,7 @@ cs:
391
391
  odt: Odt
392
392
  bottom_hint: "(Budete mít možnost zobrazit a třídit sekce dokumentů)"
393
393
  document_legend: 'Přidejte dokument nižší než 2 MB, každá sekce až do hloubky 3 úrovní bude analyzována do návrhů. Podporované formáty jsou: %{valid_mime_types}'
394
- title: PŘIDAT DOKUMENT
394
+ title: Přidat dokument
395
395
  upload_document: Nahrát dokument
396
396
  publish:
397
397
  invalid: Nelze publikovat návrhy
@@ -431,6 +431,7 @@ cs:
431
431
  form:
432
432
  attachment_legend: "(Volitelné) Přidání přílohy"
433
433
  created_in_meeting: Tento návrh pochází z jednání
434
+ delete_attachment: Smazat přílohu
434
435
  select_a_category: Vyberte kategorii
435
436
  select_a_meeting: Vyberte schůzku
436
437
  index:
@@ -423,6 +423,7 @@ de:
423
423
  form:
424
424
  attachment_legend: "(Optional) Anhang hinzufügen"
425
425
  created_in_meeting: Dieser Vorschlag stammt von einer Besprechung
426
+ delete_attachment: Anhang löschen
426
427
  select_a_category: Kategorie auswählen
427
428
  select_a_meeting: Besprechung auswählen
428
429
  index:
@@ -424,6 +424,7 @@ en:
424
424
  form:
425
425
  attachment_legend: "(Optional) Add an attachment"
426
426
  created_in_meeting: This proposal comes from a meeting
427
+ delete_attachment: Delete attachment
427
428
  select_a_category: Select a category
428
429
  select_a_meeting: Select a meeting
429
430
  index:
@@ -423,6 +423,7 @@ fi-pl:
423
423
  form:
424
424
  attachment_legend: "(Valinnainen) Lisää liite"
425
425
  created_in_meeting: Tämä ehdotus on luotu tapaamisessa
426
+ delete_attachment: Poista liite
426
427
  select_a_category: Valitse aihepiiri
427
428
  select_a_meeting: Valitse tapaaminen
428
429
  index:
@@ -423,6 +423,7 @@ fi:
423
423
  form:
424
424
  attachment_legend: "(Valinnainen) Lisää liite"
425
425
  created_in_meeting: Tämä ehdotus on luotu tapaamisessa
426
+ delete_attachment: Poista liite
426
427
  select_a_category: Valitse aihepiiri
427
428
  select_a_meeting: Valitse tapaaminen
428
429
  index:
@@ -423,6 +423,7 @@ fr-CA:
423
423
  form:
424
424
  attachment_legend: "(Facultatif) Ajouter une pièce jointe"
425
425
  created_in_meeting: Cette proposition provient d'une réunion
426
+ delete_attachment: Supprimer la pièce jointe
426
427
  select_a_category: Sélectionner une catégorie
427
428
  select_a_meeting: Sélectionnez une réunion
428
429
  index:
@@ -423,6 +423,7 @@ fr:
423
423
  form:
424
424
  attachment_legend: "(Facultatif) Ajouter une pièce jointe"
425
425
  created_in_meeting: Cette proposition provient d'une réunion
426
+ delete_attachment: Supprimer la pièce jointe
426
427
  select_a_category: Sélectionner une catégorie
427
428
  select_a_meeting: Sélectionnez une réunion
428
429
  index:
@@ -401,6 +401,7 @@ nl:
401
401
  form:
402
402
  attachment_legend: "(Optioneel) Een bijlage toevoegen"
403
403
  created_in_meeting: Dit voorstel komt uit een vergadering
404
+ delete_attachment: Bijlage verwijderen
404
405
  select_a_category: Kies een categorie
405
406
  select_a_meeting: Selecteer een vergadering
406
407
  index:
@@ -664,7 +664,7 @@
664
664
  filter_by: Filtrer etter
665
665
  unfold: Åpne
666
666
  index:
667
- collaborative_drafts_list: Tilgang til samarbeids utkaster
667
+ collaborative_drafts_list: Lag utkast sammen med andre
668
668
  new_proposal: Nytt forslag
669
669
  see_all_withdrawn: Se alle tilbaketrukne forslag
670
670
  view_proposal: Se forslag
@@ -676,7 +676,7 @@
676
676
  send: Fortsett
677
677
  title: Opprett Ditt forslag
678
678
  orders:
679
- label: 'Bestill forslag av:'
679
+ label: 'Sorter forslag:'
680
680
  most_commented: Flest kommentarer
681
681
  most_endorsed: Mest påtegnet
682
682
  most_followed: Mest fulgte
@@ -4,7 +4,7 @@ module Decidim
4
4
  # This holds decidim-proposals version.
5
5
  module Proposals
6
6
  def self.version
7
- "0.23.2"
7
+ "0.23.3"
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-proposals
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.23.2
4
+ version: 0.23.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josep Jaume Rey Peroy
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2021-02-09 00:00:00.000000000 Z
13
+ date: 2021-02-23 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: acts_as_list
@@ -60,28 +60,28 @@ dependencies:
60
60
  requirements:
61
61
  - - '='
62
62
  - !ruby/object:Gem::Version
63
- version: 0.23.2
63
+ version: 0.23.3
64
64
  type: :runtime
65
65
  prerelease: false
66
66
  version_requirements: !ruby/object:Gem::Requirement
67
67
  requirements:
68
68
  - - '='
69
69
  - !ruby/object:Gem::Version
70
- version: 0.23.2
70
+ version: 0.23.3
71
71
  - !ruby/object:Gem::Dependency
72
72
  name: decidim-core
73
73
  requirement: !ruby/object:Gem::Requirement
74
74
  requirements:
75
75
  - - '='
76
76
  - !ruby/object:Gem::Version
77
- version: 0.23.2
77
+ version: 0.23.3
78
78
  type: :runtime
79
79
  prerelease: false
80
80
  version_requirements: !ruby/object:Gem::Requirement
81
81
  requirements:
82
82
  - - '='
83
83
  - !ruby/object:Gem::Version
84
- version: 0.23.2
84
+ version: 0.23.3
85
85
  - !ruby/object:Gem::Dependency
86
86
  name: doc2text
87
87
  requirement: !ruby/object:Gem::Requirement
@@ -150,84 +150,84 @@ dependencies:
150
150
  requirements:
151
151
  - - '='
152
152
  - !ruby/object:Gem::Version
153
- version: 0.23.2
153
+ version: 0.23.3
154
154
  type: :development
155
155
  prerelease: false
156
156
  version_requirements: !ruby/object:Gem::Requirement
157
157
  requirements:
158
158
  - - '='
159
159
  - !ruby/object:Gem::Version
160
- version: 0.23.2
160
+ version: 0.23.3
161
161
  - !ruby/object:Gem::Dependency
162
162
  name: decidim-assemblies
163
163
  requirement: !ruby/object:Gem::Requirement
164
164
  requirements:
165
165
  - - '='
166
166
  - !ruby/object:Gem::Version
167
- version: 0.23.2
167
+ version: 0.23.3
168
168
  type: :development
169
169
  prerelease: false
170
170
  version_requirements: !ruby/object:Gem::Requirement
171
171
  requirements:
172
172
  - - '='
173
173
  - !ruby/object:Gem::Version
174
- version: 0.23.2
174
+ version: 0.23.3
175
175
  - !ruby/object:Gem::Dependency
176
176
  name: decidim-budgets
177
177
  requirement: !ruby/object:Gem::Requirement
178
178
  requirements:
179
179
  - - '='
180
180
  - !ruby/object:Gem::Version
181
- version: 0.23.2
181
+ version: 0.23.3
182
182
  type: :development
183
183
  prerelease: false
184
184
  version_requirements: !ruby/object:Gem::Requirement
185
185
  requirements:
186
186
  - - '='
187
187
  - !ruby/object:Gem::Version
188
- version: 0.23.2
188
+ version: 0.23.3
189
189
  - !ruby/object:Gem::Dependency
190
190
  name: decidim-dev
191
191
  requirement: !ruby/object:Gem::Requirement
192
192
  requirements:
193
193
  - - '='
194
194
  - !ruby/object:Gem::Version
195
- version: 0.23.2
195
+ version: 0.23.3
196
196
  type: :development
197
197
  prerelease: false
198
198
  version_requirements: !ruby/object:Gem::Requirement
199
199
  requirements:
200
200
  - - '='
201
201
  - !ruby/object:Gem::Version
202
- version: 0.23.2
202
+ version: 0.23.3
203
203
  - !ruby/object:Gem::Dependency
204
204
  name: decidim-meetings
205
205
  requirement: !ruby/object:Gem::Requirement
206
206
  requirements:
207
207
  - - '='
208
208
  - !ruby/object:Gem::Version
209
- version: 0.23.2
209
+ version: 0.23.3
210
210
  type: :development
211
211
  prerelease: false
212
212
  version_requirements: !ruby/object:Gem::Requirement
213
213
  requirements:
214
214
  - - '='
215
215
  - !ruby/object:Gem::Version
216
- version: 0.23.2
216
+ version: 0.23.3
217
217
  - !ruby/object:Gem::Dependency
218
218
  name: decidim-participatory_processes
219
219
  requirement: !ruby/object:Gem::Requirement
220
220
  requirements:
221
221
  - - '='
222
222
  - !ruby/object:Gem::Version
223
- version: 0.23.2
223
+ version: 0.23.3
224
224
  type: :development
225
225
  prerelease: false
226
226
  version_requirements: !ruby/object:Gem::Requirement
227
227
  requirements:
228
228
  - - '='
229
229
  - !ruby/object:Gem::Version
230
- version: 0.23.2
230
+ version: 0.23.3
231
231
  description: A proposals component for decidim's participatory spaces.
232
232
  email:
233
233
  - josepjaume@gmail.com