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,54 @@
1
+ - @stylesheets << 'admin/assets'
2
+ = javascript_include_tag 'admin/assets_admin'
3
+
4
+ #assets-container
5
+ #asset-tabs
6
+ - render_region :asset_tabs do |asset_tabs|
7
+ - if @page && !@page.new_record?
8
+ - asset_tabs.attachment_tab do
9
+ %a.asset-tab{ :href => "#page-attachments", :id => "tab_page-attachments" }
10
+ = t("clipped_extension.attached_assets")
11
+ - asset_tabs.upload_tab do
12
+ %a.asset-tab{ :href => "#upload_assets", :id => "tab_upload_assets" }
13
+ = t("clipped_extension.upload")
14
+ - asset_tabs.bucket_tab do
15
+ %a.asset-tab{ :href => "#bucket", :id => "tab_bucket" }
16
+ = t("clipped_extension.bucket")
17
+ - asset_tabs.search_tab do
18
+ %a.asset-tab{ :href => "#search-assets" }
19
+ = t("clipped_extension.search")
20
+ - else
21
+ - asset_tabs.bucket_tab do
22
+ %a.asset-tab.here{ :href => "#" }
23
+ = t("clipped_extension.bucket")
24
+ - if @page && !@page.new_record?
25
+ - render_region :asset_panes do |asset_panes|
26
+
27
+ - asset_panes.page_attachments do
28
+ #page-attachments.pane
29
+ %p
30
+ %span.note
31
+ != t("clipped_extension.asset_note")
32
+ %ul#attachments
33
+ = render :partial => "admin/assets/page_assets"
34
+ .clear
35
+
36
+ - asset_panes.upload do
37
+ #upload_assets.pane
38
+ %p
39
+ %span.note
40
+ != t("clipped_extension.asset_page_upload_note")
41
+ = render :partial => "admin/assets/upload_to_page"
42
+ .clear
43
+ - asset_panes.search do
44
+ #search-assets.pane
45
+ - form_tag do
46
+ %p
47
+ %label.note{ :for => 'search' }
48
+ = t("clipped_extension.search_assets")
49
+ %input{ :type => "hidden", :name => "search", :value => @page.id }
50
+ %input{ :type => "search", :id => "search", :name => "search" }
51
+ = submit_tag t("clipped_extension.search")
52
+ #search-results
53
+ .clear
54
+ = observe_field 'search', :frequency => 1, :update => 'search-results', :url => admin_assets_path(:asset_page => @page), :method => 'get', :with => "'search=' + escape(value)"
@@ -0,0 +1,11 @@
1
+ %ul#bucket_list
2
+ - if session[:bucket]
3
+ - session[:bucket].each do |url, info|
4
+ = render :partial => 'admin/assets/bucket_asset', :locals => { :asset_url => url, :asset_id => info[:id], :asset_type => info[:type], :asset_title => info[:title], :asset_thumbnail =>info[:thumbnail], :page => @page }
5
+ - else
6
+ %li
7
+ %p.note
8
+ = t("clipped_extension.empty_bucket")
9
+
10
+
11
+
@@ -0,0 +1,9 @@
1
+ %li
2
+
3
+ %div{ :class => "#{asset_type} asset", :id => "bucket_#{asset_id}" }
4
+ = link_to image_tag(asset_thumbnail), asset_url, :title => asset_title, :class => "bucket_link"
5
+
6
+ .info{ :id => "#{asset_id}_info" }
7
+ = link_to image('assets/edit'), edit_admin_asset_url(asset_id), :class => "edit_asset", :title => t("clipped_extension.edit_asset", :asset => asset_title)
8
+ - if page && !page.new_record?
9
+ = link_to image('assets/add'), attach_page_asset_url(:asset => asset_id, :page => page.id), :class => "add_asset", :title => t("clipped_extension.attach_to_page")
@@ -0,0 +1,4 @@
1
+ - unless @page.nil? || @page.new_record?
2
+ %span#show-bucket
3
+ = t('clipped_extension.bucket')
4
+ = link_to t("clipped_extension.show_assets_bucket"), "#"
@@ -0,0 +1,12 @@
1
+ #upload-form
2
+ - form_for :asset, :url => admin_assets_path(:page => @page, :format => 'js'), :html => { :id => 'asset-upload', :method => "post", :multipart => true, :target => 'ulframe' } do |form|
3
+ %div.file
4
+ %label.upload
5
+ = t("clipped_extension.choose_upload")
6
+ = form.file_field :asset, :class => "", :style => "width: 100%"
7
+
8
+ .upload-buttons
9
+ = form.submit t("clipped_extension.save_and_upload"), :class => "button"
10
+ %div.spinner
11
+
12
+ %iframe{:id => 'ulframe', :name => "ulframe", :src => "about:blank"}
@@ -0,0 +1 @@
1
+ = render :partial => 'admin/assets/asset', :object => asset, :locals => {:dom_id => "attachment_#{asset.id}" }
@@ -12,10 +12,7 @@ require 'trustygems'
12
12
 
