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.
- checksums.yaml +4 -4
- data/Gemfile +9 -14
- data/Gemfile.lock +84 -70
- data/README.md +4 -0
- data/app/assets/images/admin/add.png +0 -0
- data/app/assets/images/admin/archive_icon.png +0 -0
- data/app/assets/images/admin/audio_icon.png +0 -0
- data/app/assets/images/admin/audio_thumbnail.png +0 -0
- data/app/assets/images/admin/c_icon.png +0 -0
- data/app/assets/images/admin/copy.png +0 -0
- data/app/assets/images/admin/css_icon.png +0 -0
- data/app/assets/images/admin/database_icon.png +0 -0
- data/app/assets/images/admin/delete.png +0 -0
- data/app/assets/images/admin/document_icon.png +0 -0
- data/app/assets/images/admin/document_thumbnail.png +0 -0
- data/app/assets/images/admin/flash_icon.png +0 -0
- data/app/assets/images/admin/flash_thumbnail.png +0 -0
- data/app/assets/images/admin/font_icon.png +0 -0
- data/app/assets/images/admin/gzip_icon.png +0 -0
- data/app/assets/images/admin/html_icon.png +0 -0
- data/app/assets/images/admin/image_icon.png +0 -0
- data/app/assets/images/admin/image_thumbnail.png +0 -0
- data/app/assets/images/admin/java_icon.png +0 -0
- data/app/assets/images/admin/page_edit.png +0 -0
- data/app/assets/images/admin/pdf_icon.png +0 -0
- data/app/assets/images/admin/pdf_thumbnail.png +0 -0
- data/app/assets/images/admin/perl_icon.png +0 -0
- data/app/assets/images/admin/php_icon.png +0 -0
- data/app/assets/images/admin/presentation_icon.png +0 -0
- data/app/assets/images/admin/python_icon.png +0 -0
- data/app/assets/images/admin/reorder_assets.png +0 -0
- data/app/assets/images/admin/ruby_icon.png +0 -0
- data/app/assets/images/admin/script_icon.png +0 -0
- data/app/assets/images/admin/spinner.gif +0 -0
- data/app/assets/images/admin/spreadsheet_icon.png +0 -0
- data/app/assets/images/admin/tar_icon.png +0 -0
- data/app/assets/images/admin/unknown_icon.png +0 -0
- data/app/assets/images/admin/unknown_thumbnail.png +0 -0
- data/app/assets/images/admin/video_icon.png +0 -0
- data/app/assets/images/admin/video_thumbnail.png +0 -0
- data/app/assets/images/admin/xml_icon.png +0 -0
- data/app/assets/images/admin/zip_icon.png +0 -0
- data/app/assets/javascripts/admin/assets.js +268 -0
- data/app/assets/javascripts/admin/assets_admin.js +16 -0
- data/app/assets/javascripts/admin/jquery.fileupload.js +1457 -0
- data/app/assets/javascripts/admin/jquery.iframe-transport.js +214 -0
- data/app/assets/javascripts/admin/jquery.ui.widget.js +558 -0
- data/app/assets/stylesheets/admin/assets.scss +283 -0
- data/app/controllers/admin/assets_controller.rb +88 -0
- data/app/controllers/admin/page_attachments_controller.rb +23 -0
- data/app/helpers/admin/assets_helper.rb +16 -0
- data/app/helpers/admin/page_attachments_helper.rb +2 -0
- data/app/models/asset.rb +251 -0
- data/app/models/asset_type.rb +239 -0
- data/app/models/old_page_attachment.rb +26 -0
- data/app/models/page_attachment.rb +20 -0
- data/app/views/admin/assets/_asset.html.haml +12 -0
- data/app/views/admin/assets/_asset_table.html.haml +30 -0
- data/app/views/admin/assets/_errors.html.haml +3 -0
- data/app/views/admin/assets/_form.html.haml +18 -0
- data/app/views/admin/assets/_page_assets.html.haml +12 -0
- data/app/views/admin/assets/_search.html.haml +17 -0
- data/app/views/admin/assets/_search_results.html.haml +17 -0
- data/app/views/admin/assets/edit.html.haml +40 -0
- data/app/views/admin/assets/index.html.haml +15 -0
- data/app/views/admin/assets/new.html.haml +24 -0
- data/app/views/admin/assets/refresh.html.haml +14 -0
- data/app/views/admin/assets/remove.html.haml +16 -0
- data/app/views/admin/configuration/_clipped_edit.html.haml +8 -0
- data/app/views/admin/configuration/_clipped_show.html.haml +12 -0
- data/app/views/admin/page_attachments/_attachment.html.haml +25 -0
- data/app/views/admin/pages/_asset_popups.html.haml +37 -0
- data/app/views/admin/pages/_assets.html.haml +13 -0
- data/app/views/admin/removed/_assets_bucket.html.haml +8 -0
- data/app/views/admin/removed/_assets_container.html.haml +54 -0
- data/app/views/admin/removed/_bucket.html.haml +11 -0
- data/app/views/admin/removed/_bucket_asset.html.haml +9 -0
- data/app/views/admin/removed/_show_bucket_link.html.haml +4 -0
- data/app/views/admin/removed/_upload_to_page.html.haml +12 -0
- data/app/views/admin/removed/bucket/_iframe.html.haml +1 -0
- data/config/application.rb +0 -37
- data/config/initializers/assets.rb +1 -0
- data/config/initializers/interpolation.rb +6 -0
- data/config/initializers/kraken.rb +7 -0
- data/config/initializers/trusty_cms_config.rb +67 -0
- data/config/locales/en.yml +101 -0
- data/config/routes.rb +14 -3
- data/coverage/index.html +26 -26
- data/db/migrate/028_create_assets.rb +12 -0
- data/db/migrate/029_create_paperclip_attributes.rb +13 -0
- data/db/migrate/030_create_user_observer.rb +13 -0
- data/db/migrate/031_create_page_attachments.rb +19 -0
- data/db/migrate/032_rename_users.rb +13 -0
- data/db/migrate/20110513205050_asset_uuid.rb +11 -0
- data/db/migrate/20110606111250_update_configuration.rb +34 -0
- data/db/migrate/20110609101438_dimensions.rb +13 -0
- data/lib/trusty_cms.rb +1 -1
- data/spec/dummy/db/schema.rb +22 -0
- data/spec/dummy/log/test.log +95620 -0
- data/spec/dummy/tmp/cache/747/A70/TrustyCms%3A%3AConfig +0 -0
- data/spec/dummy/tmp/cache/85C/FA0/TrustyCms.cache_mtime +0 -0
- data/spec/dummy/tmp/capybara/capybara-20180312152412265881245.html +262 -0
- data/spec/dummy/tmp/capybara/capybara-201803121526139973682798.html +149 -0
- data/spec/factories/layout.rb +1 -1
- data/spec/factories/page.rb +3 -3
- data/spec/factories/page_part.rb +1 -1
- data/spec/factories/user.rb +1 -1
- data/spec/models/layout_spec.rb +6 -6
- data/spec/spec_helper.rb +4 -4
- data/trusty_cms.gemspec +27 -22
- data/vendor/extensions/clipped-extension/clipped_extension.rb +40 -0
- data/vendor/extensions/clipped-extension/lib/asset_tags.rb +346 -0
- data/vendor/extensions/clipped-extension/lib/clipped/engine.rb +11 -0
- data/vendor/extensions/clipped-extension/lib/clipped_admin_ui.rb +28 -0
- data/vendor/extensions/clipped-extension/lib/generators/templates/clipped_config.rb +53 -0
- data/vendor/extensions/clipped-extension/lib/page_asset_associations.rb +13 -0
- data/vendor/extensions/clipped-extension/lib/paperclip/frame_grab.rb +73 -0
- data/vendor/extensions/clipped-extension/lib/paperclip/geometry_transformation.rb +80 -0
- data/vendor/extensions/clipped-extension/lib/tasks/clipped_extension_tasks.rake +124 -0
- data/vendor/extensions/clipped-extension/lib/tasks/paperclip_tasks.rake +79 -0
- data/vendor/extensions/clipped-extension/lib/trusty-clipped-extension.rb +2 -0
- data/vendor/extensions/clipped-extension/lib/trusty_cms_clipped_extension/cloud.rb +41 -0
- metadata +219 -67
- data/config/initializers/ckeditor.rb +0 -3
- data/config/initializers/haml.rb +0 -2
- data/config/initializers/rails_patch.rb +0 -2
- data/config/initializers/string_extensions.rb +0 -1
- 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,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
data/spec/dummy/db/schema.rb
CHANGED
@@ -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"
|