caboose-cms 0.8.89 → 0.9.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 13c65f79a43427d49eec81dcedba73190ad7f4ad
4
- data.tar.gz: 1fd9cdacff471b16104521d1f13687b6bc45f5fb
3
+ metadata.gz: 68fa060ae238f851781562c6bbdc67c99b757e2c
4
+ data.tar.gz: 62c2fbbbfbab125e25ad71e33fa810e8f85f2de6
5
5
  SHA512:
6
- metadata.gz: 2f704db76b8c8ac7542923548a9c07ed05cfa3e0fc1ffbb7fdb47c26ffb9a711012b43bac46df0a209dfa2755715a596bbf0e55ebf9d2dfaed12d37b4c9ccb09
7
- data.tar.gz: b82f85dd53e864c54b1377456d9288d388a26b2e1d6bbb3ca186d548e8380e494ffa7b7b719d67e07546367d84992d833a0b7697f41d8cb1808e0dde49bfb0c4
6
+ metadata.gz: 816f4317a6e8717c1bcfd40b3be784a0b6248f0fe52f173fadc883cbe85646eeb59a4b4eb7d7f2908e76192c5972724a67362427a4cc823d4d8d4233fd7c8ee4
7
+ data.tar.gz: 71c13b3af1b80ac04da17eadc10e75f271a8cd7d2ddee6e7fee07afb2fe3377c7d37ca6e80789554c590aebd9dec8fbd7f77c139c991544ef800abab2e0a4900
@@ -226,9 +226,19 @@ class Caboose::Block < ActiveRecord::Base
226
226
  #end
227
227
 