13
13
 
14
14
  if defined?(Bundler)
15
- # If you precompile assets before deploying to production, use this line
16
15
  Bundler.require(*Rails.groups(:assets => %w(development test)))
17
- # If you want your assets lazily compiled in production, use this line
18
- # Bundler.require(:default, :assets, Rails.env)
19
16
  end
20
17
 
21
18
  module TrustyCms
@@ -47,40 +44,6 @@ module TrustyCms
47
44
 
48
45
  config.encoding = 'utf-8'
49
46
 
50
- # Skip frameworks you're not going to use (only works if using vendor/rails).
51
- # To use Rails without a database, you must remove the Active Record framework
52
- # config.frameworks -= [ :action_mailer ]
53
-
54
- # Only load the extensions named here, in the order given. By default all
55
- # extensions in vendor/extensions are loaded, in alphabetical order. :all
56
- # can be used as a placeholder for all extensions not explicitly named.
57
- # config.extensions = [ :all ]
58
-
59
- # By default, only English translations are loaded. Remove any of these from
60
- # the list below if you'd like to provide any of the additional options
61
- # config.ignore_extensions []
62
-
63
- # Comment out this line if you want to turn off all caching, or
64
- # add options to modify the behavior. In the majority of deployment
65
- # scenarios it is desirable to leave TrustyCms's cache enabled and in
66
- # the default configuration.
67
- #
68
- # Additional options:
69
- # :use_x_sendfile => true
70
- # Turns on X-Sendfile support for Apache with mod_xsendfile or lighttpd.
71
- # :use_x_accel_redirect => '/some/virtual/path'
72
- # Turns on X-Accel-Redirect support for nginx. You have to provide
73
- # a path that corresponds to a virtual location in your webserver
74
- # configuration.
75
- # :entitystore => "radiant:tmp/cache/entity"
76
- # Sets the entity store type (preceding the colon) and storage
77
- # location (following the colon, relative to Rails.root).
78
- # We recommend you use radiant: since this will enable manual expiration.
79
- # :metastore => "radiant:tmp/cache/meta"
80
- # Sets the meta store type and storage location. We recommend you use
81
- # radiant: since this will enable manual expiration and acceleration headers.
82
-
83
-
84
47
  config.middleware.use Rack::Cache,
85
48
  :private_headers => ['Authorization'],
86
49
  :entitystore => "radiant:tmp/cache/entity",
@@ -1,3 +1,4 @@
1
1
  Rails.application.config.assets.paths << Rails.root.join('node_modules')
2
2
  Rails.application.config.assets.precompile += ['*.png',
3
3
  '*.gif']
4
+ Rails.application.config.assets.precompile += %w(admin/assets.css admin/assets_admin.js)
@@ -0,0 +1,6 @@
1
+ require 'paperclip'
2
+
3
+ Paperclip.interpolates :no_original_style do |attachment, style|
4
+ style ||= :original
5
+ style == attachment.default_style ? nil : "_#{style}"
6
+ end
@@ -0,0 +1,7 @@
1
+ require 'rubygems'
2
+ require 'kraken-io'
3
+
4
+ $kraken = Kraken::API.new(
5
+ :api_key => ENV['KRAKEN_KEY'],
6
+ :api_secret => ENV['KRAKEN_SECRET']
7
+ )
@@ -1,4 +1,5 @@
1
1
  require 'multi_site/engine'
