alchemy_cms 5.0.0.rc1 → 5.0.3

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: 9b719983afdc90cf645552079d8de65a7632372c37b3c3acc98e81c726fe3ddd
4
- data.tar.gz: 45f07d11d8cce7598ba56a9e6801eb93e3ef31873d24a5e894d8e5208628f99c
3
+ metadata.gz: 54cfa6b7582851195ca4efa3cba8f84bbb4f1d4f064df0e0ed7827d2878c9642
4
+ data.tar.gz: 2d8c9abc0af15288204c2c8fd190d36717ff2c5d6fd2b9d1cef4d1dff0d0ab66
5
5
  SHA512:
6
- metadata.gz: de9831e1555fa6ecff7dfe9e28d762ae6bfb9507566aae096ca6ade3087e976a0ec840b1e5a87167fe198154d34cca498fed9d693775f4ba0960d8a062847e24
7
- data.tar.gz: 179690bed4cb7feadeb9bff852a8de948c397c8c65d06643bc8dc8863538f951499307a42c883a188454c916d945abe3788ee0eba3f97839e70a881eba2ae21b
6
+ metadata.gz: 10d8633d5579d29799a981f465fefd14341e8165c124c008f75e1598b8e7001bccb7960fb3a79fcda915587296ff8aec627446ff733059cda3e548ab2480ab30
7
+ data.tar.gz: 3f9af3b0200fa6a4d58ce70c955a95e40296a9332f58f8773d31987911b9254fc83e6b7bddabdb0a8380ba2e7768a37abb7620287848d1f8150fd2c6657d1802
@@ -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@v1
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@preview
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@preview
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@preview
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.7
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@master
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@v1
115
+ - uses: actions/checkout@v2.3.4
116
116
  - name: Restore node modules cache
117
- uses: actions/cache@preview
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
@@ -1,5 +1,22 @@
1
- ## 5.0.0 (unreleased)
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", "~> 1.0" if ENV["DB"] == "postgresql"
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.87.1", require: false
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
  [![Gem Version](https://badge.fury.io/rb/alchemy_cms.svg)](http://badge.fury.io/rb/alchemy_cms)
4
- [![Build Status](https://github.com/AlchemyCMS/alchemy_cms/workflows/CI/badge.svg?branch=master)](https://github.com/AlchemyCMS/alchemy_cms/actions)
4
+ [![Build Status](https://github.com/AlchemyCMS/alchemy_cms/workflows/CI/badge.svg?branch=main)](https://github.com/AlchemyCMS/alchemy_cms/actions)
5
5
  [![Maintainability](https://api.codeclimate.com/v1/badges/196c56c56568ed24a697/maintainability)](https://codeclimate.com/github/AlchemyCMS/alchemy_cms/maintainability)
6
6
  [![Test Coverage](https://api.codeclimate.com/v1/badges/196c56c56568ed24a697/test_coverage)](https://codeclimate.com/github/AlchemyCMS/alchemy_cms/test_coverage)
7
7
  [![Depfu](https://badges.depfu.com/badges/ebe56d2dd7b7044a8ae700cc81212a8e/overview.svg)](https://depfu.com/github/AlchemyCMS/alchemy_cms?project_id=4600)
@@ -286,5 +286,6 @@
286
286
  color: $muted-text-color;
287
287
  margin-right: $default-margin;
288
288
  font-size: $small-font-size;
289
+ line-height: 31px;
289
290
  }
290
291
  }
@@ -3,14 +3,14 @@
3
3
  padding-bottom: 138px;
4
4
 
5
5
  &.filtered {
6
- padding-bottom: 164px;
6
+ padding-bottom: 178px;
7
7
  }
8
8
 
9
9
  &.with_filter_bar {
10
10
  padding-bottom: 218px;
11
11
 
12
12
  &.filtered {
13
- padding-bottom: 244px;
13
+ padding-bottom: 256px;
14
14
  }
15
15
  }
16
16
 
@@ -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?
@@ -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: essence.alt_tag.presence,
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
- 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(" "))
@@ -40,7 +40,7 @@ module Alchemy
40
40
 
41
41
  level = path.count + base_level
42
42
 
43
- path.last[:children] << page_hash(page, has_children, level, folded)
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, has_children, level, folded)
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.depth == 1,
63
- root_or_leaf: page.depth == 1 || !has_children,
62
+ root: page.root?,
63
+ root_or_leaf: page.root? || page.leaf?,
64
64
  children: [],
65
65
  }
66
66
 
@@ -1,4 +1,4 @@
1
- <% remarkable_type = element.class.name.demodulize.underscore.pluralize %>
1
+ <% remarkable_type = "elements" %>
2
2
  <div class="element-toolbar">
3
3
  <span class="element_tools">
4
4
  <div class="button_with_label">
@@ -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' %>
@@ -1,5 +1,5 @@
1
- <%= alchemy_form_for site, url: alchemy.admin_sites_path(site, search_filter_params) do |f| %>
2
- <%= f.input :host, hint: resource_handler.help_text_for(name: :host).html_safe %>
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} %>
@@ -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
  {
@@ -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
- false
226
+ nil
227
227
  end
228
228
 
229
229
  # Return attributes that should be viewable but not editable.
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Alchemy
4
- VERSION = "5.0.0.rc1"
4
+ VERSION = "5.0.3"
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.rc1
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: 2020-07-14 00:00:00.000000000 Z
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: 1.3.1
1268
+ version: '0'
1269
1269
  requirements:
1270
1270
  - ImageMagick (libmagick), v6.6 or greater.
1271
- rubygems_version: 3.0.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
- ...