alchemy_cms 5.0.0.rc2 → 5.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/.github/PULL_REQUEST_TEMPLATE.md +1 -1
- data/.github/workflows/stale.yml +1 -1
- data/.gitignore +1 -0
- data/.travis.yml +48 -0
- data/CHANGELOG.md +64 -2
- data/CONTRIBUTING.md +2 -2
- data/Gemfile +3 -3
- data/README.md +2 -2
- data/alchemy_cms.gemspec +3 -2
- data/app/assets/images/alchemy/missing-image.svg +1 -0
- data/app/assets/javascripts/alchemy/alchemy.element_editors.js.coffee +1 -4
- data/app/assets/javascripts/alchemy/alchemy.preview.js.coffee +0 -3
- data/app/assets/javascripts/alchemy/alchemy.preview_window.js.coffee +29 -4
- data/app/assets/stylesheets/alchemy/_variables.scss +3 -0
- data/app/assets/stylesheets/alchemy/archive.scss +23 -17
- data/app/assets/stylesheets/alchemy/buttons.scss +26 -15
- data/app/assets/stylesheets/alchemy/errors.scss +1 -1
- data/app/assets/stylesheets/alchemy/navigation.scss +7 -10
- data/app/assets/stylesheets/alchemy/pagination.scss +1 -1
- data/app/assets/stylesheets/alchemy/search.scss +12 -2
- data/app/assets/stylesheets/alchemy/selects.scss +4 -2
- data/app/assets/stylesheets/alchemy/tables.scss +38 -9
- data/app/assets/stylesheets/alchemy/tags.scss +19 -31
- data/app/controllers/alchemy/admin/pages_controller.rb +59 -9
- data/app/controllers/alchemy/admin/pictures_controller.rb +13 -6
- data/app/controllers/alchemy/admin/resources_controller.rb +3 -3
- data/app/controllers/alchemy/pages_controller.rb +49 -14
- data/app/helpers/alchemy/admin/base_helper.rb +0 -42
- data/app/helpers/alchemy/admin/navigation_helper.rb +2 -1
- data/app/helpers/alchemy/url_helper.rb +2 -2
- data/app/models/alchemy/attachment.rb +21 -1
- data/app/models/alchemy/attachment/url.rb +40 -0
- data/app/models/alchemy/essence_file.rb +1 -1
- data/app/models/alchemy/essence_picture.rb +4 -4
- data/app/models/alchemy/essence_picture_view.rb +10 -4
- data/app/models/alchemy/page.rb +24 -1
- data/app/models/alchemy/page/page_natures.rb +2 -0
- data/app/models/alchemy/page/url_path.rb +8 -6
- data/app/models/alchemy/picture.rb +58 -2
- data/app/models/alchemy/picture/calculations.rb +55 -0
- data/app/models/alchemy/picture/transformations.rb +5 -49
- data/app/models/alchemy/picture/url.rb +28 -75
- data/app/models/alchemy/picture_thumb.rb +57 -0
- data/app/models/alchemy/picture_thumb/create.rb +39 -0
- data/app/models/alchemy/picture_thumb/signature.rb +23 -0
- data/app/models/alchemy/picture_thumb/uid.rb +22 -0
- data/app/models/alchemy/picture_variant.rb +114 -0
- data/app/models/alchemy/site/layout.rb +30 -2
- data/app/views/alchemy/admin/attachments/show.html.erb +8 -8
- data/app/views/alchemy/admin/dashboard/index.html.erb +13 -16
- data/app/views/alchemy/admin/essence_pictures/crop.html.erb +1 -1
- data/app/views/alchemy/admin/essence_pictures/edit.html.erb +2 -2
- data/app/views/alchemy/admin/layoutpages/edit.html.erb +4 -6
- data/app/views/alchemy/admin/pages/_create_language_form.html.erb +19 -29
- data/app/views/alchemy/admin/pages/_form.html.erb +4 -6
- data/app/views/alchemy/admin/pages/_new_page_form.html.erb +12 -2
- data/app/views/alchemy/admin/pages/_page_layout_filter.html.erb +29 -0
- data/app/views/alchemy/admin/pages/_table.html.erb +27 -0
- data/app/views/alchemy/admin/pages/_table_row.html.erb +107 -0
- data/app/views/alchemy/admin/pages/_toolbar.html.erb +77 -0
- data/app/views/alchemy/admin/pages/edit.html.erb +9 -1
- data/app/views/alchemy/admin/pages/index.html.erb +41 -74
- data/app/views/alchemy/admin/pages/list/_table.html.erb +31 -0
- data/app/views/alchemy/admin/pages/unlock.js.erb +2 -2
- data/app/views/alchemy/admin/pages/update.js.erb +19 -10
- data/app/views/alchemy/admin/partials/_remote_search_form.html.erb +14 -13
- data/app/views/alchemy/admin/partials/_search_form.html.erb +8 -8
- data/app/views/alchemy/admin/pictures/_archive.html.erb +1 -1
- data/app/views/alchemy/admin/pictures/_form.html.erb +1 -1
- data/app/views/alchemy/admin/pictures/_picture.html.erb +3 -3
- data/app/views/alchemy/admin/pictures/_picture_to_assign.html.erb +1 -1
- data/app/views/alchemy/admin/pictures/edit_multiple.html.erb +1 -1
- data/app/views/alchemy/admin/pictures/index.html.erb +1 -1
- data/app/views/alchemy/admin/pictures/show.html.erb +3 -3
- data/app/views/alchemy/admin/resources/_filter_bar.html.erb +13 -11
- data/app/views/alchemy/admin/resources/_per_page_select.html.erb +3 -3
- data/app/views/alchemy/admin/resources/index.html.erb +24 -22
- data/app/views/alchemy/admin/tags/index.html.erb +14 -15
- data/app/views/alchemy/base/500.html.erb +11 -13
- data/app/views/alchemy/essences/_essence_file_view.html.erb +4 -4
- data/config/alchemy/config.yml +15 -11
- data/config/alchemy/modules.yml +12 -12
- data/config/locales/alchemy.en.yml +6 -4
- data/config/routes.rb +1 -1
- data/db/migrate/20200617110713_create_alchemy_picture_thumbs.rb +22 -0
- data/db/migrate/20200907111332_remove_tri_state_booleans.rb +33 -0
- data/lib/alchemy.rb +66 -0
- data/lib/alchemy/admin/preview_url.rb +2 -0
- data/lib/alchemy/auth_accessors.rb +12 -5
- data/lib/alchemy/config.rb +1 -3
- data/lib/alchemy/engine.rb +7 -6
- data/lib/alchemy/modules.rb +11 -1
- data/lib/alchemy/permissions.rb +1 -0
- data/lib/alchemy/test_support/factories/picture_factory.rb +0 -1
- data/lib/alchemy/test_support/factories/picture_thumb_factory.rb +12 -0
- data/lib/alchemy/version.rb +1 -1
- data/lib/alchemy_cms.rb +2 -3
- data/lib/generators/alchemy/install/files/alchemy.en.yml +2 -2
- data/lib/generators/alchemy/install/templates/dragonfly.rb.tt +5 -5
- data/lib/tasks/alchemy/thumbnails.rake +37 -0
- metadata +41 -13
- data/.github/workflows/ci.yml +0 -134
- data/.github/workflows/greetings.yml +0 -13
- data/app/controllers/concerns/alchemy/locale_redirects.rb +0 -40
- data/app/controllers/concerns/alchemy/page_redirects.rb +0 -68
- data/lib/alchemy/userstamp.rb +0 -12
@@ -171,8 +171,8 @@ en:
|
|
171
171
|
anchor_link_headline: "You can link to an element anchor from the actual page."
|
172
172
|
attribute_fixed: Value can't be changed for this page type
|
173
173
|
back: 'back'
|
174
|
-
create_tree_as_new_language: "Create %{language} as a new language tree"
|
175
174
|
locked_pages: "Active pages"
|
175
|
+
"Add a page": "Add a page"
|
176
176
|
"Add global page": "Add global page"
|
177
177
|
"Add page link": "Add page link"
|
178
178
|
"Alchemy is open software and itself uses open software and free resources:": "Alchemy is open software and itself uses open software and free resources:"
|
@@ -339,13 +339,13 @@ en:
|
|
339
339
|
copy_element: "Copy this element"
|
340
340
|
copy_page: "Copy page"
|
341
341
|
"Could not delete Pictures": "Could not delete Pictures"
|
342
|
-
copy_language_tree_heading: "Copy
|
342
|
+
copy_language_tree_heading: "Copy pages"
|
343
343
|
country_code_placeholder: 'i.e. US (optional)'
|
344
344
|
country_code_foot_note: "You only need to set a country code if you want to support multiple countries with the same language."
|
345
345
|
create: "create"
|
346
346
|
"Create language": "Create a new language"
|
347
347
|
"Create site": "Create a new site"
|
348
|
-
create_language_tree_heading: "Create
|
348
|
+
create_language_tree_heading: "Create new homepage"
|
349
349
|
create_menu: "Add a menu"
|
350
350
|
create_node: "Add a menu node"
|
351
351
|
create_page: "Create a new subpage"
|
@@ -402,6 +402,7 @@ en:
|
|
402
402
|
"Open upload form": "Open upload form"
|
403
403
|
"Select all pictures": "Select all pictures"
|
404
404
|
hide_element_content: "Hide this elements content."
|
405
|
+
homepage_does_not_exist: "This language has no homepage yet"
|
405
406
|
dashboard: "Dashboard"
|
406
407
|
image_alt_tag: "Alt-tag"
|
407
408
|
image_caption: "Caption"
|
@@ -415,7 +416,6 @@ en:
|
|
415
416
|
javascript_disabled_headline: "Javascript is disabled!"
|
416
417
|
javascript_disabled_text: "Alchemy needs Javascript to run smoothly. Please enable it in your browser settings."
|
417
418
|
language_code_placeholder: 'i.e. en'
|
418
|
-
language_does_not_exist: "This language tree does not exist"
|
419
419
|
language_pages_copied: "Language tree successfully copied."
|
420
420
|
last_upload_only: "Last upload only"
|
421
421
|
left: "left"
|
@@ -521,6 +521,7 @@ en:
|
|
521
521
|
'768': '768px (iPad - Portrait)'
|
522
522
|
'1024': '1024px (iPad - Landscape)'
|
523
523
|
'1280': '1280px (Desktop)'
|
524
|
+
preview_url: Preview
|
524
525
|
recently_uploaded_only: 'Recently uploaded only'
|
525
526
|
"regular method": "Regular method"
|
526
527
|
remove: "Remove"
|
@@ -690,6 +691,7 @@ en:
|
|
690
691
|
alchemy/message:
|
691
692
|
one: Message
|
692
693
|
other: Messages
|
694
|
+
alchemy/admin/preview_url: Internal
|
693
695
|
attributes:
|
694
696
|
alchemy/message:
|
695
697
|
salutation: 'Salutation'
|
data/config/routes.rb
CHANGED
@@ -124,7 +124,7 @@ Alchemy::Engine.routes.draw do
|
|
124
124
|
|
125
125
|
get "/attachment/:id/download(/:name)" => "attachments#download",
|
126
126
|
as: :download_attachment
|
127
|
-
get "/attachment/:id/show" => "attachments#show",
|
127
|
+
get "/attachment/:id/show(/:name)" => "attachments#show",
|
128
128
|
as: :show_attachment
|
129
129
|
|
130
130
|
resources :messages, only: [:index, :new, :create]
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class CreateAlchemyPictureThumbs < ActiveRecord::Migration[5.2]
|
4
|
+
def up
|
5
|
+
return if table_exists?(:alchemy_picture_thumbs)
|
6
|
+
|
7
|
+
create_table :alchemy_picture_thumbs do |t|
|
8
|
+
t.references :picture, foreign_key: { to_table: :alchemy_pictures }, null: false
|
9
|
+
t.string :signature, null: false
|
10
|
+
t.text :uid, null: false
|
11
|
+
end
|
12
|
+
add_index :alchemy_picture_thumbs, :signature, unique: true
|
13
|
+
end
|
14
|
+
|
15
|
+
def down
|
16
|
+
return unless table_exists?(:alchemy_picture_thumbs)
|
17
|
+
|
18
|
+
remove_foreign_key :alchemy_picture_thumbs, :alchemy_pictures, column: :picture_id
|
19
|
+
remove_index :alchemy_picture_thumbs, :signature
|
20
|
+
drop_table :alchemy_picture_thumbs
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class RemoveTriStateBooleans < ActiveRecord::Migration[5.2]
|
4
|
+
def change
|
5
|
+
change_column_null :alchemy_elements, :public, false, false
|
6
|
+
change_column_default :alchemy_elements, :public, true
|
7
|
+
|
8
|
+
change_column_null :alchemy_elements, :folded, false
|
9
|
+
change_column_null :alchemy_elements, :unique, false
|
10
|
+
|
11
|
+
change_column_null :alchemy_essence_richtexts, :public, false, false
|
12
|
+
change_column_default :alchemy_essence_richtexts, :public, false
|
13
|
+
|
14
|
+
change_column_null :alchemy_essence_texts, :public, false
|
15
|
+
|
16
|
+
change_column_null :alchemy_folded_pages, :folded, false
|
17
|
+
|
18
|
+
change_column_null :alchemy_languages, :public, false
|
19
|
+
change_column_null :alchemy_languages, :default, false
|
20
|
+
|
21
|
+
change_column_null :alchemy_pages, :language_root, false, false
|
22
|
+
change_column_default :alchemy_pages, :language_root, false
|
23
|
+
|
24
|
+
change_column_null :alchemy_pages, :restricted, false
|
25
|
+
change_column_null :alchemy_pages, :robot_index, false
|
26
|
+
change_column_null :alchemy_pages, :robot_follow, false
|
27
|
+
change_column_null :alchemy_pages, :sitemap, false
|
28
|
+
|
29
|
+
change_column_null :alchemy_sites, :public, false
|
30
|
+
change_column_null :alchemy_sites, :redirect_to_primary_host, false, false
|
31
|
+
change_column_default :alchemy_sites, :redirect_to_primary_host, false
|
32
|
+
end
|
33
|
+
end
|
data/lib/alchemy.rb
ADDED
@@ -0,0 +1,66 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "alchemy/admin/preview_url"
|
4
|
+
|
5
|
+
module Alchemy
|
6
|
+
YAML_WHITELIST_CLASSES = %w(Symbol Date Regexp)
|
7
|
+
|
8
|
+
# Define page preview sources
|
9
|
+
#
|
10
|
+
# A preview source is a Ruby class returning an URL
|
11
|
+
# that is used as source for the preview frame in the
|
12
|
+
# admin UI.
|
13
|
+
#
|
14
|
+
# == Example
|
15
|
+
#
|
16
|
+
# # lib/acme/preview_source.rb
|
17
|
+
# class Acme::PreviewSource < Alchemy::Admin::PreviewUrl
|
18
|
+
# def url_for(page)
|
19
|
+
# if page.site.name == "Next"
|
20
|
+
# "https://user:#{ENV['PREVIEW_HTTP_PASS']}@next.acme.com"
|
21
|
+
# else
|
22
|
+
# "https://www.acme.com"
|
23
|
+
# end
|
24
|
+
# end
|
25
|
+
# end
|
26
|
+
#
|
27
|
+
# # config/initializers/alchemy.rb
|
28
|
+
# require "acme/preview_source"
|
29
|
+
# Alchemy.preview_sources << Acme::PreviewSource
|
30
|
+
#
|
31
|
+
# # config/locales/de.yml
|
32
|
+
# de:
|
33
|
+
# activemodel:
|
34
|
+
# models:
|
35
|
+
# acme/preview_source: Acme Vorschau
|
36
|
+
#
|
37
|
+
def self.preview_sources
|
38
|
+
@_preview_sources ||= begin
|
39
|
+
Set.new << Alchemy::Admin::PreviewUrl
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
# Define page publish targets
|
44
|
+
#
|
45
|
+
# A publish target is a ActiveJob that gets performed
|
46
|
+
# whenever a user clicks the publish page button.
|
47
|
+
#
|
48
|
+
# Use this to trigger deployment hooks of external
|
49
|
+
# services in an asychronous way.
|
50
|
+
#
|
51
|
+
# == Example
|
52
|
+
#
|
53
|
+
# # app/jobs/publish_job.rb
|
54
|
+
# class PublishJob < ApplicationJob
|
55
|
+
# def perform(page)
|
56
|
+
# RestClient.post(ENV['BUILD_HOOK_URL'])
|
57
|
+
# end
|
58
|
+
# end
|
59
|
+
#
|
60
|
+
# # config/initializers/alchemy.rb
|
61
|
+
# Alchemy.publish_targets << PublishJob
|
62
|
+
#
|
63
|
+
def self.publish_targets
|
64
|
+
@_publish_targets ||= Set.new
|
65
|
+
end
|
66
|
+
end
|
@@ -91,16 +91,23 @@ module Alchemy
|
|
91
91
|
@@user_class_name.constantize
|
92
92
|
rescue NameError => e
|
93
93
|
if e.message =~ /#{Regexp.escape(@@user_class_name)}/
|
94
|
-
|
94
|
+
Rails.logger.warn <<~MSG
|
95
|
+
#{e.message}
|
96
|
+
#{e.backtrace.join("\n")}
|
95
97
|
|
96
|
-
|
98
|
+
AlchemyCMS cannot find any user class!
|
97
99
|
|
98
|
-
|
99
|
-
to create your own class, add the `alchemy-devise` gem to your Gemfile.
|
100
|
+
Please add a user class and tell Alchemy about it:
|
100
101
|
|
101
|
-
|
102
|
+
# config/initializers/alchemy.rb
|
103
|
+
Alchemy.user_class_name = 'MyUser'
|
104
|
+
|
105
|
+
Or add the `alchemy-devise` gem to your Gemfile:
|
106
|
+
|
107
|
+
bundle add alchemy-devise
|
102
108
|
|
103
109
|
MSG
|
110
|
+
nil
|
104
111
|
else
|
105
112
|
raise e
|
106
113
|
end
|
data/lib/alchemy/config.rb
CHANGED
data/lib/alchemy/engine.rb
CHANGED
@@ -9,10 +9,6 @@ module Alchemy
|
|
9
9
|
Alchemy::LOOKUP_CONTEXT = ActionView::LookupContext.new(Rails.root.join("app", "views", "alchemy"))
|
10
10
|
end
|
11
11
|
|
12
|
-
initializer "alchemy.admin.preview_url" do
|
13
|
-
Alchemy::Admin::PREVIEW_URL = Alchemy::Admin::PreviewUrl.new(routes: Alchemy::Engine.routes)
|
14
|
-
end
|
15
|
-
|
16
12
|
initializer "alchemy.dependency_tracker" do
|
17
13
|
[:erb, :slim, :haml].each do |handler|
|
18
14
|
ActionView::DependencyTracker.register_tracker(handler, CacheDigests::TemplateTracker)
|
@@ -40,8 +36,13 @@ module Alchemy
|
|
40
36
|
end
|
41
37
|
end
|
42
38
|
|
43
|
-
|
44
|
-
|
39
|
+
initializer "alchemy.userstamp" do
|
40
|
+
if Alchemy.user_class
|
41
|
+
ActiveSupport.on_load(:active_record) do
|
42
|
+
Alchemy.user_class.model_stamper
|
43
|
+
Alchemy.user_class.stampable(stamper_class_name: Alchemy.user_class_name)
|
44
|
+
end
|
45
|
+
end
|
45
46
|
end
|
46
47
|
end
|
47
48
|
end
|
data/lib/alchemy/modules.rb
CHANGED
@@ -72,7 +72,8 @@ module Alchemy
|
|
72
72
|
alchemy_modules.detect do |alchemy_module|
|
73
73
|
module_navi = alchemy_module.fetch("navigation", {})
|
74
74
|
definition_from_mainnavi(module_navi, name_or_params) ||
|
75
|
-
definition_from_subnavi(module_navi, name_or_params)
|
75
|
+
definition_from_subnavi(module_navi, name_or_params) ||
|
76
|
+
definition_from_nested(module_navi, name_or_params)
|
76
77
|
end
|
77
78
|
else
|
78
79
|
raise ArgumentError, "Could not find module definition for #{name_or_params}"
|
@@ -94,6 +95,15 @@ module Alchemy
|
|
94
95
|
end
|
95
96
|
end
|
96
97
|
|
98
|
+
def definition_from_nested(module_navi, params)
|
99
|
+
nested = module_navi["nested"]
|
100
|
+
return if nested.nil?
|
101
|
+
|
102
|
+
nested.any? do |navi|
|
103
|
+
controller_matches?(navi, params) && action_matches?(navi, params)
|
104
|
+
end
|
105
|
+
end
|
106
|
+
|
97
107
|
def controller_matches?(navi, params)
|
98
108
|
remove_slash(navi["controller"]) == remove_slash(params["controller"])
|
99
109
|
end
|
data/lib/alchemy/permissions.rb
CHANGED
@@ -0,0 +1,12 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "factory_bot"
|
4
|
+
require "securerandom"
|
5
|
+
|
6
|
+
FactoryBot.define do
|
7
|
+
factory :alchemy_picture_thumb, class: "Alchemy::PictureThumb" do
|
8
|
+
picture { create(:alchemy_picture) }
|
9
|
+
signature { SecureRandom.hex(16) }
|
10
|
+
sequence(:uid) { |n| "#{Time.now.strftime("%Y/%m/%d")}/#{n}.jpg" }
|
11
|
+
end
|
12
|
+
end
|
data/lib/alchemy/version.rb
CHANGED
data/lib/alchemy_cms.rb
CHANGED
@@ -18,7 +18,7 @@ en:
|
|
18
18
|
# Default texts for new contents created
|
19
19
|
default_content_texts:
|
20
20
|
article_headline: "Welcome to your first Alchemy CMS page"
|
21
|
-
article_text: '<p><strong>How to get started.</strong></p><p>First of all you should read about Alchemy and its architecture in the <a class="external" href="http://guides.alchemy-cms.com/
|
21
|
+
article_text: '<p><strong>How to get started.</strong></p><p>First of all you should read about Alchemy and its architecture in the <a class="external" href="http://guides.alchemy-cms.com/alchemy_approach.html" target="_blank" data-link-target="blank">guidelines</a>.</p><p>The most important things to know about Alchemy are elements and page layouts.</p><p><span style="text-decoration: underline;"><strong>Elements:</strong></span></p><p>With Alchemy you can split pages into content parts, elements. These elements can be defined out of several base content types: essences. The basic essences are:</p><ul><li>EssenceText - <em>A single line of text</em></li><li>EssenceRichtext - <em>A TinyMCE powered formatted text block</em></li><li>EssencePicture - <em>A reference to an image</em></li><li>EssenceHtml - <em>HTML embed code</em></li><li>EssenceSelect - <em>A selection of values</em></li><li>EssenceBoolean - <em>A checkbox</em></li></ul><p>Elements get defined in a YAML file <strong>config/alchemy/elements.yml</strong></p><p><a class="external" href="http://guides.alchemy-cms.com/elements.html" target="_blank" data-link-target="blank">Read more about elements and how to define them in the guidelines.</a></p><p><span style="text-decoration: underline;"><strong>Page types:</strong></span></p><p>You can define several types of pages, called page layouts. You can assign elements to page layouts and control how elements and the page of a certain layout behave.</p><p>Page layouts get defined in a YAML file <strong>config/alchemy/page_layouts.yml</strong></p><p><a class="external" href="http://guides.alchemy-cms.com/page_layouts.html" target="_blank" data-link-target="blank">Read more about defining page layouts in the guidelines.</a></p>'
|
22
22
|
|
23
23
|
# Hint texts for elements
|
24
24
|
element_hints:
|
@@ -28,4 +28,4 @@ en:
|
|
28
28
|
content_hints:
|
29
29
|
headline: "This is a single line of unformatable Text"
|
30
30
|
picture: "Pictures are stored in the library. You can assign a picture multiple times throughout your site. Alchemy has an image cropper build right in."
|
31
|
-
text: "This is a rich text block powered by TinyMCE editor. You can change the configuration of the editor. See http://guides.alchemy-cms.com/
|
31
|
+
text: "This is a rich text block powered by TinyMCE editor. You can change the configuration of the editor. See http://guides.alchemy-cms.com/customize_tinymce.html"
|
@@ -15,12 +15,12 @@ Dragonfly.app(:alchemy_pictures).configure do
|
|
15
15
|
dragonfly_url nil
|
16
16
|
plugin :imagemagick
|
17
17
|
plugin :svg
|
18
|
-
secret
|
19
|
-
url_format
|
18
|
+
secret "<%= SecureRandom.hex(32) %>"
|
19
|
+
url_format "/pictures/:job/:basename.:ext"
|
20
20
|
|
21
21
|
datastore :file,
|
22
|
-
root_path: Rails.root.join(
|
23
|
-
server_root: Rails.root.join(
|
22
|
+
root_path: Rails.root.join("uploads/pictures").to_s,
|
23
|
+
server_root: Rails.root.join("public"),
|
24
24
|
store_meta: false
|
25
25
|
end
|
26
26
|
|
@@ -30,6 +30,6 @@ Rails.application.middleware.use Dragonfly::Middleware, :alchemy_pictures
|
|
30
30
|
# Attachments
|
31
31
|
Dragonfly.app(:alchemy_attachments).configure do
|
32
32
|
datastore :file,
|
33
|
-
root_path:
|
33
|
+
root_path: Rails.root.join("uploads/attachments").to_s,
|
34
34
|
store_meta: false
|
35
35
|
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
namespace :alchemy do
|
4
|
+
namespace :generate do
|
5
|
+
desc "Generates all thumbnails for Alchemy Pictures and EssencePictures."
|
6
|
+
task thumbnails: [
|
7
|
+
"alchemy_dragonfly_s3:generate:picture_thumbnails",
|
8
|
+
"alchemy_dragonfly_s3:generate:essence_picture_thumbnails",
|
9
|
+
]
|
10
|
+
|
11
|
+
desc "Generates thumbnails for Alchemy Pictures."
|
12
|
+
task picture_thumbnails: :environment do
|
13
|
+
puts "Regenerate #{Alchemy::Picture.count} picture thumbnails."
|
14
|
+
puts "Please wait..."
|
15
|
+
|
16
|
+
Alchemy::Picture.find_each do |picture|
|
17
|
+
puts Alchemy::PictureThumb.generate_thumbs!(picture)
|
18
|
+
end
|
19
|
+
|
20
|
+
puts "Done!"
|
21
|
+
end
|
22
|
+
|
23
|
+
desc "Generates thumbnails for Alchemy EssencePictures."
|
24
|
+
task essence_picture_thumbnails: :environment do
|
25
|
+
essence_pictures = Alchemy::EssencePicture.joins(:content, :ingredient_association)
|
26
|
+
puts "Regenerate #{essence_pictures.count} essence picture thumbnails."
|
27
|
+
puts "Please wait..."
|
28
|
+
|
29
|
+
essence_pictures.find_each do |essence_picture|
|
30
|
+
puts essence_picture.picture_url
|
31
|
+
puts essence_picture.thumbnail_url
|
32
|
+
end
|
33
|
+
|
34
|
+
puts "Done!"
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
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.
|
4
|
+
version: 5.1.0.rc1
|
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: 2020-
|
16
|
+
date: 2020-11-06 00:00:00.000000000 Z
|
17
17
|
dependencies:
|
18
18
|
- !ruby/object:Gem::Dependency
|
19
19
|
name: active_model_serializers
|
@@ -87,22 +87,22 @@ dependencies:
|
|
87
87
|
name: coffee-rails
|
88
88
|
requirement: !ruby/object:Gem::Requirement
|
89
89
|
requirements:
|
90
|
-
- - "
|
90
|
+
- - ">="
|
91
91
|
- !ruby/object:Gem::Version
|
92
92
|
version: '4.0'
|
93
93
|
- - "<"
|
94
94
|
- !ruby/object:Gem::Version
|
95
|
-
version: '
|
95
|
+
version: '6.0'
|
96
96
|
type: :runtime
|
97
97
|
prerelease: false
|
98
98
|
version_requirements: !ruby/object:Gem::Requirement
|
99
99
|
requirements:
|
100
|
-
- - "
|
100
|
+
- - ">="
|
101
101
|
- !ruby/object:Gem::Version
|
102
102
|
version: '4.0'
|
103
103
|
- - "<"
|
104
104
|
- !ruby/object:Gem::Version
|
105
|
-
version: '
|
105
|
+
version: '6.0'
|
106
106
|
- !ruby/object:Gem::Dependency
|
107
107
|
name: dragonfly
|
108
108
|
requirement: !ruby/object:Gem::Requirement
|
@@ -477,14 +477,14 @@ dependencies:
|
|
477
477
|
requirements:
|
478
478
|
- - "~>"
|
479
479
|
- !ruby/object:Gem::Version
|
480
|
-
version: '
|
480
|
+
version: '5.0'
|
481
481
|
type: :development
|
482
482
|
prerelease: false
|
483
483
|
version_requirements: !ruby/object:Gem::Requirement
|
484
484
|
requirements:
|
485
485
|
- - "~>"
|
486
486
|
- !ruby/object:Gem::Version
|
487
|
-
version: '
|
487
|
+
version: '5.0'
|
488
488
|
- !ruby/object:Gem::Dependency
|
489
489
|
name: rails-controller-testing
|
490
490
|
requirement: !ruby/object:Gem::Requirement
|
@@ -583,6 +583,20 @@ dependencies:
|
|
583
583
|
- - "~>"
|
584
584
|
- !ruby/object:Gem::Version
|
585
585
|
version: '4.0'
|
586
|
+
- !ruby/object:Gem::Dependency
|
587
|
+
name: timecop
|
588
|
+
requirement: !ruby/object:Gem::Requirement
|
589
|
+
requirements:
|
590
|
+
- - "~>"
|
591
|
+
- !ruby/object:Gem::Version
|
592
|
+
version: '0.9'
|
593
|
+
type: :development
|
594
|
+
prerelease: false
|
595
|
+
version_requirements: !ruby/object:Gem::Requirement
|
596
|
+
requirements:
|
597
|
+
- - "~>"
|
598
|
+
- !ruby/object:Gem::Version
|
599
|
+
version: '0.9'
|
586
600
|
description: Alchemy is a powerful, userfriendly and flexible Rails CMS.
|
587
601
|
email:
|
588
602
|
- hello@alchemy-cms.com
|
@@ -596,14 +610,13 @@ files:
|
|
596
610
|
- ".github/ISSUE_TEMPLATE/Bug_report.md"
|
597
611
|
- ".github/ISSUE_TEMPLATE/Feature_request.md"
|
598
612
|
- ".github/PULL_REQUEST_TEMPLATE.md"
|
599
|
-
- ".github/workflows/ci.yml"
|
600
|
-
- ".github/workflows/greetings.yml"
|
601
613
|
- ".github/workflows/stale.yml"
|
602
614
|
- ".gitignore"
|
603
615
|
- ".hound.yml"
|
604
616
|
- ".localeapp/config.rb"
|
605
617
|
- ".prettierrc"
|
606
618
|
- ".rubocop.yml"
|
619
|
+
- ".travis.yml"
|
607
620
|
- ".yardopts"
|
608
621
|
- CHANGELOG.md
|
609
622
|
- CODE_OF_CONDUCT.md
|
@@ -620,6 +633,7 @@ files:
|
|
620
633
|
- app/assets/images/alchemy/icon-white.svg
|
621
634
|
- app/assets/images/alchemy/icon.svg
|
622
635
|
- app/assets/images/alchemy/lupe.cur
|
636
|
+
- app/assets/images/alchemy/missing-image.svg
|
623
637
|
- app/assets/javascripts/alchemy/admin.js
|
624
638
|
- app/assets/javascripts/alchemy/alchemy.autocomplete.js.coffee
|
625
639
|
- app/assets/javascripts/alchemy/alchemy.base.js.coffee
|
@@ -757,8 +771,6 @@ files:
|
|
757
771
|
- app/controllers/concerns/alchemy/admin/current_language.rb
|
758
772
|
- app/controllers/concerns/alchemy/admin/uploader_responses.rb
|
759
773
|
- app/controllers/concerns/alchemy/legacy_page_redirects.rb
|
760
|
-
- app/controllers/concerns/alchemy/locale_redirects.rb
|
761
|
-
- app/controllers/concerns/alchemy/page_redirects.rb
|
762
774
|
- app/controllers/concerns/alchemy/site_redirects.rb
|
763
775
|
- app/decorators/alchemy/content_editor.rb
|
764
776
|
- app/decorators/alchemy/element_editor.rb
|
@@ -780,6 +792,7 @@ files:
|
|
780
792
|
- app/mailers/alchemy/base_mailer.rb
|
781
793
|
- app/mailers/alchemy/messages_mailer.rb
|
782
794
|
- app/models/alchemy/attachment.rb
|
795
|
+
- app/models/alchemy/attachment/url.rb
|
783
796
|
- app/models/alchemy/base_record.rb
|
784
797
|
- app/models/alchemy/content.rb
|
785
798
|
- app/models/alchemy/content/factory.rb
|
@@ -815,9 +828,15 @@ files:
|
|
815
828
|
- app/models/alchemy/page/page_scopes.rb
|
816
829
|
- app/models/alchemy/page/url_path.rb
|
817
830
|
- app/models/alchemy/picture.rb
|
831
|
+
- app/models/alchemy/picture/calculations.rb
|
818
832
|
- app/models/alchemy/picture/preprocessor.rb
|
819
833
|
- app/models/alchemy/picture/transformations.rb
|
820
834
|
- app/models/alchemy/picture/url.rb
|
835
|
+
- app/models/alchemy/picture_thumb.rb
|
836
|
+
- app/models/alchemy/picture_thumb/create.rb
|
837
|
+
- app/models/alchemy/picture_thumb/signature.rb
|
838
|
+
- app/models/alchemy/picture_thumb/uid.rb
|
839
|
+
- app/models/alchemy/picture_variant.rb
|
821
840
|
- app/models/alchemy/site.rb
|
822
841
|
- app/models/alchemy/site/layout.rb
|
823
842
|
- app/models/alchemy/tag.rb
|
@@ -923,10 +942,14 @@ files:
|
|
923
942
|
- app/views/alchemy/admin/pages/_new_page_form.html.erb
|
924
943
|
- app/views/alchemy/admin/pages/_page.html.erb
|
925
944
|
- app/views/alchemy/admin/pages/_page_infos.html.erb
|
945
|
+
- app/views/alchemy/admin/pages/_page_layout_filter.html.erb
|
926
946
|
- app/views/alchemy/admin/pages/_page_status.html.erb
|
927
947
|
- app/views/alchemy/admin/pages/_publication_fields.html.erb
|
928
948
|
- app/views/alchemy/admin/pages/_sitemap.html.erb
|
949
|
+
- app/views/alchemy/admin/pages/_table.html.erb
|
950
|
+
- app/views/alchemy/admin/pages/_table_row.html.erb
|
929
951
|
- app/views/alchemy/admin/pages/_tinymce_custom_config.html.erb
|
952
|
+
- app/views/alchemy/admin/pages/_toolbar.html.erb
|
930
953
|
- app/views/alchemy/admin/pages/configure.html.erb
|
931
954
|
- app/views/alchemy/admin/pages/edit.html.erb
|
932
955
|
- app/views/alchemy/admin/pages/flush.js.erb
|
@@ -934,6 +957,7 @@ files:
|
|
934
957
|
- app/views/alchemy/admin/pages/index.html.erb
|
935
958
|
- app/views/alchemy/admin/pages/info.html.erb
|
936
959
|
- app/views/alchemy/admin/pages/link.html.erb
|
960
|
+
- app/views/alchemy/admin/pages/list/_table.html.erb
|
937
961
|
- app/views/alchemy/admin/pages/locked.html.erb
|
938
962
|
- app/views/alchemy/admin/pages/new.html.erb
|
939
963
|
- app/views/alchemy/admin/pages/show.html.erb
|
@@ -1070,6 +1094,9 @@ files:
|
|
1070
1094
|
- db/migrate/20200511113603_add_menu_type_to_alchemy_nodes.rb
|
1071
1095
|
- db/migrate/20200514091507_make_page_layoutpage_null_false.rb
|
1072
1096
|
- db/migrate/20200519073500_remove_visible_from_alchemy_pages.rb
|
1097
|
+
- db/migrate/20200617110713_create_alchemy_picture_thumbs.rb
|
1098
|
+
- db/migrate/20200907111332_remove_tri_state_booleans.rb
|
1099
|
+
- lib/alchemy.rb
|
1073
1100
|
- lib/alchemy/ability_helper.rb
|
1074
1101
|
- lib/alchemy/admin/locale.rb
|
1075
1102
|
- lib/alchemy/admin/preview_url.rb
|
@@ -1118,6 +1145,7 @@ files:
|
|
1118
1145
|
- lib/alchemy/test_support/factories/node_factory.rb
|
1119
1146
|
- lib/alchemy/test_support/factories/page_factory.rb
|
1120
1147
|
- lib/alchemy/test_support/factories/picture_factory.rb
|
1148
|
+
- lib/alchemy/test_support/factories/picture_thumb_factory.rb
|
1121
1149
|
- lib/alchemy/test_support/factories/site_factory.rb
|
1122
1150
|
- lib/alchemy/test_support/fixtures/image.png
|
1123
1151
|
- lib/alchemy/test_support/integration_helpers.rb
|
@@ -1128,7 +1156,6 @@ files:
|
|
1128
1156
|
- lib/alchemy/upgrader/five_point_zero.rb
|
1129
1157
|
- lib/alchemy/upgrader/tasks/element_views_updater.rb
|
1130
1158
|
- lib/alchemy/upgrader/tasks/harden_gutentag_migrations.rb
|
1131
|
-
- lib/alchemy/userstamp.rb
|
1132
1159
|
- lib/alchemy/version.rb
|
1133
1160
|
- lib/alchemy_cms.rb
|
1134
1161
|
- lib/generators/alchemy/base.rb
|
@@ -1175,6 +1202,7 @@ files:
|
|
1175
1202
|
- lib/kaminari/scoped_pagination_url_helper.rb
|
1176
1203
|
- lib/tasks/alchemy/db.rake
|
1177
1204
|
- lib/tasks/alchemy/install.rake
|
1205
|
+
- lib/tasks/alchemy/thumbnails.rake
|
1178
1206
|
- lib/tasks/alchemy/tidy.rake
|
1179
1207
|
- lib/tasks/alchemy/upgrade.rake
|
1180
1208
|
- package.json
|