2
+ require 'clipped/engine'
2
3
 
3
4
  TrustyCms.config do |config|
4
5
  config.define 'admin.title', :default => "TrustyCms CMS"
@@ -19,6 +20,72 @@ TrustyCms.config do |config|
19
20
  require 'multi_site/scoped_validation'
20
21
  end
21
22
 
23
+ TrustyCms.config do |config|
24
+ config.namespace 'paperclip' do |pc|
25
+ pc.define 'url', :default => '/system/:attachment/:id/:style/:basename:no_original_style.:extension', :allow_change => true
26
+ pc.define 'path', :default => ':rails_root/public/system/:attachment/:id/:style/:basename:no_original_style.:extension', :allow_change => true
27
+ pc.define 'skip_filetype_validation', :default => true, :type => :boolean
28
+ pc.define 'storage', :default => 'filesystem',
29
+ :select_from => {
30
+ 'File System' => 'filesystem',
31
+ 'Amazon S3' => 'fog',
32
+ 'Google Storage' => 'fog',
33
+ 'Rackspace Cloud Files' => 'fog'
34
+ },
35
+ :allow_blank => false,
36
+ :allow_display => false
37
+
38
+ pc.namespace 'fog' do |fog|
39
+ fog.define 'provider', :select_from => {
40
+ 'Amazon S3' => 'AWS',
41
+ 'Google Storage' => 'Google',
42
+ 'Rackspace Cloud Files' => 'Rackspace'
43
+ }
44
+ fog.define 'directory'
45
+ fog.define 'public?', :default => true
46
+ fog.define 'host'
47
+ end
48
+
49
+ pc.namespace 'google_storage' do |gs|
50
+ gs.define 'access_key_id'
51
+ gs.define 'secret_access_key'
52
+ end
53
+
54
+ pc.namespace 'rackspace' do |rs|
55
+ rs.define 'username'
56
+ rs.define 'api_key'
57
+ end
58
+
59
+ pc.namespace 's3' do |s3|
60
+ s3.define 'key'
61
+ s3.define 'secret'
62
+ s3.define 'region', :select_from => {
63
+ 'Asia North East' => 'ap-northeast-1',
64
+ 'Asia South East' => 'ap-southeast-1',
65
+ 'EU West' => 'eu-west-1',
66
+ 'US East' => 'us-east-1',
67
+ 'US West' => 'us-west-1'
68
+ }
69
+ end
70
+ end
71
+
72
+ config.namespace 'assets', :allow_display => false do |assets|
73
+ assets.define 'create_image_thumbnails?', :default => 'true'
74
+ assets.define 'create_video_thumbnails?', :default => 'true'
75
+ assets.define 'create_pdf_thumbnails?', :default => 'true'
76
+
77
+ assets.namespace 'thumbnails' do |thumbs| # NB :icon and :thumbnail are already defined as fixed formats for use in the admin interface and can't be changed
78
+ thumbs.define 'image', :default => 'normal:size=640x640>|small:size=320x320>'
79
+ thumbs.define 'video', :default => 'normal:size=640x640>,format=jpg|small:size=320x320>,format=jpg'
80
+ thumbs.define 'pdf', :default => 'normal:size=640x640>,format=jpg|small:size=320x320>,format=jpg'
81
+ end
82
+
83
+ assets.define 'max_asset_size', :default => 5, :type => :integer, :units => 'MB'
84
+ assets.define 'display_size', :default => 'normal', :allow_blank => true
85
+ assets.define 'insertion_size', :default => 'normal', :allow_blank => true
86
+ end
87
+ end
88
+
22
89
  if TrustyCms.config_definitions['defaults.snippet.filter'].nil?
