caboose-cms 0.4.20 → 0.4.21
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/app/views/caboose/blocks/_image.html.erb +29 -20
- data/lib/caboose/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZWMyZGVlYmZhOTU1MDMxNjhjMDcyMDEyNTAyOWZjYWY5MDdiZjY3OA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MTA2NGRmOWM3YzJlZGJiNDI0ZDJjN2MzYWFmNWMzODJjMTkxNmRkZA==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NzQyNzAwZjUwNWJhMDhlYjU5YjNiNWE2NmMzY2VkMTVkN2ExMjg0OWRiNTVj
|
10
|
+
MDIxMGNkMWQ5ZWE5NjIyZDZjNTQyZjkyYTI5YmJjZjcyNTExNjAzNTAyZDEx
|
11
|
+
YmUzYmI2MjE5MmQxOWQ3MTkyNTBkY2JiNjAwMzdkYzNjMDIxMWI=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ODgyZTJjODBmYmE0ZDFmNDllNzhlOTk3ZGYwYWIzMjBlMzhjMjNkNDVjYmE1
|
14
|
+
MGRhYmMwZTJlZjBiODU5YWIzMzM4OGZhNzU3NjA2NWI2YmI5ZTAxZjYzODIz
|
15
|
+
ZjMxMTAxMTcxZTM3Y2VmNWQ4ZmUwMDRjZGViNmY3OTFhYjUzNWQ=
|
@@ -1,29 +1,38 @@
|
|
1
1
|
<%
|
2
|
-
img
|
3
|
-
img_style
|
4
|
-
link
|
5
|
-
align
|
6
|
-
width
|
7
|
-
height
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
2
|
+
img = block.child('image_src')
|
3
|
+
img_style = block.child('image_style').value.to_sym
|
4
|
+
link = block.child('link').value
|
5
|
+
align = block.child('align').value
|
6
|
+
width = block.child('width').value
|
7
|
+
height = block.child('height').value
|
8
|
+
mt = block.child('margin_top').value.downcase
|
9
|
+
mr = block.child('margin_right').value.downcase
|
10
|
+
mb = block.child('margin_bottom').value.downcase
|
11
|
+
ml = block.child('margin_left').value.downcase
|
12
12
|
url = img && img.image ? img.image.url(img_style.downcase.to_sym) : nil
|
13
13
|
|
14
14
|
img = nil
|
15
15
|
if url && !url.include?('missing.png')
|
16
16
|
style = []
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
17
|
+
if align == 'Center'
|
18
|
+
ml = 'auto'
|
19
|
+
mr = 'auto'
|
20
|
+
style << "display: block"
|
21
|
+
end
|
22
|
+
|
23
|
+
ml = "#{ml}px" if ml && ml != 'auto' && !ml.ends_with?('px') && !ml.ends_with?('em') && !ml.ends_with?('%')
|
24
|
+
mr = "#{mr}px" if mr && mr != 'auto' && !mr.ends_with?('px') && !mr.ends_with?('em') && !mr.ends_with?('%')
|
25
|
+
mt = "#{mt}px" if mt && mt != 'auto' && !mt.ends_with?('px') && !mt.ends_with?('em') && !mt.ends_with?('%')
|
26
|
+
mb = "#{mb}px" if mb && mb != 'auto' && !mb.ends_with?('px') && !mb.ends_with?('em') && !mb.ends_with?('%')
|
27
|
+
|
28
|
+
style << "width: #{width}px" if width
|
29
|
+
style << "max-height: #{height}px" if height
|
30
|
+
style << "float: left" if align == 'Left'
|
31
|
+
style << "float: right" if align == 'Right'
|
32
|
+
style << "margin-left: #{ml}" if ml
|
33
|
+
style << "margin-right: #{mr}" if mr
|
34
|
+
style << "margin-top: #{mt}" if mt
|
35
|
+
style << "margin-bottom: #{mb}" if mb
|
27
36
|
style = style.join('; ')
|
28
37
|
|
29
38
|
img = "<img src='#{url}' style='#{style}' id='block_#{block.id}' />"
|
data/lib/caboose/version.rb
CHANGED