locomotivecms 4.0.3 → 4.1.0.rc1
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 -1
- data/app/api/locomotive/api/forms/content_type_form.rb +2 -1
- data/app/api/locomotive/api/forms/site_form.rb +1 -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 +1 -1
- data/app/api/locomotive/api/resources/site_resource.rb +3 -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_type/import.rb +124 -0
- 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 +2 -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_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/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/locomotive/configuration.rb +1 -0
- data/lib/locomotive/dragonfly.rb +6 -4
- data/lib/locomotive/version.rb +1 -1
- metadata +38 -29
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9ac2bdf950937bd4a07418b142bb21eea251c24db4b5682b8412a9c718374343
|
4
|
+
data.tar.gz: 1546625baf49879c2c70209e5f3df46f0290b689f28c141135e8d52019c3b065
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d2e672fcec21c3eecba19c80fc7d1bc35f56488d57bc59f43cd2cde49946e71f900b826bef17c5255037b598f1ce4bdc912623d9b09fc477c95112e1d8ac2380
|
7
|
+
data.tar.gz: 9226f4e89892f1e2d66b6f6b74d71981462f53e4969de3a5b09042316e2de20ac578dc9286165055b87066978b37b6a1883bb6da62f5de26173e603d6f3ba3b6
|
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 || []
|
@@ -7,7 +7,7 @@ module Locomotive
|
|
7
7
|
expose :name, :handle, :seo_title, :meta_keywords, :meta_description,
|
8
8
|
:robots_txt, :cache_enabled, :private_access
|
9
9
|
|
10
|
-
expose :locales, :prefix_default_locale, :bypass_browser_locale, :domains, :asset_host, :url_redirections
|
10
|
+
expose :locales, :prefix_default_locale, :bypass_browser_locale, :domains, :asset_host, :url_redirections, :overwrite_same_content_assets
|
11
11
|
|
12
12
|
expose :memberships, using: MembershipEntity
|
13
13
|
|
@@ -10,6 +10,7 @@ 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
|
13
14
|
|
14
15
|
# Make sure locales and domains are in arrays.
|
15
16
|
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,7 @@ module Locomotive
|
|
47
47
|
optional :asset_host
|
48
48
|
optional :sections_content
|
49
49
|
optional :routes
|
50
|
+
optional :overwrite_same_content_assets
|
50
51
|
end
|
51
52
|
end
|
52
53
|
put do
|
@@ -58,7 +59,6 @@ module Locomotive
|
|
58
59
|
present current_site, with: entity_klass
|
59
60
|
end
|
60
61
|
|
61
|
-
|
62
62
|
desc "Delete current site"
|
63
63
|
delete do
|
64
64
|
authorize current_site, :destroy?
|
@@ -76,6 +76,7 @@ module Locomotive
|
|
76
76
|
optional :asset_host
|
77
77
|
optional :sections_content
|
78
78
|
optional :routes
|
79
|
+
optional :overwrite_same_content_assets
|
79
80
|
end
|
80
81
|
end
|
81
82
|
post do
|
@@ -113,11 +114,12 @@ module Locomotive
|
|
113
114
|
optional :asset_host
|
114
115
|
optional :sections_content
|
115
116
|
optional :routes
|
117
|
+
optional :overwrite_same_content_assets
|
116
118
|
end
|
117
119
|
end
|
118
120
|
put ':id' do
|
119
121
|
site = load_site
|
120
|
-
authorize site, :update?
|
122
|
+
authorize site, :update?
|
121
123
|
|
122
124
|
site_form = Forms::SiteForm.new(permitted_params_from_policy(site, :site, [:picture], [:metafields_ui, :metafields_schema, :metafields, :routes, :sections_content]))
|
123
125
|
service.update!(site, site_form.serializable_hash)
|