23
90
  TrustyCms.config.define 'defaults.snippet.filter', :select_from => lambda { TextFilter.descendants.map { |s| s.filter_name }.sort }, :allow_blank => true
24
91
  end
@@ -13,6 +13,10 @@ en:
13
13
  too_long: 'this must not be longer than %{count} characters' # character_limit
14
14
  too_short: 'this must be at least %{count} characters long' # character_minimum
15
15
  models:
16
+ asset:
17
+ attributes:
18
+ asset:
19
+ blank: 'You must choose a file to upload!'
16
20
  page:
17
21
  attributes:
18
22
  slug:
@@ -30,6 +34,19 @@ en:
30
34
  add_part: 'Add Part'
31
35
  add_tab: 'Add Tab'
32
36
  admin: 'Administrator'
37
+ assets: 'Assets'
38
+ asset_types:
39
+ all: 'All'
40
+ documents: 'Documents'
41
+ fonts: 'Fonts'
42
+ images: 'Images'
43
+ others: 'Others'
44
+ audios: 'Audio'
45
+ flashes: 'Flash'
46
+ fonts: 'Fonts'
47
+ videos: 'Video'
48
+ pdfs: 'PDFs'
49
+ swfs: 'Flash'
33
50
  available_tags: 'Available Tags'
34
51
  available_tags_for: 'Available Tags for %{name}'
35
52
  body: 'Body'
@@ -40,10 +57,94 @@ en:
40
57
  save_changes: 'Save Changes'
41
58
  cancel: 'Cancel'
42
59
  change: 'Change'
60
+ clipped_extension:
61
+ actions: Actions
62
+ all: 'All'
63
+ all_thumbnails_refreshed: 'All asset thumbnails refreshed.'
64
+ alt_text_or_title: 'Set Asset Title <span class="hint">(optional)</span>'
65
+ asset: 'Asset'
66
+ asset_edit_title: 'Edit Asset'
67
+ asset_errors: 'Sorry. {{errors}}'
68
+ asset_page_attachment_note: 'Attached assets. These can be inserted with drag and drop or shown with the <code>&lt;r:assets:each /&gt;</code> tag.'
69
+ asset_note: 'Attached assets. '
70
+ assets: 'Assets'
71
+ assets_explanation: 'Assets and images can be uploaded and then attached or inserted into pages, snippets and layouts. Click on a asset name above to edit it or click <code>Remove</code> to delete it.'
72
+ assets_title: 'Assets'
73
+ asset_page_upload_note: 'Assets uploaded here will be automatically associated with this page.'
74
+ asset_upload_note: 'Choose an asset to upload here. If the <code>Title</code> field is left blank, the filename (without the file type) will be automatically added. By clicking on <code>More</code>, you can add a caption as well.'
75
+ attached_assets: 'Attached Assets'
76
+ attach: 'Attach'
77
+ attach_asset: 'attach asset'
78
+ attach_assets: 'Attach assets'
79
+ attach_existing: 'Attach Existing Assets'
80
+ attach_to_page: 'Attach to page'
81
+ audio: 'Audio'
82
+ cancel_attachment: 'Unattach'
83
+ copy: 'Copy'
84
+ copy_alt: 'copy radius tag to clipboard'
85
+ choose_file: 'Choose File'
86
+ documents: 'Documents'
87
+ caption: 'Caption'
88
+ confirm_refresh_assets: 'Are you sure you want to regenerate every asset thumbnail? This is likely to take a long time and use a lot of server resources: <strong class="warning">the performance of your site is very likely to be affected</strong> and your browser may time out before the operation is complete. This is only recommended if your asset collection is small!'
89
+ confirm_remove_asset: 'Are you sure you want to permanently remove the following asset?'
90
+ confirm_remove_from_page: 'Are you sure you want to remove this assets from the page?'
91
+ delete_asset: 'Delete Asset'
92
+ detach: 'Detach'
93
+ edit: 'Edit'
94
+ edit_asset: 'Edit {{asset}}'
95
+ filename: 'Filename'
96
+ find_assets: 'Find Assets'
97
+ images: 'Images'
98
+ images_automatically_created: 'images are automatically created'
99
+ insert: 'Insert'
100
+ modify: 'Modify'
101
+ movies: 'Movies'
102
+ need_to_upload: 'Need to upload?'
103
+ new_asset: 'New Asset'
104
+ no_assets_found: 'There were no assets found'
105
+ no_assets: 'No Assets'
106
+ no_attached_assets: 'No assets attached.'
107
+ others: 'Others'
108
+ refresh_assets: 'Regenerate all thumbnails'
109
+ regenerate: 'Regenerate'
110
+ regenerate_thumbnails: 'Regenerate Thumbnails'
111
+ remove_asset: 'Remove Asset'
112
+ remove_from_page: 'Remove from page'
113
+ reorder: 'Reorder'
114
+ remove: 'Remove'
115
+ refresh_assets_rake_task: 'For better results please log into your server and run <code>rake paperclip:refresh class=Asset</code>.'
116
+ replace_file: 'Replace File'
117
+ save_and_upload: 'Save and Upload'
118
+ search_assets: 'Search for assets'
119
+ search: 'Search'
120
+ select: 'Select'
121
+ thumbnails_refreshed: "Thumbnails refreshed."
122
+ title: 'Title'
123
+ type: 'Type'
124
+ types_to_find: 'Types to find'
125
+ upload: 'Upload'
126
+ upload_asset: 'Upload Asset'
43
127
  close: 'Close'
