scrivito_content_browser 0.65.2 → 0.66.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,7 @@
1
1
  module ConverterHelper
2
2
  extend ActionView::Helpers::NumberHelper
3
3
 
4
- def self.human_binary_length(length)
5
- number_to_human_size length
4
+ def self.human_binary_length(obj)
5
+ number_to_human_size(obj.binary_length) if obj.binary?
6
6
  end
7
7
  end
@@ -3,7 +3,7 @@ module ScrivitoContentBrowser
3
3
 
4
4
  def info_for_content_browser
5
5
  if binary?
6
- "#{file_extension.upcase} #{ConverterHelper.human_binary_length binary_length}"
6
+ "#{file_extension.upcase} #{ConverterHelper.human_binary_length self}"
7
7
  else
8
8
  obj_class_name
9
9
  end
@@ -6,7 +6,7 @@ Scrivito::Configuration.register_obj_format('content_browser') do |obj, _, view_
6
6
  format = {
7
7
  id: obj.id,
8
8
  file_type: obj.obj_class_name,
9
- file_size: ConverterHelper.human_binary_length(obj.binary_length),
9
+ file_size: ConverterHelper.human_binary_length(obj),
10
10
  last_changed: obj[:_last_changed],
11
11
  title: obj.description_for_editor.presence || obj.binary.try(:filename),
12
12
  subtitle: obj.info_for_content_browser,
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scrivito_content_browser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.65.2
4
+ version: 0.66.0.rc1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Scrivito
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - '='
46
46
  - !ruby/object:Gem::Version
47
- version: 0.65.2
47
+ version: 0.66.0.rc1
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - '='
53
53
  - !ruby/object:Gem::Version
54
- version: 0.65.2
54
+ version: 0.66.0.rc1
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: pry
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -87,7 +87,6 @@ executables: []
87
87
  extensions: []
88
88
  extra_rdoc_files: []
89
89
  files:
90
- - CHANGELOG.md
91
90
  - LICENSE
92
91
  - README.md
93
92
  - Rakefile
data/CHANGELOG.md DELETED
@@ -1,45 +0,0 @@
1
- # v0.30.0
2
- * Compatibility with https://rubygems.org/gems/scrivito 0.30.0
3
- * Restored fallbacks for uploading videos and images (when `filter_default.upload` config is empty)
4
-
5
- # v0.1.0
6
- * Renamed from Scrivito Resource Browser to Scrivito Content Browser
7
- * API change: `Resourcebrowser` is now `scrivito.content_browser`
8
- * API change: `ResourcebrowserUploader.mimeTypeMapping` is now
9
- `scrivito.content_browser.filter_defaults.upload`
10
- * API change: option `.open(onSave)` is now a promise: `.open().done`
11
- * API change: option `.open(onClose)` is now a promise: `.open().fail`
12
- * API change: removed option `.open(onDelete)`
13
- * See your app's JS console for hints and deprecation warnings
14
-
15
- # v0.0.6
16
- * Added list view mode
17
- * The _Selected_ filter appears at the top of the filter list
18
- * Changed the icon namespace to `scrivito-resourcebrowser-icon-*`
19
- `editing-icon-*` is still supported for the filter option `icon`
20
- * Dropped unused controller actions, leaving only `inspector`
21
-
22
- # v0.0.5
23
- * Uploading a MIME type with no configured `obj_class` shows sensible error message.
24
- * Show the app configurable `description_for_editor` as subtitle.
25
- * Some visual improvements.
26
-
27
- # v0.0.4
28
- * The filters are now a simple hash instead of a function that returns a hash. This allows to
29
- extend the filters multiple times. This is useful, when a gem wants to add filters to the ones
30
- already defined in the application. (Thanks @gertimon)
31
-
32
- # v0.0.3
33
- * Change the icon to open the details view from a magnifying glass to a pen.
34
- * Added option "selectionMode", which can be set to `single` in order to allow only one selected
35
- item at a time. Any other value will allow to select an arbitrary number of items.
36
- * Added "selected" filter that displays all currently selected items.
37
- * Display "missing title" when a custom filter has no title configured.
38
- * Added installation and usage section in the README.
39
-
40
- # v0.0.2
41
- * Bugfix: An error on assets:precompile was caused by a typo. (Thanks @dcsaszar)
42
-
43
- # v0.0.1
44
- * rename to resource browser
45
- * initial version