trusty-cms 3.1.11 → 3.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (128) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +9 -14
  3. data/Gemfile.lock +84 -70
  4. data/README.md +4 -0
  5. data/app/assets/images/admin/add.png +0 -0
  6. data/app/assets/images/admin/archive_icon.png +0 -0
  7. data/app/assets/images/admin/audio_icon.png +0 -0
  8. data/app/assets/images/admin/audio_thumbnail.png +0 -0
  9. data/app/assets/images/admin/c_icon.png +0 -0
  10. data/app/assets/images/admin/copy.png +0 -0
  11. data/app/assets/images/admin/css_icon.png +0 -0
  12. data/app/assets/images/admin/database_icon.png +0 -0
  13. data/app/assets/images/admin/delete.png +0 -0
  14. data/app/assets/images/admin/document_icon.png +0 -0
  15. data/app/assets/images/admin/document_thumbnail.png +0 -0
  16. data/app/assets/images/admin/flash_icon.png +0 -0
  17. data/app/assets/images/admin/flash_thumbnail.png +0 -0
  18. data/app/assets/images/admin/font_icon.png +0 -0
  19. data/app/assets/images/admin/gzip_icon.png +0 -0
  20. data/app/assets/images/admin/html_icon.png +0 -0
  21. data/app/assets/images/admin/image_icon.png +0 -0
  22. data/app/assets/images/admin/image_thumbnail.png +0 -0
  23. data/app/assets/images/admin/java_icon.png +0 -0
  24. data/app/assets/images/admin/page_edit.png +0 -0
  25. data/app/assets/images/admin/pdf_icon.png +0 -0
  26. data/app/assets/images/admin/pdf_thumbnail.png +0 -0
  27. data/app/assets/images/admin/perl_icon.png +0 -0
  28. data/app/assets/images/admin/php_icon.png +0 -0
  29. data/app/assets/images/admin/presentation_icon.png +0 -0
  30. data/app/assets/images/admin/python_icon.png +0 -0
  31. data/app/assets/images/admin/reorder_assets.png +0 -0
  32. data/app/assets/images/admin/ruby_icon.png +0 -0
  33. data/app/assets/images/admin/script_icon.png +0 -0
  34. data/app/assets/images/admin/spinner.gif +0 -0
  35. data/app/assets/images/admin/spreadsheet_icon.png +0 -0
  36. data/app/assets/images/admin/tar_icon.png +0 -0
  37. data/app/assets/images/admin/unknown_icon.png +0 -0
  38. data/app/assets/images/admin/unknown_thumbnail.png +0 -0
  39. data/app/assets/images/admin/video_icon.png +0 -0
  40. data/app/assets/images/admin/video_thumbnail.png +0 -0
  41. data/app/assets/images/admin/xml_icon.png +0 -0
  42. data/app/assets/images/admin/zip_icon.png +0 -0
  43. data/app/assets/javascripts/admin/assets.js +268 -0
  44. data/app/assets/javascripts/admin/assets_admin.js +16 -0
  45. data/app/assets/javascripts/admin/jquery.fileupload.js +1457 -0
  46. data/app/assets/javascripts/admin/jquery.iframe-transport.js +214 -0
  47. data/app/assets/javascripts/admin/jquery.ui.widget.js +558 -0
  48. data/app/assets/stylesheets/admin/assets.scss +283 -0
  49. data/app/controllers/admin/assets_controller.rb +88 -0
  50. data/app/controllers/admin/page_attachments_controller.rb +23 -0
  51. data/app/helpers/admin/assets_helper.rb +16 -0
  52. data/app/helpers/admin/page_attachments_helper.rb +2 -0
  53. data/app/models/asset.rb +251 -0
  54. data/app/models/asset_type.rb +239 -0
  55. data/app/models/old_page_attachment.rb +26 -0
  56. data/app/models/page_attachment.rb +20 -0
  57. data/app/views/admin/assets/_asset.html.haml +12 -0
  58. data/app/views/admin/assets/_asset_table.html.haml +30 -0
  59. data/app/views/admin/assets/_errors.html.haml +3 -0
  60. data/app/views/admin/assets/_form.html.haml +18 -0
  61. data/app/views/admin/assets/_page_assets.html.haml +12 -0
  62. data/app/views/admin/assets/_search.html.haml +17 -0
  63. data/app/views/admin/assets/_search_results.html.haml +17 -0
  64. data/app/views/admin/assets/edit.html.haml +40 -0
  65. data/app/views/admin/assets/index.html.haml +15 -0
  66. data/app/views/admin/assets/new.html.haml +24 -0
  67. data/app/views/admin/assets/refresh.html.haml +14 -0
  68. data/app/views/admin/assets/remove.html.haml +16 -0
  69. data/app/views/admin/configuration/_clipped_edit.html.haml +8 -0
  70. data/app/views/admin/configuration/_clipped_show.html.haml +12 -0
  71. data/app/views/admin/page_attachments/_attachment.html.haml +25 -0
  72. data/app/views/admin/pages/_asset_popups.html.haml +37 -0
  73. data/app/views/admin/pages/_assets.html.haml +13 -0
  74. data/app/views/admin/removed/_assets_bucket.html.haml +8 -0
  75. data/app/views/admin/removed/_assets_container.html.haml +54 -0
  76. data/app/views/admin/removed/_bucket.html.haml +11 -0
  77. data/app/views/admin/removed/_bucket_asset.html.haml +9 -0
  78. data/app/views/admin/removed/_show_bucket_link.html.haml +4 -0
  79. data/app/views/admin/removed/_upload_to_page.html.haml +12 -0
  80. data/app/views/admin/removed/bucket/_iframe.html.haml +1 -0
  81. data/config/application.rb +0 -37
  82. data/config/initializers/assets.rb +1 -0
  83. data/config/initializers/interpolation.rb +6 -0
  84. data/config/initializers/kraken.rb +7 -0
  85. data/config/initializers/trusty_cms_config.rb +67 -0
  86. data/config/locales/en.yml +101 -0
  87. data/config/routes.rb +14 -3
  88. data/coverage/index.html +26 -26
  89. data/db/migrate/028_create_assets.rb +12 -0
  90. data/db/migrate/029_create_paperclip_attributes.rb +13 -0
  91. data/db/migrate/030_create_user_observer.rb +13 -0
  92. data/db/migrate/031_create_page_attachments.rb +19 -0
  93. data/db/migrate/032_rename_users.rb +13 -0
  94. data/db/migrate/20110513205050_asset_uuid.rb +11 -0
  95. data/db/migrate/20110606111250_update_configuration.rb +34 -0
  96. data/db/migrate/20110609101438_dimensions.rb +13 -0
  97. data/lib/trusty_cms.rb +1 -1
  98. data/spec/dummy/db/schema.rb +22 -0
  99. data/spec/dummy/log/test.log +95620 -0
  100. data/spec/dummy/tmp/cache/747/A70/TrustyCms%3A%3AConfig +0 -0
  101. data/spec/dummy/tmp/cache/85C/FA0/TrustyCms.cache_mtime +0 -0
  102. data/spec/dummy/tmp/capybara/capybara-20180312152412265881245.html +262 -0
  103. data/spec/dummy/tmp/capybara/capybara-201803121526139973682798.html +149 -0
  104. data/spec/factories/layout.rb +1 -1
  105. data/spec/factories/page.rb +3 -3
  106. data/spec/factories/page_part.rb +1 -1
  107. data/spec/factories/user.rb +1 -1
  108. data/spec/models/layout_spec.rb +6 -6
  109. data/spec/spec_helper.rb +4 -4
  110. data/trusty_cms.gemspec +27 -22
  111. data/vendor/extensions/clipped-extension/clipped_extension.rb +40 -0
  112. data/vendor/extensions/clipped-extension/lib/asset_tags.rb +346 -0
  113. data/vendor/extensions/clipped-extension/lib/clipped/engine.rb +11 -0
  114. data/vendor/extensions/clipped-extension/lib/clipped_admin_ui.rb +28 -0
  115. data/vendor/extensions/clipped-extension/lib/generators/templates/clipped_config.rb +53 -0
  116. data/vendor/extensions/clipped-extension/lib/page_asset_associations.rb +13 -0
  117. data/vendor/extensions/clipped-extension/lib/paperclip/frame_grab.rb +73 -0
  118. data/vendor/extensions/clipped-extension/lib/paperclip/geometry_transformation.rb +80 -0
  119. data/vendor/extensions/clipped-extension/lib/tasks/clipped_extension_tasks.rake +124 -0
  120. data/vendor/extensions/clipped-extension/lib/tasks/paperclip_tasks.rake +79 -0
  121. data/vendor/extensions/clipped-extension/lib/trusty-clipped-extension.rb +2 -0
  122. data/vendor/extensions/clipped-extension/lib/trusty_cms_clipped_extension/cloud.rb +41 -0
  123. metadata +219 -67
  124. data/config/initializers/ckeditor.rb +0 -3
  125. data/config/initializers/haml.rb +0 -2
  126. data/config/initializers/rails_patch.rb +0 -2
  127. data/config/initializers/string_extensions.rb +0 -1
  128. data/config/initializers/symbol_extensions.rb +0 -1
