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: 15e72642e0f8c0612f6f1bb63e143a82d7dd4a01
4
- data.tar.gz: caa241c4e009957b8e25ba9a8f0c7aeed7fdbcdb
3
+ metadata.gz: 5e53abf70dea958b1911dffc06743aae8a92948b
4
+ data.tar.gz: 0fa8fa8287038e637bd081ef22f1f8d59c2d0c00
5
5
  SHA512:
6
- metadata.gz: 8c6fefcd47df94447684084c53dd205d86f1876183015f98765d4a4c18d27ae541f87c62c51ed25d5d8044c6feb291dd3724c385924406533d3f4ec7e554c718
7
- data.tar.gz: 178ce2a28fedabfffe6de98bd9668f52299a9ec8fd9d9d8f46164c42942ceca071f65d058315273c971debae5f9482d218a99179fb5b8b88462e75299f28d07d
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
@@ -1,3 +1,3 @@
1
1
  module Polygallery
2
- VERSION = '0.4.4'
2
+ VERSION = '0.4.5'
3
3
  end
@@ -2,10 +2,10 @@ module Polygallery
2
2
  module ViewHelpers
3
3
 
4
4
  def fields_for_polygallery(title, f, options={})
5
- options = {}.merge(options)
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 :partial => 'polygallery/galleries/fields_for', :locals => {:f => f, :gallery => gallery, :options => options}
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
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-21 00:00:00.000000000 Z
11
+ date: 2015-09-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails