alchemy_cms 6.0.10 → 6.0.12

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 03cfa47992384280268b398c712c0d2fe88402482c1acd514406ba784e5e74d0
4
- data.tar.gz: 9793cf56d7592cdd552009efac7f065d0ee1c6511b4d4d2e6307997c850c88d8
3
+ metadata.gz: 706ea8d8bb121be924f467a6d367104dae78cf131a1a86bca33c08c75f377239
4
+ data.tar.gz: 8e8d3603be2b6b507c39a010b6231b2b3b753babb6556453741258699635a400
5
5
  SHA512:
6
- metadata.gz: d3600a98fec4301d4d5ed8dd156ecde606a1857cdd028e5c97318ca3284d19e54e13614e1192ef69bff3805037c325d8a57821efbebf449101cda575559c6874
7
- data.tar.gz: e0d22ac66fb2b8d75a5bc3719372f12be3332dedad315f5f8758850407b7690a98d5eb24ac0b905199de40a7ba9f13930ef6c79c36304b02ee894f7410ad1273
6
+ metadata.gz: 00b2766205aba938284f4fef79e6d7e00c1271c243ab4b50faa63dff68e11cb47c2029bc4afd20f57c917966429083328a0ab9a3629ab9ede810793b60aa036a
7
+ data.tar.gz: ecfbc1794df353099fd1ec2454275c55d09c9521cb85591258f67707ed2cf6dc72f287ca99135373783710def1df11a3302066f51935772bcf84c56d94a8ba98
data/CHANGELOG.md CHANGED
@@ -1,3 +1,14 @@
1
+ ## 6.0.12 (2022-11-19)
2
+
3
+ - More installer options [#2385](https://github.com/AlchemyCMS/alchemy_cms/pull/2385) ([tvdeyen](https://github.com/tvdeyen))
4
+ - Fix custom module installer [#2384](https://github.com/AlchemyCMS/alchemy_cms/pull/2384) ([tvdeyen](https://github.com/tvdeyen))
5
+ - Always provide format with attachment URLs [#2383](https://github.com/AlchemyCMS/alchemy_cms/pull/2383) ([mamhoff](https://github.com/mamhoff))
6
+
7
+ ## 6.0.11 (2022-09-22)
8
+
9
+ - Do not touch pages when toggling element [#2377](https://github.com/AlchemyCMS/alchemy_cms/pull/2377) ([tvdeyen](https://github.com/tvdeyen))
10
+ - Remove unused Kaminari::Helpers::Tag hack [#2376](https://github.com/AlchemyCMS/alchemy_cms/pull/2376) ([tvdeyen](https://github.com/tvdeyen))
11
+
1
12
  ## 6.0.10 (2022-09-04)
2
13
 
3
14
  - Deprecate essence classes [#2371](https://github.com/AlchemyCMS/alchemy_cms/pull/2371) ([tvdeyen](https://github.com/tvdeyen))
@@ -90,14 +90,12 @@ module Alchemy
90
90
  end
91
91
  end
92
92
 
93
- # Toggle fodls the element and persists the state in the db
93
+ # Toggle folds the element and persists the state in the db
94
94
  #
95
- # Ingredient validations might make the element invalid.
96
- # In this case we are just toggling a UI state and do not care about the validations.
97
95
  def fold
98
96
  @page = @element.page
99
- @element.folded = !@element.folded
100
- @element.save(validate: false)
97
+ # We do not want to trigger the touch callback or any validations
98
+ @element.update_columns(folded: !@element.folded)
101
99
  end
102
100
 
103
101
  private
@@ -23,6 +23,7 @@ module Alchemy
23
23
  # @return [String]
24
24
  #
25
25
  def call(options = {})
26
+ options[:format] ||= @attachment.suffix
26
27
  if options.delete(:download)
27
28
  routes.download_attachment_path(@attachment, options)
28
29
  else
@@ -18,12 +18,10 @@ module Alchemy
18
18
  inject_into_file "./config/routes.rb", "\n mount Alchemy::Engine => '#{mountpoint}'\n", { after: sentinel, verbose: true }
19
19
  end
20
20
 
21
- def set_primary_language(auto_accept = false)
22
- code = "en"
21
+ def set_primary_language(code: "en", name: "English", auto_accept: false)
23
22
  unless auto_accept
24
23
  code = ask("- What is the language code of your site's primary language?", default: code)
25
24
  end
26
- name = "English"
27
25
  unless auto_accept
28
26
  name = ask("- What is the name of your site's primary language?", default: name)
29
27
  end
@@ -32,13 +32,13 @@ module Alchemy
32
32
  defined_controllers = [definition_hash["navigation"]["controller"]]
33
33
 
34
34
  if definition_hash["navigation"]["sub_navigation"].is_a?(Array)
35
- defined_controllers.concat(definition_hash["navigation"]["sub_navigation"].map{ |x| x["controller"] })
35
+ defined_controllers.concat(definition_hash["navigation"]["sub_navigation"].map { |x| x["controller"] })
36
36
  end
37
37
 
38
38
  validate_controllers_existence(defined_controllers)
39
39
  end
40
40
 
41
- @@alchemy_modules << definition_hash
41
+ @@alchemy_modules |= [definition_hash]
42
42
  end
43
43
 
44
44
  private
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Alchemy
4
- VERSION = "6.0.10"
4
+ VERSION = "6.0.12"
5
5
 
6
6
  def self.version
7
7
  VERSION
data/lib/alchemy_cms.rb CHANGED
@@ -57,8 +57,5 @@ require_relative "alchemy/tinymce"
57
57
  require_relative "alchemy/taggable"
58
58
  require_relative "alchemy/version"
59
59
 
60
- # Require hacks
61
- require_relative "kaminari/scoped_pagination_url_helper"
62
-
63
60
  # Finally require Alchemy itself
64
61
  require_relative "alchemy/engine"
@@ -26,7 +26,22 @@ module Alchemy
26
26
  class_option :skip_db_create,
27
27
  type: :boolean,
28
28
  default: false,
29
- desc: "Skip creting the database during install."
29
+ desc: "Skip creating the database during install."
30
+
31
+ class_option :skip_mount,
32
+ type: :boolean,
33
+ default: false,
34
+ desc: "Skip mounting into routes.rb during install."
35
+
36
+ class_option :default_language_code,
37
+ type: :string,
38
+ default: "en",
39
+ desc: "The default language code of your site."
40
+
41
+ class_option :default_language_name,
42
+ type: :string,
43
+ default: "English",
44
+ desc: "The default language name of your site."
30
45
 
31
46
  source_root File.expand_path("files", __dir__)
32
47
 
@@ -34,6 +49,11 @@ module Alchemy
34
49
  header
35
50
  say "Welcome to AlchemyCMS!"
36
51
  say "Let's begin with some questions.\n\n"
52
+ end
53
+
54
+ def mount
55
+ return if options[:skip_mount]
56
+
37
57
  install_tasks.inject_routes(options[:auto_accept])
38
58
  end
39
59
 
@@ -108,13 +128,17 @@ module Alchemy
108
128
 
109
129
  def set_primary_language
110
130
  header
111
- install_tasks.set_primary_language(options[:auto_accept])
131
+ install_tasks.set_primary_language(
132
+ code: options[:default_language_code],
133
+ name: options[:default_language_name],
134
+ auto_accept: options[:auto_accept]
135
+ )
112
136
  end
113
137
 
114
138
  def setup_database
115
139
  rake("db:create", abort_on_failure: true) unless options[:skip_db_create]
116
140
  # We can't invoke this rake task, because Rails will use wrong engine names otherwise
117
- rake("railties:install:migrations", abort_on_failure: true)
141
+ rake("alchemy:install:migrations", abort_on_failure: true)
118
142
  rake("db:migrate", abort_on_failure: true)
119
143
  install_tasks.inject_seeder
120
144
  rake("db:seed", abort_on_failure: true)
@@ -1,4 +1,4 @@
1
- class <%= @class_name %>Ability
1
+ class <%= @controller_class %>Ability
2
2
  include CanCan::Ability
3
3
 
4
4
  def initialize(user)
@@ -7,5 +7,4 @@ class <%= @class_name %>Ability
7
7
  can :manage, :admin_<%= @controller_name %>
8
8
  end
9
9
  end
10
-
11
- end
10
+ end
@@ -1,17 +1,19 @@
1
- Alchemy::Modules.register_module({
2
- name: '<%= @module_name %>',
3
- order: 1,
4
- navigation: {
5
- name: 'modules.<%= @module_name %>',
6
- controller: '/admin/<%= @module_name %>',
7
- action: 'index',
8
- image: 'alchemy/<%= @module_name %>_module.png',
9
- sub_navigation: [{
1
+ Rails.application.config.to_prepare do
2
+ Alchemy::Modules.register_module({
3
+ name: '<%= @module_name %>',
4
+ order: 1,
5
+ navigation: {
10
6
  name: 'modules.<%= @module_name %>',
11
7
  controller: '/admin/<%= @module_name %>',
12
- action: 'index'
13
- }]
14
- }
15
- })
8
+ action: 'index',
9
+ image: 'alchemy/<%= @module_name %>_module.png',
10
+ sub_navigation: [{
11
+ name: 'modules.<%= @module_name %>',
12
+ controller: '/admin/<%= @module_name %>',
13
+ action: 'index'
14
+ }]
15
+ }
16
+ })
16
17
 
17
- Alchemy.register_ability(<%= @class_name %>Ability)
18
+ Alchemy.register_ability(<%= @controller_class %>Ability)
19
+ end
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alchemy_cms/admin",
3
- "version": "6.0.10",
3
+ "version": "6.0.12",
4
4
  "description": "AlchemyCMS",
5
5
  "browser": "package/admin.js",
6
6
  "files": [
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.10
4
+ version: 6.0.12
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: 2022-09-04 00:00:00.000000000 Z
16
+ date: 2022-11-19 00:00:00.000000000 Z
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
19
  name: actionmailer
@@ -1419,7 +1419,6 @@ files:
1419
1419
  - lib/generators/alchemy/site_layouts/templates/layout.html.haml
1420
1420
  - lib/generators/alchemy/site_layouts/templates/layout.html.slim
1421
1421
  - lib/generators/alchemy/views/views_generator.rb
1422
- - lib/kaminari/scoped_pagination_url_helper.rb
1423
1422
  - lib/tasks/alchemy/db.rake
1424
1423
  - lib/tasks/alchemy/install.rake
1425
1424
  - lib/tasks/alchemy/thumbnails.rake
@@ -1,12 +0,0 @@
1
- # frozen_string_literal: true
2
- # A Kaminari patch for scoping the urls.
3
- Kaminari::Helpers::Tag.class_eval do
4
- def page_url_for(page)
5
- params = @params.merge(@param_name => (page <= 1 ? nil : page))
6
- if @options[:scope]
7
- @options[:scope].url_for params
8
- else
9
- @template.url_for params
10
- end
11
- end
12
- end