neofiles 1.2.2 → 1.3.0
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bd6bd67b5f8e69f12e4b4f5302180449877bf5c2
|
4
|
+
data.tar.gz: 1e80129c603885ae84c8654c0d43d361e025c239
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4d659abcdbcd5659e858fbe346138f04fdd33c6d4bfd6bdfdc3223e2086ba1f625583245dad8be62c7606ba5a01d91f6dfa3d6c22a8a8c4289b319a721c6f4d4
|
7
|
+
data.tar.gz: 897cbe909484416ff6ef6bdff3ca33ddf8feeb86f548bd3e2ef39a6cc76f522943c1cc3e8e2222393d70d77ae098631c46b90ae35b979a46ac002404d9f716e4
|
data/README.md
CHANGED
@@ -403,6 +403,10 @@ config.neofiles.image_max_crop_height = 2000 # users can request resizing only u
|
|
403
403
|
config.neofiles.watermarker = ->(image, no_watermark: false, watermark_width:, watermark_height:) do
|
404
404
|
...
|
405
405
|
end
|
406
|
+
|
407
|
+
# picture when added is displayed on the right or left
|
408
|
+
# also affects the order of displaying pictures
|
409
|
+
config.neofiles.album_append_create_side = :left
|
406
410
|
```
|
407
411
|
|
408
412
|
Roadmap, TODOs
|
@@ -107,7 +107,8 @@ class Neofiles::AdminController < ApplicationController
|
|
107
107
|
|
108
108
|
result = []
|
109
109
|
file_objects.each_with_index do |file, i|
|
110
|
-
|
110
|
+
append_create_position = Rails.application.config.neofiles.album_append_create_side == :left ? i == 0 : i == file_objects.count - 1
|
111
|
+
result << file_compact(data.merge(id: file.id, widget_id: "#{data[:widget_id]}_ap_#{i}", append_create: append_create_position && !old_file && data[:append_create] == '1' ? '1' : '0'))
|
111
112
|
end
|
112
113
|
|
113
114
|
if result.empty?
|
@@ -2,6 +2,10 @@
|
|
2
2
|
- desc = file.try(:description).try(:to_s).try!(:strip).try!(:truncate, 15).presence
|
3
3
|
- empty_desc = t 'neofiles.views.no_description'
|
4
4
|
|
5
|
+
- if Rails.application.config.neofiles.album_append_create_side == :left
|
6
|
+
- if append_create && file
|
7
|
+
= render partial: 'file_compact', locals: {file: nil, input_name: input_name, widget_id: widget_id + '_ap', clean_remove: clean_remove, append_create: true, error: nil, disabled: disabled, multiple: multiple, with_desc: with_desc, no_wm: no_wm}
|
8
|
+
|
5
9
|
- classes = []
|
6
10
|
- classes << 'neofiles-image-compact-empty' unless file
|
7
11
|
- classes << 'neofiles-image-compact-with-description' if file && with_desc
|
@@ -82,6 +86,6 @@
|
|
82
86
|
$("##{widget_id}").image();
|
83
87
|
});
|
84
88
|
|
85
|
-
- if
|
86
|
-
|
87
|
-
|
89
|
+
- if Rails.application.config.neofiles.album_append_create_side == :right
|
90
|
+
- if append_create && file
|
91
|
+
= render partial: 'file_compact', locals: {file: nil, input_name: input_name, widget_id: widget_id + '_ap', clean_remove: clean_remove, append_create: true, error: nil, disabled: disabled, multiple: multiple, with_desc: with_desc, no_wm: no_wm}
|
data/lib/neofiles/engine.rb
CHANGED
@@ -16,6 +16,8 @@ module Neofiles
|
|
16
16
|
config.neofiles.image_max_crop_width = 2000 # users can request resizing only up to this width
|
17
17
|
config.neofiles.image_max_crop_height = 2000 # users can request resizing only up to this height
|
18
18
|
|
19
|
+
config.neofiles.album_append_create_side = :right # picture when added is displayed on the right
|
20
|
+
|
19
21
|
# default watermarker — redefine to set special watermarking logic
|
20
22
|
# by default, watermark only images larger than 300x300 with watermark at the bottom center, taken from file
|
21
23
|
# /app/assets/images/neofiles/watermark.png
|
data/lib/neofiles/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: neofiles
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Konanykhin Ilya
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-05-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|