polygallery 0.4.4 → 0.4.5
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: 5e53abf70dea958b1911dffc06743aae8a92948b
|
4
|
+
data.tar.gz: 0fa8fa8287038e637bd081ef22f1f8d59c2d0c00
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 99f20772f457715d3fb8bebf7c59a9e771efc7c1e14d905abd2bb7f19df390d4f6f123066bfe993b293d4f128c49f2b42a462df218ba781ef5b8dea3e7f666f1
|
7
|
+
data.tar.gz: a313adf8bda7f3cc1087e2bb2da79f1c89aa83544eca49ae83f8e075608f6adaded514dc1c1ff4ce26b81cdbdb404572b74ba2c79b2fe47609a99f49da5f10ce
|
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
%h3.lead
|
7
7
|
= link_to_add_association 'Add Photo', f, :photos, partial: 'polygallery/photos/simple_fields_for', class: 'btn btn-default btn-sm pull-right', data: {association_insertion_node: "##{photo_association_name} .photo-receptacle", association_insertion_method: 'append'}
|
8
|
-
= f.object.title.titleize
|
8
|
+
= settings[:label] || f.object.title.titleize
|
9
9
|
.polygallery-cocoon-table{:id => photo_association_name.to_s}
|
10
10
|
%table.table.table-bordered.table-striped.table-condensed.polygallery-photos-table
|
11
11
|
%thead
|
@@ -8,9 +8,12 @@ module Polygallery
|
|
8
8
|
fb.simple_fields_for(title, *args, &block) << '</div>' ).html_safe
|
9
9
|
end
|
10
10
|
def simple_fields_for_polygallery(fb, title=:gallery, *args, &block)
|
11
|
+
defaults = { label: nil }
|
12
|
+
settings = if (options = args.find{|a| a.is_a? Hash }).nil? then defaults
|
13
|
+
else defaults.merge options end
|
11
14
|
new_block = block_given? ? block : ->(fb2) {
|
12
15
|
render partial: 'polygallery/galleries/simple_fields_for',
|
13
|
-
locals: { f: fb2 } }
|
16
|
+
locals: { f: fb2, settings: settings } }
|
14
17
|
SimpleFormHelper.simple_fields_for_polygallery(
|
15
18
|
fb, title, *args, &new_block)
|
16
19
|
end
|
data/lib/polygallery/version.rb
CHANGED
@@ -2,10 +2,10 @@ module Polygallery
|
|
2
2
|
module ViewHelpers
|
3
3
|
|
4
4
|
def fields_for_polygallery(title, f, options={})
|
5
|
-
|
5
|
+
settings = { label: nil }.merge(options)
|
6
6
|
raise "Polygallery #{title} not found for #{f.object.class.name}" unless f.object.class.has_polygallery?(title)
|
7
7
|
gallery = f.object.send(title)
|
8
|
-
render :
|
8
|
+
render partial: 'polygallery/galleries/fields_for', locals: {f: f, gallery: gallery, settings: settings}
|
9
9
|
end
|
10
10
|
|
11
11
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: polygallery
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- MacKinley Smith
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-09-
|
11
|
+
date: 2015-09-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|