44
128
  trusty_config:
45
129
  admin:
46
130
  title: 'admin header title'
131
+ assets:
132
+ additional_thumbnails: 'Additional Thumbnails'
133
+ content_types: 'Content Types'
134
+ create_image_thumbnails?: 'Image thumbnails'
135
+ create_pdf_thumbnails?: 'PDF thumbnails'
136
+ create_video_thumbnails?: 'Video thumbnails'
137
+ display_size: 'Display Size'
138
+ insertion_size: 'Insertion Size'
139
+ max_asset_size: 'Max Asset Size'
140
+ path: 'Path'
141
+ s3:
142
+ bucket: 'Bucket'
143
+ key: 'Key'
144
+ secret: 'Secret'
145
+ skip_filetype_validation: 'Skip Filetype Validation'
146
+ storage: 'Storage'
147
+ url: 'Url'
47
148
  defaults:
48
149
  locale: 'default language'
49
150
  page:
data/config/routes.rb CHANGED
@@ -4,12 +4,10 @@ TrustyCms::Application.routes.draw do
4
4
  get '/rad_social/mail' => 'social_mailer#social_mail_form', as: :rad_social_mail_form
5
5
  post '/rad_social/mail' => 'social_mailer#create_social_mail', as: :rad_create_social_mail
6
6
  TrustyCms::Application.config.enabled_extensions.each { |ext|
7
- #load File.join(TrustyCms::ExtensionPath.find(ext).to_s, "config", "routes.rb")
8
7
  }
9
8
  namespace :admin do
10
9
  resources :pages do
11
10
  resources :children, :controller => 'pages'
12
- #TODO: put back the remove on children possibly
13
11
  get 'remove', on: :member
14
12
  end
15
13
  resources :layouts do
@@ -23,6 +21,20 @@ TrustyCms::Application.routes.draw do
23
21
  end
24
22
  resources :password_resets
25
23
  post 'save-table-position' => "pages#save_table_position", as: "save_tables_position"
24
+
25
+ resources :assets do
26
+ get :remove, on: :member
27
+ get :refresh, on: :collection
28
+ post :regenerate, on: :collection
29
+ put :refresh, on: :member
30
+ end
31
+ resources :page_attachments, :only => [:new] do
32
+ get :remove, on: :member
33
+ end
34
+ resources :pages do
35
+ get :remove, on: :member
36
+ resources :page_attachments
37
+ end
26
38
  end
27
39
 
28
40
  match 'admin/preview' => 'admin/pages#preview', :as => :preview, :via => [:post, :put]
@@ -47,7 +59,6 @@ TrustyCms::Application.routes.draw do
47
59
  get 'admin/welcome' => 'admin/welcome#index', :as => :welcome
48
60
  match 'admin/login' => 'admin/welcome#login', :as => :login, :via => [:get, :post]
49
61
  get 'admin/logout' => 'admin/welcome#logout', :as => :logout
50
- # match '/' => 'site#show_page', :url => '/' # set root to this so root_path works
51
62
  get 'error/404' => 'site#not_found', :as => :not_found
52
63
  get 'error/500' => 'site#error', :as => :error
53
64
  get '*url' => 'site#show_page'
data/coverage/index.html CHANGED
@@ -14,7 +14,7 @@
14
14
  <img src="./assets/0.10.2/loading.gif" alt="loading"/>
15
15
  </div>
16
16
  <div id="wrapper" style="display:none;">
17
- <div class="timestamp">Generated <abbr class="timeago" title="2018-02-07T11:30:37-05:00">2018-02-07T11:30:37-05:00</abbr></div>
17
+ <div class="timestamp">Generated <abbr class="timeago" title="2018-03-30T11:37:29-04:00">2018-03-30T11:37:29-04:00</abbr></div>
18
18
  <ul class="group_tabs"></ul>
19
19
 
20
20
  <div id="content">
@@ -287,7 +287,7 @@
287
287
  <td>14</td>
288
288
  <td>14</td>
289
289
  <td>0</td>
290
- <td>21.7</td>
290
+ <td>21.9</td>
291
291
  </tr>
292
292
 
293
293
  <tr>
@@ -6414,8 +6414,8 @@
6414
6414
  <code class="ruby"> # Default Order</code>
6415
6415
  </li>
6416
6416
 
6417
- <li class="covered" data-hits="26" data-linenumber="7">
6418
- <span class="hits">26</span>
6417
+ <li class="covered" data-hits="27" data-linenumber="7">
6418
+ <span class="hits">27</span>
6419
6419
 
6420
6420
  <code class="ruby"> default_scope {order(&quot;name&quot;)}</code>
6421
6421
  </li>
@@ -6888,14 +6888,14 @@
6888
6888
  <code class="ruby"> def encrypt_password_unless_empty_or_unchanged</code>
6889
6889
  </li>
6890
6890
 
6891
- <li class="covered" data-hits="1" data-linenumber="86">
6892
- <span class="hits">1</span>
6891
+ <li class="covered" data-hits="2" data-linenumber="86">
6892
+ <span class="hits">2</span>
6893
6893
 
6894
6894
  <code class="ruby"> user = self.class.find(self.id)</code>
6895
6895
  </li>
6896
6896
 
6897
- <li class="covered" data-hits="1" data-linenumber="87">
6898
- <span class="hits">1</span>
6897
+ <li class="covered" data-hits="2" data-linenumber="87">
6898
+ <span class="hits">2</span>
6899
6899
 
6900
6900
  <code class="ruby"> case password</code>
6901
6901
  </li>
@@ -7039,8 +7039,8 @@
7039
7039
  <code class="ruby"> def current_user</code>
7040
7040
  </li>
7041
7041
 
7042
- <li class="covered" data-hits="8" data-linenumber="12">
7043
- <span class="hits">8</span>
7042
+ <li class="covered" data-hits="9" data-linenumber="12">
7043
+ <span class="hits">9</span>
7044
7044
 
7045
7045
  <code class="ruby"> self.class.current_user</code>
7046
7046
  </li>
@@ -7057,8 +7057,8 @@
7057
7057
  <code class="ruby"> def self.current_user</code>
7058
7058
  </li>
7059
7059
 
7060
- <li class="covered" data-hits="8" data-linenumber="15">
7061
- <span class="hits">8</span>
7060
+ <li class="covered" data-hits="9" data-linenumber="15">
7061
+ <span class="hits">9</span>
7062
7062
 
7063
7063
  <code class="ruby"> Thread.current[:current_user]</code>
7064
7064
  </li>
@@ -7105,8 +7105,8 @@
7105
7105
  <code class="ruby"> def before_update(model)</code>
