locomotivecms 4.0.3 → 4.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +3 -0
- data/app/api/locomotive/api/entities/content_type_entity.rb +1 -1
- data/app/api/locomotive/api/entities/site_entity.rb +1 -0
- data/app/api/locomotive/api/forms/content_type_form.rb +2 -1
- data/app/api/locomotive/api/forms/site_form.rb +2 -0
- data/app/api/locomotive/api/helpers/persistence_helper.rb +1 -1
- data/app/api/locomotive/api/resources/content_asset_resource.rb +6 -0
- data/app/api/locomotive/api/resources/content_type_resource.rb +2 -0
- data/app/api/locomotive/api/resources/current_site_resource.rb +2 -1
- data/app/api/locomotive/api/resources/site_resource.rb +5 -1
- data/app/assets/javascripts/locomotive/editor.js +7819 -100
- data/app/assets/javascripts/locomotive/views/content_entry_imports/new_view.js.coffee +12 -0
- data/app/assets/javascripts/locomotive/views/content_entry_imports/show_view.js.coffee +8 -0
- data/app/assets/stylesheets/locomotive/application.scss +2 -0
- data/app/assets/stylesheets/locomotive/editor.css +105 -12
- data/app/assets/stylesheets/locomotive/new/_dashboard.scss +20 -0
- data/app/assets/stylesheets/locomotive/old/_content_assets.scss +1 -1
- data/app/controllers/locomotive/content_assets_controller.rb +1 -1
- data/app/controllers/locomotive/content_entry_imports_controller.rb +50 -0
- data/app/helpers/locomotive/base_helper.rb +1 -1
- data/app/helpers/locomotive/shared/pages_helper.rb +1 -1
- data/app/jobs/locomotive/import_content_entry_job.rb +12 -0
- data/app/mailers/locomotive/notifications.rb +37 -11
- data/app/models/locomotive/account.rb +1 -0
- data/app/models/locomotive/concerns/asset/vignette.rb +7 -5
- data/app/models/locomotive/concerns/content_entry/slug.rb +7 -2
- data/app/models/locomotive/concerns/content_type/import.rb +124 -0
- data/app/models/locomotive/concerns/shared/slug.rb +3 -3
- data/app/models/locomotive/concerns/site/metafields.rb +26 -0
- data/app/models/locomotive/content_asset.rb +9 -2
- data/app/models/locomotive/content_type.rb +1 -0
- data/app/models/locomotive/section.rb +3 -1
- data/app/models/locomotive/site.rb +3 -0
- data/app/policies/locomotive/content_entry_policy.rb +1 -2
- data/app/policies/locomotive/content_type_policy.rb +3 -0
- data/app/policies/locomotive/site_policy.rb +5 -3
- data/app/services/locomotive/content_asset_service.rb +27 -4
- data/app/services/locomotive/content_entry_import_service.rb +107 -0
- data/app/services/locomotive/content_entry_service.rb +1 -1
- data/app/uploaders/locomotive/picture_uploader.rb +1 -1
- data/app/uploaders/locomotive/theme_asset_uploader.rb +1 -1
- data/app/views/locomotive/content_assets/_dropzone.html.slim +5 -1
- data/app/views/locomotive/content_assets/_list.html.slim +2 -2
- data/app/views/locomotive/content_entries/index.html.slim +8 -0
- data/app/views/locomotive/content_entry_imports/new.html.slim +23 -0
- data/app/views/locomotive/content_entry_imports/show.html.slim +54 -0
- data/app/views/locomotive/current_site/form/_advanced.html.slim +2 -0
- data/app/views/locomotive/page_content/edit.html.erb +1 -0
- data/app/views/locomotive/shared/account/_head.html.slim +2 -0
- data/app/views/locomotive/shared/account/_main_app_head.html.slim +1 -0
- data/config/locales/editor.en.yml +22 -0
- data/config/locales/editor.fr.yml +22 -0
- data/config/locales/en.yml +19 -0
- data/config/locales/es.yml +2 -0
- data/config/locales/flash.en.yml +6 -0
- data/config/locales/mongoid.en.yml +5 -1
- data/config/locales/mongoid.es.yml +4 -0
- data/config/locales/simple_form.en.yml +13 -1
- data/config/locales/simple_form.es.yml +2 -0
- data/config/routes.rb +3 -2
- data/lib/generators/locomotive/install/templates/carrierwave_aws.rb +5 -0
- data/lib/generators/locomotive/install/templates/locomotive.rb +5 -1
- data/lib/locomotive/configuration.rb +3 -0
- data/lib/locomotive/core_ext.rb +21 -0
- data/lib/locomotive/dragonfly.rb +6 -4
- data/lib/locomotive/steam_adaptor.rb +9 -5
- data/lib/locomotive/version.rb +1 -1
- metadata +37 -27
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f262308ca535c2fab8094e923bcfa830cccd8d47412c017354d3d41698545af0
|
4
|
+
data.tar.gz: 2dfc9cee2bb9d8543abb64ad496a5659baa8cbe7d47f22f7b74dabb7a0e79cdc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 42b05ebe723bd5b2e84ab6a8b405677e7dec0e17f33702eafae56d4882dc9ad7691be902a17d273193e8199cf8311579f178c5a8791e0fcf2bb5fd95e2f0f068
|
7
|
+
data.tar.gz: 9aea9657f2b6a396e6fc749273c223b480d775add9827ff418760cbcebb037af3adfa7bdc117dca1d9eca78c6252216acde6da435c1e2d9f4982ae18a649666a
|
data/Rakefile
CHANGED
@@ -9,7 +9,7 @@ module Locomotive
|
|
9
9
|
:public_submission_accounts,
|
10
10
|
:public_submission_title_template,
|
11
11
|
:recaptcha_required,
|
12
|
-
:entry_template, :display_settings, :filter_fields
|
12
|
+
:entry_template, :display_settings, :filter_fields, :import_enabled
|
13
13
|
|
14
14
|
expose :fields, using: ContentTypeFieldEntity do |content_type, _|
|
15
15
|
content_type.ordered_entries_custom_fields || []
|
@@ -8,6 +8,7 @@ module Locomotive
|
|
8
8
|
:robots_txt, :cache_enabled, :private_access
|
9
9
|
|
10
10
|
expose :locales, :prefix_default_locale, :bypass_browser_locale, :domains, :asset_host, :url_redirections
|
11
|
+
expose :overwrite_same_content_assets, :allow_dots_in_slugs
|
11
12
|
|
12
13
|
expose :memberships, using: MembershipEntity
|
13
14
|
|
@@ -10,6 +10,8 @@ module Locomotive
|
|
10
10
|
attrs :seo_title, :meta_keywords, :meta_description, localized: true
|
11
11
|
attrs :cache_enabled, :cache_control, :cache_vary
|
12
12
|
attrs :sections_content
|
13
|
+
attrs :overwrite_same_content_assets
|
14
|
+
attrs :allow_dots_in_slugs
|
13
15
|
|
14
16
|
# Make sure locales and domains are in arrays.
|
15
17
|
def locales
|
@@ -118,7 +118,7 @@ module Locomotive
|
|
118
118
|
def setup_singular_getter_method
|
119
119
|
self.class.send(:define_method, singular) do
|
120
120
|
instance_variable = "@#{singular}"
|
121
|
-
if instance_variable_defined?(instance_variable)
|
121
|
+
if instance_variable_defined?(instance_variable)
|
122
122
|
instance_variable_get(instance_variable)
|
123
123
|
else
|
124
124
|
if params[:id]
|
@@ -40,7 +40,13 @@ module Locomotive
|
|
40
40
|
end
|
41
41
|
post do
|
42
42
|
authorize ContentAsset, :create?
|
43
|
+
|
43
44
|
form = form_klass.new(content_asset_params)
|
45
|
+
|
46
|
+
if current_site.overwrite_same_content_assets?
|
47
|
+
self.content_asset = content_assets.by_exact_filename(form.source['filename']).first || content_assets.new
|
48
|
+
end
|
49
|
+
|
44
50
|
persist_from_form(form)
|
45
51
|
|
46
52
|
present content_asset, with: entity_klass
|
@@ -70,6 +70,7 @@ module Locomotive
|
|
70
70
|
optional :public_submission_account_emails
|
71
71
|
optional :public_submission_title_template
|
72
72
|
optional :public_submission_email_attachments
|
73
|
+
optional :import_enabled
|
73
74
|
end
|
74
75
|
end
|
75
76
|
post do
|
@@ -121,6 +122,7 @@ module Locomotive
|
|
121
122
|
optional :public_submission_title_template
|
122
123
|
optional :public_submission_email_attachments
|
123
124
|
optional :recaptcha_required
|
125
|
+
optional :import_enabled
|
124
126
|
end
|
125
127
|
end
|
126
128
|
put ':id' do
|
@@ -47,6 +47,8 @@ module Locomotive
|
|
47
47
|
optional :asset_host
|
48
48
|
optional :sections_content
|
49
49
|
optional :routes
|
50
|
+
optional :overwrite_same_content_assets
|
51
|
+
optional :allow_dots_in_slugs
|
50
52
|
end
|
51
53
|
end
|
52
54
|
put do
|
@@ -58,7 +60,6 @@ module Locomotive
|
|
58
60
|
present current_site, with: entity_klass
|
59
61
|
end
|
60
62
|
|
61
|
-
|
62
63
|
desc "Delete current site"
|
63
64
|
delete do
|
64
65
|
authorize current_site, :destroy?
|
@@ -76,6 +76,8 @@ module Locomotive
|
|
76
76
|
optional :asset_host
|
77
77
|
optional :sections_content
|
78
78
|
optional :routes
|
79
|
+
optional :overwrite_same_content_assets
|
80
|
+
optional :allow_dots_in_slugs
|
79
81
|
end
|
80
82
|
end
|
81
83
|
post do
|
@@ -113,11 +115,13 @@ module Locomotive
|
|
113
115
|
optional :asset_host
|
114
116
|
optional :sections_content
|
115
117
|
optional :routes
|
118
|
+
optional :overwrite_same_content_assets
|
119
|
+
optional :allow_dots_in_slugs
|
116
120
|
end
|
117
121
|
end
|
118
122
|
put ':id' do
|
119
123
|
site = load_site
|
120
|
-
authorize site, :update?
|
124
|
+
authorize site, :update?
|
121
125
|
|
122
126
|
site_form = Forms::SiteForm.new(permitted_params_from_policy(site, :site, [:picture], [:metafields_ui, :metafields_schema, :metafields, :routes, :sections_content]))
|
123
127
|
service.update!(site, site_form.serializable_hash)
|