@@ -0,0 +1,19 @@
1
+ class CreatePageAttachments < ActiveRecord::Migration[5.1]
2
+ def self.up
3
+ # See if a page_attachments table from the original 'page_attachments' extension already exists
4
+ # If so, rename the table to old_page_attachments so they can be migrated later
5
+ if self.connection.tables.include?('page_attachments')
6
+ rename_table :page_attachments, :old_page_attachments
7
+ end
8
+ create_table :page_attachments do |t|
9
+ t.column :asset_id, :integer
10
+ t.column :page_id, :integer
11
+ t.column :position, :integer
12
+ end
13
+
14
+ end
15
+
16
+ def self.down
17
+ drop_table :page_attachments
18
+ end
19
+ end
@@ -0,0 +1,13 @@
1
+ class RenameUsers < ActiveRecord::Migration[5.1]
2
+
3
+ def self.up
4
+ rename_column :assets, :created_by, :created_by_id
5
+ rename_column :assets, :updated_by, :updated_by_id
6
+ end
7
+
8
+ def self.down
9
+ rename_column :assets, :created_by_id, :created_by
10
+ rename_column :assets, :updated_by_id, :updated_by
11
+ end
12
+
13
+ end
@@ -0,0 +1,11 @@
1
+ class AssetUuid < ActiveRecord::Migration[5.1]
2
+ def self.up
3
+ add_column :assets, :uuid, :string
4
+ Asset.reset_column_information
5
+ Asset.all.each { |a| a.save! } # triggers assign_uuid
6
+ end
7
+
8
+ def self.down
9
+ remove_column :assets, :uuid
10
+ end
11
+ end
@@ -0,0 +1,34 @@
1
+ class UpdateConfiguration < ActiveRecord::Migration[5.1]
2
+ def self.up
3
+ if TrustyCms.config.table_exists?
4
+
5
+ puts "Importing paperclip configuration"
6
+ %w{url path skip_filetype_validation storage}.select{|k| !!TrustyCms.config["assets.#{k}"] }.each do |k|
7
+ begin
8
+ TrustyCms.config["paperclip.#{k}"] = TrustyCms.config["assets.#{k}"]
9
+ rescue ActiveRecord::RecordInvalid => e
10
+ print "Oops! There was trouble setting #{k} to '#{TrustyCms.config["assets.#{k}"]}'"
11
+ print "\nSetting it to 'fog'. Please see the clipped extension README for more details."
12
+ TrustyCms.config["paperclip.#{k}"] = 'fog'
13
+ end
14
+ end
15
+
16
+ puts "Importing s3 storage configuration"
17
+ %w{bucket key secret host_alias}.select{|k| !!TrustyCms.config["assets.s3.#{k}"] }.each do |k|
18
+ TrustyCms.config["paperclip.s3.#{k}"] = TrustyCms.config["assets.s3.#{k}"]
19
+ end
20
+
21
+ puts "Importing thumbnail configuration"
22
+ if thumbnails = TrustyCms.config["assets.additional_thumbnails"]
23
+ old_styles = thumbnails.to_s.gsub(' ','').split(',').collect{|s| s.split('=')}.inject({}) {|ha, (k, v)| ha[k.to_sym] = v; ha}
24
+ new_styles = old_styles.map {|k,v| "#{k}:size=#{v}"}
25
+ TrustyCms.config["assets.thumbnails.image"] = new_styles.join("|")
26
+ TrustyCms.config["assets.thumbnails.video"] = new_styles.map{|s| "#{s},format=jpg"}.join("|")
27
+ TrustyCms.config["assets.thumbnails.pdf"] = new_styles.map{|s| "#{s},format=jpg"}.join("|")
28
+ end
29
+ end
30
+ end
31
+
32
+ def self.down
33
+ end
34
+ end
@@ -0,0 +1,13 @@
1
+ class Dimensions < ActiveRecord::Migration[5.1]
2
+ def self.up
3
+ add_column :assets, :original_width, :integer
4
+ add_column :assets, :original_height, :integer
5
+ add_column :assets, :original_extension, :string
6
+ end
7
+
8
+ def self.down
9
+ remove_column :assets, :original_width
10
+ remove_column :assets, :original_height
11
+ remove_column :assets, :original_extension
12
+ end
13
+ end
data/lib/trusty_cms.rb CHANGED
@@ -2,6 +2,6 @@ TRUSTY_CMS_ROOT = File.expand_path(File.join(File.dirname(__FILE__), "..")) unle
2
2
 