7106
7106
  </li>
7107
7107
 
7108
- <li class="covered" data-hits="1" data-linenumber="23">
7109
- <span class="hits">1</span>
7108
+ <li class="covered" data-hits="2" data-linenumber="23">
7109
+ <span class="hits">2</span>
7110
7110
 
7111
7111
  <code class="ruby"> model.updated_by = self.current_user</code>
7112
7112
  </li>
@@ -8189,7 +8189,7 @@
8189
8189
  <li class="covered" data-hits="1" data-linenumber="1">
8190
8190
  <span class="hits">1</span>
8191
8191
 
8192
- <code class="ruby">FactoryGirl.define do</code>
8192
+ <code class="ruby">FactoryBot.define do</code>
8193
8193
  </li>
8194
8194
 
8195
8195
  <li class="never" data-hits="" data-linenumber="2">
@@ -8310,7 +8310,7 @@
8310
8310
  <li class="covered" data-hits="1" data-linenumber="1">
8311
8311
  <span class="hits">1</span>
8312
8312
 
8313
- <code class="ruby">FactoryGirl.define do</code>
8313
+ <code class="ruby">FactoryBot.define do</code>
8314
8314
  </li>
8315
8315
 
8316
8316
  <li class="covered" data-hits="1" data-linenumber="2">
@@ -8352,7 +8352,7 @@
8352
8352
  <li class="covered" data-hits="1" data-linenumber="8">
8353
8353
  <span class="hits">1</span>
8354
8354
 
