sibu 0.1.2 → 0.1.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: 7635dae443f7cd9cea480558c4d28d1595e8b0dd
4
- data.tar.gz: dd93b5227313bcd4f6863191261a6fae389b5310
3
+ metadata.gz: f4069d42c8c180c80e1ccb387a073b6679fba5d8
4
+ data.tar.gz: ab6384000526466cdbf32b916567a3d6fff8ed02
5
5
  SHA512:
6
- metadata.gz: 0525e546145a52500ae365f916c992e8dbb02bb1473dc7e94ef1b3b77975bb77e0b7d1e1f66ab717fcf7dfb5403616d1513cc6a4e035f535d8025f90d8f5bcec
7
- data.tar.gz: b208922425d9433c712b40356f8be17fb67b32fbd3391028e5ef4b19415c2ed94f7e006d8813b57589a64883bcef70c8d371f4d9bf37bfdb5bf8a4f287aba1d7
6
+ metadata.gz: 8ff358f9082ef0ddab1aea8fe5fcda96ab9224d7bad174da0fccf72c3fc7f5866de8b574f140fba1553113b59251810f183288bcc9943a2aa46f3739614b7bde
7
+ data.tar.gz: 59f1bee45c6cdce0bda85e45a58626bb8a46923d43f90058dfab153677aa236be20bbb8b8d197242668829aa36345809f8b12c3e03e772b96a524633e665cbf2
@@ -15,7 +15,7 @@ module Sibu
15
15
  [['Français', 'fr'], ['Anglais', 'en']]
16
16
  end
17
17
 
18
- [:h1, :h2, :h3, :h4, :h5, :h6, :p, :span, :div, :label].each do |t|
18
+ [:h1, :h2, :h3, :h4, :h5, :h6, :p, :span, :div].each do |t|
19
19
  define_method(t) do |id_or_elt, html_opts = {}|
20
20
  content = id_or_elt.is_a?(Hash) ? (id_or_elt || {"text" => "Texte à modifier"}) : (select(id_or_elt) || {"text" => "Texte à modifier"})
21
21
  html_opts.merge!({class: "sb-#{t} #{html_opts[:class]}", data: {id: id_or_elt.is_a?(Hash) ? id_or_elt["id"] : id_or_elt}}) if action_name != 'show'
@@ -76,5 +76,11 @@ module Sibu
76
76
  content_tag(:a, content["text"], {href: href}.merge(html_opts))
77
77
  end
78
78
  end
79
+
80
+ def form_label(id_or_elt, html_opts = {}, &block)
81
+ content = id_or_elt.is_a?(Hash) ? (id_or_elt || {"text" => "Texte à modifier"}) : (select(id_or_elt) || {"text" => "Texte à modifier"})
82
+ html_opts.merge!({class: "sb-label #{html_opts[:class]}", data: {id: id_or_elt.is_a?(Hash) ? id_or_elt["id"] : id_or_elt}}) if action_name != 'show'
83
+ content_tag(:label, raw(content["text"]).html_safe, html_opts)
84
+ end
79
85
  end
80
86
  end
data/lib/sibu/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Sibu
2
- VERSION = '0.1.2'
2
+ VERSION = '0.1.3'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sibu
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jean-Baptiste Vilain