trusty-cms 5.3.1 → 5.3.4

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: 0db12a9ef02b41ed7f72023d47359e2d09ba6ee251d6a6b2df8d128742ce17ad
4
- data.tar.gz: b227c357bf7c52bd7c9bb4fa4dd369d039f0aa422e1bf1dcaac446a24ea151c7
3
+ metadata.gz: cf01f0ff82114eed61c1833bae22ab040a78551980250f7beb00ab90c0fda9c6
4
+ data.tar.gz: 4ebc73d4737c0933aed84ccd95d24421fc222a0968ae572b08688da6913a7437
5
5
  SHA512:
6
- metadata.gz: ea4ae2569c7703a5fadbe8da6b6dc94fe10f7e46cc52f7cfc51df874e164ff0916c78f3f0cc1c82c8175c2d6b4e71a650f8b4c2c5a86761e03d50ec40f6bbd38
7
- data.tar.gz: 6bacfa11732c89241179a97accbb018f37a5d164ae86011ad4f7df4cf5e7d2be3328e57211f4cbb68dcdf49e23367b81a30bc06909cbf363f25c6ef889f0fa82
6
+ metadata.gz: e20bf4b915b8bbe3b8e2085c011518dfbf1f961dc2db3a8255ce8239710abb20689fe1980cb15b94eacd0a2628f649c47a231069eee966939870c231729bd5ba
7
+ data.tar.gz: b0f0e9baa3ae7e7929c0c218676d1d0a57dfa3f5873c8907cd19fb1b17c8fcb4214ba7a165ce2ed400527a9b9939fd4437d4ca5693a0764b69deb751f3cdcc08
data/Gemfile CHANGED
@@ -21,7 +21,7 @@ group :development, :test do
21
21
  gem 'mysql2'
22
22
  gem 'poltergeist', '~> 1.18.1'
23
23
  gem 'pry-byebug'
24
- gem 'psych', '4.0.3'
24
+ gem 'psych', '4.0.4'
25
25
  gem 'rails-observers'
26
26
  gem 'rspec-rails'
27
27
  gem 'simplecov'
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- trusty-cms (5.3)
4
+ trusty-cms (5.3.3)
5
5
  RedCloth (= 4.3.2)
6
6
  activestorage-validator
7
7
  acts_as_list (>= 0.9.5, < 1.1.0)
@@ -202,8 +202,8 @@ GEM
202
202
  libv8-node (~> 16.10.0.0)
203
203
  minitest (5.15.0)
204
204
  multi_xml (0.6.0)
205
- multipart-post (2.1.1)
206
- mysql2 (0.5.3)
205
+ multipart-post (2.2.2)
206
+ mysql2 (0.5.4)
207
207
  nio4r (2.5.8)
208
208
  nokogiri (1.12.5-x86_64-darwin)
209
209
  racc (~> 1.4)
@@ -220,11 +220,11 @@ GEM
220
220
  pry-byebug (3.9.0)
221
221
  byebug (~> 11.0)
222
222
  pry (~> 0.13.0)
223
- psych (4.0.3)
223
+ psych (4.0.4)
224
224
  stringio
225
225
  public_suffix (4.0.6)
226
226
  racc (1.6.0)
227
- rack (2.2.3)
227
+ rack (2.2.3.1)
228
228
  rack-cache (1.13.0)
229
229
  rack (>= 0.4)
230
230
  rack-test (1.1.0)
@@ -356,7 +356,7 @@ DEPENDENCIES
356
356
  mysql2
357
357
  poltergeist (~> 1.18.1)
358
358
  pry-byebug
359
- psych (= 4.0.3)
359
+ psych (= 4.0.4)
360
360
  rails-observers
361
361
  rspec-rails
362
362
  simplecov
@@ -41,18 +41,23 @@ class Admin::AssetsController < Admin::ResourceController
41
41
  else
42
42
  uploaded_asset = compress(uploaded_asset) if $kraken.api_key.present? && COMPRESS_FILE_TYPE.include?(uploaded_asset.content_type) && compress
