scrivito_pdf_widget 1.0.13 → 1.0.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/pdf.rb +1 -18
- data/app/models/pdf_widget.rb +1 -1
- data/lib/scrivito_pdf_widget/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b606644d5dfd3997c43c62cfa5af95add7d637a5
|
4
|
+
data.tar.gz: 02a697ba89dc0b76bc61f541f0eb1a7d9becbc70
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1cf73d8a560a22d33969fe2708b135b1d04fa15ecc22776cbb5f00f8c864cf599cfa2f9f9a4f8bc91265d30a7a2a5a1f47461ccf2beed6f7048c6b2f3172509b
|
7
|
+
data.tar.gz: a2b02c395233fe126a1ae54efd5c39fe802892d07968b6c07b65fbb4ddd71bdb5ad9c53207957e94fbee5c21ea74362c7a6aa29978907afa524e62308becb98d
|
data/app/models/pdf.rb
CHANGED
@@ -1,25 +1,8 @@
|
|
1
|
-
class Pdf <
|
1
|
+
class Pdf < Obj
|
2
2
|
attribute :headline, :string
|
3
3
|
attribute :description, :html
|
4
4
|
attribute :blob, :binary
|
5
5
|
|
6
|
-
def self.create(attributes)
|
7
|
-
attributes = attributes.with_indifferent_access
|
8
|
-
|
9
|
-
unless attributes.has_key?(:_obj_class)
|
10
|
-
attributes[:_obj_class] = 'Pdf'
|
11
|
-
end
|
12
|
-
|
13
|
-
if attributes.has_key?(:blob) && !attributes.has_key?(:_path)
|
14
|
-
filename = Pathname.new(attributes[:blob].path).basename
|
15
|
-
path = "_resources/#{SecureRandom.hex(8)}/#{filename}"
|
16
|
-
|
17
|
-
attributes[:_path] = path
|
18
|
-
end
|
19
|
-
|
20
|
-
super(attributes)
|
21
|
-
end
|
22
|
-
|
23
6
|
def url_to_pdf
|
24
7
|
self.try(:binary_url).split('?').first
|
25
8
|
end
|
data/app/models/pdf_widget.rb
CHANGED
@@ -2,6 +2,6 @@ class PdfWidget < Widget
|
|
2
2
|
attribute :pdf, :reference
|
3
3
|
|
4
4
|
def self.filter
|
5
|
-
{_obj_class: {field: '_obj_class', options: {images: {selected: true, title: '
|
5
|
+
{_obj_class: {field: '_obj_class', options: {images: {selected: true, title: 'PDFs', value: 'Pdf'}}}}
|
6
6
|
end
|
7
7
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: scrivito_pdf_widget
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Scrivito
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-05-
|
11
|
+
date: 2015-05-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|