caboose-cms 0.9.228 → 0.9.229
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/caboose/admin.js +1 -1
- data/app/assets/javascripts/caboose/admin_main.js +1 -13
- data/app/assets/javascripts/caboose/admin_media_index.js +161 -158
- data/app/assets/javascripts/caboose/application.js +8 -7
- data/app/assets/javascripts/caboose/block_content_controller_dragdrop.js +60 -4
- data/app/assets/javascripts/caboose/block_modal_controllers/block_dd_modal_controller.js +3 -2
- data/app/assets/javascripts/caboose/block_modal_controllers/media_modal_controller.js +17 -6
- data/app/assets/javascripts/caboose/model/all.js +5 -1
- data/app/assets/stylesheets/caboose/admin_block_edit_image.css.scss +2 -1
- data/app/assets/stylesheets/caboose/admin_edit_page_content_dragdrop.scss +71 -15
- data/app/assets/stylesheets/caboose/admin_main.css.scss +25 -29
- data/app/assets/stylesheets/caboose/admin_media_index.css.scss +26 -5
- data/app/assets/stylesheets/caboose/application.css +11 -5
- data/app/assets/stylesheets/caboose/login.scss +1 -0
- data/app/assets/stylesheets/caboose/model_binder.css +13 -4
- data/app/assets/stylesheets/caboose/page_bar_generator.css +2 -1
- data/app/controllers/caboose/admin_controller.rb +3 -4
- data/app/controllers/caboose/application_controller.rb +16 -19
- data/app/controllers/caboose/block_types_controller.rb +8 -6
- data/app/controllers/caboose/cart_controller.rb +2 -2
- data/app/controllers/caboose/change_logs_controller.rb +13 -0
- data/app/controllers/caboose/fonts_controller.rb +139 -2
- data/app/controllers/caboose/invoices_controller.rb +5 -4
- data/app/controllers/caboose/login_logs_controller.rb +5 -7
- data/app/controllers/caboose/media_categories_controller.rb +16 -2
- data/app/controllers/caboose/media_controller.rb +14 -11
- data/app/controllers/caboose/pages_controller.rb +104 -42
- data/app/controllers/caboose/posts_controller.rb +53 -7
- data/app/controllers/caboose/products_controller.rb +1 -1
- data/app/controllers/caboose/sites_controller.rb +25 -6
- data/app/controllers/caboose/sns_controller.rb +3 -3
- data/app/controllers/caboose/themes_controller.rb +30 -0
- data/app/controllers/caboose/users_controller.rb +17 -10
- data/app/controllers/caboose/variants_controller.rb +9 -9
- data/app/models/caboose/block.rb +98 -22
- data/app/models/caboose/block_type.rb +2 -1
- data/app/models/caboose/block_type_parser.rb +1 -1
- data/app/models/caboose/calendar_event_group.rb +2 -2
- data/app/models/caboose/change_log.rb +97 -0
- data/app/models/caboose/core_plugin.rb +4 -3
- data/app/models/caboose/font.rb +7 -2
- data/app/models/caboose/font_variant.rb +12 -0
- data/app/models/caboose/media.rb +15 -4
- data/app/models/caboose/media_category.rb +2 -4
- data/app/models/caboose/page.rb +316 -45
- data/app/models/caboose/page_bar_generator.rb +20 -10
- data/app/models/caboose/post.rb +108 -8
- data/app/models/caboose/product.rb +1 -1
- data/app/models/caboose/role.rb +2 -2
- data/app/models/caboose/schema.rb +73 -72
- data/app/models/caboose/site.rb +203 -1
- data/app/models/caboose/theme.rb +70 -5
- data/app/views/caboose/block_types/admin_edit.html.erb +6 -8
- data/app/views/caboose/blocks/_cached_block.html.erb +28 -0
- data/app/views/caboose/blocks/_file.html.erb +2 -2
- data/app/views/caboose/blocks/_ga.html.erb +1 -2
- data/app/views/caboose/blocks/_image.html.erb +4 -0
- data/app/views/caboose/blocks/_render_function.html.erb +9 -4
- data/app/views/caboose/change_logs/admin_index.html.erb +65 -0
- data/app/views/caboose/fonts/admin_family_edit.html.erb +63 -0
- data/app/views/caboose/fonts/admin_family_index.html.erb +42 -0
- data/app/views/caboose/fonts/admin_index.html.erb +55 -10
- data/app/views/caboose/fonts/admin_variant_edit.html.erb +84 -0
- data/app/views/caboose/invoices_mailer/customer_status_updated.html.erb +5 -14
- data/app/views/caboose/login_logs/admin_index_for_user.html.erb +1 -1
- data/app/views/caboose/media/admin_index.html.erb +14 -24
- data/app/views/caboose/my_account/index.html.erb +1 -0
- data/app/views/caboose/pages/_admin_header.html.erb +5 -0
- data/app/views/caboose/pages/admin_change_logs.html.erb +56 -0
- data/app/views/caboose/pages/admin_edit_content.html.erb +6 -2
- data/app/views/caboose/pages/admin_edit_general.html.erb +32 -4
- data/app/views/caboose/pages/compiled_asset.css.erb +0 -0
- data/app/views/caboose/pages/compiled_asset.js.erb +0 -0
- data/app/views/caboose/posts/_admin_header.html.erb +5 -0
- data/app/views/caboose/posts/admin_change_logs.html.erb +56 -0
- data/app/views/caboose/posts/admin_delete_form.html.erb +1 -1
- data/app/views/caboose/posts/admin_edit_content.html.erb +6 -2
- data/app/views/caboose/products/admin_group_variants.html.erb +1 -1
- data/app/views/caboose/products/admin_sort.html copy.erb +1 -1
- data/app/views/caboose/sites/admin_edit.html.erb +21 -0
- data/app/views/caboose/sites/compiled_asset.css.erb +0 -0
- data/app/views/caboose/sites/compiled_asset.js.erb +0 -0
- data/app/views/caboose/themes/admin_edit.html.erb +7 -3
- data/app/views/caboose/themes/admin_error_log.html.erb +9 -0
- data/app/views/caboose/themes/admin_js.html.erb +131 -0
- data/app/views/caboose/users/_admin_header.html.erb +4 -0
- data/app/views/caboose/users/admin_change_logs.html.erb +63 -0
- data/app/views/caboose/users/admin_edit_roles.html.erb +1 -0
- data/app/views/caboose/variants/admin_group.html.erb +1 -1
- data/app/views/layouts/caboose/admin.html.erb +9 -2
- data/app/views/layouts/caboose/application.html.erb +62 -92
- data/app/views/layouts/caboose/css.css.erb +44 -0
- data/app/views/layouts/caboose/footer_css.css.erb +41 -0
- data/app/views/layouts/caboose/footer_js.js.erb +31 -0
- data/app/views/layouts/caboose/js.js.erb +34 -0
- data/lib/caboose/version.rb +1 -1
- data/lib/tasks/caboose.rake +3 -14
- metadata +23 -27
- data/app/controllers/caboose/assets_controller.rb +0 -65
- data/app/models/caboose/asset.rb +0 -23
- data/app/models/caboose/asset_manifest.rb +0 -91
- data/app/models/caboose/block_cache.rb +0 -105
- data/app/models/caboose/block_cache_file.rb +0 -22
- data/app/models/caboose/block_cache_image.rb +0 -53
- data/app/models/caboose/page_cache.rb +0 -12
- data/app/models/caboose/page_cacher.rb +0 -137
- data/app/views/caboose/pages/admin_new_old.html.erb +0 -46
- data/app/views/caboose/pages/test.html.erb +0 -64
@@ -0,0 +1,41 @@
|
|
1
|
+
<%
|
2
|
+
css = ''
|
3
|
+
css << raw(@site.cached_footer_css) if @site.use_caching
|
4
|
+
if !css.blank?
|
5
|
+
css = css.gsub('<style>','')
|
6
|
+
css = css.gsub('</style>','')
|
7
|
+
links = css.scan(/@import(\s)*url\(('|")(http(s)?:)?(\/\/[A-z 0-9?=@._\-\/]*)('|")\);/).flatten
|
8
|
+
links2 = css.scan(/<link href=('|")(http(s)?:)?(\/\/[A-z 0-9?=@._\-\/]*)('|")([A-z 0-9?@="'\/]*)\/>/).flatten
|
9
|
+
css_files = []
|
10
|
+
if links && links.length > 0
|
11
|
+
links.to_a.each do |link|
|
12
|
+
if !link.blank? && link.include?('.css') && !link.include?('@import')
|
13
|
+
if !css_files.include?(link)
|
14
|
+
css_files << link
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
if links2 && links2.length > 0
|
20
|
+
links2.to_a.each do |link|
|
21
|
+
if !link.blank? && link.include?('.css') && !link.include?('media')
|
22
|
+
if !css_files.include?(link)
|
23
|
+
css_files << link
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
str = @site.custom_css_files.blank? ? '' : @site.custom_css_files
|
29
|
+
css_files.each do |csf|
|
30
|
+
str += "\n" if !str.blank? && !str.include?(csf)
|
31
|
+
str += "#{csf}" if !str.include?(csf)
|
32
|
+
end
|
33
|
+
@site.custom_css_files = str
|
34
|
+
@site.save
|
35
|
+
if !css.blank?
|
36
|
+
css = css.gsub(/@import(\s)*url\(('|")(http(s)?:)?(\/\/[A-z 0-9?=@._\-\/]*)('|")\);/,'')
|
37
|
+
css = css.gsub(/<link href=('|")(http(s)?:)?(\/\/[A-z 0-9?=@._\-\/]*)('|")([A-z 0-9@?="'\/]*)\/>/,'')
|
38
|
+
end
|
39
|
+
%>
|
40
|
+
<%== css %>
|
41
|
+
<% end %>
|
@@ -0,0 +1,31 @@
|
|
1
|
+
<%
|
2
|
+
js = ''
|
3
|
+
js << raw(@site.cached_footer_js) if @site.use_caching
|
4
|
+
if !js.blank?
|
5
|
+
links = js.scan(/<script src=('|")(http(s)?:)?(\/{1,2}[A-z 0-9?=@._\-\/]*)('|")([A-z 0-9@?="'\/]*)\><\/script>/).flatten
|
6
|
+
js_files = []
|
7
|
+
if links && links.length > 0
|
8
|
+
links.to_a.each do |link|
|
9
|
+
if !link.blank? && link.include?('.js')
|
10
|
+
if !js_files.include?(link)
|
11
|
+
js_files << link
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
str = @site.custom_js_files.blank? ? '' : @site.custom_js_files
|
17
|
+
js_files.each do |csf|
|
18
|
+
str += "\n" if !str.blank? && !str.include?(csf)
|
19
|
+
str += "#{csf}" if !str.include?(csf)
|
20
|
+
end
|
21
|
+
@site.custom_js_files = str
|
22
|
+
@site.save
|
23
|
+
if !js.blank?
|
24
|
+
js = js.gsub(/<script src=('|")(http(s)?:)?(\/{1,2}[A-z 0-9?=@._\-\/]*)('|")([A-z 0-9@?="'\/]*)\><\/script>/,'')
|
25
|
+
js = js.gsub(/<script src=('|")(http(s)?:)?(\/{1,2}[A-z 0-9?=@._\-\/]*)('|")([A-z 0-9@?="'\/]*)\>/,'')
|
26
|
+
js = js.gsub('<script>','')
|
27
|
+
js = js.gsub('</script>','')
|
28
|
+
end
|
29
|
+
%>
|
30
|
+
<%== js %>
|
31
|
+
<% end %>
|
@@ -0,0 +1,34 @@
|
|
1
|
+
<% if @page.custom_js && !@page.custom_js.blank? %>
|
2
|
+
<%== @page.custom_js %>
|
3
|
+
<% end %>
|
4
|
+
<%
|
5
|
+
js = ''
|
6
|
+
js << raw(@post ? @post.cached_js : @page.cached_js) if @site.use_caching
|
7
|
+
if !js.blank?
|
8
|
+
links = js.scan(/<script src=('|")(http(s)?:)?(\/{1,2}[A-z 0-9?=@._\-\/]*)('|")([A-z 0-9@?="'\/]*)\><\/script>/).flatten
|
9
|
+
js_files = []
|
10
|
+
if links && links.length > 0
|
11
|
+
links.to_a.each do |link|
|
12
|
+
if !link.blank? && link.include?('.js')
|
13
|
+
if !js_files.include?(link)
|
14
|
+
js_files << link
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
str = @page.custom_js_files.blank? ? '' : @page.custom_js_files
|
20
|
+
js_files.each do |csf|
|
21
|
+
str += "\n" if !str.blank? && !str.include?(csf)
|
22
|
+
str += "#{csf}" if !str.include?(csf)
|
23
|
+
end
|
24
|
+
@page.custom_js_files = str
|
25
|
+
@page.save
|
26
|
+
if !js.blank?
|
27
|
+
js = js.gsub(/<script src=('|")(http(s)?:)?(\/{1,2}[A-z 0-9?=@._\-\/]*)('|")([A-z 0-9@?="'\/]*)\><\/script>/,'')
|
28
|
+
js = js.gsub(/<script src=('|")(http(s)?:)?(\/{1,2}[A-z 0-9?=@._\-\/]*)('|")([A-z 0-9@?="'\/]*)\>/,'')
|
29
|
+
js = js.gsub('<script>','')
|
30
|
+
js = js.gsub('</script>','')
|
31
|
+
end
|
32
|
+
%>
|
33
|
+
<%== js %>
|
34
|
+
<% end %>
|
data/lib/caboose/version.rb
CHANGED
data/lib/tasks/caboose.rake
CHANGED
@@ -67,7 +67,6 @@ namespace :caboose do
|
|
67
67
|
puts Rails.application.assets.file_digest(temp_file)
|
68
68
|
#puts Rails.application.config.assets.digests['benttree/images/icons/loading.gif']
|
69
69
|
|
70
|
-
#resp = Caboose::AssetManifest.save_asset('assets/william/test1.js', 'var x = 32;')
|
71
70
|
#puts resp
|
72
71
|
end
|
73
72
|
|
@@ -328,31 +327,21 @@ namespace :caboose do
|
|
328
327
|
desc "Reprocess media images"
|
329
328
|
task :reprocess_media_images => :environment do
|
330
329
|
Caboose::Media.where("image_file_name is not null").reorder(:id).all.each do |m|
|
331
|
-
m.delay(:queue => '
|
330
|
+
m.delay(:queue => 'general', :priority => 8).reprocess_image
|
332
331
|
end
|
333
332
|
end
|
334
333
|
|
335
334
|
desc "Migrate block images and files to media"
|
336
335
|
task :migrate_block_assets_to_media => :environment do
|
337
336
|
Caboose::Block.where("image_file_name is not null and media_id is null").reorder(:id).all.each do |b|
|
338
|
-
b.delay(:queue => '
|
337
|
+
b.delay(:queue => 'general', :priority => 8).migrate_media
|
339
338
|
end
|
340
339
|
Caboose::Block.where("file_file_name is not null and media_id is null").reorder(:id).all.each do |b|
|
341
|
-
b.delay(:queue => '
|
340
|
+
b.delay(:queue => 'general', :priority => 8).migrate_media
|
342
341
|
end
|
343
342
|
Caboose::BlockType.where(:id => 19).update_all('name' => 'image2')
|
344
343
|
Caboose::Block.where(:block_type_id => 19).update_all('name' => 'image2')
|
345
344
|
end
|
346
|
-
|
347
|
-
desc "Update expired caches and cache pages that aren't cached"
|
348
|
-
task :cache_pages => :environment do
|
349
|
-
# Caboose::PageCacher.delay(:queue => 'caboose_cache').refresh
|
350
|
-
end
|
351
|
-
|
352
|
-
desc "Cache all pages"
|
353
|
-
task :cache_all_pages => :environment do
|
354
|
-
# Caboose::PageCacher.delay(:queue => 'caboose_cache').cache_all
|
355
|
-
end
|
356
345
|
|
357
346
|
desc "Run rspec tests on Caboose"
|
358
347
|
task :test => :environment do
|
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.9.
|
4
|
+
version: 0.9.229
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- William Barry
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-07-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pg
|
@@ -38,20 +38,6 @@ dependencies:
|
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: 3.2.22
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: underscore-rails
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - ">="
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '0'
|
48
|
-
type: :runtime
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - ">="
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '0'
|
55
41
|
- !ruby/object:Gem::Dependency
|
56
42
|
name: jquery-rails
|
57
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -685,7 +671,6 @@ files:
|
|
685
671
|
- app/controllers/caboose/ab_variants_controller.rb
|
686
672
|
- app/controllers/caboose/admin_controller.rb
|
687
673
|
- app/controllers/caboose/application_controller.rb
|
688
|
-
- app/controllers/caboose/assets_controller.rb
|
689
674
|
- app/controllers/caboose/billing_addresses_controller.rb
|
690
675
|
- app/controllers/caboose/block_type_categories_controller.rb
|
691
676
|
- app/controllers/caboose/block_type_sources_controller.rb
|
@@ -695,6 +680,7 @@ files:
|
|
695
680
|
- app/controllers/caboose/calendars_controller.rb
|
696
681
|
- app/controllers/caboose/cart_controller.rb
|
697
682
|
- app/controllers/caboose/categories_controller.rb
|
683
|
+
- app/controllers/caboose/change_logs_controller.rb
|
698
684
|
- app/controllers/caboose/checkout_controller.rb
|
699
685
|
- app/controllers/caboose/checkout_controller_bak.rb
|
700
686
|
- app/controllers/caboose/domains_controller.rb
|
@@ -773,14 +759,9 @@ files:
|
|
773
759
|
- app/models/caboose/ab_variant.rb
|
774
760
|
- app/models/caboose/address.rb
|
775
761
|
- app/models/caboose/approval_request.rb
|
776
|
-
- app/models/caboose/asset.rb
|
777
|
-
- app/models/caboose/asset_manifest.rb
|
778
762
|
- app/models/caboose/authenticator.rb
|
779
763
|
- app/models/caboose/authnet.rb
|
780
764
|
- app/models/caboose/block.rb
|
781
|
-
- app/models/caboose/block_cache.rb
|
782
|
-
- app/models/caboose/block_cache_file.rb
|
783
|
-
- app/models/caboose/block_cache_image.rb
|
784
765
|
- app/models/caboose/block_type.rb
|
785
766
|
- app/models/caboose/block_type_category.rb
|
786
767
|
- app/models/caboose/block_type_icons.rb
|
@@ -794,6 +775,7 @@ files:
|
|
794
775
|
- app/models/caboose/calendar_event_group.rb
|
795
776
|
- app/models/caboose/category.rb
|
796
777
|
- app/models/caboose/category_membership.rb
|
778
|
+
- app/models/caboose/change_log.rb
|
797
779
|
- app/models/caboose/comment_routes.rb
|
798
780
|
- app/models/caboose/core_plugin.rb
|
799
781
|
- app/models/caboose/crumbtrail.rb
|
@@ -835,8 +817,6 @@ files:
|
|
835
817
|
- app/models/caboose/modification_value_input_field.rb
|
836
818
|
- app/models/caboose/page.rb
|
837
819
|
- app/models/caboose/page_bar_generator.rb
|
838
|
-
- app/models/caboose/page_cache.rb
|
839
|
-
- app/models/caboose/page_cacher.rb
|
840
820
|
- app/models/caboose/page_custom_field.rb
|
841
821
|
- app/models/caboose/page_custom_field_value.rb
|
842
822
|
- app/models/caboose/page_permission.rb
|
@@ -923,6 +903,7 @@ files:
|
|
923
903
|
- app/views/caboose/block_types/admin_new.html.erb
|
924
904
|
- app/views/caboose/block_types/admin_parse_form.html.erb
|
925
905
|
- app/views/caboose/blocks/_block.html.erb
|
906
|
+
- app/views/caboose/blocks/_cached_block.html.erb
|
926
907
|
- app/views/caboose/blocks/_checkbox.html.erb
|
927
908
|
- app/views/caboose/blocks/_controller_view_content.html.erb
|
928
909
|
- app/views/caboose/blocks/_file.html.erb
|
@@ -991,6 +972,7 @@ files:
|
|
991
972
|
- app/views/caboose/categories/admin_index.html.erb
|
992
973
|
- app/views/caboose/categories/admin_new.html.erb
|
993
974
|
- app/views/caboose/categories/admin_sort_children.html.erb
|
975
|
+
- app/views/caboose/change_logs/admin_index.html.erb
|
994
976
|
- app/views/caboose/checkout/_address_form.html.erb
|
995
977
|
- app/views/caboose/checkout/_billing_form.html.erb
|
996
978
|
- app/views/caboose/checkout/_cart.html.erb
|
@@ -1032,7 +1014,10 @@ files:
|
|
1032
1014
|
- app/views/caboose/extras/error.html.erb
|
1033
1015
|
- app/views/caboose/extras/error404.html.erb
|
1034
1016
|
- app/views/caboose/extras/error_invalid_site.html.erb
|
1017
|
+
- app/views/caboose/fonts/admin_family_edit.html.erb
|
1018
|
+
- app/views/caboose/fonts/admin_family_index.html.erb
|
1035
1019
|
- app/views/caboose/fonts/admin_index.html.erb
|
1020
|
+
- app/views/caboose/fonts/admin_variant_edit.html.erb
|
1036
1021
|
- app/views/caboose/gift_cards/admin_edit.html.erb
|
1037
1022
|
- app/views/caboose/gift_cards/admin_index.html.erb
|
1038
1023
|
- app/views/caboose/inbox/admin_index.html.erb
|
@@ -1086,6 +1071,7 @@ files:
|
|
1086
1071
|
- app/views/caboose/pages/_admin_header.html.erb
|
1087
1072
|
- app/views/caboose/pages/_content.html.erb
|
1088
1073
|
- app/views/caboose/pages/_new_block_header.html.erb
|
1074
|
+
- app/views/caboose/pages/admin_change_logs.html.erb
|
1089
1075
|
- app/views/caboose/pages/admin_delete_form.html.erb
|
1090
1076
|
- app/views/caboose/pages/admin_duplicate_form.html.erb
|
1091
1077
|
- app/views/caboose/pages/admin_edit_child_sort_order.html.erb
|
@@ -1099,11 +1085,11 @@ files:
|
|
1099
1085
|
- app/views/caboose/pages/admin_edit_seo.html.erb
|
1100
1086
|
- app/views/caboose/pages/admin_index.html.erb
|
1101
1087
|
- app/views/caboose/pages/admin_new.html.erb
|
1102
|
-
- app/views/caboose/pages/admin_new_old.html.erb
|
1103
1088
|
- app/views/caboose/pages/admin_sitemap.html.erb
|
1089
|
+
- app/views/caboose/pages/compiled_asset.css.erb
|
1090
|
+
- app/views/caboose/pages/compiled_asset.js.erb
|
1104
1091
|
- app/views/caboose/pages/preview.html.erb
|
1105
1092
|
- app/views/caboose/pages/show.html.erb
|
1106
|
-
- app/views/caboose/pages/test.html.erb
|
1107
1093
|
- app/views/caboose/pages/update_pic.html.erb
|
1108
1094
|
- app/views/caboose/pages/update_resume.html.erb
|
1109
1095
|
- app/views/caboose/permissions/edit.html.erb
|
@@ -1116,6 +1102,7 @@ files:
|
|
1116
1102
|
- app/views/caboose/post_custom_fields/admin_index.html.erb
|
1117
1103
|
- app/views/caboose/posts/_admin_footer.html.erb
|
1118
1104
|
- app/views/caboose/posts/_admin_header.html.erb
|
1105
|
+
- app/views/caboose/posts/admin_change_logs.html.erb
|
1119
1106
|
- app/views/caboose/posts/admin_delete_form.html.erb
|
1120
1107
|
- app/views/caboose/posts/admin_edit_categories.html.erb
|
1121
1108
|
- app/views/caboose/posts/admin_edit_content.html.erb
|
@@ -1176,6 +1163,8 @@ files:
|
|
1176
1163
|
- app/views/caboose/sites/admin_edit_js.html.erb
|
1177
1164
|
- app/views/caboose/sites/admin_index.html.erb
|
1178
1165
|
- app/views/caboose/sites/admin_new.html.erb
|
1166
|
+
- app/views/caboose/sites/compiled_asset.css.erb
|
1167
|
+
- app/views/caboose/sites/compiled_asset.js.erb
|
1179
1168
|
- app/views/caboose/sites/robots.text.erb
|
1180
1169
|
- app/views/caboose/sites/sitemap.xml.erb
|
1181
1170
|
- app/views/caboose/smtp/admin_edit.html.erb
|
@@ -1197,9 +1186,12 @@ files:
|
|
1197
1186
|
- app/views/caboose/theme_files/admin_edit.html.erb
|
1198
1187
|
- app/views/caboose/theme_files/admin_index.html.erb
|
1199
1188
|
- app/views/caboose/themes/admin_edit.html.erb
|
1189
|
+
- app/views/caboose/themes/admin_error_log.html.erb
|
1190
|
+
- app/views/caboose/themes/admin_js.html.erb
|
1200
1191
|
- app/views/caboose/themes/admin_sass.html.erb
|
1201
1192
|
- app/views/caboose/users/_admin_footer.html.erb
|
1202
1193
|
- app/views/caboose/users/_admin_header.html.erb
|
1194
|
+
- app/views/caboose/users/admin_change_logs.html.erb
|
1203
1195
|
- app/views/caboose/users/admin_delete_form.html.erb
|
1204
1196
|
- app/views/caboose/users/admin_edit.html.erb
|
1205
1197
|
- app/views/caboose/users/admin_edit_password.html.erb
|
@@ -1229,8 +1221,12 @@ files:
|
|
1229
1221
|
- app/views/layouts/caboose/admin.html.erb
|
1230
1222
|
- app/views/layouts/caboose/admin_empty.html.erb
|
1231
1223
|
- app/views/layouts/caboose/application.html.erb
|
1224
|
+
- app/views/layouts/caboose/css.css.erb
|
1232
1225
|
- app/views/layouts/caboose/empty.html.erb
|
1233
1226
|
- app/views/layouts/caboose/error404.html.erb
|
1227
|
+
- app/views/layouts/caboose/footer_css.css.erb
|
1228
|
+
- app/views/layouts/caboose/footer_js.js.erb
|
1229
|
+
- app/views/layouts/caboose/js.js.erb
|
1234
1230
|
- app/views/layouts/caboose/modal.html.erb
|
1235
1231
|
- app/views/layouts/caboose/no_layout.html.erb
|
1236
1232
|
- app/views/layouts/caboose/store/_banner.html.erb
|
@@ -1268,7 +1264,7 @@ files:
|
|
1268
1264
|
- spec/factories/caboose_users.rb
|
1269
1265
|
- spec/models/block_spec.rb
|
1270
1266
|
- spec/models/user_spec.rb
|
1271
|
-
homepage: http://github.com/
|
1267
|
+
homepage: http://github.com/thenine/caboosecms
|
1272
1268
|
licenses: []
|
1273
1269
|
metadata: {}
|
1274
1270
|
post_install_message:
|
@@ -1,65 +0,0 @@
|
|
1
|
-
module Caboose
|
2
|
-
class AssetsController < Caboose::ApplicationController
|
3
|
-
layout 'caboose/admin'
|
4
|
-
|
5
|
-
## @route GET /admin/assets/ace
|
6
|
-
#def admin_ace
|
7
|
-
# return if !user_is_allowed('assets', 'edit')
|
8
|
-
#end
|
9
|
-
#
|
10
|
-
## @route GET /admin/assets
|
11
|
-
#def admin_index
|
12
|
-
# return if !user_is_allowed('assets', 'edit')
|
13
|
-
# config = YAML.load(File.read(Rails.root.join('config', 'aws.yml')))[Rails.env]
|
14
|
-
# bucket = config['bucket']
|
15
|
-
# @assets_path = "http://#{bucket}.s3.amazonaws.com/assets"
|
16
|
-
#end
|
17
|
-
#
|
18
|
-
## @route GET /admin/assets/manifest
|
19
|
-
#def admin_manifest
|
20
|
-
# return if !user_is_allowed('assets', 'edit')
|
21
|
-
#
|
22
|
-
# config = YAML.load(File.read(Rails.root.join('config', 'aws.yml')))[Rails.env]
|
23
|
-
# bucket = config['bucket']
|
24
|
-
# resp = HTTParty.get("http://#{bucket}.s3.amazonaws.com/assets/manifest.yml")
|
25
|
-
# str = resp.body
|
26
|
-
# manifest = self.parse_manifest(str, true)
|
27
|
-
#
|
28
|
-
# render :json => manifest
|
29
|
-
#end
|
30
|
-
#
|
31
|
-
#def parse_manifest(str, exclude_images = true)
|
32
|
-
# lines = str.split("\n")
|
33
|
-
# h = {}
|
34
|
-
# lines.each_with_index do |line, i|
|
35
|
-
# next if i == 0
|
36
|
-
# path = line.split(": ").first.split('/')
|
37
|
-
#
|
38
|
-
# if exclude_images
|
39
|
-
# ext = line.split('.')
|
40
|
-
# next if ext.count > 0 && ['png','jpg','gif','ico'].include?(ext.last.downcase)
|
41
|
-
# end
|
42
|
-
# self.verify_path_exists(path, h)
|
43
|
-
# end
|
44
|
-
# return h
|
45
|
-
#end
|
46
|
-
#
|
47
|
-
#def verify_path_exists(path, h, i = 0)
|
48
|
-
# return if i >= path.count
|
49
|
-
# h[path[i]] = i == (path.count - 1) ? true : {} if h[path[i]].nil?
|
50
|
-
# self.verify_path_exists(path, h[path[i]], i+1)
|
51
|
-
#end
|
52
|
-
#
|
53
|
-
## @route PUT /admin/assets
|
54
|
-
#def admin_update
|
55
|
-
# return if !user_is_allowed('assets', 'edit')
|
56
|
-
#
|
57
|
-
# path = params[:path]
|
58
|
-
# value = params[:value]
|
59
|
-
#
|
60
|
-
# resp = AssetManifest.save_asset(path, value)
|
61
|
-
# render :json => resp
|
62
|
-
#end
|
63
|
-
|
64
|
-
end
|
65
|
-
end
|
data/app/models/caboose/asset.rb
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
|
2
|
-
class Caboose::Asset < ActiveRecord::Base
|
3
|
-
self.table_name = "assets"
|
4
|
-
belongs_to :page
|
5
|
-
attr_accessible :page_id, :uploaded_by_id, :date_uploaded, :name, :filename, :description, :extension
|
6
|
-
|
7
|
-
def sanitize_name(str)
|
8
|
-
return str.gsub(' ', '_').downcase
|
9
|
-
end
|
10
|
-
|
11
|
-
def assets_with_uri(host_with_port, uri)
|
12
|
-
uri[0] = '' if uri.start_with? '/'
|
13
|
-
|
14
|
-
page = Page.page_with_uri(host_with_port, File.dirname(uri), false)
|
15
|
-
return false if page.nil?
|
16
|
-
|
17
|
-
asset = Asset.where(:page_id => page.id,:filename => File.basename(uri)).first
|
18
|
-
return false if asset.nil?
|
19
|
-
|
20
|
-
return asset
|
21
|
-
end
|
22
|
-
|
23
|
-
end
|
@@ -1,91 +0,0 @@
|
|
1
|
-
module Caboose
|
2
|
-
class AssetManifest
|
3
|
-
|
4
|
-
#@@bucket = nil
|
5
|
-
#
|
6
|
-
#def AssetManifest.bucket
|
7
|
-
# if @@bucket.nil?
|
8
|
-
# config = YAML.load(File.read(Rails.root.join('config', 'aws.yml')))[Rails.env]
|
9
|
-
# AWS.config({ :access_key_id => config['access_key_id'], :secret_access_key => config['secret_access_key'] })
|
10
|
-
# @@bucket = AWS::S3::Bucket.new(config['bucket'])
|
11
|
-
# end
|
12
|
-
# return @@bucket
|
13
|
-
#end
|
14
|
-
#
|
15
|
-
#def AssetManifest.save_asset(path, str, reset = true)
|
16
|
-
#
|
17
|
-
# file = self.bucket.objects[path]
|
18
|
-
# return { :error => "Can't find file." } if file.nil?
|
19
|
-
#
|
20
|
-
# # Save the contents into the source file
|
21
|
-
# return { :error => "Can't write to file." } if !file.write(str)
|
22
|
-
#
|
23
|
-
# # Compile the file
|
24
|
-
# str_compiled = ''
|
25
|
-
# begin
|
26
|
-
# str_compiled = Uglifier.compile(str)
|
27
|
-
# rescue Exception => e
|
28
|
-
# return { :error => e.message }
|
29
|
-
# end
|
30
|
-
#
|
31
|
-
# # Compute the digest for the compiled file
|
32
|
-
# # Note: digest must be generated with environment set to 'production' (sprockets changes digests per environment)
|
33
|
-
# digest = Rails.application.assets.file_digest('/Users/william/Sites/caboosecms.com/sites/benttree/images/icons/loading.gif')
|
34
|
-
# digest = Rails.application.assets.digest.hexdigest(str_compiled)
|
35
|
-
# digest = Digest::SHA2.hexdigest(str_compiled)
|
36
|
-
#
|
37
|
-
# # See if the digest file for the compiled file exists
|
38
|
-
# digest_path = self.path_with_digest(path, digest)
|
39
|
-
# if self.bucket.objects[digest_path].exists?
|
40
|
-
# digest_file = bucket.objects[digest_path]
|
41
|
-
# digest_file.write(str_compiled)
|
42
|
-
# end
|
43
|
-
#
|
44
|
-
# # See if the digest is in the manifest
|
45
|
-
# manifest = self.bucket.objects['assets/manifest.yml']
|
46
|
-
# exists = false
|
47
|
-
# changed = false
|
48
|
-
# new_lines = []
|
49
|
-
# manifest.read.split("\n").each do|line|
|
50
|
-
# if line.starts_with?("#{path}: ")
|
51
|
-
# exists = true
|
52
|
-
# changed = true if line != "#{path}: #{digest_path}"
|
53
|
-
# new_lines << "#{path}: #{digest_path}"
|
54
|
-
# else
|
55
|
-
# new_lines << line
|
56
|
-
# end
|
57
|
-
# end
|
58
|
-
# if !exists
|
59
|
-
# new_lines << "#{path}: #{digest_path}"
|
60
|
-
# changed = true
|
61
|
-
# end
|
62
|
-
#
|
63
|
-
# # If the digest has changed, update the manifest and set the app asset digests
|
64
|
-
# if changed
|
65
|
-
# manifest.write(new_lines.join("\n"))
|
66
|
-
# self.reset_asset_digests(new_lines) if reset
|
67
|
-
# end
|
68
|
-
#
|
69
|
-
# return { :sucess => true }
|
70
|
-
#end
|
71
|
-
#
|
72
|
-
#def AssetManifest.reset_asset_digests(lines = nil)
|
73
|
-
# lines = self.bucket.objects['assets/manifest.yml'].read.split("\n") if lines.nil?
|
74
|
-
# lines.each do|line|
|
75
|
-
# arr = line.split(": ")
|
76
|
-
# Rails.application.config.assets.digests[arr[0]] = arr[1]
|
77
|
-
# end
|
78
|
-
#end
|
79
|
-
#
|
80
|
-
#def AssetManifest.path_with_digest(path, digest)
|
81
|
-
# arr = path.split('/')
|
82
|
-
# filename = arr.pop
|
83
|
-
# filename = filename.split('.')
|
84
|
-
# ext = filename.pop
|
85
|
-
# filename = "#{filename.join('.')}-#{digest}.#{ext}"
|
86
|
-
# return filename if arr.count == 0
|
87
|
-
# return "#{arr.join('/')}/#{filename}"
|
88
|
-
#end
|
89
|
-
|
90
|
-
end
|
91
|
-
end
|