bootstrap-components-helpers 0.0.8 → 1.0.0
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2734ad7dd81e1376ac75763d523b3fd8b6028630
|
4
|
+
data.tar.gz: 95ceb75c26ae05b3ae5eef6c4b6b004f86c1ea75
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0f76352adbd8694b06f9336aad12a749c9c341226807379a037631214e3b0eec7fd94b20468c30bf9a2cceed7c6559de9ceedc2478bb89579dbb61609738ece8
|
7
|
+
data.tar.gz: 212b596e5dd26d31816e9f0af892ce145c9b0765232a559b6026491ca6135e6192cd524fbf2ddaf40d886d47bfec849a0d6d96778177e72eab14707f09ae35c1
|
data/README.markdown
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
[![Build Status](https://travis-ci.org/isc/bootstrap-components-helpers.svg?branch=master)](https://travis-ci.org/isc/bootstrap-components-helpers)
|
1
2
|
## Twitter Bootstrap Components Helper
|
2
3
|
|
3
4
|
Provides view helpers for **accordion**, **tabs** and **modal** Twitter Bootstrap components.
|
@@ -33,7 +34,6 @@ In your Gemfile:
|
|
33
34
|
|
34
35
|
`tabs` method options :
|
35
36
|
|
36
|
-
- `:direction` : to control the positioning of the tabs. Valid values are `below`, `left`, `right` and `above` (default is `above`).
|
37
37
|
- `:style` : `tabs` or `pills` (default is `tabs`).
|
38
38
|
|
39
39
|
`pane` method options :
|
@@ -3,7 +3,7 @@ module BootstrapComponentsHelpers
|
|
3
3
|
def accordion opts = {}
|
4
4
|
opts[:accordion_id] ||= 'accordion'
|
5
5
|
builder = AccordionBuilder.new opts, self
|
6
|
-
css_class = ['
|
6
|
+
css_class = ['panel-group']
|
7
7
|
css_class << opts[:class] if opts[:class].present?
|
8
8
|
content_tag :div, :class => css_class, :id => opts[:accordion_id] do
|
9
9
|
yield builder
|
@@ -22,13 +22,15 @@ module BootstrapComponentsHelpers
|
|
22
22
|
|
23
23
|
def pane title, options = {}, &block
|
24
24
|
css_class = options[:open] ? 'in' : ''
|
25
|
-
content_tag :div, :class => '
|
26
|
-
heading = content_tag :div, :class => '
|
27
|
-
|
25
|
+
content_tag :div, :class => 'panel panel-default' do
|
26
|
+
heading = content_tag :div, :class => 'panel-heading' do
|
27
|
+
content_tag :h4, :class => 'panel-title' do
|
28
|
+
link_to title, "##{title.parameterize}_pane", :'data-toggle' => 'collapse',
|
28
29
|
:'data-parent' => "##{@opts[:accordion_id]}"
|
30
|
+
end
|
29
31
|
end
|
30
|
-
body = content_tag :div, :class => "
|
31
|
-
content_tag :div, :class => '
|
32
|
+
body = content_tag :div, :class => "panel-collapse collapse #{css_class}", :id => "#{title.parameterize}_pane" do
|
33
|
+
content_tag :div, :class => 'panel-body' do
|
32
34
|
capture(&block)
|
33
35
|
end
|
34
36
|
end
|
@@ -6,17 +6,21 @@ module BootstrapComponentsHelpers
|
|
6
6
|
def modal title, options = {}
|
7
7
|
builder = ModalBuilder.new self
|
8
8
|
yield builder
|
9
|
-
content_tag :div, class: 'modal fade
|
10
|
-
|
11
|
-
content_tag
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
9
|
+
content_tag :div, class: 'modal fade', id: options[:id] do
|
10
|
+
content_tag :div, class: 'modal-dialog' do
|
11
|
+
content_tag :div, class: 'modal-content' do
|
12
|
+
header = content_tag :div, class: 'modal-header' do
|
13
|
+
content_tag(:a, '×', class: 'close', data: {dismiss: 'modal'}) + content_tag(:h4, title, class: 'modal-title')
|
14
|
+
end
|
15
|
+
body = content_tag(:div, class: 'modal-body') {builder.body_content}
|
16
|
+
unless options[:skip_footer]
|
17
|
+
footer = content_tag(:div, class: 'modal-footer') do
|
18
|
+
builder.footer_content || content_tag(:a, 'Cancel', class: 'btn pull-right', data: {dismiss: 'modal'})
|
19
|
+
end
|
20
|
+
end
|
21
|
+
header + body + footer
|
17
22
|
end
|
18
23
|
end
|
19
|
-
header + body + footer
|
20
24
|
end
|
21
25
|
end
|
22
26
|
|
@@ -1,7 +1,6 @@
|
|
1
1
|
module BootstrapComponentsHelpers
|
2
2
|
module TabsHelper
|
3
3
|
def tabs opts = {}
|
4
|
-
opts[:direction] ||= 'above'
|
5
4
|
opts[:style] ||= 'tabs'
|
6
5
|
builder = TabsBuilder.new self
|
7
6
|
yield builder
|
@@ -9,9 +8,8 @@ module BootstrapComponentsHelpers
|
|
9
8
|
return unless pane_handles_html
|
10
9
|
tabs = content_tag(:ul, builder.pane_handles_html, :class => "nav nav-#{opts[:style]}")
|
11
10
|
contents = content_tag(:div, builder.pane_contents_html, :class => 'tab-content')
|
12
|
-
|
13
|
-
|
14
|
-
opts[:direction] == 'below' ? (contents + tabs) : (tabs + contents)
|
11
|
+
content_tag :div do
|
12
|
+
tabs + contents
|
15
13
|
end
|
16
14
|
end
|
17
15
|
|
data/test/test_helper.rb
CHANGED
@@ -1,8 +1,10 @@
|
|
1
|
-
require '
|
1
|
+
require 'minitest/autorun'
|
2
2
|
require 'action_view'
|
3
3
|
require 'action_view/template'
|
4
4
|
require 'bootstrap-components-helpers'
|
5
5
|
|
6
|
+
ActiveSupport.test_order = :random
|
7
|
+
|
6
8
|
class ActionView::TestCase
|
7
9
|
|
8
10
|
def assert_helper_output fixture_name, actual_output
|
metadata
CHANGED
@@ -1,29 +1,43 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bootstrap-components-helpers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ivan Schneider
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-12-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: actionpack
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 4.0.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 4.0.0
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: minitest
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
27
41
|
description: View helpers that generate the proper markup for some Twitter Bootstrap
|
28
42
|
components
|
29
43
|
email: git@ivanschneider.fr
|
@@ -50,17 +64,17 @@ require_paths:
|
|
50
64
|
- lib
|
51
65
|
required_ruby_version: !ruby/object:Gem::Requirement
|
52
66
|
requirements:
|
53
|
-
- -
|
67
|
+
- - ">="
|
54
68
|
- !ruby/object:Gem::Version
|
55
69
|
version: '0'
|
56
70
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
57
71
|
requirements:
|
58
|
-
- -
|
72
|
+
- - ">="
|
59
73
|
- !ruby/object:Gem::Version
|
60
74
|
version: '0'
|
61
75
|
requirements: []
|
62
76
|
rubyforge_project:
|
63
|
-
rubygems_version: 2.
|
77
|
+
rubygems_version: 2.4.5.1
|
64
78
|
signing_key:
|
65
79
|
specification_version: 4
|
66
80
|
summary: View helpers for Twitter Bootstrap components
|