43
43
  @asset = Asset.create(asset: uploaded_asset, caption: asset_params[:asset][:caption])
44
- set_owner_or_editor
45
- if params[:for_attachment]
46
- @page = Page.find_by_id(params[:page_id]) || Page.new
47
- @page_attachments << @page_attachment = @asset.page_attachments.build(page: @page)
44
+ if @asset.valid?
45
+ set_owner_or_editor
46
+ if params[:for_attachment]
47
+ @page = Page.find_by_id(params[:page_id]) || Page.new
48
+ @page_attachments << @page_attachment = @asset.page_attachments.build(page: @page)
49
+ end
50
+ @assets << @asset
51
+ else
52
+ error = @asset.errors.first.message
53
+ flash[:error] = error
48
54
  end
49
- @assets << @asset
50
55
  end
51
- end
52
- if asset_params[:for_attachment]
53
- render partial: 'admin/page_attachments/attachment', collection: @page_attachments
54
- else
55
- response_for :create
56
+ if asset_params[:for_attachment]
57
+ render partial: 'admin/page_attachments/attachment', collection: @page_attachments
58
+ else
59
+ response_for :create
60
+ end
56
61
  end
57
62
  end
58
63
 
@@ -10,7 +10,7 @@ class RadSocialMailer < ApplicationMailer
10
10
  @from_name = from_address.display_name
11
11
  @from_email = from_address
12
12
  @message = options[:message]
13
- @actual_from = ENV['RAD_SOCIAL_FROM_EMAIL']
13
+ @actual_from = ENV.fetch('RAD_SOCIAL_FROM_EMAIL')
14
14
  @actual_from = from_address if @actual_from.nil?
15
15
 