3
3
  unless defined? TrustyCms::VERSION
4
4
  module TrustyCms
5
- VERSION = '3.1.11'
5
+ VERSION = '3.2.0'
6
6
  end
7
7
  end
@@ -12,6 +12,22 @@
12
12
 
13
13
  ActiveRecord::Schema.define(version: 20161027141250) do
14
14
 
15
+ create_table "assets", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8" do |t|
16
+ t.string "caption"
17
+ t.string "title"
18
+ t.string "asset_file_name"
19
+ t.string "asset_content_type"
20
+ t.integer "asset_file_size"
21
+ t.integer "created_by_id"
22
+ t.integer "updated_by_id"
23
+ t.datetime "created_at"
24
+ t.datetime "updated_at"
25
+ t.string "uuid"
26
+ t.integer "original_width"
27
+ t.integer "original_height"
28
+ t.string "original_extension"
29
+ end
30
+
15
31
  create_table "config", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8" do |t|
16
32
  t.string "key", limit: 40, default: "", null: false
17
33
  t.string "value", default: ""
@@ -36,6 +52,12 @@ ActiveRecord::Schema.define(version: 20161027141250) do
36
52
  t.integer "site_id"
37
53
  end
38
54
 
55
+ create_table "page_attachments", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8" do |t|
56
+ t.integer "asset_id"
57
+ t.integer "page_id"
58
+ t.integer "position"
59
+ end
60
+
39
61
  create_table "page_fields", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8" do |t|
40
62
  t.integer "page_id"
41
63
  t.string "name"