228
228
  arr = [
229
- "../../sites/#{site.name}/blocks/#{full_name}",
230
- "../../sites/#{site.name}/blocks/#{block.block_type.name}",
231
- "../../sites/#{site.name}/blocks/#{block.block_type.field_type}",
229
+ #"../../sites/#{site.name}/blocks/#{full_name}",
230
+ #"../../sites/#{site.name}/blocks/#{block.block_type.name}",
231
+ #"../../sites/#{site.name}/blocks/#{block.block_type.field_type}",
232
+ #"../../app/views/caboose/blocks/#{full_name}",
233
+ #"../../app/views/caboose/blocks/#{block.block_type.name}",
234
+ #"../../app/views/caboose/blocks/#{block.block_type.field_type}",
235
+ #"caboose/blocks/#{full_name}",
236
+ #"caboose/blocks/#{block.block_type.name}",
237
+ #"caboose/blocks/#{block.block_type.field_type}"
238
+
239
+ "../../app/views/caboose/blocks/#{site.name}/#{full_name}",
240
+ "../../app/views/caboose/blocks/#{site.name}/#{block.block_type.name}",
241
+ "../../app/views/caboose/blocks/#{site.name}/#{block.block_type.field_type}",
232
242
  "../../app/views/caboose/blocks/#{full_name}",
233
243
  "../../app/views/caboose/blocks/#{block.block_type.name}",
234
244
  "../../app/views/caboose/blocks/#{block.block_type.field_type}",
@@ -314,7 +324,8 @@ class Caboose::Block < ActiveRecord::Base
314
324
  site = options[:site]
315
325
 
316
326
  begin
317
- str = view.render(:partial => "../../sites/#{site.name}/blocks/#{name}", :locals => options2)
327
+ #str = view.render(:partial => "../../sites/#{site.name}/blocks/#{name}", :locals => options2)
328
+ str = view.render(:partial => "../../app/views/caboose/blocks/#{site.name}/#{name}", :locals => options2)
318
329
  rescue ActionView::MissingTemplate => ex
319
330
  begin
320
331
  str = view.render(:partial => "caboose/blocks/#{name}", :locals => options2)
@@ -90,15 +90,18 @@ module Caboose
90
90
  else
91
91
  full_name = bt.full_name
92
92
  full_name = "lksdjflskfjslkfjlskdfjlkjsdf" if full_name.nil? || full_name.length == 0
93
- if File.file?(Rails.root.join("sites/#{site.name}/blocks/_#{full_name}.html.erb" )) then f = Rails.root.join("sites/#{site.name}/blocks/_#{full_name}.html.erb")
94
- elsif File.file?(Rails.root.join("sites/#{site.name}/blocks/_#{bt.name}.html.erb" )) then f = Rails.root.join("sites/#{site.name}/blocks/_#{bt.name}.html.erb")
95
- elsif File.file?(Rails.root.join("sites/#{site.name}/blocks/_#{bt.field_type}.html.erb" )) then f = Rails.root.join("sites/#{site.name}/blocks/_#{bt.field_type}.html.erb")
96
- elsif File.file?(Rails.root.join("app/views/caboose/blocks/_#{full_name}.html.erb" )) then f = Rails.root.join("app/views/caboose/blocks/_#{full_name}.html.erb")
97
- elsif File.file?(Rails.root.join("app/views/caboose/blocks/_#{bt.name}.html.erb" )) then f = Rails.root.join("app/views/caboose/blocks/_#{bt.name}.html.erb")
98
- elsif File.file?(Rails.root.join("app/views/caboose/blocks/_#{bt.field_type}.html.erb" )) then f = Rails.root.join("app/views/caboose/blocks/_#{bt.field_type}.html.erb")
99
- elsif File.file?("#{Caboose.root}/app/views/caboose/blocks/_#{full_name}.html.erb" ) then f = "#{Caboose.root}/app/views/caboose/blocks/_#{full_name}.html.erb"
100
- elsif File.file?("#{Caboose.root}/app/views/caboose/blocks/_#{bt.name}.html.erb" ) then f = "#{Caboose.root}/app/views/caboose/blocks/_#{bt.name}.html.erb"
101
- elsif File.file?("#{Caboose.root}/app/views/caboose/blocks/_#{bt.field_type}.html.erb" ) then f = "#{Caboose.root}/app/views/caboose/blocks/_#{bt.field_type}.html.erb"
93
+ #if File.file?(Rails.root.join("sites/#{site.name}/blocks/_#{full_name}.html.erb" )) then f = Rails.root.join("sites/#{site.name}/blocks/_#{full_name}.html.erb")
94
+ #elsif File.file?(Rails.root.join("sites/#{site.name}/blocks/_#{bt.name}.html.erb" )) then f = Rails.root.join("sites/#{site.name}/blocks/_#{bt.name}.html.erb")
95
+ #elsif File.file?(Rails.root.join("sites/#{site.name}/blocks/_#{bt.field_type}.html.erb" )) then f = Rails.root.join("sites/#{site.name}/blocks/_#{bt.field_type}.html.erb")
96
+ if File.file?(Rails.root.join("app/views/caboose/blocks/#{site.name}/_#{full_name}.html.erb" )) then f = Rails.root.join("app/views/caboose/blocks/#{site.name}/_#{full_name}.html.erb")
97
+ elsif File.file?(Rails.root.join("app/views/caboose/blocks/#{site.name}/_#{bt.name}.html.erb" )) then f = Rails.root.join("app/views/caboose/blocks/#{site.name}/_#{bt.name}.html.erb")
98
+ elsif File.file?(Rails.root.join("app/views/caboose/blocks/#{site.name}/_#{bt.field_type}.html.erb" )) then f = Rails.root.join("app/views/caboose/blocks/#{site.name}/_#{bt.field_type}.html.erb")
99
+ elsif File.file?(Rails.root.join("app/views/caboose/blocks/_#{full_name}.html.erb" )) then f = Rails.root.join("app/views/caboose/blocks/_#{full_name}.html.erb")
100
+ elsif File.file?(Rails.root.join("app/views/caboose/blocks/_#{bt.name}.html.erb" )) then f = Rails.root.join("app/views/caboose/blocks/_#{bt.name}.html.erb")
101
+ elsif File.file?(Rails.root.join("app/views/caboose/blocks/_#{bt.field_type}.html.erb" )) then f = Rails.root.join("app/views/caboose/blocks/_#{bt.field_type}.html.erb")
102
+ elsif File.file?("#{Caboose.root}/app/views/caboose/blocks/_#{full_name}.html.erb" ) then f = "#{Caboose.root}/app/views/caboose/blocks/_#{full_name}.html.erb"
103
+ elsif File.file?("#{Caboose.root}/app/views/caboose/blocks/_#{bt.name}.html.erb" ) then f = "#{Caboose.root}/app/views/caboose/blocks/_#{bt.name}.html.erb"
104
+ elsif File.file?("#{Caboose.root}/app/views/caboose/blocks/_#{bt.field_type}.html.erb" ) then f = "#{Caboose.root}/app/views/caboose/blocks/_#{bt.field_type}.html.erb"
102
105
  end
103
106
  f = (f && f.to_s.strip.length > 0 ? File.read(f) : '')
104
107
  end
@@ -136,6 +136,9 @@ module Caboose
136
136
  mattr_accessor :use_comment_routes
137
137
  @@use_comment_routes = true
138
138
 
139
+ mattr_accessor :site_assets_path
140
+ @@site_assets_path = "sites"
141
+
139
142
  end
140
143
 
141
144
  # These are used so that both local filestorage and S3 can work without having to change paperclip paths in models
@@ -1,3 +1,3 @@
1
1
  module Caboose
2
- VERSION = '0.8.89'
3
- end
2
+ VERSION = '0.9.1'
3
+ end
@@ -2,6 +2,34 @@ require "caboose/version"
2
2
  require 'aws-sdk'
3
3
 
4
4
  namespace :caboose do
5
+
6
+ task :move_site_blocks => :environment do
7
+
8
+ #Dir["sites/*/blocks"].each do |file|
9
+ # arr = file.split('/')
10
+ # site_name = arr[1]
11
+ # next if site_name.nil? || site_name.strip.length == 0
12
+ # `mv sites/#{site_name}/blocks app/views/caboose/blocks/#{site_name}` if !File.exist?("app/views/caboose/blocks/#{site_name}")
13
+ #end
14
+
15
+ Dir["app/views/caboose/blocks/*/*"].each do |file|
16
+ arr = file.split('/')
17
+ site_name = arr[4]
18
+ partial_name = arr[5]
19
+ next if site_name.nil? || site_name.strip.length == 0 || partial_name.nil? || partial_name.strip.length == 0
20
+
21
+ #puts "site_name = #{site_name}, partial_name = #{partial_name}"
22
+
23
+ str = File.read(file)
24
+ str2 = str.gsub("../../sites/#{site_name}/blocks", "caboose/blocks/#{site_name}")
25
+ if str != str2
26
+ puts file
27
+ File.open(file, 'w') { |the_file| the_file.write(str2) }
28
+ end
29
+
30
+ end
31
+
32
+ end
5
33
 
6
34
  task :subscription_migration => :environment do
7
35
  Caboose::Subscription.migrate_from_user_subscriptions
@@ -519,10 +547,10 @@ namespace :assets do
519
547
  # Copy any site assets into the host app assets directory first
520
548
  puts "Copying site assets into host assets..."
521
549
  Caboose::Site.all.each do |site|
522
- site_js = Rails.root.join('sites', site.name, 'js')
523
- site_css = Rails.root.join('sites', site.name, 'css')
524
- site_images = Rails.root.join('sites', site.name, 'images')
525
- site_fonts = Rails.root.join('sites', site.name, 'fonts')
550
+ site_js = Rails.root.join(Caboose::site_assets_path, site.name, 'js')
551
+ site_css = Rails.root.join(Caboose::site_assets_path, site.name, 'css')
552
+ site_images = Rails.root.join(Caboose::site_assets_path, site.name, 'images')
553
+ site_fonts = Rails.root.join(Caboose::site_assets_path, site.name, 'fonts')
526
554
 
527
555
  host_js = Rails.root.join('app', 'assets', 'javascripts' , site.name)
528
556
  host_css = Rails.root.join('app', 'assets', 'stylesheets' , site.name)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: caboose-cms
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.89
4
+ version: 0.9.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - William Barry
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-10-21 00:00:00.000000000 Z
11
+ date: 2016-10-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pg