effective_resources 0.7.9 → 0.7.10

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: 022dfa4ea62f6a71b19192016d4a3108f657bda0
4
- data.tar.gz: 2c0d60521353a87ca54acde430540636742adbd8
3
+ metadata.gz: e7c20435511222c5ce79dd666f0316afd80725d7
4
+ data.tar.gz: 70f5d6058d90bc1a1d0e0464c33b0169066769ba
5
5
  SHA512:
6
- metadata.gz: f10e53623093ce79fe6b8a22aa10087aeed62014eb672338741d1277681c627cc7d1b5129c32cc1b0a1fa44332853ad9c2b02711d76801a130e85bbf3b356b71
7
- data.tar.gz: cc17e8e6b4f1af4a4c1af4acdaaba2a47e4e9055ddee77975a05f878552410369ded8c65bedf01f1f9c0baa8f0cce4a069257554c0c0c8b254c7f93f863c010f
6
+ metadata.gz: 1f42d5f5d8bc2818e92e7f242546bdb795a7a62a9d780825e775a49876dc42a515da003e00c9391a22cc72eb5fd404a3ec91d5de2582e86196ab143d9e09fe35
7
+ data.tar.gz: a5dfe04ab6f0cee8360208feacba38c4c202160ee53efbd5fbaf5564bff6612cfa31a3ac089f47eed9a3a0b8e3c9f589989721f39cde23858daba92bbe33e98d
@@ -36,23 +36,25 @@ module EffectiveBootstrap3Helper
36
36
  # %p Exports
37
37
 
38
38
  # If you pass active 'label' it will make that tab active. Otherwise first.
39
- def tabs(active: nil, &block)
39
+ def tabs(active: nil, panel: {}, list: {}, content: {}, &block)
40
40
  raise 'expected a block' unless block_given?
41
41
 
42
42
  @_tab_mode = :panel
43
43
  @_tab_active = (active || :first)
44
44
 
45
- content_tag(:div, role: 'tabpanel') do
46
- content_tag(:ul, class: 'nav nav-tabs', role: 'tablist') { yield } # Yield to tab the first time
47
- end + content_tag(:div, class: 'tab-content') do
45
+ content_tag(:div, {role: 'tabpanel'}.merge(panel)) do
46
+ content_tag(:ul, {class: 'nav nav-tabs', role: 'tablist'}.merge(list)) { yield } # Yield to tab the first time
47
+ end + content_tag(:div, {class: 'tab-content'}.merge(content)) do
48
48
  @_tab_mode = :content
49
49
  @_tab_active = (active || :first)
50
50
  yield # Yield tot ab the second time
51
51
  end
52
52
  end
53
53
 
54
- def tab(label, &block)
55
- controls = label.to_s.parameterize.gsub('_', '-')
54
+ def tab(label, controls = nil, &block)
55
+ controls ||= label.to_s.parameterize.gsub('_', '-')
56
+ controls = controls[1..-1] if controls[0] == '#'
57
+
56
58
  active = (@_tab_active == :first || @_tab_active == label)
57
59
 
58
60
  @_tab_active = nil if @_tab_active == :first
@@ -115,11 +115,11 @@ module EffectiveResourcesHelper
115
115
  glyphicon_to('remove', path, {title: 'Remove'}.merge(options))
116
116
  end
117
117
 
118
- def glyphicon_tag(icon)
118
+ def glyphicon_tag(icon, options = {})
119
119
  if icon.to_s.start_with?('glyphicon-')
120
- content_tag(:span, '', class: "glyphicon #{icon}")
120
+ content_tag(:span, '', {class: "glyphicon #{icon}"}.merge(options))
121
121
  else
122
- content_tag(:span, '', class: "glyphicon glyphicon-#{icon}")
122
+ content_tag(:span, '', {class: "glyphicon glyphicon-#{icon}"}.merge(options))
123
123
  end
124
124
  end
125
125
 
@@ -1,3 +1,3 @@
1
1
  module EffectiveResources
2
- VERSION = '0.7.9'.freeze
2
+ VERSION = '0.7.10'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_resources
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.9
4
+ version: 0.7.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-01-24 00:00:00.000000000 Z
11
+ date: 2018-01-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -83,7 +83,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
83
83
  version: '0'
84
84
  requirements: []
85
85
  rubyforge_project:
86
- rubygems_version: 2.5.2
86
+ rubygems_version: 2.4.5.1
87
87
  signing_key:
88
88
  specification_version: 4
89
89
  summary: Make any controller an effective resource controller.