8355
- <code class="ruby"> page_parts { [FactoryGirl.create(:page_part, name: &#39;body&#39;)] }</code>
8355
+ <code class="ruby"> page_parts { [FactoryBot.create(:page_part, name: &#39;body&#39;)] }</code>
8356
8356
  </li>
8357
8357
 
8358
8358
  <li class="never" data-hits="" data-linenumber="9">
@@ -8376,7 +8376,7 @@
8376
8376
  <li class="covered" data-hits="1" data-linenumber="12">
8377
8377
  <span class="hits">1</span>
8378
8378
 
8379
- <code class="ruby"> children { [FactoryGirl.create(:page, :with_parts)] }</code>
8379
+ <code class="ruby"> children { [FactoryBot.create(:page, :with_parts)] }</code>
8380
8380
  </li>
8381
8381
 
8382
8382
  <li class="never" data-hits="" data-linenumber="13">
@@ -8707,7 +8707,7 @@
8707
8707
  <li class="covered" data-hits="1" data-linenumber="1">
8708
8708
  <span class="hits">1</span>
8709
8709
 
8710
- <code class="ruby">FactoryGirl.define do</code>
8710
+ <code class="ruby">FactoryBot.define do</code>
8711
8711
  </li>
8712
8712
 
8713
8713
  <li class="never" data-hits="" data-linenumber="2">
@@ -8774,7 +8774,7 @@
8774
8774
  <li class="covered" data-hits="1" data-linenumber="1">
8775
8775
  <span class="hits">1</span>
8776
8776
 
8777
- <code class="ruby">FactoryGirl.define do</code>
8777
+ <code class="ruby">FactoryBot.define do</code>
8778
8778
  </li>
8779
8779
 
8780
8780
  <li class="covered" data-hits="1" data-linenumber="2">
@@ -10483,7 +10483,7 @@
10483
10483
  <li class="covered" data-hits="1" data-linenumber="5">
10484
10484
  <span class="hits">1</span>
10485
10485
 
10486
- <code class="ruby"> let(:layout){ FactoryGirl.build(:layout) }</code>
10486
+ <code class="ruby"> let(:layout){ FactoryBot.build(:layout) }</code>
10487
10487
  </li>
10488
10488
 
10489
10489
  <li class="never" data-hits="" data-linenumber="6">
@@ -10507,7 +10507,7 @@
10507
10507
  <li class="covered" data-hits="1" data-linenumber="9">
10508
10508
  <span class="hits">1</span>
10509
10509
 
10510
- <code class="ruby"> layout = FactoryGirl.build(:layout, name: &#39;&#39;)</code>
10510
+ <code class="ruby"> layout = FactoryBot.build(:layout, name: &#39;&#39;)</code>
10511
10511
  </li>
10512
10512
 
10513
10513
  <li class="covered" data-hits="1" data-linenumber="10">
@@ -10543,7 +10543,7 @@
10543
10543
  <li class="covered" data-hits="1" data-linenumber="15">
10544
10544
  <span class="hits">1</span>
10545
10545
 
10546
- <code class="ruby"> layout = FactoryGirl.build(:layout, name: &#39;Normal&#39;, content: &quot;Content!&quot;)</code>
10546
+ <code class="ruby"> layout = FactoryBot.build(:layout, name: &#39;Normal&#39;, content: &quot;Content!&quot;)</code>
10547
10547
  </li>
10548
10548
 
10549
10549
  <li class="covered" data-hits="1" data-linenumber="16">
@@ -10555,7 +10555,7 @@
10555
10555
  <li class="covered" data-hits="1" data-linenumber="17">
10556
10556
  <span class="hits">1</span>
10557
10557
 
10558
- <code class="ruby"> other = FactoryGirl.build(:layout, name: &#39;Normal&#39;, content: &quot;Content!&quot;)</code>
10558
+ <code class="ruby"> other = FactoryBot.build(:layout, name: &#39;Normal&#39;, content: &quot;Content!&quot;)</code>
10559
10559
  </li>
10560
10560
 
10561
10561
  <li class="covered" data-hits="2" data-linenumber="18">
@@ -10585,7 +10585,7 @@
10585
10585
  <li class="covered" data-hits="1" data-linenumber="22">
10586
10586
  <span class="hits">1</span>
10587
10587
 
10588
- <code class="ruby"> layout = FactoryGirl.build(:layout, name: &#39;x&#39; * 100)</code>
10588
+ <code class="ruby"> layout = FactoryBot.build(:layout, name: &#39;x&#39; * 100)</code>
10589
10589
  </li>
10590
10590
 
10591
10591
  <li class="covered" data-hits="1" data-linenumber="23">
@@ -10597,7 +10597,7 @@
10597
10597
  <li class="covered" data-hits="1" data-linenumber="24">
10598
10598
  <span class="hits">1</span>
10599
10599
 
10600
- <code class="ruby"> layout = FactoryGirl.build(:layout, name: &#39;x&#39; * 101)</code>
10600
+ <code class="ruby"> layout = FactoryBot.build(:layout, name: &#39;x&#39; * 101)</code>
10601
10601
  </li>
10602
10602
 
10603
10603
  <li class="covered" data-hits="2" data-linenumber="25">
@@ -0,0 +1,12 @@
1
+ class CreateAssets < ActiveRecord::Migration[5.1]
2
+ def self.up
3
+ create_table :assets do |t|
4
+ t.string :caption, :title
5
+ end
6
+
7
+ end
8
+
9
+ def self.down
10
+ drop_table :assets
11
+ end
12
+ end
@@ -0,0 +1,13 @@
1
+ class CreatePaperclipAttributes < ActiveRecord::Migration[5.1]
2
+ def self.up
3
+ add_column :assets, :asset_file_name, :string
4
+ add_column :assets, :asset_content_type, :string
5
+ add_column :assets, :asset_file_size, :integer
6
+ end
7
+
8
+ def self.down
9
+ remove_column :assets, :asset_file_name
10
+ remove_column :assets, :asset_content_type
11
+ remove_column :assets, :asset_file_size
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ class CreateUserObserver < ActiveRecord::Migration[5.1]
2
+ def self.up
3
+ add_column :assets, :created_by, :integer
4
+ add_column :assets, :updated_by, :integer
5
+ add_column :assets, :created_at, :datetime
6
+ add_column :assets, :updated_at, :datetime
7
+ end
8
+
9
+ def self.down
10
+ remove_column :assets, :created_by
11
+ remove_column :assets, :updated_by
12
+ end
13
+ end