decidim-elections 0.28.1 → 0.28.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/services/decidim/votings/census/access_codes_exporter.rb +12 -10
- data/config/locales/bg.yml +1342 -0
- data/config/locales/ca.yml +1 -1
- data/config/locales/fi.yml +6 -6
- data/config/locales/pl.yml +347 -0
- data/config/locales/sv.yml +8 -2
- data/config/locales/tr-TR.yml +6 -0
- data/lib/decidim/elections/version.rb +1 -1
- metadata +16 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c2a9ebfe2cd9d6b54273994020cfecf7f9eb24e2a3be2198b116eec548451655
|
4
|
+
data.tar.gz: f5663bc3c6473caa335d4f99c028e84eda1ed2ef819eac72ae6f30ae46ca9eaa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1793f8447b4c2ddbedd782f39f7d52046fe6f4677cf34405f9cb4248126582fcb081c8adeb681fc2e91ffdcff27bdc51c1dd4e17d1d6d8735f108157d80cc327
|
7
|
+
data.tar.gz: 4b7c05ae8c79ba24769d3f0a67f561605b6f40e300491779fc7bb2874fc864f8c0c7d7b5dfbd9f8f6b5cb0ac5144aff77848f28e71fd6c0f38ce58d6c91b69c4
|
@@ -1,7 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require "
|
4
|
-
require "zip"
|
3
|
+
require "decidim/seven_zip_wrapper"
|
5
4
|
|
6
5
|
module Decidim
|
7
6
|
module Votings
|
@@ -29,18 +28,21 @@ module Decidim
|
|
29
28
|
end
|
30
29
|
|
31
30
|
def export
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
SevenZipRuby::Writer.open(file, password:) do |szw|
|
36
|
-
szw.header_encryption = true
|
37
|
-
szw.add_data(csv_data.read, format(FILE_NAME_PATTERN, voting_name: translated_attribute(dataset.voting.title).parameterize))
|
38
|
-
end
|
39
|
-
end
|
31
|
+
tmpdir = Dir.mktmpdir("votings-access-code-exporter")
|
32
|
+
save_voting_access_code_data(tmpdir)
|
33
|
+
SevenZipWrapper.compress_and_encrypt(filename: @path, password: @password, input_directory: tmpdir)
|
40
34
|
end
|
41
35
|
|
42
36
|
private
|
43
37
|
|
38
|
+
def save_voting_access_code_data(tmpdir)
|
39
|
+
file_name = File.join(
|
40
|
+
tmpdir,
|
41
|
+
format(FILE_NAME_PATTERN, voting_name: translated_attribute(dataset.voting.title).parameterize)
|
42
|
+
)
|
43
|
+
File.write(file_name, csv_data.read)
|
44
|
+
end
|
45
|
+
|
44
46
|
def csv_data
|
45
47
|
Decidim::Exporters::CSV.new(dataset.data, Decidim::Votings::Census::DatumSerializer).export
|
46
48
|
end
|