alchemy_cms 7.1.9 → 7.1.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +13 -0
- data/app/controllers/alchemy/admin/layoutpages_controller.rb +19 -0
- data/app/controllers/alchemy/messages_controller.rb +1 -1
- data/app/controllers/concerns/alchemy/admin/current_language.rb +10 -0
- data/app/javascript/alchemy_admin/picture_editors.js +3 -3
- data/app/views/alchemy/admin/layoutpages/edit.html.erb +1 -1
- data/app/views/alchemy/admin/pages/unlock.js.erb +1 -1
- data/app/views/alchemy/admin/resources/_per_page_select.html.erb +1 -1
- data/config/routes.rb +1 -1
- data/lib/alchemy/permissions.rb +1 -1
- data/lib/alchemy/test_support/current_language_shared_examples.rb +33 -0
- data/lib/alchemy/version.rb +1 -1
- data/lib/tasks/alchemy/tidy.rake +0 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 702711d3c433b8ebd8622cb94198dd6ca4d7ff094fb2fb7993ea8ce17ff4d3a5
|
4
|
+
data.tar.gz: cb45c9e7bbf2e9df285dea8e555aa90d96c330159f2604113fbf25389cdf6597
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 574b3bb7e42ce0fdeff179dd37bc19dab1b40038c7514701fe9ae425e8f48972f455030bf8aa735515a5d33fafe91ccbbe80919b751168857646b37745dbee88
|
7
|
+
data.tar.gz: 0dd7baa8ef36719a7b738083741ac81cd498a7826c5464207704e355471448142473409e5f219c7d1490a0018d7f00faa00db6724c4be60d7c99904c3fcab5a0
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,18 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 7.1.11 (2024-08-10)
|
4
|
+
|
5
|
+
- [7.1-stable] fix PictureEditor defaultCropSize [#2991](https://github.com/AlchemyCMS/alchemy_cms/pull/2991) ([alchemycms-bot](https://github.com/alchemycms-bot))
|
6
|
+
- [7.1-stable] Fix combining search filters and pagination [#2981](https://github.com/AlchemyCMS/alchemy_cms/pull/2981) ([alchemycms-bot](https://github.com/alchemycms-bot))
|
7
|
+
- [7.1-stable] Clear current language when switching sites [#2973](https://github.com/AlchemyCMS/alchemy_cms/pull/2973) ([alchemycms-bot](https://github.com/alchemycms-bot))
|
8
|
+
- [7.1-stable] Remove call to missing content_positions task [#2962](https://github.com/AlchemyCMS/alchemy_cms/pull/2962) ([alchemycms-bot](https://github.com/alchemycms-bot))
|
9
|
+
- [7.1-stable] Fix re-render of layoutpages form if validation fails [#2953](https://github.com/AlchemyCMS/alchemy_cms/pull/2953) ([alchemycms-bot](https://github.com/alchemycms-bot))
|
10
|
+
|
11
|
+
## 7.1.10 (2024-06-27)
|
12
|
+
|
13
|
+
- [7.1-stable] Prevent Javascript error if the page will be unlocked [#2945](https://github.com/AlchemyCMS/alchemy_cms/pull/2945) ([alchemycms-bot](https://github.com/alchemycms-bot))
|
14
|
+
- [7.1-stable] fix(ContactMessages): Use alchemy route proxy [#2928](https://github.com/AlchemyCMS/alchemy_cms/pull/2928) ([alchemycms-bot](https://github.com/alchemycms-bot))
|
15
|
+
|
3
16
|
## 7.1.9 (2024-06-04)
|
4
17
|
|
5
18
|
- [7.1-stable] fix(RoutingConstraints): Allow Turbo Stream requests [#2915](https://github.com/AlchemyCMS/alchemy_cms/pull/2915) ([alchemycms-bot](https://github.com/alchemycms-bot))
|
@@ -17,6 +17,25 @@ module Alchemy
|
|
17
17
|
def edit
|
18
18
|
@page = Page.find(params[:id])
|
19
19
|
end
|
20
|
+
|
21
|
+
def update
|
22
|
+
@page = Page.find(params[:id])
|
23
|
+
if @page.update(page_params)
|
24
|
+
@notice = Alchemy.t("Page saved", name: @page.name)
|
25
|
+
render "alchemy/admin/pages/update"
|
26
|
+
else
|
27
|
+
render :edit, status: :unprocessable_entity
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
private
|
32
|
+
|
33
|
+
def page_params
|
34
|
+
params.require(:page).permit(
|
35
|
+
:name,
|
36
|
+
:tag_list
|
37
|
+
)
|
38
|
+
end
|
20
39
|
end
|
21
40
|
end
|
22
41
|
end
|
@@ -6,11 +6,21 @@ module Alchemy
|
|
6
6
|
extend ActiveSupport::Concern
|
7
7
|
|
8
8
|
included do
|
9
|
+
# This needs to happen before BaseController#current_alchemy_site sets the session value.
|
10
|
+
prepend_before_action :clear_current_language_from_session, if: :switching_site?, only: :index
|
9
11
|
before_action :load_current_language
|
10
12
|
end
|
11
13
|
|
12
14
|
private
|
13
15
|
|
16
|
+
def switching_site?
|
17
|
+
params[:site_id].present? && (params[:site_id] != session[:alchemy_site_id]&.to_s)
|
18
|
+
end
|
19
|
+
|
20
|
+
def clear_current_language_from_session
|
21
|
+
session.delete(:alchemy_language_id)
|
22
|
+
end
|
23
|
+
|
14
24
|
def load_current_language
|
15
25
|
@current_language = if session[:alchemy_language_id].present?
|
16
26
|
set_alchemy_language(session[:alchemy_language_id])
|
@@ -7,7 +7,7 @@ const UPDATE_DELAY = 125
|
|
7
7
|
const IMAGE_PLACEHOLDER = '<i class="icon ri-image-line ri-fw"></i>'
|
8
8
|
const THUMBNAIL_SIZE = "160x120"
|
9
9
|
|
10
|
-
class PictureEditor {
|
10
|
+
export class PictureEditor {
|
11
11
|
constructor(container) {
|
12
12
|
this.container = container
|
13
13
|
this.cropFromField = container.querySelector("[data-crop-from]")
|
@@ -131,10 +131,10 @@ class PictureEditor {
|
|
131
131
|
if (!this.imageCropperEnabled) return []
|
132
132
|
|
133
133
|
const mask = this.targetSize.split("x").map((n) => parseInt(n))
|
134
|
-
const zoom = max(
|
134
|
+
const zoom = max(
|
135
135
|
mask[0] / this.imageFileWidth,
|
136
136
|
mask[1] / this.imageFileHeight
|
137
|
-
|
137
|
+
)
|
138
138
|
|
139
139
|
return [Math.round(mask[0] / zoom), Math.round(mask[1] / zoom)]
|
140
140
|
}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
<%= alchemy_form_for [:admin, @page], class: 'edit_page' do |f| %>
|
1
|
+
<%= alchemy_form_for [:admin, @page], url: alchemy.admin_layoutpage_path(@page), class: 'edit_page' do |f| %>
|
2
2
|
<%= f.input :name, autofocus: true %>
|
3
3
|
<div class="input string">
|
4
4
|
<%= f.label :tag_list %>
|
@@ -15,6 +15,6 @@
|
|
15
15
|
}
|
16
16
|
locked_page_icon.outerHTML = locked_page_icon_content
|
17
17
|
}
|
18
|
-
document.querySelector("#page_<%= @page.id -%> .page_status.locked")
|
18
|
+
document.querySelector("#page_<%= @page.id -%> .page_status.locked")?.remove()
|
19
19
|
Alchemy.growl('<%= flash[:notice] -%>')
|
20
20
|
})()
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<%= form_tag url_for, method: :get, class: 'per-page-select-form' do |f| %>
|
2
2
|
<% search_filter_params.reject { |k, _| k == 'page' || k == 'per_page' }.each do |key, value| %>
|
3
|
-
<% if value.
|
3
|
+
<% if value.respond_to?(:keys) %>
|
4
4
|
<% value.each do |k, v| %>
|
5
5
|
<%= hidden_field_tag "#{key}[#{k}]", v, id: nil %>
|
6
6
|
<% end %>
|
data/config/routes.rb
CHANGED
data/lib/alchemy/permissions.rb
CHANGED
@@ -96,7 +96,7 @@ module Alchemy
|
|
96
96
|
can :leave, :alchemy_admin
|
97
97
|
can [:info, :help], :alchemy_admin_dashboard
|
98
98
|
can :manage, :alchemy_admin_clipboard
|
99
|
-
can :
|
99
|
+
can :update, :alchemy_admin_layoutpages
|
100
100
|
can :tree, :alchemy_admin_pages
|
101
101
|
|
102
102
|
# Resources
|
@@ -0,0 +1,33 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
RSpec.shared_examples_for "a controller that loads current language" do |args|
|
4
|
+
context "when session has current language id key" do
|
5
|
+
let!(:site_1) { create(:alchemy_site) }
|
6
|
+
let!(:site_1_default_language) { create :alchemy_language, site: site_1, default: true }
|
7
|
+
let!(:another_site_1_language) { create :alchemy_language, site: site_1, code: :de }
|
8
|
+
let(:site_2) { create :alchemy_site, host: "another.host", languages: [build(:alchemy_language, code: :en), build(:alchemy_language, code: :de)] }
|
9
|
+
|
10
|
+
context "on index action" do
|
11
|
+
context "when switching the current site" do
|
12
|
+
before do
|
13
|
+
session[:alchemy_site_id] = site_1.id
|
14
|
+
session[:alchemy_language_id] = another_site_1_language.id
|
15
|
+
end
|
16
|
+
|
17
|
+
it "sets @current_language to the new site default language" do
|
18
|
+
get :index, params: {site_id: site_2.id}
|
19
|
+
expect(assigns(:current_language)).to eq site_2.default_language
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
context "when no language to set" do
|
24
|
+
it "shows flash warning with redirect" do
|
25
|
+
Alchemy::Language.destroy_all
|
26
|
+
get :index, params: {site_id: site_1.id}
|
27
|
+
expect(flash[:warning]).to eq Alchemy.t("Please create a language first.")
|
28
|
+
expect(response).to redirect_to admin_languages_path
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
data/lib/alchemy/version.rb
CHANGED
data/lib/tasks/alchemy/tidy.rake
CHANGED
@@ -7,7 +7,6 @@ namespace :alchemy do
|
|
7
7
|
desc "Tidy up Alchemy database."
|
8
8
|
task :up do
|
9
9
|
Rake::Task["alchemy:tidy:element_positions"].invoke
|
10
|
-
Rake::Task["alchemy:tidy:content_positions"].invoke
|
11
10
|
Rake::Task["alchemy:tidy:remove_orphaned_records"].invoke
|
12
11
|
Rake::Task["alchemy:tidy:remove_trashed_elements"].invoke
|
13
12
|
Rake::Task["alchemy:tidy:remove_duplicate_legacy_urls"].invoke
|
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: 7.1.
|
4
|
+
version: 7.1.11
|
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: 2024-
|
16
|
+
date: 2024-08-10 00:00:00.000000000 Z
|
17
17
|
dependencies:
|
18
18
|
- !ruby/object:Gem::Dependency
|
19
19
|
name: actionmailer
|
@@ -1304,6 +1304,7 @@ files:
|
|
1304
1304
|
- lib/alchemy/test_support.rb
|
1305
1305
|
- lib/alchemy/test_support/capybara_helpers.rb
|
1306
1306
|
- lib/alchemy/test_support/config_stubbing.rb
|
1307
|
+
- lib/alchemy/test_support/current_language_shared_examples.rb
|
1307
1308
|
- lib/alchemy/test_support/factories/attachment_factory.rb
|
1308
1309
|
- lib/alchemy/test_support/factories/dummy_user_factory.rb
|
1309
1310
|
- lib/alchemy/test_support/factories/element_factory.rb
|
@@ -1442,7 +1443,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
1442
1443
|
version: '0'
|
1443
1444
|
requirements:
|
1444
1445
|
- ImageMagick (libmagick), v6.6 or greater.
|
1445
|
-
rubygems_version: 3.5.
|
1446
|
+
rubygems_version: 3.5.11
|
1446
1447
|
signing_key:
|
1447
1448
|
specification_version: 4
|
1448
1449
|
summary: A powerful, userfriendly and flexible CMS for Rails
|