neofiles 1.2.2 → 1.3.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5e933a90f0875b8daf85f331a22fb6625f671dbb
4
- data.tar.gz: 73851322957bfc79951825f9b2f588e0bec9875b
3
+ metadata.gz: bd6bd67b5f8e69f12e4b4f5302180449877bf5c2
4
+ data.tar.gz: 1e80129c603885ae84c8654c0d43d361e025c239
5
5
  SHA512:
6
- metadata.gz: b593c8017570ccca9615a6ca2820b2a3181f8e7fb79fdcffc090d0c684e38f078e6484017937603c06643bf7fd2ddeb8c0c3ad4ea05a78a96b9e5cc551705679
7
- data.tar.gz: 1cdb3f6e73c224040a4cb1f36db92fd4cf13e4b35e47dba8db8efa95252ff724e1c88c2502cbab41e19979482556876c6d86666021688d55113bf13f145d77a7
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
- result << file_compact(data.merge(id: file.id, widget_id: "#{data[:widget_id]}_ap_#{i}", append_create: i == file_objects.count - 1 && !old_file && data[:append_create] == '1' ? '1' : '0'))
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 append_create and file
86
- = 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}
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}
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Neofiles
2
- VERSION = '1.2.2'
2
+ VERSION = '1.3.0'
3
3
  end
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.2.2
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: 2018-10-23 00:00:00.000000000 Z
11
+ date: 2019-05-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails