alchemy_cms 5.0.0.rc2 → 5.0.0

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.

Potentially problematic release.


This version of alchemy_cms might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cb305961a97845dc249d123acf15ed281e69e13a4be8879eedcb5a858723a5fd
4
- data.tar.gz: 6b3d61f36b20ccb41fd0d1f21a26bff8a6fe14f6cf18a2661c63b6044fd5ac2c
3
+ metadata.gz: 16f4ae2bce440faa0777082d737d275f21bc1b5dcd13c52143369a4db9e2b5cf
4
+ data.tar.gz: 305a0964902cae1ff220c3b20e77c8da0f0ffef33e1022baa1283b97d8a8dc72
5
5
  SHA512:
6
- metadata.gz: 31c91f9169a7a21982f769fe85ed77d4d6d4609eb6de6b37b6d2006a9aeaa5d63bc775280ca37dbdbf37edff969ea28384cc3c92451c36b932f3bfde0025e665
7
- data.tar.gz: bc74c7d3bbefe12c90506e8e874c230001deed4dffc2acd5504e3c304d375ef41b818a85ce645e5c95ff064aae3a042fdd27d2c8f4dd01aadc61f764469118a1
6
+ metadata.gz: ee11b0843264ecc2feeb7317e2caae8a27d2a2416abbd990b1fef3d8a662ce4781f4b586b68bd920fc25f9c1ac5c09fd2139bf45c4cb29bb2fbcff318e40fac3
7
+ data.tar.gz: f34a6757641128e2815e2b50baa2a5628020880e2af272ad5f5df01f9b8ec9a4f98d9b8b9e696d845d3c70a27254ba09988066d0892bb0b8c23311ceb7c39069
@@ -1,5 +1,10 @@
1
- ## 5.0.0 (unreleased)
1
+ ## 5.0.0 (2020-07-17)
2
2
 
3
+ - Do not convert JPEG images into JPG [#1904](https://github.com/AlchemyCMS/alchemy_cms/pull/1904) ([tvdeyen](https://github.com/tvdeyen))
4
+ - Do not enable image cropper if file is missing [#1903](https://github.com/AlchemyCMS/alchemy_cms/pull/1903) ([tvdeyen](https://github.com/tvdeyen))
5
+ - Always show original image as zoomed image [#1902](https://github.com/AlchemyCMS/alchemy_cms/pull/1902) ([tvdeyen](https://github.com/tvdeyen))
6
+ - Rename Attachment#urlname into slug [#1848](https://github.com/AlchemyCMS/alchemy_cms/pull/1848) ([tvdeyen](https://github.com/tvdeyen))
7
+ - Deprecate toolbar helper ([tvdeyen](https://github.com/tvdeyen))
3
8
  - Deprecate redirect_to_public_child ([tvdeyen](https://github.com/tvdeyen))
4
9
  - Add --auto-accept option to installer ([tvdeyen](https://github.com/tvdeyen))
5
10
  - Move all installer code into install generator ([tvdeyen](https://github.com/tvdeyen))
@@ -138,7 +138,7 @@ module Alchemy
138
138
 
139
139
  def link
140
140
  @attachments = Attachment.all.collect { |f|
141
- [f.name, download_attachment_path(id: f.id, name: f.urlname)]
141
+ [f.name, download_attachment_path(id: f.id, name: f.slug)]
142
142
  }
143
143
  end
144
144
 
@@ -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.urlname)
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.urlname)
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 urlname
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?
@@ -23,7 +23,7 @@ module Alchemy
23
23
 
24
24
  routes.download_attachment_path(
25
25
  id: attachment.id,
26
- name: attachment.urlname,
26
+ name: attachment.slug,
27
27
  format: attachment.suffix,
28
28
  )
29
29
  end
@@ -143,7 +143,7 @@ module Alchemy
143
143
  picture.can_be_cropped_to(
144
144
  content.settings[:size],
145
145
  content.settings[:upsample],
146
- )
146
+ ) && !!picture.image_file
147
147
  end
148
148
 
149
149
  def crop_values_present?
@@ -71,7 +71,9 @@ module Alchemy
71
71
 
72
72
  encoding_options = []
73
73
 
74
- if target_format =~ /jpe?g/
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 = target_format != image_file_format || encoding_options.present?
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(" "))
@@ -1,5 +1,5 @@
1
1
  <div class="zoomed-picture-background">
2
- <%= image_tag @picture.url(format: @picture.image_file_format) %>
2
+ <%= image_tag @picture.url %>
3
3
  </div>
4
4
 
5
5
  <div class="picture-overlay-navigation">
@@ -1,29 +1,28 @@
1
1
  <% label_title = Alchemy.t("Create #{resource_name}", default: Alchemy.t('Create')) %>
2
2
 
3
- <% toolbar(
4
- buttons: [
5
- {
6
- icon: :plus,
7
- label: label_title,
8
- url: new_resource_path,
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
- hotkey: 'alt+n',
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
- icon: 'download',
19
- url: resource_url_proxy.url_for(action: 'index', format: 'csv', q: search_filter_params[:q], sort: params[:sort]),
20
- label: Alchemy.t(:download_csv),
21
- title: Alchemy.t(:download_csv),
22
- dialog: false,
23
- if_permitted_to: [:index, resource_model]
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' %>
@@ -7,7 +7,7 @@
7
7
  attachment.name,
8
8
  alchemy.download_attachment_path(
9
9
  attachment,
10
- name: attachment.urlname,
10
+ name: attachment.slug,
11
11
  format: attachment.suffix
12
12
  ),
13
13
  {
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Alchemy
4
- VERSION = "5.0.0.rc2"
4
+ VERSION = "5.0.0"
5
5
 
6
6
  def self.version
7
7
  VERSION
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.0.rc2
4
+ version: 5.0.0
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-07-14 00:00:00.000000000 Z
16
+ date: 2020-07-17 00:00:00.000000000 Z
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
19
  name: active_model_serializers
@@ -1263,9 +1263,9 @@ 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: 1.3.1
1268
+ version: '0'
1269
1269
  requirements:
1270
1270
  - ImageMagick (libmagick), v6.6 or greater.
1271
1271
  rubygems_version: 3.0.3