caboose-cms 0.5.225 → 0.5.226
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/app/models/caboose/block.rb +11 -11
- data/app/views/caboose/blocks/_image2.html.erb +1 -13
- data/lib/caboose/version.rb +1 -1
- data/lib/tasks/caboose.rake +9 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZDk1Njg3ZjIwNTA4Y2YxNmI5NzI0NDYyYzVjNjEzYzkyYWNhNWI0Zg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MzMwZTcyYjYwMjg1NzQyN2IxZjRiMGNkOTJiOGE3YWUwMDgyOGRmNw==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZmU5MzhiZGQ0ZmI0OWI4Y2Q4NGFmMTg1ODU3ZTNiNjJmMDAyNjhhMzVkMWIx
|
10
|
+
YTgxZTNmYWYxMzFlYzlkYTZmMDUyOTMzZmRiNjE4YTFkNjhhYmQ1NDc2MmE4
|
11
|
+
ZGZiZGFhMGY1NWJkNDU0Njk4NWVhNjc0ZmMyMzEyMmVhYTVjNWI=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MWY3NzA0ZDA5ZmY2MWRiNjRkMTJmNTU0NGQ0ZTliZGI5MjQ5NGQzMWNmZDI2
|
14
|
+
YTQwYjQ5ODQwMTFlMGFhNDZhNzRiNDljNTZjYmM4ZTdiNzM4MTEwYzNlN2Yz
|
15
|
+
MDJlM2ZjMjdhOWVjNWRlNjAxNmVhNjY5ZDU4ZTc1N2IyN2YxNDQ=
|
data/app/models/caboose/block.rb
CHANGED
@@ -62,16 +62,16 @@ class Caboose::Block < ActiveRecord::Base
|
|
62
62
|
def child_value(name)
|
63
63
|
b = self.child(name)
|
64
64
|
return nil if b.nil?
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
return b.image if b.block_type.field_type == 'image'
|
74
|
-
return b.file if b.block_type.field_type == 'file'
|
65
|
+
if b.block_type.field_type == 'image'
|
66
|
+
return b.media.image if b.media
|
67
|
+
return b.image
|
68
|
+
end
|
69
|
+
if b.block_type.field_type == 'file'
|
70
|
+
return b.media.file if b.media
|
71
|
+
return b.file
|
72
|
+
end
|
73
|
+
#return b.image if b.block_type.field_type == 'image'
|
74
|
+
#return b.file if b.block_type.field_type == 'file'
|
75
75
|
return b.value
|
76
76
|
end
|
77
77
|
|
@@ -218,7 +218,7 @@ class Caboose::Block < ActiveRecord::Base
|
|
218
218
|
"caboose/blocks/#{block.block_type.name}",
|
219
219
|
"caboose/blocks/#{block.block_type.field_type}"
|
220
220
|
]
|
221
|
-
Caboose.log(arr)
|
221
|
+
#Caboose.log(arr)
|
222
222
|
str = self.render_helper(view, options2, block, full_name, arr, 0)
|
223
223
|
|
224
224
|
end
|
@@ -1,9 +1,4 @@
|
|
1
1
|
<%
|
2
|
-
Caboose.log(block.id)
|
3
|
-
image_src = block.child('image_src')
|
4
|
-
Caboose.log(image_src)
|
5
|
-
Caboose.log(image_src.media_id)
|
6
|
-
|
7
2
|
img = block.child_value('image_src')
|
8
3
|
img_style = block.child_value('image_style')
|
9
4
|
link = block.child_value('link')
|
@@ -19,13 +14,6 @@ mr.downcase! if mr
|
|
19
14
|
mb.downcase! if mb
|
20
15
|
ml.downcase! if ml
|
21
16
|
url = img ? img.url(img_style.downcase.to_sym) : nil
|
22
|
-
url = nil
|
23
|
-
|
24
|
-
if image_src && image_src.media
|
25
|
-
url = image_src.media.image.url(img_style.downcase.to_sym)
|
26
|
-
elsif img
|
27
|
-
url = img.url(img_style.downcase.to_sym)
|
28
|
-
end
|
29
17
|
|
30
18
|
img = nil
|
31
19
|
alt = block.child_value('alt_text').blank? ? "" : block.child_value('alt_text')
|
@@ -62,7 +50,7 @@ if url && !url.include?('missing.png')
|
|
62
50
|
end
|
63
51
|
end
|
64
52
|
if editing && img.nil?
|
65
|
-
%><p id='block_<%= block.id %>'>
|
53
|
+
%><p id='block_<%= block.id %>'>Please upload an image.</p><%
|
66
54
|
else
|
67
55
|
%><%= raw img %><%
|
68
56
|
end
|
data/lib/caboose/version.rb
CHANGED
data/lib/tasks/caboose.rake
CHANGED
@@ -4,8 +4,15 @@ namespace :caboose do
|
|
4
4
|
|
5
5
|
desc "Migrate block images to media"
|
6
6
|
task :migrate_block_images_to_media => :environment do
|
7
|
-
Caboose::Block.where("image_file_name is not null").reorder(:id).
|
8
|
-
b.migrate_media
|
7
|
+
Caboose::Block.where("image_file_name is not null and media_id is null").reorder(:id).all.each do |b|
|
8
|
+
b.delay.migrate_media
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
desc "Migrate block files to media"
|
13
|
+
task :migrate_block_files_to_media => :environment do
|
14
|
+
Caboose::Block.where("file_file_name is not null and media_id is null").reorder(:id).all.each do |b|
|
15
|
+
b.delay.migrate_media
|
9
16
|
end
|
10
17
|
end
|
11
18
|
|