alchemy_cms 5.0.0.rc1 → 5.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +9 -17
- data/CHANGELOG.md +18 -1
- data/Gemfile +2 -2
- data/README.md +1 -1
- data/app/assets/stylesheets/alchemy/navigation.scss +1 -0
- data/app/assets/stylesheets/alchemy/tags.scss +2 -2
- data/app/controllers/alchemy/admin/pages_controller.rb +1 -1
- data/app/helpers/alchemy/admin/base_helper.rb +2 -0
- data/app/helpers/alchemy/url_helper.rb +2 -2
- data/app/models/alchemy/attachment.rb +4 -1
- data/app/models/alchemy/essence_file.rb +1 -1
- data/app/models/alchemy/essence_picture.rb +1 -1
- data/app/models/alchemy/essence_picture_view.rb +5 -1
- data/app/models/alchemy/picture/url.rb +4 -2
- data/app/serializers/alchemy/page_tree_serializer.rb +4 -4
- data/app/views/alchemy/admin/elements/_element_toolbar.html.erb +1 -1
- data/app/views/alchemy/admin/pictures/show.html.erb +1 -1
- data/app/views/alchemy/admin/resources/index.html.erb +21 -22
- data/app/views/alchemy/admin/sites/_form.html.erb +2 -2
- data/app/views/alchemy/essences/_essence_file_view.html.erb +1 -1
- data/lib/alchemy/resource.rb +2 -2
- data/lib/alchemy/version.rb +1 -1
- metadata +5 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 54cfa6b7582851195ca4efa3cba8f84bbb4f1d4f064df0e0ed7827d2878c9642
|
|
4
|
+
data.tar.gz: 2d8c9abc0af15288204c2c8fd190d36717ff2c5d6fd2b9d1cef4d1dff0d0ab66
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 10d8633d5579d29799a981f465fefd14341e8165c124c008f75e1598b8e7001bccb7960fb3a79fcda915587296ff8aec627446ff733059cda3e548ab2480ab30
|
|
7
|
+
data.tar.gz: 3f9af3b0200fa6a4d58ce70c955a95e40296a9332f58f8773d31987911b9254fc83e6b7bddabdb0a8380ba2e7768a37abb7620287848d1f8150fd2c6657d1802
|
data/.github/workflows/ci.yml
CHANGED
|
@@ -43,14 +43,14 @@ jobs:
|
|
|
43
43
|
MYSQL_ROOT_PASSWORD: password
|
|
44
44
|
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=5
|
|
45
45
|
steps:
|
|
46
|
-
- uses: actions/checkout@
|
|
46
|
+
- uses: actions/checkout@v2.3.4
|
|
47
47
|
- name: Set up Ruby
|
|
48
|
-
uses: actions/setup-ruby@v1
|
|
48
|
+
uses: actions/setup-ruby@v1.1.2
|
|
49
49
|
with:
|
|
50
50
|
ruby-version: ${{ matrix.ruby }}
|
|
51
51
|
- name: Restore apt cache
|
|
52
52
|
id: apt-cache
|
|
53
|
-
uses: actions/cache@
|
|
53
|
+
uses: actions/cache@v2.1.3
|
|
54
54
|
with:
|
|
55
55
|
path: /home/runner/apt/cache
|
|
56
56
|
key: ${{ runner.os }}-apt-${{ matrix.database }}
|
|
@@ -75,7 +75,7 @@ jobs:
|
|
|
75
75
|
gem install bundler
|
|
76
76
|
- name: Restore Ruby Gems cache
|
|
77
77
|
id: cache
|
|
78
|
-
uses: actions/cache@
|
|
78
|
+
uses: actions/cache@v2.1.3
|
|
79
79
|
with:
|
|
80
80
|
path: vendor/bundle
|
|
81
81
|
key: ${{ runner.os }}-bundle-${{ matrix.ruby }}-${{ matrix.rails }}-${{ matrix.database }}-${{ hashFiles('**/Gemfile') }}
|
|
@@ -87,7 +87,7 @@ jobs:
|
|
|
87
87
|
bundle install --jobs 4 --retry 3 --path vendor/bundle
|
|
88
88
|
- name: Restore node modules cache
|
|
89
89
|
id: yarn-cache
|
|
90
|
-
uses: actions/cache@
|
|
90
|
+
uses: actions/cache@v2.1.3
|
|
91
91
|
with:
|
|
92
92
|
path: spec/dummy/node_modules
|
|
93
93
|
key: ${{ runner.os }}-yarn-dummy-${{ hashFiles('./package.json') }}
|
|
@@ -97,12 +97,12 @@ jobs:
|
|
|
97
97
|
run: |
|
|
98
98
|
bundle exec rake alchemy:spec:prepare
|
|
99
99
|
- name: Run tests & publish code coverage
|
|
100
|
-
uses: paambaati/codeclimate-action@v2.5
|
|
100
|
+
uses: paambaati/codeclimate-action@v2.7.5
|
|
101
101
|
env:
|
|
102
102
|
CC_TEST_REPORTER_ID: bca4349e32f97919210ac8a450b04904b90683fcdd57d65a22c0f5065482bc22
|
|
103
103
|
with:
|
|
104
104
|
coverageCommand: bundle exec rspec
|
|
105
|
-
- uses: actions/upload-artifact@
|
|
105
|
+
- uses: actions/upload-artifact@main
|
|
106
106
|
if: failure()
|
|
107
107
|
with:
|
|
108
108
|
name: Screenshots
|
|
@@ -112,9 +112,9 @@ jobs:
|
|
|
112
112
|
env:
|
|
113
113
|
NODE_ENV: test
|
|
114
114
|
steps:
|
|
115
|
-
- uses: actions/checkout@
|
|
115
|
+
- uses: actions/checkout@v2.3.4
|
|
116
116
|
- name: Restore node modules cache
|
|
117
|
-
uses: actions/cache@
|
|
117
|
+
uses: actions/cache@v2.1.3
|
|
118
118
|
with:
|
|
119
119
|
path: node_modules
|
|
120
120
|
key: ${{ runner.os }}-yarn-${{ hashFiles('./package.json') }}
|
|
@@ -124,11 +124,3 @@ jobs:
|
|
|
124
124
|
run: yarn install
|
|
125
125
|
- name: Run jest
|
|
126
126
|
run: yarn jest
|
|
127
|
-
- name: Run jest & publish code coverage
|
|
128
|
-
uses: paambaati/codeclimate-action@v2.5.7
|
|
129
|
-
env:
|
|
130
|
-
CC_TEST_REPORTER_ID: bca4349e32f97919210ac8a450b04904b90683fcdd57d65a22c0f5065482bc22
|
|
131
|
-
with:
|
|
132
|
-
coverageLocations:
|
|
133
|
-
./coverage/lcov.info:lcov
|
|
134
|
-
coverageCommand: yarn jest --collectCoverage --coverageDirectory=coverage
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
|
-
## 5.0.
|
|
1
|
+
## 5.0.3 (2021-01-12)
|
|
2
2
|
|
|
3
|
+
- Fix copy element feature [#1996](https://github.com/AlchemyCMS/alchemy_cms/pull/1996) ([tvdeyen](https://github.com/tvdeyen))
|
|
4
|
+
|
|
5
|
+
## 5.0.2 (2020-12-18)
|
|
6
|
+
|
|
7
|
+
- Fix page sorting [#1984](https://github.com/AlchemyCMS/alchemy_cms/pull/1984) ([tvdeyen](https://github.com/tvdeyen))
|
|
8
|
+
|
|
9
|
+
## 5.0.1 (2020-09-29)
|
|
10
|
+
|
|
11
|
+
- Better image alt text support [#1940](https://github.com/AlchemyCMS/alchemy_cms/pull/1940) ([tvdeyen](https://github.com/tvdeyen))
|
|
12
|
+
|
|
13
|
+
## 5.0.0 (2020-07-17)
|
|
14
|
+
|
|
15
|
+
- Do not convert JPEG images into JPG [#1904](https://github.com/AlchemyCMS/alchemy_cms/pull/1904) ([tvdeyen](https://github.com/tvdeyen))
|
|
16
|
+
- Do not enable image cropper if file is missing [#1903](https://github.com/AlchemyCMS/alchemy_cms/pull/1903) ([tvdeyen](https://github.com/tvdeyen))
|
|
17
|
+
- Always show original image as zoomed image [#1902](https://github.com/AlchemyCMS/alchemy_cms/pull/1902) ([tvdeyen](https://github.com/tvdeyen))
|
|
18
|
+
- Rename Attachment#urlname into slug [#1848](https://github.com/AlchemyCMS/alchemy_cms/pull/1848) ([tvdeyen](https://github.com/tvdeyen))
|
|
19
|
+
- Deprecate toolbar helper ([tvdeyen](https://github.com/tvdeyen))
|
|
3
20
|
- Deprecate redirect_to_public_child ([tvdeyen](https://github.com/tvdeyen))
|
|
4
21
|
- Add --auto-accept option to installer ([tvdeyen](https://github.com/tvdeyen))
|
|
5
22
|
- Move all installer code into install generator ([tvdeyen](https://github.com/tvdeyen))
|
data/Gemfile
CHANGED
|
@@ -10,7 +10,7 @@ if ENV["DB"].nil? || ENV["DB"] == "sqlite"
|
|
|
10
10
|
gem "sqlite3", "~> 1.4.1"
|
|
11
11
|
end
|
|
12
12
|
gem "mysql2", "~> 0.5.1" if ENV["DB"] == "mysql"
|
|
13
|
-
gem "pg",
|
|
13
|
+
gem "pg", "~> 1.0" if ENV["DB"] == "postgresql"
|
|
14
14
|
|
|
15
15
|
group :development, :test do
|
|
16
16
|
if ENV["GITHUB_ACTIONS"]
|
|
@@ -22,7 +22,7 @@ group :development, :test do
|
|
|
22
22
|
gem "yard"
|
|
23
23
|
gem "redcarpet"
|
|
24
24
|
gem "pry-byebug"
|
|
25
|
-
gem "rubocop", "~> 0.
|
|
25
|
+
gem "rubocop", "~> 0.85.0", require: false
|
|
26
26
|
gem "listen"
|
|
27
27
|
gem "localeapp", "~> 3.0", require: false
|
|
28
28
|
gem "dotenv", "~> 2.2"
|
data/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# AlchemyCMS
|
|
2
2
|
|
|
3
3
|
[](http://badge.fury.io/rb/alchemy_cms)
|
|
4
|
-
[](https://github.com/AlchemyCMS/alchemy_cms/actions)
|
|
5
5
|
[](https://codeclimate.com/github/AlchemyCMS/alchemy_cms/maintainability)
|
|
6
6
|
[](https://codeclimate.com/github/AlchemyCMS/alchemy_cms/test_coverage)
|
|
7
7
|
[](https://depfu.com/github/AlchemyCMS/alchemy_cms?project_id=4600)
|
|
@@ -314,6 +314,8 @@ module Alchemy
|
|
|
314
314
|
end
|
|
315
315
|
end
|
|
316
316
|
|
|
317
|
+
deprecate toolbar: "Please use `content_for(:toolbar)` instead", deprecator: Alchemy::Deprecation
|
|
318
|
+
|
|
317
319
|
# (internal) Used by upload form
|
|
318
320
|
def new_asset_path_with_session_information(asset_type)
|
|
319
321
|
session_key = Rails.application.config.session_options[:key]
|
|
@@ -26,12 +26,12 @@ module Alchemy
|
|
|
26
26
|
|
|
27
27
|
# Returns the path for downloading an alchemy attachment
|
|
28
28
|
def download_alchemy_attachment_path(attachment)
|
|
29
|
-
alchemy.download_attachment_path(attachment, attachment.
|
|
29
|
+
alchemy.download_attachment_path(attachment, attachment.slug)
|
|
30
30
|
end
|
|
31
31
|
|
|
32
32
|
# Returns the url for downloading an alchemy attachment
|
|
33
33
|
def download_alchemy_attachment_url(attachment)
|
|
34
|
-
alchemy.download_attachment_url(attachment, attachment.
|
|
34
|
+
alchemy.download_attachment_url(attachment, attachment.slug)
|
|
35
35
|
end
|
|
36
36
|
|
|
37
37
|
# Returns the full url containing host, page and anchor for the given element
|
|
@@ -77,10 +77,13 @@ module Alchemy
|
|
|
77
77
|
end
|
|
78
78
|
|
|
79
79
|
# An url save filename without format suffix
|
|
80
|
-
def
|
|
80
|
+
def slug
|
|
81
81
|
CGI.escape(file_name.gsub(/\.#{extension}$/, "").tr(".", " "))
|
|
82
82
|
end
|
|
83
83
|
|
|
84
|
+
alias_method :urlname, :slug
|
|
85
|
+
deprecate urlname: :slug, deprecator: Alchemy::Deprecation
|
|
86
|
+
|
|
84
87
|
# Checks if the attachment is restricted, because it is attached on restricted pages only
|
|
85
88
|
def restricted?
|
|
86
89
|
pages.any? && pages.not_restricted.blank?
|
|
@@ -55,7 +55,7 @@ module Alchemy
|
|
|
55
55
|
def img_tag
|
|
56
56
|
@_img_tag ||= image_tag(
|
|
57
57
|
essence.picture_url(options.except(*DEFAULT_OPTIONS.keys)), {
|
|
58
|
-
alt:
|
|
58
|
+
alt: alt_text,
|
|
59
59
|
title: essence.title.presence,
|
|
60
60
|
class: caption ? nil : essence.css_class.presence,
|
|
61
61
|
srcset: srcset.join(", ").presence,
|
|
@@ -79,5 +79,9 @@ module Alchemy
|
|
|
79
79
|
width.present? ? "#{url} #{width}w" : "#{url} #{height}h"
|
|
80
80
|
end
|
|
81
81
|
end
|
|
82
|
+
|
|
83
|
+
def alt_text
|
|
84
|
+
essence.alt_tag.presence || html_options.delete(:alt) || essence.picture.name&.humanize
|
|
85
|
+
end
|
|
82
86
|
end
|
|
83
87
|
end
|
|
@@ -71,7 +71,9 @@ module Alchemy
|
|
|
71
71
|
|
|
72
72
|
encoding_options = []
|
|
73
73
|
|
|
74
|
-
|
|
74
|
+
convert_format = target_format != image_file_format.sub("jpeg", "jpg")
|
|
75
|
+
|
|
76
|
+
if target_format =~ /jpe?g/ && convert_format
|
|
75
77
|
quality = options[:quality] || Config.get(:output_image_jpg_quality)
|
|
76
78
|
encoding_options << "-quality #{quality}"
|
|
77
79
|
end
|
|
@@ -80,7 +82,7 @@ module Alchemy
|
|
|
80
82
|
encoding_options << "-flatten"
|
|
81
83
|
end
|
|
82
84
|
|
|
83
|
-
convertion_needed =
|
|
85
|
+
convertion_needed = convert_format || encoding_options.present?
|
|
84
86
|
|
|
85
87
|
if has_convertible_format? && convertion_needed
|
|
86
88
|
image = image.encode(target_format, encoding_options.join(" "))
|
|
@@ -40,7 +40,7 @@ module Alchemy
|
|
|
40
40
|
|
|
41
41
|
level = path.count + base_level
|
|
42
42
|
|
|
43
|
-
path.last[:children] << page_hash(page,
|
|
43
|
+
path.last[:children] << page_hash(page, level, folded)
|
|
44
44
|
end
|
|
45
45
|
|
|
46
46
|
tree
|
|
@@ -48,7 +48,7 @@ module Alchemy
|
|
|
48
48
|
|
|
49
49
|
protected
|
|
50
50
|
|
|
51
|
-
def page_hash(page,
|
|
51
|
+
def page_hash(page, level, folded)
|
|
52
52
|
p_hash = {
|
|
53
53
|
id: page.id,
|
|
54
54
|
name: page.name,
|
|
@@ -59,8 +59,8 @@ module Alchemy
|
|
|
59
59
|
urlname: page.urlname,
|
|
60
60
|
url_path: page.url_path,
|
|
61
61
|
level: level,
|
|
62
|
-
root: page.
|
|
63
|
-
root_or_leaf: page.
|
|
62
|
+
root: page.root?,
|
|
63
|
+
root_or_leaf: page.root? || page.leaf?,
|
|
64
64
|
children: [],
|
|
65
65
|
}
|
|
66
66
|
|
|
@@ -1,29 +1,28 @@
|
|
|
1
1
|
<% label_title = Alchemy.t("Create #{resource_name}", default: Alchemy.t('Create')) %>
|
|
2
2
|
|
|
3
|
-
<% toolbar
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
<% content_for(:toolbar) do %>
|
|
4
|
+
<%= toolbar_button(
|
|
5
|
+
icon: :plus,
|
|
6
|
+
label: label_title,
|
|
7
|
+
url: new_resource_path,
|
|
8
|
+
title: label_title,
|
|
9
|
+
hotkey: 'alt+n',
|
|
10
|
+
dialog_options: {
|
|
9
11
|
title: label_title,
|
|
10
|
-
|
|
11
|
-
dialog_options: {
|
|
12
|
-
title: label_title,
|
|
13
|
-
size: resource_window_size
|
|
14
|
-
},
|
|
15
|
-
if_permitted_to: [:create, resource_model]
|
|
12
|
+
size: resource_window_size
|
|
16
13
|
},
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
) %>
|
|
14
|
+
if_permitted_to: [:create, resource_model]
|
|
15
|
+
) %>
|
|
16
|
+
<%= toolbar_button(
|
|
17
|
+
icon: :download,
|
|
18
|
+
url: resource_url_proxy.url_for(action: 'index', format: 'csv', q: search_filter_params[:q], sort: params[:sort]),
|
|
19
|
+
label: Alchemy.t(:download_csv),
|
|
20
|
+
title: Alchemy.t(:download_csv),
|
|
21
|
+
dialog: false,
|
|
22
|
+
if_permitted_to: [:index, resource_model]
|
|
23
|
+
) %>
|
|
24
|
+
<%= render 'alchemy/admin/partials/search_form' %>
|
|
25
|
+
<% end %>
|
|
27
26
|
|
|
28
27
|
<div id="archive_all" class="resources-table-wrapper<%= ' with_tag_filter' if resource_has_tags || resource_has_filters %>">
|
|
29
28
|
<%= render 'alchemy/admin/resources/table_header' %>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
<%= alchemy_form_for site, url:
|
|
2
|
-
<%= f.input :host, hint: resource_handler.help_text_for(name: :host)
|
|
1
|
+
<%= alchemy_form_for site, url: resource_path(site, search_filter_params) do |f| %>
|
|
2
|
+
<%= f.input :host, hint: resource_handler.help_text_for(name: :host)&.html_safe %>
|
|
3
3
|
<%= f.input :name %>
|
|
4
4
|
<%= f.input :public %>
|
|
5
5
|
<%= f.input :aliases, hint: resource_handler.help_text_for(name: :aliases), input_html: {rows: 4} %>
|
data/lib/alchemy/resource.rb
CHANGED
|
@@ -210,7 +210,7 @@ module Alchemy
|
|
|
210
210
|
@module_definition && @module_definition["engine_name"]
|
|
211
211
|
end
|
|
212
212
|
|
|
213
|
-
# Returns a help text for resource's form
|
|
213
|
+
# Returns a help text for resource's form or nil if no help text is available
|
|
214
214
|
#
|
|
215
215
|
# === Example:
|
|
216
216
|
#
|
|
@@ -223,7 +223,7 @@ module Alchemy
|
|
|
223
223
|
def help_text_for(attribute)
|
|
224
224
|
::I18n.translate!(attribute[:name], scope: [:alchemy, :resource_help_texts, resource_name])
|
|
225
225
|
rescue ::I18n::MissingTranslationData
|
|
226
|
-
|
|
226
|
+
nil
|
|
227
227
|
end
|
|
228
228
|
|
|
229
229
|
# Return attributes that should be viewable but not editable.
|
data/lib/alchemy/version.rb
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: 5.0.
|
|
4
|
+
version: 5.0.3
|
|
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:
|
|
16
|
+
date: 2021-01-12 00:00:00.000000000 Z
|
|
17
17
|
dependencies:
|
|
18
18
|
- !ruby/object:Gem::Dependency
|
|
19
19
|
name: active_model_serializers
|
|
@@ -1263,14 +1263,13 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
1263
1263
|
version: 2.3.0
|
|
1264
1264
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
1265
1265
|
requirements:
|
|
1266
|
-
- - "
|
|
1266
|
+
- - ">="
|
|
1267
1267
|
- !ruby/object:Gem::Version
|
|
1268
|
-
version:
|
|
1268
|
+
version: '0'
|
|
1269
1269
|
requirements:
|
|
1270
1270
|
- ImageMagick (libmagick), v6.6 or greater.
|
|
1271
|
-
rubygems_version: 3.
|
|
1271
|
+
rubygems_version: 3.1.4
|
|
1272
1272
|
signing_key:
|
|
1273
1273
|
specification_version: 4
|
|
1274
1274
|
summary: A powerful, userfriendly and flexible CMS for Rails
|
|
1275
1275
|
test_files: []
|
|
1276
|
-
...
|