inline_forms 3.0.15 → 3.0.16

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NTFhM2U1YjMzODkxOGFmYjYxMGNkZjYwNjczMzRiNzEwOTc1N2Y1Nw==
4
+ ODRlYjQ0MjAyM2Y5NDYyMmFmMjVhOTI2NTFkMmJhZDk0ODM0YjkzZQ==
5
5
  data.tar.gz: !binary |-
6
- MTc0MThiMjVmNDg4MjU1YWU3YWVmM2Y1MmUxYzQzMjViNmZlODYwOQ==
6
+ YmQxOTg5YTc3YmU2NDUwYjZmM2EyZjcxODA1OWE4MTAwZDVhYzA1Nw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MDM3YjVlZDU1MzJkM2U3ZTdjYmU5ZGU0Yzg3OWRjMWZiMTk2MGE2NjI0OGVk
10
- ZmY1ZjEwMDM0Y2YyMjI2MjQ0NzM2OGQyMmU5ZTA4YzQ4YjUxNzhmNmJkYTQ4
11
- ODE2ODEwNDk1OWRhMDQ1NTFkN2MxMTZjOWZiNDliOTIyMjc0ZGM=
9
+ NGYwZGM2NmI2OGM3MjA3MzM0ZmUxMDFmMmMxZWVlNzFlNjkyOTZiZmNiZDYx
10
+ NmQxMzgxYWFjYzM1ZThkYTgxNzQ1OThkYjgyYzJkNTJiNTI5ZDUyNTcwYjky
11
+ ZGUzOGEzYmI5NzcwZWViMDY0MDJiNzM5NjRkODliZjIyMWY3MWI=
12
12
  data.tar.gz: !binary |-
13
- ZDI4ZjMxMzlkYWM5N2M1OTJmNmJiYWZmNmNlZWE2ZmI0NzUyMDg0M2Q4MGIy
14
- NTk2YmY2ZDQ2Y2QwNTVhODAxYzhjMTZjMGZmNzU3OTMzNzY3OGZmNDc0NjFk
15
- OTlkMTc1ODAwZTI5OTRjMjcxMDczYmIwN2Q2YWFlYWE1MzE1M2Q=
13
+ OTAwOTgwYzc5YWQxY2Q1ZDRlYjU0M2IxNTZiZjJiOWMwM2VkNDcwZmI3Mjhi
14
+ MmQ3NWYyZmY4ZmQxMDdkOGFlMDVmZjhkMTc1NTlhYTIxYjdkN2EzYTVmM2Rj
15
+ MjM3MTc3NzUyZTk0YTA3M2Q5Y2Q2M2IwY2RkMDAzOTE3NjgyNzA=
@@ -4,12 +4,7 @@
4
4
  // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
5
5
  // the compiled file.
6
6
  //
7
- //= require jquery
8
- //= require jquery_ujs
9
7
  //= require jquery.ui.all
10
8
  //= require jquery.ui.datepicker-nl.js
11
- //= require foundation
12
- //= require jquery.remotipart
13
- //= require ckeditor/init
14
9
  //= require inline_forms
15
10
 
@@ -0,0 +1,16 @@
1
+ # -*- encoding : utf-8 -*-
2
+ InlineForms::SPECIAL_COLUMN_TYPES[:dropdown_with_values_with_stars]=:integer
3
+
4
+ # dropdown_with_values_with_stars
5
+ def dropdown_with_values_with_stars_show(object, attribute)
6
+ values = attribute_values(object, attribute)
7
+ link_to_inline_edit object, attribute, (object[attribute].nil? || object[attribute] == 0) ? "<i class='fi-plus'></i>".html_safe : image_tag(object[attribute].to_s + 'stars.png')
8
+ end
9
+ def dropdown_with_values_with_stars_edit(object, attribute)
10
+ # the leading underscore is to avoid name conflicts, like 'email' and 'email_type' will result in 'email' and 'email[email_type_id]' in the form!
11
+ values = attribute_values(object, attribute)
12
+ collection_select( ('_' + object.class.to_s.underscore).to_sym, attribute.to_sym, values, 'first', 'last', :selected => object.send(attribute))
13
+ end
14
+ def dropdown_with_values_with_stars_update(object, attribute)
15
+ object[attribute.to_sym] = params[('_' + object.class.to_s.underscore).to_sym][attribute.to_sym]
16
+ end
@@ -0,0 +1,30 @@
1
+ # -*- encoding : utf-8 -*-
2
+ # not needed here, since this is only used in the views InlineForms::SPECIAL_COLUMN_TYPES[:info]=:string
3
+
4
+ # this will NOT stay in inline_forms, it belongs in an app.
5
+
6
+ def chicas_photo_list_show(object, attribute)
7
+ # the attribute should be like members_photos
8
+ # then it will look for object.members.photos
9
+ # I know it's crappy.
10
+ members, photos = attribute.to_s.split('_')
11
+ thumbnail_list = {}
12
+ object.send(members).each do |member|
13
+ member.send(photos).each do |photo|
14
+ thumbnail_list[photo.rating] ||= []
15
+ thumbnail_list[photo.rating] << photo.image.url(:thumb)
16
+ end
17
+ end
18
+ out = ''
19
+ out = "<div class='row #{cycle('odd', 'even')}'>no photos</div>" if thumbnail_list.empty?
20
+ unless thumbnail_list.empty?
21
+ out << "<div class='row #{cycle('odd', 'even')}'>"
22
+ thumbnail_list.sort.reverse.each do |rating, thumbnails|
23
+ thumbnails.each do |thumbnail|
24
+ out << image_tag(thumbnail)
25
+ end
26
+ end
27
+ out << '</div>'
28
+ end
29
+ out.html_safe
30
+ end
@@ -1,4 +1,4 @@
1
1
  # -*- encoding : utf-8 -*-
2
2
  module InlineForms
3
- VERSION = "3.0.15"
3
+ VERSION = "3.0.16"
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: inline_forms
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.15
4
+ version: 3.0.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ace Suares
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-27 00:00:00.000000000 Z
11
+ date: 2014-12-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rvm
@@ -194,6 +194,7 @@ files:
194
194
  - lib/app/helpers/form_elements/dropdown_with_integers.rb
195
195
  - lib/app/helpers/form_elements/dropdown_with_other.rb
196
196
  - lib/app/helpers/form_elements/dropdown_with_values.rb
197
+ - lib/app/helpers/form_elements/dropdown_with_values_with_stars.rb
197
198
  - lib/app/helpers/form_elements/file_field.rb
198
199
  - lib/app/helpers/form_elements/geo_code_curacao.rb
199
200
  - lib/app/helpers/form_elements/header.rb
@@ -207,6 +208,7 @@ files:
207
208
  - lib/app/helpers/form_elements/month_year_picker.rb
208
209
  - lib/app/helpers/form_elements/move.rb
209
210
  - lib/app/helpers/form_elements/pdf_link.rb
211
+ - lib/app/helpers/form_elements/photo_list.rb
210
212
  - lib/app/helpers/form_elements/plain_text_area.rb
211
213
  - lib/app/helpers/form_elements/question_list.rb
212
214
  - lib/app/helpers/form_elements/radio_button.rb