16
16
  mail({
data/app/models/asset.rb CHANGED
@@ -37,7 +37,7 @@ class Asset < ActiveRecord::Base
37
37
  blob:
38
38
  {
39
39
  content_type: %w[application/zip image/jpg image/jpeg image/png image/gif application/pdf text/css],
40
- size_range: 1..5.megabytes,
40
+ size_range: 1..10.megabytes,
41
41
  }
42
42
  before_save :assign_title
43
43
  before_save :assign_uuid
@@ -362,7 +362,7 @@ module StandardTags
362
362
  tag.locals.page = aggregate_page
363
363
  aggregates << tag.expand
364
364
  end
365
- aggregates.flatten.join('')
365
+ aggregates.flatten.join
366
366
  end
367
367
 
368
368
  tag 'aggregate:each:children' do |tag|
@@ -380,7 +380,7 @@ module StandardTags
380
380
  tag.locals.page = item
381
381
  result << tag.expand
382
382
  end
383
- result.flatten.join('')
383
+ result.flatten.join
384
384
  end
385
385
 
386
386
  tag 'aggregate:children' do |tag|
@@ -976,7 +976,7 @@ module StandardTags
976
976
  tag.locals.paginated_list = displayed_children
977
977
  result << tag.render('pagination', tag.attr.dup)
978
978
  end
979
- result.flatten.join('')
979
+ result.flatten.join
980
980
  end
981
981
 
982
982
  def children_find_options(tag)
@@ -1,8 +1,8 @@
1
1
  unless defined? TRUSTY_CMS_ROOT
2
2
  ENV["Rails.env"] = "test"
3
3
  case
4
- when ENV["RADIANT_ENV_FILE"]
5
- require ENV["RADIANT_ENV_FILE"]
4
+ when ENV.fetch('RADIANT_ENV_FILE')
5
+ require ENV.fetch('RADIANT_ENV_FILE')
6
6
  when File.dirname(__FILE__) =~ %r{vendor/trusty_cms/vendor/extensions}
7
7
  require "#{File.expand_path(File.dirname(__FILE__) + "/../../../../../../")}/config/environment"
8
8
  else
@@ -3,8 +3,8 @@ require 'test/unit'
3
3
  unless defined? TRUSTY_CMS_ROOT
4
4
  ENV['Rails.env'] = 'test'
5
5
  case
6
- when ENV['RADIANT_ENV_FILE']
7
- require ENV['RADIANT_ENV_FILE']
6
+ when ENV.fetch('RADIANT_ENV_FILE')
7
+ require ENV.fetch('RADIANT_ENV_FILE')
8
8
  when File.dirname(__FILE__) =~ %r{vendor/trusty_cms/vendor/extensions}
9
9
  require "#{File.expand_path(File.dirname(__FILE__) + '/../../../../../../')}/config/environment"
10
10
  else
@@ -2,7 +2,7 @@
2
2
  # Configure your app in config/environment.rb and config/environments/*.rb
3
3
 
4
4
  Rails.root = "#{File.dirname(__FILE__)}/.." unless defined?(Rails.root)
5
- Rails.env = (ENV['RAILS_ENV'] || 'development').dup unless defined?(Rails.env)
5
+ Rails.env = ENV.fetch('RAILS_ENV', 'development').dup unless defined?(Rails.env)
6
6
 
7
7
  module Rails
8
8
  class << self
@@ -1,8 +1,8 @@
1
1
  unless defined? TRUSTY_CMS_ROOT
2
2
  ENV["Rails.env"] = "test"
3
3
  case
4
- when ENV["RADIANT_ENV_FILE"]
5
- require ENV["RADIANT_ENV_FILE"]
4
+ when ENV.fetch('RADIANT_ENV_FILE')
5
+ require ENV.fetch('RADIANT_ENV_FILE')
6
6
  when File.dirname(__FILE__) =~ %r{vendor/trusty_cms/vendor/extensions}
7
7
  require "#{File.expand_path(File.dirname(__FILE__) + "/../../../../../../")}/config/environment"
8
8
  else
@@ -3,8 +3,8 @@ require 'test/unit'
3
3
  unless defined? TRUSTY_CMS_ROOT
4
4
  ENV["Rails.env"] = "test"
5
5
  case
6
- when ENV["RADIANT_ENV_FILE"]
7
- require ENV["RADIANT_ENV_FILE"]
6
+ when ENV.fetch('RADIANT_ENV_FILE')
7
+ require ENV.fetch('RADIANT_ENV_FILE')
8
8
  when File.dirname(__FILE__) =~ %r{vendor/trusty_cms/vendor/extensions}
9
9
  require "#{File.expand_path(File.dirname(__FILE__) + "/../../../../../../")}/config/environment"
10
10
  else
@@ -59,10 +59,10 @@ namespace :db do
59
59
  task bootstrap: :initialize do
60
60
  require 'trusty_cms/setup'
61
61
  TrustyCms::Setup.bootstrap(
62
- admin_name: ENV['ADMIN_NAME'],
63
- admin_username: ENV['ADMIN_USERNAME'],
64
- admin_password: ENV['ADMIN_PASSWORD'],
65
- database_template: ENV['DATABASE_TEMPLATE'],
62
+ admin_name: ENV.fetch('ADMIN_NAME'),
63
+ admin_username: ENV.fetch('ADMIN_USERNAME'),
64
+ admin_password: ENV.fetch('ADMIN_PASSWORD'),
65
+ database_template: ENV.fetch('DATABASE_TEMPLATE'),
66
66
  )
67
67
  puts %{
68
68
  Your TrustyCms application is ready to use. Run `rails s -e production` to
@@ -7,7 +7,7 @@ unless File.directory? "#{Rails.root}/app"
7
7
  require 'rubygems'
8
8
  require 'rubygems/gem_runner'
9
9
 
10
- trusty = (version = ENV['VERSION']) ?
10
+ trusty = (version = ENV.fetch('VERSION')) ?
11
11
  Gem.cache.search('trusty-cms', "= #{version}").first :
12
12
  Gem.cache.search('trusty-cms').max_by { |g| g.version }
13
13
 
@@ -4,14 +4,14 @@ namespace :trusty_cms do
4
4
  desc 'Export TrustyCms::Config to Rails.root/config/trusty_config.yml. Specify a path with TRUSTY_CONFIG_PATH - defaults to Rails.root/config/trusty_config.yml'
5
5
  task export: :environment do
6
6
  config_path = ENV['TRUSTY_CONFIG_PATH'] || "#{Rails.root}/config/trusty_config.yml"
7
- clear = ENV['CLEAR_CONFIG'] || nil
7
+ clear = ENV.fetch('CLEAR_CONFIG', nil)
8
8
  TrustyCms::TaskSupport.config_export(config_path)
9
9
  end
10
10
 
11
11
  desc 'Import TrustyCms::Config from Rails.root/config/trusty_config.yml. Specify a path with TRUSTY_CONFIG_PATH - defaults to Rails.root/config/trusty_config.yml Set CLEAR_CONFIG=true to delete all existing settings before import'
12
12
  task import: :environment do
13
13
  config_path = ENV['TRUSTY_CONFIG_PATH'] || "#{Rails.root}/config/trusty_config.yml"
14
- clear = ENV['CLEAR_CONFIG'] || nil
14
+ clear = ENV.fetch('CLEAR_CONFIG', nil)
15
15
  TrustyCms::TaskSupport.config_import(config_path, clear)
16
16
  end
17
17
  end
@@ -10,8 +10,8 @@ namespace :import do
10
10
  LegacyUser.all.each do |legacy|
11
11
  u = User.new(
12
12
  email: legacy.email,
13
- first_name: legacy.name.split(' ')[0],
14
- last_name: legacy.name.split(' ')[1],
13
+ first_name: legacy.name.split[0],
14
+ last_name: legacy.name.split[1],
15
15
  password: password,
16
16
  password_confirmation: password,
17
17
  admin: legacy.admin,
data/lib/trusty_cms.rb CHANGED
@@ -2,6 +2,6 @@ TRUSTY_CMS_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..')) unle
2
2
 
3
3
  unless defined? TrustyCms::VERSION
4
4
  module TrustyCms
5
- VERSION = '5.3.1'.freeze
5
+ VERSION = '5.3.4'.freeze
6
6
  end
7
7
  end
data/package.json CHANGED
@@ -13,7 +13,7 @@
13
13
  "jquery-treetable": "^3.2.0-1",
14
14
  "jquery-ui-bundle": "^1.12.1",
15
15
  "jquery-ujs": "^1.2.2",
16
- "jquery-validation": "^1.19.3",
16
+ "jquery-validation": "^1.19.4",
17
17
  "js-cookie": "^3.0.1",
18
18
  "tablesaw": "^3.1.2"
19
19
  },
data/yarn.lock CHANGED
@@ -974,10 +974,10 @@ jquery-ujs@^1.2.2:
974
974
  dependencies:
975
975
  jquery ">=1.8.0"
976
976
 
977
- jquery-validation@^1.19.3:
978
- version "1.19.3"
979
- resolved "https://registry.yarnpkg.com/jquery-validation/-/jquery-validation-1.19.3.tgz#50b350eba8b02bcfd119ba15f199487b7eb64086"
980
- integrity sha512-iXxCS5W7STthSTMFX/NDZfWHBLbJ1behVK3eAgHXAV8/0vRa9M4tiqHvJMr39VGWHMGdlkhrtrkBuaL2UlE8yw==
977
+ jquery-validation@^1.19.4:
978
+ version "1.19.4"
979
+ resolved "https://registry.yarnpkg.com/jquery-validation/-/jquery-validation-1.19.4.tgz#a765781d954e5876fa437d5c75b7a9440bfa37a8"
980
+ integrity sha512-PcwKcATCR+JL77m9kkWd84NAHAunJP9iasF6IbMxUgl73xDAimxjt5oYFmYHDXBmTZM4rpkXxMNR/jGI5TlSjA==
981
981
 
982
982
  jquery@>=1.6:
983
983
  version "3.6.0"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: trusty-cms
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.3.1
4
+ version: 5.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - TrustyCms CMS dev team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-06-08 00:00:00.000000000 Z
11
+ date: 2022-06-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activestorage-validator