bh 1.1.1 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (147) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +2 -1
  3. data/CHANGELOG.md +19 -0
  4. data/README.md +51 -18
  5. data/bh.gemspec +13 -9
  6. data/examples/middleman/.gitignore +18 -0
  7. data/examples/middleman/Gemfile +6 -0
  8. data/examples/middleman/config.rb +1 -0
  9. data/examples/middleman/source/index.html.erb +158 -0
  10. data/examples/padrino/Gemfile +9 -0
  11. data/examples/padrino/app/app.rb +16 -0
  12. data/examples/padrino/app/views/index.html.erb +155 -0
  13. data/examples/padrino/config.ru +5 -0
  14. data/examples/padrino/config/apps.rb +5 -0
  15. data/examples/padrino/config/boot.rb +8 -0
  16. data/examples/rails/.gitignore +12 -0
  17. data/examples/rails/Gemfile +5 -0
  18. data/examples/rails/app/controllers/application_controller.rb +6 -0
  19. data/examples/rails/app/controllers/users_controller.rb +2 -0
  20. data/examples/rails/app/models/user.rb +15 -0
  21. data/examples/rails/app/views/application/index.html.erb +160 -0
  22. data/examples/rails/bin/rails +4 -0
  23. data/examples/rails/config.ru +4 -0
  24. data/examples/rails/config/application.rb +12 -0
  25. data/examples/rails/config/boot.rb +3 -0
  26. data/examples/rails/config/environment.rb +5 -0
  27. data/examples/rails/config/environments/development.rb +7 -0
  28. data/examples/rails/config/routes.rb +4 -0
  29. data/examples/rails/config/secrets.yml +22 -0
  30. data/examples/rails/log/.keep +0 -0
  31. data/gemfiles/Gemfile.rails-3.x +2 -0
  32. data/gemfiles/Gemfile.rails-4.x +2 -0
  33. data/lib/bh.rb +15 -4
  34. data/lib/bh/classes/alert_box.rb +35 -0
  35. data/lib/bh/classes/base.rb +125 -0
  36. data/lib/bh/classes/button.rb +58 -0
  37. data/lib/bh/classes/button_to.rb +33 -0
  38. data/lib/bh/classes/cdn.rb +35 -0
  39. data/lib/bh/classes/dropdown.rb +56 -0
  40. data/lib/bh/classes/icon.rb +34 -0
  41. data/lib/bh/classes/link_to.rb +22 -0
  42. data/lib/bh/classes/modal.rb +68 -0
  43. data/lib/bh/classes/nav.rb +37 -0
  44. data/lib/bh/classes/navbar.rb +78 -0
  45. data/lib/bh/classes/panel.rb +72 -0
  46. data/lib/bh/classes/panel_row.rb +13 -0
  47. data/lib/bh/classes/progress_bar.rb +89 -0
  48. data/lib/bh/classes/stack.rb +19 -0
  49. data/lib/bh/classes/vertical.rb +27 -0
  50. data/lib/bh/core_ext/middleman.rb +24 -0
  51. data/lib/bh/core_ext/padrino.rb +25 -0
  52. data/lib/bh/core_ext/rails/base_helper.rb +21 -0
  53. data/lib/bh/{helpers → core_ext/rails}/form/base_helper.rb +3 -1
  54. data/lib/bh/{helpers → core_ext/rails}/form/check_box_helper.rb +1 -1
  55. data/lib/bh/{helpers → core_ext/rails}/form/field_helper.rb +1 -1
  56. data/lib/bh/{helpers → core_ext/rails}/form/fields_for_helper.rb +1 -1
  57. data/lib/bh/{helpers → core_ext/rails}/form/fieldset_helper.rb +1 -1
  58. data/lib/bh/{helpers → core_ext/rails}/form/file_field_helper.rb +1 -1
  59. data/lib/bh/{helpers → core_ext/rails}/form/legend_helper.rb +1 -1
  60. data/lib/bh/{helpers → core_ext/rails}/form/radio_button_helper.rb +1 -1
  61. data/lib/bh/{helpers → core_ext/rails}/form/select_helper.rb +1 -1
  62. data/lib/bh/{helpers → core_ext/rails}/form/static_control_helper.rb +1 -1
  63. data/lib/bh/{helpers → core_ext/rails}/form/submit_helper.rb +1 -1
  64. data/lib/bh/{form_builders → core_ext/rails}/form_builder.rb +11 -10
  65. data/lib/bh/core_ext/rails/form_for_helper.rb +32 -0
  66. data/lib/bh/core_ext/railtie.rb +27 -0
  67. data/lib/bh/helpers/alert_box_helper.rb +40 -0
  68. data/lib/bh/helpers/button_helper.rb +35 -58
  69. data/lib/bh/helpers/button_to_helper.rb +48 -10
  70. data/lib/bh/helpers/cdn_helper.rb +11 -35
  71. data/lib/bh/helpers/dropdown_helper.rb +29 -62
  72. data/lib/bh/helpers/glyphicon_helper.rb +7 -13
  73. data/lib/bh/helpers/horizontal_helper.rb +35 -0
  74. data/lib/bh/helpers/icon_helper.rb +15 -29
  75. data/lib/bh/helpers/link_to_helper.rb +52 -41
  76. data/lib/bh/helpers/modal_helper.rb +49 -79
  77. data/lib/bh/helpers/nav_helper.rb +25 -40
  78. data/lib/bh/helpers/navbar_helper.rb +36 -170
  79. data/lib/bh/helpers/panel_helper.rb +45 -72
  80. data/lib/bh/helpers/panel_row_helper.rb +20 -38
  81. data/lib/bh/helpers/progress_bar_helper.rb +48 -59
  82. data/lib/bh/helpers/vertical_helper.rb +33 -0
  83. data/lib/bh/version.rb +1 -1
  84. data/lib/bh/views/bh/_alert_dismiss_button.html +4 -0
  85. data/lib/bh/views/bh/_dropdown.html.erb +5 -5
  86. data/lib/bh/views/bh/_dropdown_split.html.erb +5 -5
  87. data/lib/bh/views/bh/_modal.html.erb +5 -8
  88. data/lib/bh/views/bh/_navbar.html.erb +5 -0
  89. data/spec/padrino/button_to_helper.rb +35 -0
  90. data/spec/padrino_spec.rb +28 -0
  91. data/spec/rails/button_to_helper.rb +31 -0
  92. data/spec/{helpers → rails}/form/check_box_helper_spec.rb +3 -3
  93. data/spec/{helpers → rails}/form/field_helper_spec.rb +3 -3
  94. data/spec/{helpers → rails}/form/fields_for_helper_spec.rb +3 -3
  95. data/spec/{helpers → rails}/form/fieldset_helper_spec.rb +3 -3
  96. data/spec/{helpers → rails}/form/file_field_helper_spec.rb +3 -3
  97. data/spec/{helpers → rails}/form/legend_helper_spec.rb +3 -3
  98. data/spec/{helpers → rails}/form/radio_button_helper_spec.rb +3 -3
  99. data/spec/{helpers → rails}/form/select_helper_spec.rb +3 -3
  100. data/spec/{helpers → rails}/form/static_control_helper_spec.rb +3 -3
  101. data/spec/{helpers → rails}/form/submit_helper_spec.rb +3 -3
  102. data/spec/{helpers → rails}/form_for_helper_spec.rb +3 -3
  103. data/spec/rails_helper.rb +25 -0
  104. data/spec/rails_spec.rb +28 -0
  105. data/spec/shared/alert_box_helper.rb +62 -0
  106. data/spec/shared/button_helper.rb +52 -0
  107. data/spec/shared/button_to_helper.rb +42 -0
  108. data/spec/shared/cdn_helper.rb +36 -0
  109. data/spec/shared/dropdown_helper.rb +112 -0
  110. data/spec/shared/glyphicon_helper.rb +21 -0
  111. data/spec/shared/horizontal_helper.rb +37 -0
  112. data/spec/shared/icon_helper.rb +31 -0
  113. data/spec/shared/link_to_helper.rb +62 -0
  114. data/spec/shared/modal_helper.rb +104 -0
  115. data/spec/shared/nav_helper.rb +49 -0
  116. data/spec/shared/navbar_helper.rb +63 -0
  117. data/spec/shared/panel_helper.rb +76 -0
  118. data/spec/shared/panel_row_helper.rb +21 -0
  119. data/spec/shared/progress_bar_helper.rb +103 -0
  120. data/spec/shared/vertical_helper.rb +43 -0
  121. data/spec/spec_helper.rb +6 -29
  122. data/spec/support/matchers.rb +38 -0
  123. data/spec/support/padrino.rb +33 -0
  124. data/spec/support/rails.rb +27 -0
  125. metadata +183 -94
  126. data/config.rb +0 -6
  127. data/lib/bh/helpers/alert_helper.rb +0 -77
  128. data/lib/bh/helpers/base_helper.rb +0 -39
  129. data/lib/bh/helpers/form_for_helper.rb +0 -30
  130. data/lib/bh/middleman.rb +0 -39
  131. data/lib/bh/railtie.rb +0 -42
  132. data/spec/dummy/index.html.erb +0 -60
  133. data/spec/dummy/layouts/default.erb +0 -17
  134. data/spec/helpers/alert_helper_spec.rb +0 -84
  135. data/spec/helpers/button_helper_spec.rb +0 -100
  136. data/spec/helpers/button_to_helper_spec.rb +0 -25
  137. data/spec/helpers/cdn_helper_spec.rb +0 -100
  138. data/spec/helpers/dropdown_helper_spec.rb +0 -146
  139. data/spec/helpers/glyphicon_helper_spec.rb +0 -21
  140. data/spec/helpers/icon_helper_spec.rb +0 -45
  141. data/spec/helpers/link_to_helper_spec.rb +0 -124
  142. data/spec/helpers/modal_helper_spec.rb +0 -133
  143. data/spec/helpers/nav_helper_spec.rb +0 -53
  144. data/spec/helpers/navbar_helper_spec.rb +0 -194
  145. data/spec/helpers/panel_helper_spec.rb +0 -95
  146. data/spec/helpers/panel_row_helper_spec.rb +0 -27
  147. data/spec/helpers/progress_bar_helper_spec.rb +0 -114
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8884ce49e3336610cfc24e59f78a9a879d9c6020
4
- data.tar.gz: 299d96e55a68df487308b191ddd91376962a12e5
3
+ metadata.gz: c4f7bca38e930bb3d819bb8eb02c8179cba085ba
4
+ data.tar.gz: 0f378c9f8ad7a87c3c157a394f22523c725479bf
5
5
  SHA512:
