friendly_extensions 0.2.2 → 0.2.3

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: ac4f85968b3d37d0597a910af411e043be2c00dc
4
- data.tar.gz: 5ac0137259d25f5127a0e7b7fb0e507a35c09f92
3
+ metadata.gz: a01b9b85383134538a7ec1474614ed7452dd9571
4
+ data.tar.gz: 4618e189892061d3807000bcb43779350c332232
5
5
  SHA512:
6
- metadata.gz: 8a0b7737589d8d83e29b03dccc233528ef1e323f6c9d7ab8eb2724b80530c993a0a941e42818c3cb3213ef217dc9de88ceec5f2d2399e43ab1a4f20d89944652
7
- data.tar.gz: 6fd3088be768f59537d1dc8f878a17bc9837d162309ef3c7f4dc6efb42ecd7a0e40eca823b937ffdfa273549e90afc57d3d9b5c6a889da61f3ac582cde9cf18a
6
+ metadata.gz: c88031655536eb625f031e72d439c822fa1a61bdf05c999fd714460b4c18a2a924bf942351f8be1c03cdd57acbe2e682a1f512dce188220c18513569b9be1112
7
+ data.tar.gz: eab0686a96a99a286906b33f3bda04a4790e4271ab4b1ced7ef14bd2b7a5e3ad2eda7f48126ff090f5fefb7a62f2d54f50e0040ed30766404d044452fd80a53b
@@ -1,27 +1,27 @@
1
1
  module FriendsFormsHelper
2
-
2
+
3
3
  def fieldset(title, options = {}, &block)
4
4
  if options[:if].nil? || options[:if] == true
5
5
  data_string = " "
6
6
  if options[:data]
7
7
  options[:data].each {|d,v| data_string << "#{d}='v' "}
8
- end
8
+ end
9
9
  concat raw("<fieldset id='#{options[:id]}' #{data_string} class='shadow #{options[:mainclass]}' #{("style='height: %spx'" % options[:height]) if options[:height]} style='#{options[:mainstyle]}'>")
10
10
  concat raw("<legend class='#{options[:class]}' style='#{options[:style]}'>#{title}</legend><div class='fieldset-content'>")
11
11
  yield
12
12
  concat raw("</div></fieldset>")
13
- end
14
- end
15
-
16
- def tooltip_box(tooltip)
17
- "<span class='label-tooltip' title='#{tooltip}'>&nbsp;</span>".html_safe
13
+ end
18
14
  end
19
-
15
+
16
+ def tooltip_box(tooltip, options = {fallback: false})
17
+ "<span class='label-tooltip label-tooltip-fallback-#{options[:fallback]}' title='#{tooltip}'>&nbsp;</span>".html_safe
18
+ end
19
+
20
20
  def tooltip_content_box(name, options = {}, &block)
21
21
  options[:default_class] ||= "icon-clue"
22
22
  html = "<div class='tooltip-box'><div class='tooltip-box-label #{options[:default_class]}'>"
23
23
  html << "#{name}<div class='tooltip-box-content #{options[:css]} box rounded shadow'>#{capture(&block)}</div></div></div>"
24
24
  concat(html.html_safe)
25
- end
26
-
27
- end
25
+ end
26
+
27
+ end
@@ -28,7 +28,9 @@ module FriendsLabeledFormHelper
28
28
  end
29
29
 
30
30
  # we dont want to see the empty boxes on production
31
- unless Rails.env.production?
31
+ if tt == i18n_str && !Rails.env.production?
32
+ label_text << tooltip_box(tt, fallback: true)
33
+ else
32
34
  label_text << tooltip_box(tt)
33
35
  end
34
36
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: friendly_extensions
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Florian Eck