neofiles 2.0.4 → 2.1.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: a1c972f4b33e6b201100fdd560d8c2cfbf4750c1
4
- data.tar.gz: a012aa43d9d363119f5a32281050fb0a3604c405
3
+ metadata.gz: 608e65d64271a321dce00fe990fb86a05c118ec7
4
+ data.tar.gz: 36c66a96f2bd63d7da9dc8698ee1284906092a3c
5
5
  SHA512:
6
- metadata.gz: b20688a3559211398444b2796ffa8da7254c2aafb543155afc53f199d7a59fac718aa3e34d5ad832e6a4a301b85af87cde9a400c4dfb77bd657acb3332bd2a29
7
- data.tar.gz: 7fb035546faf97836f89506ddfb572f8b7a7381e594a31ab6f89dea3029547d44ecb0fb4b38ebbeb91c47087c5b69271cd240acdef59753fb5b0911abc57134b
6
+ metadata.gz: 5c55f27849fa99522b073b2b8c6f7573474a59f8183598498939a3da173ce3a09816f6d5ff3acbb39bbdcf7189f0d673ae3825fb7052dd72fb39fbbefb3ca0bc
7
+ data.tar.gz: 384333a60af7019ec2a048feb27acafa38229b32af22b4c4c81f4723c4e7e0625b83013ba0bef299224c14591fab4fbb3dfd20ffd231c5d610a6b46c9c8e50ec
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,11 @@
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 and 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
+
9
+
5
10
  - classes = []
6
11
  - classes << 'neofiles-image-compact-empty' unless file
7
12
  - classes << 'neofiles-image-compact-with-description' if file && with_desc
@@ -82,6 +87,7 @@
82
87
  $("##{widget_id}").image();
83
88
  });
84
89
 
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}
90
+ - if Rails.application.config.neofiles.album_append_create_side == :right
91
+ - if append_create && file
92
+ = 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
93
 
@@ -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 storage
20
22
  config.neofiles.write_data_stores = 'mongo'
21
23
  config.neofiles.read_data_stores = 'mongo'
@@ -1,3 +1,3 @@
1
1
  module Neofiles
2
- VERSION = '2.0.4'
2
+ VERSION = '2.1.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: 2.0.4
4
+ version: 2.1.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: 2019-02-16 00:00:00.000000000 Z
11
+ date: 2019-05-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails