alchemy_cms 6.0.0.b1 → 6.0.0.pre.b5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +46 -0
- data/README.md +14 -2
- data/Rakefile +37 -23
- data/alchemy_cms.gemspec +1 -1
- data/app/assets/stylesheets/alchemy/_extends.scss +15 -2
- data/app/assets/stylesheets/alchemy/archive.scss +16 -1
- data/app/assets/stylesheets/alchemy/fonts.scss +0 -0
- data/app/assets/stylesheets/tinymce/skins/alchemy/fonts/tinymce-small.svg +0 -0
- data/app/assets/stylesheets/tinymce/skins/alchemy/fonts/tinymce-small.ttf +0 -0
- data/app/assets/stylesheets/tinymce/skins/alchemy/fonts/tinymce-small.woff +0 -0
- data/app/assets/stylesheets/tinymce/skins/alchemy/fonts/tinymce.svg +0 -0
- data/app/assets/stylesheets/tinymce/skins/alchemy/fonts/tinymce.ttf +0 -0
- data/app/assets/stylesheets/tinymce/skins/alchemy/fonts/tinymce.woff +0 -0
- data/app/assets/stylesheets/tinymce/skins/alchemy/img/anchor.gif +0 -0
- data/app/assets/stylesheets/tinymce/skins/alchemy/img/loader.gif +0 -0
- data/app/assets/stylesheets/tinymce/skins/alchemy/img/object.gif +0 -0
- data/app/assets/stylesheets/tinymce/skins/alchemy/img/trans.gif +0 -0
- data/app/assets/stylesheets/tinymce/skins/alchemy/skin.min.css.scss +0 -0
- data/app/controllers/alchemy/admin/attachments_controller.rb +3 -3
- data/app/controllers/alchemy/admin/elements_controller.rb +1 -0
- data/app/controllers/alchemy/admin/pages_controller.rb +1 -9
- data/app/controllers/alchemy/admin/pictures_controller.rb +21 -8
- data/app/controllers/alchemy/admin/resources_controller.rb +84 -10
- data/app/controllers/alchemy/api/elements_controller.rb +12 -8
- data/app/controllers/alchemy/api/pages_controller.rb +4 -2
- data/app/decorators/alchemy/element_editor.rb +7 -4
- data/app/decorators/alchemy/ingredient_editor.rb +5 -1
- data/app/helpers/alchemy/elements_block_helper.rb +14 -6
- data/app/models/alchemy/attachment.rb +24 -7
- data/app/models/alchemy/element/element_essences.rb +14 -3
- data/app/models/alchemy/element/element_ingredients.rb +11 -3
- data/app/models/alchemy/element/presenters.rb +18 -1
- data/app/models/alchemy/element.rb +0 -14
- data/app/models/alchemy/ingredient.rb +21 -62
- data/app/models/alchemy/page/page_natures.rb +1 -10
- data/app/models/alchemy/page/page_scopes.rb +4 -0
- data/app/models/alchemy/page.rb +13 -4
- data/app/models/alchemy/page_version.rb +1 -1
- data/app/models/alchemy/picture.rb +14 -38
- data/app/views/alchemy/admin/attachments/_archive_overlay.html.erb +1 -1
- data/app/views/alchemy/admin/attachments/index.html.erb +2 -3
- data/app/views/alchemy/admin/elements/create.js.erb +1 -1
- data/app/views/alchemy/admin/elements/destroy.js.erb +1 -3
- data/app/views/alchemy/admin/elements/fold.js.erb +2 -2
- data/app/views/alchemy/admin/elements/update.js.erb +1 -1
- data/app/views/alchemy/admin/pages/_toolbar.html.erb +1 -1
- data/app/views/alchemy/admin/pages/edit.html.erb +1 -1
- data/app/views/alchemy/admin/pages/index.html.erb +2 -9
- data/app/views/alchemy/admin/partials/_search_form.html.erb +9 -0
- data/app/views/alchemy/admin/pictures/_archive.html.erb +1 -1
- data/app/views/alchemy/admin/pictures/_archive_overlay.html.erb +1 -1
- data/app/views/alchemy/admin/pictures/_filter_and_size_bar.html.erb +4 -2
- data/app/views/alchemy/admin/pictures/index.html.erb +8 -3
- data/app/views/alchemy/admin/resources/_filter.html.erb +12 -0
- data/app/views/alchemy/admin/resources/_filter_bar.html.erb +14 -17
- data/app/views/alchemy/admin/resources/_form.html.erb +2 -0
- data/app/views/alchemy/admin/resources/_table_header.html.erb +15 -0
- data/app/views/alchemy/admin/resources/index.html.erb +3 -11
- data/app/views/alchemy/ingredients/_boolean_editor.html.erb +1 -1
- data/app/views/alchemy/ingredients/_file_editor.html.erb +3 -1
- data/app/views/alchemy/ingredients/_headline_editor.html.erb +1 -1
- data/app/views/alchemy/ingredients/_html_editor.html.erb +1 -1
- data/app/views/alchemy/ingredients/_link_editor.html.erb +8 -8
- data/app/views/alchemy/ingredients/_node_editor.html.erb +1 -0
- data/app/views/alchemy/ingredients/_page_editor.html.erb +1 -0
- data/app/views/alchemy/ingredients/_picture_editor.html.erb +7 -6
- data/app/views/alchemy/ingredients/_select_editor.html.erb +1 -0
- data/app/views/alchemy/ingredients/_text_editor.html.erb +5 -4
- data/config/locales/alchemy.en.yml +85 -49
- data/lib/alchemy/forms/builder.rb +21 -1
- data/lib/alchemy/resource_filter.rb +40 -0
- data/lib/alchemy/resources_helper.rb +1 -16
- data/lib/alchemy/test_support/shared_ingredient_examples.rb +21 -4
- data/lib/alchemy/tinymce.rb +4 -0
- data/lib/alchemy/upgrader/tasks/ingredients_migrator.rb +18 -7
- data/lib/alchemy/version.rb +1 -1
- data/lib/alchemy_cms.rb +1 -0
- data/lib/generators/alchemy/menus/templates/node.html.erb +1 -1
- data/lib/generators/alchemy/menus/templates/node.html.haml +1 -1
- data/lib/generators/alchemy/menus/templates/node.html.slim +1 -1
- data/lib/generators/alchemy/menus/templates/wrapper.html.erb +1 -1
- data/lib/generators/alchemy/menus/templates/wrapper.html.haml +1 -1
- data/lib/generators/alchemy/menus/templates/wrapper.html.slim +1 -1
- data/package.json +1 -1
- metadata +7 -7
- data/app/views/alchemy/admin/attachments/_filter_bar.html.erb +0 -29
- data/app/views/alchemy/admin/pictures/_filter_bar.html.erb +0 -30
data/lib/alchemy/tinymce.rb
CHANGED
@@ -34,6 +34,10 @@ module Alchemy
|
|
34
34
|
@@init
|
35
35
|
end
|
36
36
|
|
37
|
+
def custom_configs_present?(page)
|
38
|
+
custom_config_contents(page).any? || custom_config_ingredients(page).any?
|
39
|
+
end
|
40
|
+
|
37
41
|
def custom_config_contents(page)
|
38
42
|
content_definitions_from_elements(page.descendent_element_definitions)
|
39
43
|
end
|
@@ -10,6 +10,9 @@ module Alchemy::Upgrader::Tasks
|
|
10
10
|
def create_ingredients
|
11
11
|
Alchemy::Deprecation.silence do
|
12
12
|
elements_with_ingredients = Alchemy::ElementDefinition.all.select { |d| d.key?(:ingredients) }
|
13
|
+
if ENV["ONLY"]
|
14
|
+
elements_with_ingredients = elements_with_ingredients.select { |d| d[:name].in? ENV["ONLY"].split(",") }
|
15
|
+
end
|
13
16
|
# eager load all elements that have ingredients defined but no ingredient records yet.
|
14
17
|
all_elements = Alchemy::Element
|
15
18
|
.named(elements_with_ingredients.map { |d| d[:name] })
|
@@ -22,21 +25,29 @@ module Alchemy::Upgrader::Tasks
|
|
22
25
|
puts "-- Creating ingredients for #{elements.count} #{element_definition[:name]}(s)"
|
23
26
|
elements.each do |element|
|
24
27
|
Alchemy::Element.transaction do
|
25
|
-
|
28
|
+
element_definition[:ingredients].each do |ingredient_definition|
|
26
29
|
content = element.content_by_name(ingredient_definition[:role])
|
27
30
|
next unless content
|
28
31
|
|
29
|
-
|
30
|
-
|
32
|
+
essence = content.essence
|
33
|
+
ingredient = element.ingredients.build(
|
34
|
+
role: ingredient_definition[:role],
|
35
|
+
type: Alchemy::Ingredient.normalize_type(ingredient_definition[:type]),
|
36
|
+
)
|
37
|
+
belongs_to_associations = essence.class.reflect_on_all_associations(:belongs_to)
|
31
38
|
if belongs_to_associations.any?
|
32
|
-
ingredient.related_object =
|
39
|
+
ingredient.related_object = essence.public_send(belongs_to_associations.first.name)
|
33
40
|
else
|
34
41
|
ingredient.value = content.ingredient
|
35
42
|
end
|
36
|
-
|
43
|
+
data = ingredient.class.stored_attributes.fetch(:data, []).each_with_object({}) do |attr, d|
|
44
|
+
d[attr] = essence.public_send(attr)
|
45
|
+
end
|
46
|
+
ingredient.data = data
|
37
47
|
print "."
|
38
|
-
ingredient
|
39
|
-
|
48
|
+
ingredient.save!
|
49
|
+
content.destroy!
|
50
|
+
end
|
40
51
|
end
|
41
52
|
end
|
42
53
|
puts "\n"
|
data/lib/alchemy/version.rb
CHANGED
data/lib/alchemy_cms.rb
CHANGED
@@ -54,6 +54,7 @@ require_relative "alchemy/permissions"
|
|
54
54
|
require_relative "alchemy/resource"
|
55
55
|
require_relative "alchemy/tinymce"
|
56
56
|
require_relative "alchemy/taggable"
|
57
|
+
require_relative "alchemy/version"
|
57
58
|
|
58
59
|
# Require hacks
|
59
60
|
require_relative "kaminari/scoped_pagination_url_helper"
|
data/package.json
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: alchemy_cms
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.0.0.
|
4
|
+
version: 6.0.0.pre.b5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thomas von Deyen
|
@@ -13,7 +13,7 @@ authors:
|
|
13
13
|
autorequire:
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
|
-
date: 2021-
|
16
|
+
date: 2021-08-27 00:00:00.000000000 Z
|
17
17
|
dependencies:
|
18
18
|
- !ruby/object:Gem::Dependency
|
19
19
|
name: actionmailer
|
@@ -689,14 +689,14 @@ dependencies:
|
|
689
689
|
requirements:
|
690
690
|
- - "~>"
|
691
691
|
- !ruby/object:Gem::Version
|
692
|
-
version: '
|
692
|
+
version: '5.0'
|
693
693
|
type: :development
|
694
694
|
prerelease: false
|
695
695
|
version_requirements: !ruby/object:Gem::Requirement
|
696
696
|
requirements:
|
697
697
|
- - "~>"
|
698
698
|
- !ruby/object:Gem::Version
|
699
|
-
version: '
|
699
|
+
version: '5.0'
|
700
700
|
- !ruby/object:Gem::Dependency
|
701
701
|
name: timecop
|
702
702
|
requirement: !ruby/object:Gem::Requirement
|
@@ -1013,7 +1013,6 @@ files:
|
|
1013
1013
|
- app/views/alchemy/admin/attachments/_attachment.html.erb
|
1014
1014
|
- app/views/alchemy/admin/attachments/_file_to_assign.html.erb
|
1015
1015
|
- app/views/alchemy/admin/attachments/_files_list.html.erb
|
1016
|
-
- app/views/alchemy/admin/attachments/_filter_bar.html.erb
|
1017
1016
|
- app/views/alchemy/admin/attachments/_overlay_file_list.html.erb
|
1018
1017
|
- app/views/alchemy/admin/attachments/_replace_button.html.erb
|
1019
1018
|
- app/views/alchemy/admin/attachments/_tag_list.html.erb
|
@@ -1131,7 +1130,6 @@ files:
|
|
1131
1130
|
- app/views/alchemy/admin/pictures/_archive.html.erb
|
1132
1131
|
- app/views/alchemy/admin/pictures/_archive_overlay.html.erb
|
1133
1132
|
- app/views/alchemy/admin/pictures/_filter_and_size_bar.html.erb
|
1134
|
-
- app/views/alchemy/admin/pictures/_filter_bar.html.erb
|
1135
1133
|
- app/views/alchemy/admin/pictures/_form.html.erb
|
1136
1134
|
- app/views/alchemy/admin/pictures/_infos.html.erb
|
1137
1135
|
- app/views/alchemy/admin/pictures/_overlay_picture_list.html.erb
|
@@ -1145,6 +1143,7 @@ files:
|
|
1145
1143
|
- app/views/alchemy/admin/pictures/index.js.erb
|
1146
1144
|
- app/views/alchemy/admin/pictures/show.html.erb
|
1147
1145
|
- app/views/alchemy/admin/pictures/update.js.erb
|
1146
|
+
- app/views/alchemy/admin/resources/_filter.html.erb
|
1148
1147
|
- app/views/alchemy/admin/resources/_filter_bar.html.erb
|
1149
1148
|
- app/views/alchemy/admin/resources/_form.html.erb
|
1150
1149
|
- app/views/alchemy/admin/resources/_per_page_select.html.erb
|
@@ -1323,6 +1322,7 @@ files:
|
|
1323
1322
|
- lib/alchemy/paths.rb
|
1324
1323
|
- lib/alchemy/permissions.rb
|
1325
1324
|
- lib/alchemy/resource.rb
|
1325
|
+
- lib/alchemy/resource_filter.rb
|
1326
1326
|
- lib/alchemy/resources_helper.rb
|
1327
1327
|
- lib/alchemy/routing_constraints.rb
|
1328
1328
|
- lib/alchemy/seeder.rb
|
@@ -1516,7 +1516,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
1516
1516
|
version: 1.3.1
|
1517
1517
|
requirements:
|
1518
1518
|
- ImageMagick (libmagick), v6.6 or greater.
|
1519
|
-
rubygems_version: 3.1.
|
1519
|
+
rubygems_version: 3.1.6
|
1520
1520
|
signing_key:
|
1521
1521
|
specification_version: 4
|
1522
1522
|
summary: A powerful, userfriendly and flexible CMS for Rails
|
@@ -1,29 +0,0 @@
|
|
1
|
-
<div id="filter_bar">
|
2
|
-
<h3><%= Alchemy.t('Filter') %></h3>
|
3
|
-
<%= select_tag(
|
4
|
-
'file_type_filter',
|
5
|
-
options_for_select(
|
6
|
-
Alchemy::Attachment.file_types_for_select,
|
7
|
-
search_filter_params[:file_type]
|
8
|
-
),
|
9
|
-
include_blank: Alchemy.t('Show all files'),
|
10
|
-
data: { remote: !!request.xhr? },
|
11
|
-
class: 'alchemy_selectbox'
|
12
|
-
) %>
|
13
|
-
</div>
|
14
|
-
|
15
|
-
<script type="text/javascript">
|
16
|
-
$(function() {
|
17
|
-
$('#file_type_filter').on('change', function(e) {
|
18
|
-
var $this = $(this);
|
19
|
-
var url = '<%= alchemy.admin_attachments_path(search_filter_params.except(:file_type).to_h) %>';
|
20
|
-
if ($this.data('remote') === true) {
|
21
|
-
$.get(url, {file_type: $this.val()}, null, 'script');
|
22
|
-
} else {
|
23
|
-
delimiter = url.match(/\?/) ? '&' : '?';
|
24
|
-
Turbolinks.visit(url + delimiter + 'file_type=' + encodeURIComponent($this.val()));
|
25
|
-
}
|
26
|
-
return false;
|
27
|
-
});
|
28
|
-
});
|
29
|
-
</script>
|
@@ -1,30 +0,0 @@
|
|
1
|
-
<div id="filter_bar">
|
2
|
-
<h3><%= Alchemy.t('Filter') %></h3>
|
3
|
-
<%= select_tag(
|
4
|
-
'picture_filter',
|
5
|
-
options_for_select([
|
6
|
-
[Alchemy.t(:all_pictures), ''],
|
7
|
-
[Alchemy.t(:last_upload_only), 'last_upload'],
|
8
|
-
[Alchemy.t(:recently_uploaded_only), 'recent'],
|
9
|
-
[Alchemy.t(:without_tag), 'without_tag']
|
10
|
-
], search_filter_params[:filter]),
|
11
|
-
:data => { :remote => !!request.xhr? },
|
12
|
-
:class => 'alchemy_selectbox'
|
13
|
-
) %>
|
14
|
-
</div>
|
15
|
-
|
16
|
-
<script type="text/javascript">
|
17
|
-
$(function() {
|
18
|
-
$('#picture_filter').on('change', function(e) {
|
19
|
-
var $this = $(this);
|
20
|
-
var url = '<%= alchemy.admin_pictures_path(search_filter_params.except(:filter).to_h) %>';
|
21
|
-
if ($this.data('remote') === true) {
|
22
|
-
$.get(url, {filter: $this.val()}, null, 'script');
|
23
|
-
} else {
|
24
|
-
delimiter = url.match(/\?/) ? '&' : '?';
|
25
|
-
Turbolinks.visit(url + delimiter + 'filter=' + $this.val());
|
26
|
-
}
|
27
|
-
return false;
|
28
|
-
});
|
29
|
-
});
|
30
|
-
</script>
|