alchemy_cms 4.0.0.beta → 4.0.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +4 -7
- data/CHANGELOG.md +23 -0
- data/README.md +1 -1
- data/alchemy_cms.gemspec +1 -1
- data/app/assets/javascripts/alchemy/alchemy.dragndrop.js.coffee +2 -2
- data/app/assets/stylesheets/alchemy/_extends.scss +3 -5
- data/app/assets/stylesheets/alchemy/_mixins.scss +1 -1
- data/app/assets/stylesheets/alchemy/base.scss +2 -2
- data/app/assets/stylesheets/alchemy/buttons.scss +2 -2
- data/app/assets/stylesheets/alchemy/dialogs.scss +3 -3
- data/app/assets/stylesheets/alchemy/elements.scss +2 -2
- data/app/assets/stylesheets/alchemy/image_library.scss +10 -10
- data/app/assets/stylesheets/alchemy/jquery.datetimepicker.scss +2 -2
- data/app/assets/stylesheets/alchemy/lists.scss +2 -1
- data/app/assets/stylesheets/alchemy/sitemap.scss +1 -16
- data/app/assets/stylesheets/alchemy/tables.scss +1 -1
- data/app/assets/stylesheets/tinymce/skins/alchemy/skin.min.css.scss +4 -4
- data/app/controllers/alchemy/admin/attachments_controller.rb +10 -10
- data/app/controllers/alchemy/admin/base_controller.rb +10 -19
- data/app/controllers/alchemy/admin/clipboard_controller.rb +20 -7
- data/app/controllers/alchemy/admin/contents_controller.rb +5 -19
- data/app/controllers/alchemy/admin/dashboard_controller.rb +5 -3
- data/app/controllers/alchemy/admin/elements_controller.rb +7 -1
- data/app/controllers/alchemy/admin/essence_files_controller.rb +2 -2
- data/app/controllers/alchemy/admin/essence_pictures_controller.rb +8 -13
- data/app/controllers/alchemy/admin/languages_controller.rb +2 -0
- data/app/controllers/alchemy/admin/layoutpages_controller.rb +2 -0
- data/app/controllers/alchemy/admin/legacy_page_urls_controller.rb +2 -0
- data/app/controllers/alchemy/admin/pages_controller.rb +3 -1
- data/app/controllers/alchemy/admin/pictures_controller.rb +11 -9
- data/app/controllers/alchemy/admin/resources_controller.rb +25 -4
- data/app/controllers/alchemy/admin/sites_controller.rb +2 -0
- data/app/controllers/alchemy/admin/tags_controller.rb +2 -0
- data/app/controllers/alchemy/admin/trash_controller.rb +2 -0
- data/app/controllers/alchemy/api/base_controller.rb +2 -0
- data/app/controllers/alchemy/api/contents_controller.rb +2 -0
- data/app/controllers/alchemy/api/elements_controller.rb +2 -0
- data/app/controllers/alchemy/api/pages_controller.rb +2 -0
- data/app/controllers/alchemy/attachments_controller.rb +2 -0
- data/app/controllers/alchemy/base_controller.rb +3 -1
- data/app/controllers/alchemy/elements_controller.rb +2 -0
- data/app/controllers/alchemy/messages_controller.rb +2 -0
- data/app/controllers/alchemy/pages_controller.rb +11 -2
- data/app/controllers/concerns/alchemy/admin/uploader_responses.rb +2 -0
- data/app/controllers/concerns/alchemy/legacy_page_redirects.rb +2 -0
- data/app/controllers/concerns/alchemy/locale_redirects.rb +2 -0
- data/app/controllers/concerns/alchemy/page_redirects.rb +2 -0
- data/app/controllers/concerns/alchemy/site_redirects.rb +2 -0
- data/app/helpers/alchemy/admin/attachments_helper.rb +2 -0
- data/app/helpers/alchemy/admin/base_helper.rb +2 -28
- data/app/helpers/alchemy/admin/contents_helper.rb +2 -0
- data/app/helpers/alchemy/admin/elements_helper.rb +2 -0
- data/app/helpers/alchemy/admin/essences_helper.rb +2 -0
- data/app/helpers/alchemy/admin/form_helper.rb +2 -0
- data/app/helpers/alchemy/admin/navigation_helper.rb +2 -0
- data/app/helpers/alchemy/admin/pages_helper.rb +2 -0
- data/app/helpers/alchemy/admin/pictures_helper.rb +2 -0
- data/app/helpers/alchemy/admin/tags_helper.rb +24 -76
- data/app/helpers/alchemy/base_helper.rb +2 -0
- data/app/helpers/alchemy/deprecated_pages_helper.rb +2 -0
- data/app/helpers/alchemy/elements_block_helper.rb +2 -0
- data/app/helpers/alchemy/elements_helper.rb +2 -0
- data/app/helpers/alchemy/essences_helper.rb +2 -0
- data/app/helpers/alchemy/pages_helper.rb +2 -0
- data/app/helpers/alchemy/url_helper.rb +2 -0
- data/app/mailers/alchemy/base_mailer.rb +2 -0
- data/app/mailers/alchemy/messages_mailer.rb +2 -0
- data/app/models/alchemy.rb +2 -0
- data/app/models/alchemy/attachment.rb +6 -4
- data/app/models/alchemy/cell.rb +4 -2
- data/app/models/alchemy/content.rb +7 -5
- data/app/models/alchemy/content/factory.rb +7 -7
- data/app/models/alchemy/element.rb +21 -28
- data/app/models/alchemy/element/definitions.rb +4 -2
- data/app/models/alchemy/element/element_contents.rb +3 -1
- data/app/models/alchemy/element/element_essences.rb +2 -0
- data/app/models/alchemy/element/presenters.rb +2 -0
- data/app/models/alchemy/element_to_page.rb +2 -0
- data/app/models/alchemy/essence_boolean.rb +2 -0
- data/app/models/alchemy/essence_date.rb +2 -0
- data/app/models/alchemy/essence_file.rb +2 -0
- data/app/models/alchemy/essence_html.rb +2 -0
- data/app/models/alchemy/essence_link.rb +6 -4
- data/app/models/alchemy/essence_picture.rb +13 -11
- data/app/models/alchemy/essence_picture_view.rb +2 -0
- data/app/models/alchemy/essence_richtext.rb +2 -0
- data/app/models/alchemy/essence_select.rb +3 -1
- data/app/models/alchemy/essence_text.rb +6 -4
- data/app/models/alchemy/folded_page.rb +4 -2
- data/app/models/alchemy/language.rb +9 -6
- data/app/models/alchemy/language/code.rb +2 -0
- data/app/models/alchemy/legacy_page_url.rb +3 -1
- data/app/models/alchemy/message.rb +2 -0
- data/app/models/alchemy/page.rb +3 -2
- data/app/models/alchemy/page/fixed_attributes.rb +2 -0
- data/app/models/alchemy/page/page_cells.rb +2 -0
- data/app/models/alchemy/page/page_elements.rb +3 -1
- data/app/models/alchemy/page/page_naming.rb +2 -0
- data/app/models/alchemy/page/page_natures.rb +2 -1
- data/app/models/alchemy/page/page_scopes.rb +2 -0
- data/app/models/alchemy/page/page_users.rb +2 -0
- data/app/models/alchemy/picture.rb +2 -0
- data/app/models/alchemy/picture/transformations.rb +2 -0
- data/app/models/alchemy/picture/url.rb +2 -0
- data/app/models/alchemy/site.rb +4 -2
- data/app/models/alchemy/site/layout.rb +2 -0
- data/app/models/alchemy/tag.rb +5 -2
- data/app/models/alchemy/tree_node.rb +2 -0
- data/app/serializers/alchemy/attachment_serializer.rb +2 -0
- data/app/serializers/alchemy/base_serializer.rb +2 -0
- data/app/serializers/alchemy/cell_serializer.rb +2 -0
- data/app/serializers/alchemy/content_serializer.rb +2 -0
- data/app/serializers/alchemy/element_serializer.rb +2 -0
- data/app/serializers/alchemy/essence_boolean_serializer.rb +2 -0
- data/app/serializers/alchemy/essence_date_serializer.rb +2 -0
- data/app/serializers/alchemy/essence_file_serializer.rb +2 -0
- data/app/serializers/alchemy/essence_html_serializer.rb +2 -0
- data/app/serializers/alchemy/essence_link_serializer.rb +2 -0
- data/app/serializers/alchemy/essence_picture_serializer.rb +2 -0
- data/app/serializers/alchemy/essence_richtext_serializer.rb +2 -0
- data/app/serializers/alchemy/essence_select_serializer.rb +2 -0
- data/app/serializers/alchemy/essence_text_serializer.rb +2 -0
- data/app/serializers/alchemy/legacy_element_serializer.rb +2 -0
- data/app/serializers/alchemy/page_serializer.rb +2 -0
- data/app/serializers/alchemy/page_tree_serializer.rb +2 -0
- data/app/serializers/alchemy/picture_serializer.rb +2 -0
- data/app/views/alchemy/admin/attachments/_archive_overlay.html.erb +1 -1
- data/app/views/alchemy/admin/attachments/_file_to_assign.html.erb +1 -1
- data/app/views/alchemy/admin/attachments/_filter_bar.html.erb +1 -3
- data/app/views/alchemy/admin/attachments/_tag_list.html.erb +1 -1
- data/app/views/alchemy/admin/contents/_missing.html.erb +1 -1
- data/app/views/alchemy/admin/contents/create.js.erb +9 -13
- data/app/views/alchemy/admin/contents/new.html.erb +1 -1
- data/app/views/alchemy/admin/elements/_picture_gallery_editor.html.erb +4 -4
- data/app/views/alchemy/admin/essence_files/assign.js.erb +1 -1
- data/app/views/alchemy/admin/essence_pictures/assign.js.erb +1 -1
- data/app/views/alchemy/admin/essence_pictures/crop.html.erb +1 -1
- data/app/views/alchemy/admin/essence_pictures/destroy.js.erb +10 -7
- data/app/views/alchemy/admin/essence_pictures/edit.html.erb +8 -6
- data/app/views/alchemy/admin/essence_pictures/update.js.erb +1 -1
- data/app/views/alchemy/admin/partials/_remote_search_form.html.erb +2 -2
- data/app/views/alchemy/admin/pictures/_filter_and_size_bar.html.erb +4 -4
- data/app/views/alchemy/admin/pictures/_filter_bar.html.erb +1 -3
- data/app/views/alchemy/admin/pictures/_overlay_picture_list.html.erb +1 -1
- data/app/views/alchemy/admin/pictures/_picture_to_assign.html.erb +1 -1
- data/app/views/alchemy/admin/pictures/_tag_list.html.erb +1 -1
- data/app/views/alchemy/admin/resources/_filter_bar.html.erb +1 -3
- data/app/views/alchemy/admin/resources/_tag_list.html.erb +1 -1
- data/app/views/alchemy/admin/uploader/_button.html.erb +1 -1
- data/app/views/alchemy/essences/_essence_file_editor.html.erb +2 -2
- data/app/views/alchemy/essences/_essence_picture_editor.html.erb +2 -2
- data/app/views/alchemy/essences/shared/_essence_picture_tools.html.erb +3 -3
- data/app/views/alchemy/navigation/_renderer.html.erb +1 -2
- data/config/brakeman.ignore +65 -0
- data/db/migrate/20130827094554_alchemy_two_point_six.rb +1 -1
- data/db/migrate/20130828121054_remove_do_not_index_from_alchemy_essence_texts.rb +1 -1
- data/db/migrate/20130828121120_remove_do_not_index_from_alchemy_essence_richtexts.rb +1 -1
- data/db/migrate/20130918201742_add_published_at_to_alchemy_pages.rb +1 -1
- data/db/migrate/20150608204610_add_parent_element_id_to_alchemy_elements.rb +1 -1
- data/db/migrate/20150729151825_add_link_text_to_alchemy_essence_files.rb +1 -1
- data/db/migrate/20150906195818_add_locale_to_alchemy_languages.rb +1 -1
- data/db/migrate/20160108174834_add_timebased_publishing_columns_to_pages.rb +1 -1
- data/db/migrate/20160422195310_add_image_file_format_to_alchemy_pictures.rb +1 -1
- data/db/migrate/20160617224938_change_alchemy_pages_locked_to_locked_at.rb +1 -1
- data/db/migrate/20160912223112_add_index_to_alchemy_pages_rgt.rb +1 -1
- data/db/migrate/20160927205604_add_foreign_key_indices_and_null_constraints.rb +1 -1
- data/db/migrate/20160928080104_add_foreign_keys.rb +1 -1
- data/lib/alchemy/ability_helper.rb +2 -0
- data/lib/alchemy/admin/locale.rb +2 -0
- data/lib/alchemy/auth_accessors.rb +2 -0
- data/lib/alchemy/cache_digests/template_tracker.rb +2 -0
- data/lib/alchemy/config.rb +2 -0
- data/lib/alchemy/configuration_methods.rb +2 -0
- data/lib/alchemy/controller_actions.rb +2 -0
- data/lib/alchemy/deprecation.rb +3 -0
- data/lib/alchemy/errors.rb +2 -0
- data/lib/alchemy/essence.rb +2 -0
- data/lib/alchemy/filetypes.rb +2 -0
- data/lib/alchemy/forms/builder.rb +2 -0
- data/lib/alchemy/hints.rb +2 -0
- data/lib/alchemy/i18n.rb +2 -0
- data/lib/alchemy/logger.rb +2 -0
- data/lib/alchemy/modules.rb +2 -0
- data/lib/alchemy/name_conversions.rb +2 -0
- data/lib/alchemy/on_page_layout.rb +2 -0
- data/lib/alchemy/on_page_layout/callbacks_runner.rb +2 -0
- data/lib/alchemy/page_layout.rb +3 -1
- data/lib/alchemy/paths.rb +2 -0
- data/lib/alchemy/permissions.rb +2 -0
- data/lib/alchemy/picture_attributes.rb +2 -0
- data/lib/alchemy/resource.rb +2 -0
- data/lib/alchemy/resources_helper.rb +14 -12
- data/lib/alchemy/routing_constraints.rb +2 -0
- data/lib/alchemy/ssl_protection.rb +2 -0
- data/lib/alchemy/test_support/controller_requests.rb +20 -0
- data/lib/alchemy/test_support/essence_shared_examples.rb +3 -21
- data/lib/alchemy/tinymce.rb +2 -0
- data/lib/alchemy/touching.rb +2 -0
- data/lib/alchemy/upgrader/three_point_four.rb +20 -3
- data/lib/alchemy/userstamp.rb +2 -0
- data/lib/alchemy/version.rb +3 -1
- data/lib/alchemy_cms.rb +1 -0
- data/lib/tasks/alchemy/upgrade.rake +5 -1
- metadata +7 -5
@@ -1,20 +1,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
# == Schema Information
|
2
4
|
#
|
3
5
|
# Table name: alchemy_elements
|
4
6
|
#
|
5
|
-
# id
|
6
|
-
# name
|
7
|
-
# position
|
8
|
-
# page_id
|
9
|
-
# public
|
10
|
-
# folded
|
11
|
-
# unique
|
12
|
-
# created_at
|
13
|
-
# updated_at
|
14
|
-
# creator_id
|
15
|
-
# updater_id
|
16
|
-
# cell_id
|
17
|
-
# cached_tag_list
|
7
|
+
# id :integer not null, primary key
|
8
|
+
# name :string
|
9
|
+
# position :integer
|
10
|
+
# page_id :integer not null
|
11
|
+
# public :boolean default(TRUE)
|
12
|
+
# folded :boolean default(FALSE)
|
13
|
+
# unique :boolean default(FALSE)
|
14
|
+
# created_at :datetime not null
|
15
|
+
# updated_at :datetime not null
|
16
|
+
# creator_id :integer
|
17
|
+
# updater_id :integer
|
18
|
+
# cell_id :integer
|
19
|
+
# cached_tag_list :text
|
20
|
+
# parent_element_id :integer
|
18
21
|
#
|
19
22
|
|
20
23
|
module Alchemy
|
@@ -77,7 +80,7 @@ module Alchemy
|
|
77
80
|
required: false,
|
78
81
|
touch: true
|
79
82
|
|
80
|
-
has_and_belongs_to_many :touchable_pages, -> {
|
83
|
+
has_and_belongs_to_many :touchable_pages, -> { distinct },
|
81
84
|
class_name: 'Alchemy::Page',
|
82
85
|
join_table: ElementToPage.table_name
|
83
86
|
|
@@ -121,9 +124,7 @@ module Alchemy
|
|
121
124
|
# could be found
|
122
125
|
#
|
123
126
|
def new_from_scratch(attributes = {})
|
124
|
-
attributes = attributes.dup.symbolize_keys
|
125
127
|
return new if attributes[:name].blank?
|
126
|
-
|
127
128
|
new_element_from_definition_by(attributes) || raise(ElementDefinitionError, attributes)
|
128
129
|
end
|
129
130
|
|
@@ -152,10 +153,7 @@ module Alchemy
|
|
152
153
|
# @copy.public? # => false
|
153
154
|
#
|
154
155
|
def copy(source_element, differences = {})
|
155
|
-
source_element.attributes.
|
156
|
-
differences.stringify_keys!
|
157
|
-
|
158
|
-
attributes = source_element.attributes
|
156
|
+
attributes = source_element.attributes.with_indifferent_access
|
159
157
|
.except(*SKIPPED_ATTRIBUTES_ON_COPY)
|
160
158
|
.merge(differences)
|
161
159
|
.merge({
|
@@ -193,16 +191,11 @@ module Alchemy
|
|
193
191
|
private
|
194
192
|
|
195
193
|
def new_element_from_definition_by(attributes)
|
196
|
-
|
197
|
-
|
198
|
-
element_definition = Element.definition_by_name(attributes[:name])
|
194
|
+
element_attributes = attributes.to_h.merge(name: attributes[:name].split('#').first)
|
195
|
+
element_definition = Element.definition_by_name(element_attributes[:name])
|
199
196
|
return if element_definition.nil?
|
200
197
|
|
201
|
-
new(element_definition.merge(
|
202
|
-
end
|
203
|
-
|
204
|
-
def remove_cell_name_from_element_name!(attributes)
|
205
|
-
attributes[:name] = attributes[:name].split('#').first
|
198
|
+
new(element_definition.merge(element_attributes).except(*FORBIDDEN_DEFINITION_ATTRIBUTES))
|
206
199
|
end
|
207
200
|
end
|
208
201
|
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Alchemy
|
2
4
|
# Module concerning element definitions
|
3
5
|
#
|
@@ -11,7 +13,7 @@ module Alchemy
|
|
11
13
|
# your own set of elements
|
12
14
|
#
|
13
15
|
def definitions
|
14
|
-
@definitions ||= read_definitions_file
|
16
|
+
@definitions ||= read_definitions_file.map(&:with_indifferent_access)
|
15
17
|
end
|
16
18
|
|
17
19
|
# Returns one element definition by given name.
|
@@ -26,7 +28,7 @@ module Alchemy
|
|
26
28
|
#
|
27
29
|
def read_definitions_file
|
28
30
|
if ::File.exist?(definitions_file_path)
|
29
|
-
::YAML.safe_load(ERB.new(File.read(definitions_file_path)).result, [Regexp,
|
31
|
+
::YAML.safe_load(ERB.new(File.read(definitions_file_path)).result, [Date, Regexp, Symbol], [], true) || []
|
30
32
|
else
|
31
33
|
raise LoadError, "Could not find elements.yml file! Please run `rails generate alchemy:scaffold`"
|
32
34
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
# Methods concerning contents for elements
|
2
4
|
#
|
3
5
|
module Alchemy
|
@@ -138,7 +140,7 @@ module Alchemy
|
|
138
140
|
# creates the contents for this element as described in the elements.yml
|
139
141
|
def create_contents
|
140
142
|
definition.fetch("contents", []).each do |content_hash|
|
141
|
-
Content.create_from_scratch(self, content_hash
|
143
|
+
Content.create_from_scratch(self, content_hash)
|
142
144
|
end
|
143
145
|
end
|
144
146
|
end
|
@@ -1,12 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
# == Schema Information
|
2
4
|
#
|
3
5
|
# Table name: alchemy_essence_links
|
4
6
|
#
|
5
7
|
# id :integer not null, primary key
|
6
|
-
# link :string
|
7
|
-
# link_title :string
|
8
|
-
# link_target :string
|
9
|
-
# link_class_name :string
|
8
|
+
# link :string
|
9
|
+
# link_title :string
|
10
|
+
# link_target :string
|
11
|
+
# link_class_name :string
|
10
12
|
# created_at :datetime not null
|
11
13
|
# updated_at :datetime not null
|
12
14
|
# creator_id :integer
|
@@ -1,24 +1,26 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
# == Schema Information
|
2
4
|
#
|
3
5
|
# Table name: alchemy_essence_pictures
|
4
6
|
#
|
5
7
|
# id :integer not null, primary key
|
6
8
|
# picture_id :integer
|
7
|
-
# caption :string
|
8
|
-
# title :string
|
9
|
-
# alt_tag :string
|
10
|
-
# link :string
|
11
|
-
# link_class_name :string
|
12
|
-
# link_title :string
|
13
|
-
# css_class :string
|
14
|
-
# link_target :string
|
9
|
+
# caption :string
|
10
|
+
# title :string
|
11
|
+
# alt_tag :string
|
12
|
+
# link :string
|
13
|
+
# link_class_name :string
|
14
|
+
# link_title :string
|
15
|
+
# css_class :string
|
16
|
+
# link_target :string
|
15
17
|
# creator_id :integer
|
16
18
|
# updater_id :integer
|
17
19
|
# created_at :datetime not null
|
18
20
|
# updated_at :datetime not null
|
19
|
-
# crop_from :string
|
20
|
-
# crop_size :string
|
21
|
-
# render_size :string
|
21
|
+
# crop_from :string
|
22
|
+
# crop_size :string
|
23
|
+
# render_size :string
|
22
24
|
#
|
23
25
|
|
24
26
|
module Alchemy
|
@@ -1,9 +1,11 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
# == Schema Information
|
2
4
|
#
|
3
5
|
# Table name: alchemy_essence_selects
|
4
6
|
#
|
5
7
|
# id :integer not null, primary key
|
6
|
-
# value :string
|
8
|
+
# value :string
|
7
9
|
# created_at :datetime not null
|
8
10
|
# updated_at :datetime not null
|
9
11
|
# creator_id :integer
|
@@ -1,14 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
# == Schema Information
|
2
4
|
#
|
3
5
|
# Table name: alchemy_essence_texts
|
4
6
|
#
|
5
7
|
# id :integer not null, primary key
|
6
8
|
# body :text
|
7
|
-
# link :string
|
8
|
-
# link_title :string
|
9
|
-
# link_class_name :string
|
9
|
+
# link :string
|
10
|
+
# link_title :string
|
11
|
+
# link_class_name :string
|
10
12
|
# public :boolean default(FALSE)
|
11
|
-
# link_target :string
|
13
|
+
# link_target :string
|
12
14
|
# creator_id :integer
|
13
15
|
# updater_id :integer
|
14
16
|
# created_at :datetime not null
|
@@ -1,10 +1,12 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
# == Schema Information
|
2
4
|
#
|
3
5
|
# Table name: alchemy_folded_pages
|
4
6
|
#
|
5
7
|
# id :integer not null, primary key
|
6
|
-
# page_id :integer
|
7
|
-
# user_id :integer
|
8
|
+
# page_id :integer not null
|
9
|
+
# user_id :integer not null
|
8
10
|
# folded :boolean default(FALSE)
|
9
11
|
#
|
10
12
|
|
@@ -1,20 +1,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
# == Schema Information
|
2
4
|
#
|
3
5
|
# Table name: alchemy_languages
|
4
6
|
#
|
5
7
|
# id :integer not null, primary key
|
6
|
-
# name :string
|
7
|
-
# language_code :string
|
8
|
-
# frontpage_name :string
|
9
|
-
# page_layout :string
|
8
|
+
# name :string
|
9
|
+
# language_code :string
|
10
|
+
# frontpage_name :string
|
11
|
+
# page_layout :string default("intro")
|
10
12
|
# public :boolean default(FALSE)
|
11
13
|
# created_at :datetime not null
|
12
14
|
# updated_at :datetime not null
|
13
15
|
# creator_id :integer
|
14
16
|
# updater_id :integer
|
15
17
|
# default :boolean default(FALSE)
|
16
|
-
# country_code :string
|
17
|
-
# site_id :integer
|
18
|
+
# country_code :string default(""), not null
|
19
|
+
# site_id :integer not null
|
20
|
+
# locale :string
|
18
21
|
#
|
19
22
|
|
20
23
|
module Alchemy
|
@@ -1,9 +1,11 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
# == Schema Information
|
2
4
|
#
|
3
5
|
# Table name: alchemy_legacy_page_urls
|
4
6
|
#
|
5
7
|
# id :integer not null, primary key
|
6
|
-
# urlname :string
|
8
|
+
# urlname :string not null
|
7
9
|
# page_id :integer not null
|
8
10
|
# created_at :datetime not null
|
9
11
|
# updated_at :datetime not null
|
data/app/models/alchemy/page.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
# == Schema Information
|
2
4
|
#
|
3
5
|
# Table name: alchemy_pages
|
@@ -16,8 +18,6 @@
|
|
16
18
|
# parent_id :integer
|
17
19
|
# depth :integer
|
18
20
|
# visible :boolean default(FALSE)
|
19
|
-
# public :boolean default(FALSE)
|
20
|
-
# locked_at :datetime
|
21
21
|
# locked_by :integer
|
22
22
|
# restricted :boolean default(FALSE)
|
23
23
|
# robot_index :boolean default(TRUE)
|
@@ -33,6 +33,7 @@
|
|
33
33
|
# published_at :datetime
|
34
34
|
# public_on :datetime
|
35
35
|
# public_until :datetime
|
36
|
+
# locked_at :datetime
|
36
37
|
#
|
37
38
|
|
38
39
|
module Alchemy
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Alchemy
|
2
4
|
module Page::PageElements
|
3
5
|
extend ActiveSupport::Concern
|
@@ -17,7 +19,7 @@ module Alchemy
|
|
17
19
|
through: :descendent_elements,
|
18
20
|
class_name: 'Alchemy::Content',
|
19
21
|
source: :contents
|
20
|
-
has_and_belongs_to_many :to_be_swept_elements, -> {
|
22
|
+
has_and_belongs_to_many :to_be_swept_elements, -> { distinct },
|
21
23
|
class_name: 'Alchemy::Element',
|
22
24
|
join_table: ElementToPage.table_name
|
23
25
|
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Alchemy
|
2
4
|
module Page::PageNatures
|
3
5
|
extend ActiveSupport::Concern
|
@@ -96,7 +98,6 @@ module Alchemy
|
|
96
98
|
|
97
99
|
# Returns the self#page_layout definition from config/alchemy/page_layouts.yml file.
|
98
100
|
def definition
|
99
|
-
return {} if systempage?
|
100
101
|
definition = PageLayout.get(page_layout)
|
101
102
|
if definition.nil?
|
102
103
|
log_warning "Page definition for `#{page_layout}` not found. Please check `page_layouts.yml` file."
|