6
- metadata.gz: bf5ceafa2d9173590b86524882306d573d63b7a8462316a24708444aa60d1ae199bc9ab863756e4e7fdf8bee0e888b7d2da46d27f8d4fe39e13982f5d258a8d6
7
- data.tar.gz: e238691c83f7b6212368b3d0d54839e4f6dd416f66a17a3b3e7087fbc22ca61542887242661f67bd799e121505b254d091e9146a7a0821ac9cb1656f04c3d345
6
+ metadata.gz: 191624fbe875bdbeeaca0c0892371b98982be93c52c371c6fbfb570040965616b8d9cfc59ad87edeb4f39d24f476181ef9674f5773d6e226b7386cf3221c63dc
7
+ data.tar.gz: 1fbac9bf8bb10d1d3763aedd47e35a569c51211a93b21aa5c7acb25877c1dc9e300db77a8a74495f30f1ebaf5696766504e148bb8a8c802d9df11c191c3d6390
data/.yardopts CHANGED
@@ -1,2 +1,3 @@
1
1
  --no-private
2
- --markup markdown
2
+ --markup markdown
3
+ --hide-api private
data/CHANGELOG.md CHANGED
@@ -6,6 +6,25 @@ For more information about changelogs, check
6
6
  [Keep a Changelog](http://keepachangelog.com) and
7
7
  [Vandamme](http://tech-angels.github.io/vandamme).
8
8
 
9
+ ## 1.2.0 - 2014-11-13
10
+
11
+ * [FEATURE] Add support for Middleman and Padrino for all helpers except `form_for`
12
+ * [FEATURE] Extend `button_to` to accept the same :content, :size and :layout options as `button`
13
+ * [DEPRECATION] Deprecate `glyphicon` in favor of `icon` (`glyphicon` will still work until version 2.0.0)
14
+ * [BUGFIX] Don’t override `button_to` unless `:context`, `:size` or `:layout` is passed
15
+ * [ENHANCEMENT] Allow `alert_box` to pass extra parameters to the alert box <div>
16
+ * [ENHANCEMENT] Allow `button_to` to pass extra parameters to the button element
17
+ * [ENHANCEMENT] Allow `dropdown` to display a full-width button when called with `{layout: :block, groupable: false}`
18
+ * [ENHANCEMENT] Allow `dropdown` to pass `:id` parameter to the dropdown <ul>
19
+ * [ENHANCEMENT] Allow `modal` to pass the `:id` parameter to the wrapping <div>
20
+ * [ENHANCEMENT] Allow `modal` to pass `{button: :class}` parameter to the toggle <button>
21
+ * [ENHANCEMENT] Allow `panel` to pass extra parameters to the wrapping <div>
22
+ * [ENHANCEMENT] Allow `progress_bar` to pass extra parameters to the wrapping container
23
+ * [ENHANCEMENT] Allow `progress_bar` to pass extra parameters to each bar
24
+ * [ENHANCEMENT] Don’t render anything when `vertical` and `horizontal` are not wrapped in a `navbar`
25
+ * [ENHANCEMENT] Wrap plain content passed to `modal` inside the modal body
26
+ * [ENHANCEMENT] Wrap plain content passed to `panel` inside the panel body
27
+
9
28
  ## 1.1.1 - 2014-09-20
10
29
 
11
30
  * [ENHANCEMENT] Bump Bootstrap version to 3.3.0
data/README.md CHANGED
@@ -4,13 +4,13 @@ Bh · Bootstrap Helpers
4
4
  Bh provides a set of helpers that streamlines the use of
5
5
  [Bootstrap 3 components](http://getbootstrap.com/components) in Ruby views.
6
6
 
7
- The **full documentation** is available at [rubydoc.info](http://rubydoc.info/github/Fullscreen/bh/master/frames).
7
+ The **full documentation** is available at [rubydoc.info](http://www.rubydoc.info/github/Fullscreen/bh/master/Bh/Helpers).
8
8
 
9
9
  [![Build Status](http://img.shields.io/travis/Fullscreen/bh/master.svg)](https://travis-ci.org/Fullscreen/bh)
10
10
  [![Coverage Status](http://img.shields.io/coveralls/Fullscreen/bh/master.svg)](https://coveralls.io/r/Fullscreen/bh)
11
11
  [![Dependency Status](http://img.shields.io/gemnasium/Fullscreen/bh.svg)](https://gemnasium.com/Fullscreen/bh)
12
12
  [![Code Climate](http://img.shields.io/codeclimate/github/Fullscreen/bh.svg)](https://codeclimate.com/github/Fullscreen/bh)
13
- [![Online docs](http://img.shields.io/badge/docs-✓-green.svg)](http://rubydoc.info/github/Fullscreen/bh/master/frames)
13
+ [![Online docs](http://img.shields.io/badge/docs-✓-green.svg)](http://www.rubydoc.info/github/Fullscreen/bh/master/Bh/Helpers)
14
14
  [![Gem Version](http://img.shields.io/gem/v/bh.svg)](http://rubygems.org/gems/bh)
15
15
 
16
16
  Bootstrap 3 is a great framework, but requires many lines of HTML code
@@ -30,15 +30,30 @@ For instance, you need to write the following HTML to show a _dismissible alert_
30
30
  Writing this for every _dismissible alert_ is cumbersome,
31
31
  repetitive, and prone to errors.
32
32
 
33
- With Bh, you can achieve the same thing with just one line of code:
33
+ With Bh, you can achieve the same result with just one line of code:
34
34
 
35
35
  ```rhtml
36
36
  <%= alert_box 'You accepted the Terms of service.', dismissible: true %>
37
37
  ```
38
38
 
39
39
  `alert_box` is only one of the helpers provided by Bh.
40
- You can use the helpers you need and even mix-and-match the "standard way"
41
- of writing Bootstrap 3 components (many HTML lines) with the "Bh way".
40
+ The other ones are: `bootstrap_css`, `bootstrap_js`, `bootstrap_theme_css`,
41
+ `button_to`, `button`, `dropdown`, `font_awesome_css`, `form_for`,
42
+ `icon`, `modal`, `navbar`, `nav`, `panel_row`, `panel` and `progress_bar`.
43
+
44
+ How to install
45
+ ==============
46
+
47
+ Bh is compatible with **Rails 3**, **Rails 4**, **Padrino** and **Middleman**.
48
+
49
+ To include the Bh gem in your project:
50
+
51
+ 1. Add `gem 'bh', '~> 1.2'` to the `Gemfile` file of your Rails, Padrino or Middleman project.
52
+ 2. *Only if you are using Middleman*: open `config.rb` and add `activate :bh`.
53
+ 3. *Only if you are using Padrino*: open `app.rb` and add `register Bh`.
54
+
55
+ That’s all!
56
+ From now on, you will be able to use any Bh helper in your views.
42
57
 
43
58
  A comprehensive guide to Bh helpers
44
59
  ===================================
@@ -49,24 +64,46 @@ All the helpers available in Bh are detailed on the [Bh homepage](http://fullscr
49
64
 
50
65
  Please proceed to [http://fullscreen.github.io/bh](http://fullscreen.github.io/bh) for more details and examples on how to use Bh.
51
66
 
67
+ How to try it in your browser
68
+ =============================
52
69
 
53
- How to install
54
- ==============
70
+ The `examples` folder includes three sample apps that you can rapidly run in
71
+ your browser and edit as you please, in order to visually appreciate the result
72
+ of Bh.
73
+
74
+ If you’d like to run the _test Rails app_:
75
+
76
+ 1. Download the source code
77
+ 1. `cd` into the `examples/rails` folder
78
+ 1. Run `bundle install`
79
+ 1. Run `bundle exec rails server`
80
+ 1. Point your browser to [http://0.0.0.0:3000](http://0.0.0.0:3000)
55
81
 
56
- Bh is meant to be included in Rails apps by adding this line to the Gemfile:
82
+ If you prefer to see the helpers inside a _test Middleman app_:
57
83
 
58
- gem 'bh', '~> 1.1'
84
+ 1. Download the source code
85
+ 1. `cd` into the `examples/middleman` folder
86
+ 1. Run `bundle install`
87
+ 1. Run `bundle exec middleman`
88
+ 1. Point your browser to [http://0.0.0.0:4567](http://0.0.0.0:4567)
59
89
 
60
- Since the gem follows [Semantic Versioning](http://semver.org), indicating the
61
- version number in your Gemfile in the *'~> major.minor'* format guarantees
62
- that your project won’t break when you `bundle update` to a new version.
90
+ If you prefer to see the helpers inside a _test Padrino app_:
91
+
92
+ 1. Download the source code
93
+ 1. `cd` into the `examples/padrino` folder
94
+ 1. Run `bundle install`
95
+ 1. Run `bundle padrino start`
96
+ 1. Point your browser to [http://0.0.0.0:3000](http://0.0.0.0:3000)
63
97
 
64
- Adding `bh` to your Gemfile is all you need!
65
- From now on, you will be able to use any Bh helper in your ERB views.
66
98
 
67
99
  How to update
68
100
  =============
69
101
 
102
+ Bh strictly follows [Semantic Versioning](http://semver.org).
103
+ By indicating the version number in the *'~> major.minor'* format in your
104
+ Gemfile, you are guaranteed that that your project won’t break when you
105
+ `bundle update` to a new version.
106
+
70
107
  Whenever a new version is released, the [CHANGELOG file](https://github.com/claudiob/bh/blob/master/CHANGELOG.md)
71
108
  will include a description of what features have changed and how to upgrade
72
109
  your code, if necessary.
@@ -109,9 +146,5 @@ be merged!
109
146
 
110
147
  To run the tests, simply type `bundle exec rspec` on the command line.
111
148
 
112
- To see the HTML generated by helpers in a browser,
113
- edit the [spec/dummy/index.html file](https://github.com/claudiob/bh/blob/master/spec/dummy/index.html),
114
- then type `bundle exec middleman` and point your browser to [http://0.0.0.0:4567](http://0.0.0.0:4567).
115
-
116
149
  Don’t hesitate to send code comments, issues or pull requests through GitHub
117
150
  and to spread the love. And [don’t click here](http://bit.ly/move-to-la)! Thanks! :)
data/bh.gemspec CHANGED
@@ -21,17 +21,21 @@ Gem::Specification.new do |spec|
21
21
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
22
22
  spec.require_paths = ["lib"]
23
23
 
24
- spec.add_dependency 'activesupport'
25
- spec.add_dependency 'actionpack'
24
+ spec.add_dependency 'activesupport' # versioned in gemfiles/
25
+ spec.add_dependency 'actionpack' # versioned in gemfiles/
26
26
 
27
27
  # For development / Code coverage / Documentation
28
- spec.add_development_dependency 'bundler' #, '~> 1.0'
29
- spec.add_development_dependency 'rspec' #, '~> 2.0'
30
- spec.add_development_dependency 'rake' #, '~> 10.0'
31
- spec.add_development_dependency 'yard' #, '~> 0.8.0'
32
- spec.add_development_dependency 'coveralls' #, '~> 0.7.0'
33
- spec.add_development_dependency 'activemodel'
28
+ spec.add_development_dependency 'bundler', '~> 1.1'
29
+ spec.add_development_dependency 'rspec', '~> 3.1'
30
+ spec.add_development_dependency 'rake', '~> 10.3'
31
+ spec.add_development_dependency 'yard', '~> 0.8.7'
32
+ spec.add_development_dependency 'coveralls', '~> 0.7.1'
33
+ spec.add_development_dependency 'activemodel' # versioned in gemfiles/
34
34
 
35
35
  # For spec/dummy
36
- spec.add_development_dependency 'middleman-core' #, '~> 3.3.5'
36
+ spec.add_development_dependency 'middleman-core' # versioned in gemfiles/
37
+
38
+ # For Middleman/Padrino tests
39
+ spec.add_development_dependency 'padrino-helpers', '~> 0.12.4'
40
+ spec.add_development_dependency 'padrino-routing', '~> 0.5.0'
37
41
  end
@@ -0,0 +1,18 @@
1
+ # See http://help.github.com/ignore-files/ for more about ignoring files.
2
+ #
3
+ # If you find yourself ignoring temporary files generated by your text editor
4
+ # or operating system, you probably want to add a global ignore instead:
5
+ # git config --global core.excludesfile ~/.gitignore_global
6
+
7
+ # Ignore bundler config
8
+ /.bundle
9
+
10
+ # Ignore the build directory
11
+ /build
12
+
13
+ # Ignore cache
14
+ /.sass-cache
15
+ /.cache
16
+
17
+ # Ignore .DS_store file
18
+ .DS_Store
@@ -0,0 +1,6 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem 'middleman', '~> 3.3'
4
+ gem 'middleman-livereload', '~> 3.1'
5
+
6
+ gem 'bh', path: '../../../bh'
@@ -0,0 +1 @@
1
+ activate :bh
@@ -0,0 +1,158 @@
1
+ ---
2
+ ---
3
+
4
+ <!DOCTYPE html>
5
+ <html lang="en">
6
+ <head>
7
+ <meta charset="utf-8" />
8
+ <meta content="IE=edge" http-equiv="X-UA-Compatible" />
9
+ <meta name="viewport" content="width=device-width, initial-scale=1">
10
+ <%= stylesheet_link_tag font_awesome_css, bootstrap_css, bootstrap_theme_css %>
11
+ <title>Bh test page (Middleman)</title>
12
+ </head>
13
+ <body>
14
+ <div class='container'>
15
+
16
+ <h1>Alerts</h1>
17
+
18
+ <!-- Try setting different :dismissible and :context options -->
19
+ <%= alert_box 'You accepted the Terms of service.' %>
20
+
21
+ <% alert_box context: :warning, dismissible: true, id: 'alert', class: :en, data: {js: 1} do %>
22
+ <em>Thanks!</em> You accepted the <%= link_to 'Terms of service', '/#terms' %>.
23
+ <% end %>
24
+
25
+ <h1>Panels</h1>
26
+
27
+ <!-- Try setting different :title, :tag and :context options -->
28
+ <%= panel 'You accepted the Terms of service', title: 'Thanks', tag: :aside %>
29
+
30
+ <% panel heading: 'Thanks', context: :info, id: 'panel', class: :en, data: {js: 1} do %>
31
+ <div class='panel-body'>You accepted the Terms of service. <%= icon :ok %></div>
32
+ <% end %>
33
+
34
+ <h1>Panel rows</h1>
35
+
36
+ <!-- Try setting a different :column_class option -->
37
+ <% panel_row column_class: 'col-sm-12' do %>
38
+ <%= panel 'Plain full-width panel' %>
39
+ <% end %>
40
+
41
+ <% panel_row column_class: 'col-sm-6', id: 'panel-row', class: :en, data: {js: 1} do %>
42
+ <%= panel 'John Smith', title: 'User', context: :info %>
43
+ <% panel title: 'Phone' do %>
44
+ <div class='panel-body'><%= icon :earphone %> 323-555-5555</div>
45
+ <% end %>
46
+ <% end %>
47
+
48
+ <h1>Modals</h1>
49
+
50
+ <!-- Try setting different :title, :size, :button or :context options -->
51
+ <%= modal 'Do what you want!', button: {size: :small, context: :info} %>
52
+
53
+ <% modal size: :large, id: 'modal', button: {class: :en} do %>
54
+ <div class="modal-body">Please accept the Terms of service.</div>
55
+ <div class="modal-footer"><button type="button" class="btn btn-primary">Accept</button></div>
56
+ <% end %>
57
+
58
+ <h1>Navs</h1>
59
+
60
+ <% nav do %>
61
+ <li class='active'>
62
+ <%= link_to 'Home', '/' %>
63
+ </li>
64
+ <li>
65
+ <%= link_to 'Profile', '/#profile' %>
66
+ </li>
67
+ <li>
68
+ <%= link_to 'Settings', '/#settings' %>
69
+ </li>
70
+ <% end %>
71
+
72
+ <br />
73
+ <!-- Try setting different :layout or :as options -->
74
+ <% nav as: :pills, layout: :stacked, id: 'my-nav', data: {value: 1} do %>
75
+ <li class='active'>
76
+ <%= link_to 'Home', '/' %>
77
+ </li>
78
+ <li>
79
+ <%= link_to 'Profile', '/#profile' %>
80
+ </li>
81
+ <li>
82
+ <%= link_to 'Settings', '/#settings' %>
83
+ </li>
84
+ <% end %>
85
+
86
+ <h1>Navbars</h1>
87
+
88
+ <!-- Try adding a horizontal element and setting different :inverted, :fluid, :position or :padding options -->
89
+ <% navbar inverted: true do %>
90
+ <% vertical do %>
91
+ <%= link_to 'Home', '/' %>
92
+ <% end %>
93
+ <% end %>
94
+
95
+ <% navbar id: 'navbar' do %>
96
+ <% vertical id: 'vertical', class: :en, data: {js: 1} do %>
97
+ <%= link_to 'Home', '/' %>
98
+ <% end %>
99
+ <% horizontal class: :en, data: {js: 2} do %>
100
+ <% nav class: 'navbar-left' do %>
101
+ <%= link_to 'Profile', '/#profile' %>
102
+ <%= link_to 'Settings', '/#settings' %>
103
+ <% end %>
104
+ <% end %>
105
+ <% end %>
106
+
107
+ <h1>Buttons</h1>
108
+
109
+ <!-- Try setting different :context, :size and :layout options -->
110
+ <%= button 'Menu' %>
111
+
112
+ <% button context: :warning, id: 'button', class: :en, data: {js: 1} do %>
113
+ Your <em>personal</em> menu
114
+ <% end %>
115
+
116
+ <h1>Dropdowns</h1>
117
+
118
+ <!-- Try setting different :split, :direction, :align, :groupable, :layout, :context or :size options -->
119
+ <% dropdown 'Menu', direction: :up, context: :success, align: :right do %>
120
+ <%= link_to 'Home', '/' %>
121
+ <%= link_to 'Profile', '/#profile' %>
122
+ <%= link_to 'Settings', '/#settings' %>
123
+ <% end %>
124
+
125
+ <% dropdown 'Menu', split: true, id: 'dropdown', button: {class: :en} do %>
126
+ <li role="presentation"><a href="#">Home</a></li>
127
+ <li role="presentation"><a href="#"><%= content_tag :em, 'Profile' %></a></li>
128
+ <% end %>
129
+
130
+ <h1>Progress bars</h1>
131
+
132
+ <!-- Try passing multiple values with different :percentage, :label, :context, :striped, :animated options -->
133
+ <%= progress_bar [{percentage: 75, striped: true}, {percentage: 20, context: :warning, label: true}] %>
134
+
135
+ <%= progress_bar({percentage: 30, id: 'bar', data: {js: 1}}, id: 'container', class: :en) %>
136
+
137
+ <h1>Icons</h1>
138
+
139
+ <!-- Try setting a different :library option -->
140
+ <%= icon :user %>
141
+
142
+ <%= icon :user, library: :font_awesome, class: 'fa-2x', id: 'icon', data: {value: 1} %>
143
+
144
+ <h1>Button to</h1>
145
+
146
+ <%= button_to 'New', '#new', submit_options: {class: 'b'}, class: 'f', method: :get %>
147
+ <br />
148
+ <%= button_to 'New', '#new', submit_options: {class: 'b'}, class: 'f', method: :get, context: :primary %>
149
+
150
+ <% button_to '/#edit', method: :get do %>
151
+ <button id="my-btn-to" data-value="1" class="btn btn-link">Button <strong>styled</strong> as a link</button>
152
+ <% end %>
153
+
154
+ </div>
155
+ <%= javascript_include_tag '//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js' %>
156
+ <%= javascript_include_tag bootstrap_js %>
157
+ </body>
158
+ </html>
@@ -0,0 +1,9 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem 'rake'
4
+ gem 'erubis', '~> 2.7.0'
5
+
6
+ # Point padrino to Rubygems once http://git.io/ll8xtA is merged
7
+ gem 'padrino', github: 'padrino/padrino-framework' # '~> 0.13.0'
8
+
9
+ gem 'bh', path: '../../../bh'
@@ -0,0 +1,16 @@
1
+ module TestBh
2
+ class App < Padrino::Application
3
+ register Padrino::Helpers
4
+ register Padrino::Rendering
5
+
6
+ register Bh
7
+
8
+ get :root, map: '/' do
9
+ render :index
10
+ end
11
+
12
+ get :users, map: '/users' do
13
+ render :index
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,155 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <meta content="IE=edge" http-equiv="X-UA-Compatible" />
6
+ <meta name="viewport" content="width=device-width, initial-scale=1">
7
+ <%= stylesheet_link_tag font_awesome_css, bootstrap_css, bootstrap_theme_css %>
8
+ <title>Bh test page (Padrino)</title>
9
+ </head>
10
+ <body>
11
+ <div class='container'>
12
+
13
+ <h1>Alerts</h1>
14
+
15
+ <!-- Try setting different :dismissible and :context options -->
16
+ <%= alert_box 'You accepted the Terms of service.' %>
17
+
18
+ <% alert_box context: :warning, dismissible: true, id: 'alert', class: :en, data: {js: 1} do %>
19
+ <em>Thanks!</em> You accepted the <%= link_to 'Terms of service', '/#terms' %>.
20
+ <% end %>
21
+
22
+ <h1>Panels</h1>
23
+
24
+ <!-- Try setting different :title, :tag and :context options -->
25
+ <%= panel 'You accepted the Terms of service', title: 'Thanks', tag: :aside %>
26
+
27
+ <% panel heading: 'Thanks', context: :info, id: 'panel', class: :en, data: {js: 1} do %>
28
+ <div class='panel-body'>You accepted the Terms of service. <%= icon :ok %></div>
29
+ <% end %>
30
+
31
+ <h1>Panel rows</h1>
32
+
33
+ <!-- Try setting a different :column_class option -->
34
+ <% panel_row column_class: 'col-sm-12' do %>
35
+ <%= panel 'Plain full-width panel' %>
36
+ <% end %>
37
+
38
+ <% panel_row column_class: 'col-sm-6', id: 'panel-row', class: :en, data: {js: 1} do %>
39
+ <%= panel 'John Smith', title: 'User', context: :info %>
40
+ <% panel title: 'Phone' do %>
41
+ <div class='panel-body'><%= icon :earphone %> 323-555-5555</div>
42
+ <% end %>
43
+ <% end %>
44
+
45
+ <h1>Modals</h1>
46
+
47
+ <!-- Try setting different :title, :size, :button or :context options -->
48
+ <%= modal 'Do what you want!', button: {size: :small, context: :info} %>
49
+
50
+ <% modal title: 'Terms of service', size: :large, id: 'modal', button: {class: :en} do %>
51
+ <div class="modal-body">Please accept the Terms of service.</div>
52
+ <div class="modal-footer"><button type="button" class="btn btn-primary">Accept</button></div>
53
+ <% end %>
54
+
55
+ <h1>Navs</h1>
56
+
57
+ <% nav do %>
58
+ <li class='active'>
59
+ <%= link_to 'Home', '/' %>
60
+ </li>
61
+ <li>
62
+ <%= link_to 'Profile', '/#profile' %>
63
+ </li>
64
+ <li>
65
+ <%= link_to 'Settings', '/#settings' %>
66
+ </li>
67
+ <% end %>
68
+
69
+ <br />
70
+ <!-- Try setting different :layout or :as options -->
71
+ <% nav as: :pills, layout: :stacked, id: 'my-nav', data: {value: 1} do %>
72
+ <li class='active'>
73
+ <%= link_to 'Home', '/' %>
74
+ </li>
75
+ <li>
76
+ <%= link_to 'Profile', '/#profile' %>
77
+ </li>
78
+ <li>
79
+ <%= link_to 'Settings', '/#settings' %>
80
+ </li>
81
+ <% end %>
82
+
83
+ <h1>Navbars</h1>
84
+
85
+ <!-- Try adding a horizontal element and setting different :inverted, :fluid, :position or :padding options -->
86
+ <% navbar inverted: true do %>
87
+ <% vertical do %>
88
+ <%= link_to 'Home', '/' %>
89
+ <% end %>
90
+ <% end %>
91
+
92
+ <% navbar id: 'navbar' do %>
93
+ <% vertical id: 'vertical', class: :en, data: {js: 1} do %>
94
+ <%= link_to 'Home', '/' %>
95
+ <% end %>
96
+ <% horizontal class: :en, data: {js: 2} do %>
97
+ <% nav class: 'navbar-left' do %>
98
+ <%= link_to 'Profile', '/#profile' %>
99
+ <%= link_to 'Settings', '/#settings' %>
100
+ <% end %>
101
+ <% end %>
102
+ <% end %>
103
+
104
+ <h1>Buttons</h1>
105
+
106
+ <!-- Try setting different :context, :size and :layout options -->
107
+ <%= button 'Menu' %>
108
+
109
+ <% button context: :warning, id: 'button', class: :en, data: {js: 1} do %>
110
+ Your <em>personal</em> menu
111
+ <% end %>
112
+
113
+ <h1>Dropdowns</h1>
114
+
115
+ <!-- Try setting different :split, :direction, :align, :groupable, :layout, :context or :size options -->
116
+ <% dropdown 'Menu', direction: :up, context: :success, align: :right do %>
117
+ <%= link_to 'Home', '/' %>
118
+ <%= link_to 'Profile', '/#profile' %>
119
+ <%= link_to 'Settings', '/#settings' %>
120
+ <% end %>
121
+
122
+ <% dropdown 'Menu', split: true, id: 'dropdown', button: {class: :en} do %>
123
+ <li role="presentation"><a href="#">Home</a></li>
124
+ <li role="presentation"><a href="#"><%= content_tag :em, 'Profile' %></a></li>
125
+ <% end %>
126
+
127
+ <h1>Progress bars</h1>
128
+
129
+ <!-- Try passing multiple values with different :percentage, :label, :context, :striped, :animated options -->
130
+ <%= progress_bar [{percentage: 75, striped: true}, {percentage: 20, context: :warning, label: true}] %>
131
+
132
+ <%= progress_bar({percentage: 30, id: 'bar', data: {js: 1}}, id: 'container', class: :en) %>
133
+
134
+ <h1>Icons</h1>
135
+
136
+ <!-- Try setting a different :library option -->
137
+ <%= icon :user %>
138
+
139
+ <%= icon :user, library: :font_awesome, class: 'fa-2x', id: 'icon', data: {value: 1} %>
140
+
141
+ <h1>Button to</h1>
142
+
143
+ <%= button_to 'New', '#new', submit_options: {class: 'b'}, class: 'f', method: :get %>
144
+ <br />
145
+ <%= button_to 'New', '#new', submit_options: {class: 'b'}, class: 'f', method: :get, context: :primary %>
146
+
147
+ <% button_to '/#edit', method: :get, context: :link, submit_options: {id: 'my-btn-to', data: {value: 1}} do %>
148
+ Button <strong>styled</strong> as a link
149
+ <% end %>
150
+
151
+ </div>
152
+ <%= javascript_include_tag '//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js' %>
153
+ <%= javascript_include_tag bootstrap_js %>
154
+ </body>
155
+ </html>