caboose-cms 0.5.225 → 0.5.226

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NzhiODE1NTkwZWI3NTQ3M2RiZjZkOTVlMDUzN2NlZDYwN2JjZjZmZA==
4
+ ZDk1Njg3ZjIwNTA4Y2YxNmI5NzI0NDYyYzVjNjEzYzkyYWNhNWI0Zg==
5
5
  data.tar.gz: !binary |-
6
- NDNkZmY3YTRjZWRmZjlmMWQ0MDBkNDU2YmZhYjBlN2I2ZWU4ZmIwZA==
6
+ MzMwZTcyYjYwMjg1NzQyN2IxZjRiMGNkOTJiOGE3YWUwMDgyOGRmNw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ZTJhZmRkNGQzY2U1MzQ1ZmFjOTgxYzMxMjMxOTUyYWZjYjNmNGNkOGJkMGYy
10
- N2VlNDQ0YjI3MDU1MWFkOWE0MDI5N2IzZDFhNjEzMWM0OTEzOGUwYWM2Yzkz
11
- N2NmMzcwMmI4YmYyNTQ4ODBhOTYxYzY2ZmQzOWEzYmMyZDBiMjg=
9
+ ZmU5MzhiZGQ0ZmI0OWI4Y2Q4NGFmMTg1ODU3ZTNiNjJmMDAyNjhhMzVkMWIx
10
+ YTgxZTNmYWYxMzFlYzlkYTZmMDUyOTMzZmRiNjE4YTFkNjhhYmQ1NDc2MmE4
11
+ ZGZiZGFhMGY1NWJkNDU0Njk4NWVhNjc0ZmMyMzEyMmVhYTVjNWI=
12
12
  data.tar.gz: !binary |-
13
- YjQwN2ViNjZlNjZlMTNkNjdjMDk5OTQyZjUxNGY1ZmQwYWU3NjYzNzc3Nzgx
14
- YWIxODc5OWEwZWI2NWRkNTkwNTdmMzhmOTY3OTQ0NWJkM2Y0NzRlZWEyNjU0
15
- NDc2MDVlZGExMzg5OTc5ODgzNTZhY2Y1MWUzNGVkYjg4NzMzOWM=
13
+ MWY3NzA0ZDA5ZmY2MWRiNjRkMTJmNTU0NGQ0ZTliZGI5MjQ5NGQzMWNmZDI2
14
+ YTQwYjQ5ODQwMTFlMGFhNDZhNzRiNDljNTZjYmM4ZTdiNzM4MTEwYzNlN2Yz
15
+ MDJlM2ZjMjdhOWVjNWRlNjAxNmVhNjY5ZDU4ZTc1N2IyN2YxNDQ=
@@ -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
- #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'
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 %>'>TPlease upload an image.</p><%
53
+ %><p id='block_<%= block.id %>'>Please upload an image.</p><%
66
54
  else
67
55
  %><%= raw img %><%
68
56
  end
@@ -1,3 +1,3 @@
1
1
  module Caboose
2
- VERSION = '0.5.225'
2
+ VERSION = '0.5.226'
3
3
  end
@@ -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).limit(1).all.each do |b|
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
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: caboose-cms
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.225
4
+ version: 0.5.226
5
5
  platform: ruby
6
6
  authors:
7
7
  - William Barry