twitter-bootstrap-rails 2.2.8 → 4.0.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of twitter-bootstrap-rails might be problematic. Click here for more details.

Files changed (185) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +229 -322
  3. data/Rakefile +4 -6
  4. data/app/assets/fonts/glyphicons-halflings-regular.eot +0 -0
  5. data/app/assets/fonts/glyphicons-halflings-regular.svg +288 -0
  6. data/app/assets/fonts/glyphicons-halflings-regular.ttf +0 -0
  7. data/app/assets/fonts/glyphicons-halflings-regular.woff +0 -0
  8. data/app/assets/fonts/glyphicons-halflings-regular.woff2 +0 -0
  9. data/app/assets/javascripts/twitter/bootstrap.js +12 -13
  10. data/app/assets/javascripts/twitter/bootstrap/affix.js +162 -0
  11. data/app/assets/javascripts/twitter/bootstrap/alert.js +94 -0
  12. data/app/assets/javascripts/twitter/bootstrap/button.js +120 -0
  13. data/app/assets/javascripts/twitter/bootstrap/carousel.js +237 -0
  14. data/app/assets/javascripts/twitter/bootstrap/collapse.js +211 -0
  15. data/app/assets/javascripts/twitter/bootstrap/dropdown.js +165 -0
  16. data/app/assets/javascripts/twitter/bootstrap/modal.js +337 -0
  17. data/app/assets/javascripts/twitter/bootstrap/popover.js +108 -0
  18. data/app/assets/javascripts/twitter/bootstrap/scrollspy.js +172 -0
  19. data/app/assets/javascripts/twitter/bootstrap/tab.js +155 -0
  20. data/app/assets/javascripts/twitter/bootstrap/tooltip.js +514 -0
  21. data/app/assets/javascripts/twitter/bootstrap/transition.js +59 -0
  22. data/app/assets/stylesheets/twitter-bootstrap-static/bootstrap.css.erb +1 -890
  23. data/app/assets/stylesheets/twitter-bootstrap-static/sprites.css.erb +1 -146
  24. data/app/helpers/bootstrap_flash_helper.rb +14 -7
  25. data/app/helpers/form_errors_helper.rb +22 -0
  26. data/app/helpers/glyph_helper.rb +12 -6
  27. data/app/helpers/modal_helper.rb +26 -22
  28. data/app/helpers/navbar_helper.rb +47 -32
  29. data/app/helpers/twitter_breadcrumbs_helper.rb +6 -2
  30. data/app/views/twitter-bootstrap/_breadcrumbs.html.erb +8 -8
  31. data/lib/generators/bootstrap/install/install_generator.rb +3 -2
  32. data/lib/generators/bootstrap/install/templates/bootstrap_and_overrides.css +3 -4
  33. data/lib/generators/bootstrap/install/templates/bootstrap_and_overrides.less +9 -18
  34. data/lib/generators/bootstrap/install/templates/en.bootstrap.yml +5 -0
  35. data/lib/generators/bootstrap/layout/layout_generator.rb +1 -4
  36. data/lib/generators/bootstrap/layout/templates/layout.html.erb +27 -48
  37. data/lib/generators/bootstrap/layout/templates/layout.html.haml +19 -34
  38. data/lib/generators/bootstrap/layout/templates/layout.html.slim +13 -30
  39. data/lib/generators/bootstrap/partial/templates/_login.html.erb +2 -3
  40. data/lib/generators/bootstrap/themed/templates/_form.html.erb +30 -10
  41. data/lib/generators/bootstrap/themed/templates/_form.html.haml +10 -8
  42. data/lib/generators/bootstrap/themed/templates/_form.html.slim +11 -9
  43. data/lib/generators/bootstrap/themed/templates/edit.html.slim +1 -1
  44. data/lib/generators/bootstrap/themed/templates/index.html.erb +4 -2
  45. data/lib/generators/bootstrap/themed/templates/index.html.haml +3 -2
  46. data/lib/generators/bootstrap/themed/templates/index.html.slim +6 -5
  47. data/lib/generators/bootstrap/themed/templates/new.html.slim +1 -1
  48. data/lib/generators/bootstrap/themed/templates/show.html.erb +5 -7
  49. data/lib/generators/bootstrap/themed/templates/show.html.haml +4 -4
  50. data/lib/generators/bootstrap/themed/templates/show.html.slim +6 -7
  51. data/lib/generators/bootstrap/themed/templates/simple_form/_form.html.erb +5 -5
  52. data/lib/generators/bootstrap/themed/templates/simple_form/_form.html.haml +3 -3
  53. data/lib/generators/bootstrap/themed/templates/simple_form/_form.html.slim +4 -4
  54. data/lib/generators/bootstrap/themed/themed_generator.rb +2 -2
  55. data/lib/twitter/bootstrap/rails/breadcrumbs.rb +69 -0
  56. data/lib/twitter/bootstrap/rails/engine.rb +17 -10
  57. data/lib/twitter/bootstrap/rails/version.rb +2 -2
  58. data/spec/lib/breadcrumbs_spec.rb +99 -0
  59. data/spec/lib/twitter_bootstrap_rails/badge_label_helper_spec.rb +12 -4
  60. data/spec/lib/twitter_bootstrap_rails/bootstrap_flash_helper_spec.rb +128 -0
  61. data/spec/lib/twitter_bootstrap_rails/form_errors_helper_spec.rb +148 -0
  62. data/spec/lib/twitter_bootstrap_rails/glyph_helper_spec.rb +24 -0
  63. data/spec/lib/twitter_bootstrap_rails/modal_helper_spec.rb +15 -15
  64. data/spec/lib/twitter_bootstrap_rails/navbar_helper_spec.rb +207 -173
  65. data/spec/lib/twitter_bootstrap_rails/uri_state_spec.rb +18 -16
  66. data/spec/spec_helper.rb +11 -1
  67. data/vendor/assets/stylesheets/twitter-bootstrap-static/bootstrap.css.erb +5796 -1
  68. data/vendor/static-source/bootstrap.less +0 -1
  69. data/vendor/static-source/sprites.less +1 -1
  70. data/vendor/toolkit/twitter/bootstrap/alerts.less +51 -57
  71. data/vendor/toolkit/twitter/bootstrap/badges.less +66 -0
  72. data/vendor/toolkit/twitter/bootstrap/bootstrap.less +29 -36
  73. data/vendor/toolkit/twitter/bootstrap/breadcrumbs.less +11 -9
  74. data/vendor/toolkit/twitter/bootstrap/button-groups.less +167 -152
  75. data/vendor/toolkit/twitter/bootstrap/buttons.less +107 -169
  76. data/vendor/toolkit/twitter/bootstrap/carousel.less +177 -65
  77. data/vendor/toolkit/twitter/bootstrap/close.less +21 -19
  78. data/vendor/toolkit/twitter/bootstrap/code.less +38 -30
  79. data/vendor/toolkit/twitter/bootstrap/component-animations.less +15 -4
  80. data/vendor/toolkit/twitter/bootstrap/dropdowns.less +120 -152
  81. data/vendor/toolkit/twitter/bootstrap/forms.less +470 -547
  82. data/vendor/toolkit/twitter/bootstrap/glyphicons.less +305 -0
  83. data/vendor/toolkit/twitter/bootstrap/grid.less +74 -11
  84. data/vendor/toolkit/twitter/bootstrap/input-groups.less +171 -0
  85. data/vendor/toolkit/twitter/bootstrap/jumbotron.less +54 -0
  86. data/vendor/toolkit/twitter/bootstrap/labels.less +64 -0
  87. data/vendor/toolkit/twitter/bootstrap/list-group.less +130 -0
  88. data/vendor/toolkit/twitter/bootstrap/media.less +40 -29
  89. data/vendor/toolkit/twitter/bootstrap/mixins.less +37 -699
  90. data/vendor/toolkit/twitter/bootstrap/mixins/alerts.less +14 -0
  91. data/vendor/toolkit/twitter/bootstrap/mixins/background-variant.less +9 -0
  92. data/vendor/toolkit/twitter/bootstrap/mixins/border-radius.less +18 -0
  93. data/vendor/toolkit/twitter/bootstrap/mixins/buttons.less +65 -0
  94. data/vendor/toolkit/twitter/bootstrap/mixins/center-block.less +7 -0
  95. data/vendor/toolkit/twitter/bootstrap/mixins/clearfix.less +22 -0
  96. data/vendor/toolkit/twitter/bootstrap/mixins/forms.less +85 -0
  97. data/vendor/toolkit/twitter/bootstrap/mixins/gradients.less +59 -0
  98. data/vendor/toolkit/twitter/bootstrap/mixins/grid-framework.less +91 -0
  99. data/vendor/toolkit/twitter/bootstrap/mixins/grid.less +122 -0
  100. data/vendor/toolkit/twitter/bootstrap/mixins/hide-text.less +21 -0
  101. data/vendor/toolkit/twitter/bootstrap/mixins/image.less +33 -0
  102. data/vendor/toolkit/twitter/bootstrap/mixins/labels.less +12 -0
  103. data/vendor/toolkit/twitter/bootstrap/mixins/list-group.less +30 -0
  104. data/vendor/toolkit/twitter/bootstrap/mixins/nav-divider.less +10 -0
  105. data/vendor/toolkit/twitter/bootstrap/mixins/nav-vertical-align.less +9 -0
  106. data/vendor/toolkit/twitter/bootstrap/mixins/opacity.less +8 -0
  107. data/vendor/toolkit/twitter/bootstrap/mixins/pagination.less +24 -0
  108. data/vendor/toolkit/twitter/bootstrap/mixins/panels.less +24 -0
  109. data/vendor/toolkit/twitter/bootstrap/mixins/progress-bar.less +10 -0
  110. data/vendor/toolkit/twitter/bootstrap/mixins/reset-filter.less +8 -0
  111. data/vendor/toolkit/twitter/bootstrap/mixins/reset-text.less +18 -0
  112. data/vendor/toolkit/twitter/bootstrap/mixins/resize.less +6 -0
  113. data/vendor/toolkit/twitter/bootstrap/mixins/responsive-visibility.less +15 -0
  114. data/vendor/toolkit/twitter/bootstrap/mixins/size.less +10 -0
  115. data/vendor/toolkit/twitter/bootstrap/mixins/tab-focus.less +9 -0
  116. data/vendor/toolkit/twitter/bootstrap/mixins/table-row.less +28 -0
  117. data/vendor/toolkit/twitter/bootstrap/mixins/text-emphasis.less +9 -0
  118. data/vendor/toolkit/twitter/bootstrap/mixins/text-overflow.less +8 -0
  119. data/vendor/toolkit/twitter/bootstrap/mixins/vendor-prefixes.less +227 -0
  120. data/vendor/toolkit/twitter/bootstrap/modals.less +109 -54
  121. data/vendor/toolkit/twitter/bootstrap/navbar.less +547 -384
  122. data/vendor/toolkit/twitter/bootstrap/navs.less +192 -359
  123. data/vendor/toolkit/twitter/bootstrap/normalize.less +424 -0
  124. data/vendor/toolkit/twitter/bootstrap/pager.less +45 -34
  125. data/vendor/toolkit/twitter/bootstrap/pagination.less +71 -105
  126. data/vendor/toolkit/twitter/bootstrap/panels.less +271 -0
  127. data/vendor/toolkit/twitter/bootstrap/popovers.less +66 -68
  128. data/vendor/toolkit/twitter/bootstrap/print.less +101 -0
  129. data/vendor/toolkit/twitter/bootstrap/progress-bars.less +40 -75
  130. data/vendor/toolkit/twitter/bootstrap/responsive-embed.less +35 -0
  131. data/vendor/toolkit/twitter/bootstrap/responsive-utilities.less +177 -42
  132. data/vendor/toolkit/twitter/bootstrap/scaffolding.less +131 -23
  133. data/vendor/toolkit/twitter/bootstrap/tables.less +172 -182
  134. data/vendor/toolkit/twitter/bootstrap/theme.less +291 -0
  135. data/vendor/toolkit/twitter/bootstrap/thumbnails.less +27 -44
  136. data/vendor/toolkit/twitter/bootstrap/tooltip.less +58 -27
  137. data/vendor/toolkit/twitter/bootstrap/type.less +209 -154
  138. data/vendor/toolkit/twitter/bootstrap/utilities.less +32 -7
  139. data/vendor/toolkit/twitter/bootstrap/variables.less +784 -216
  140. data/vendor/toolkit/twitter/bootstrap/wells.less +7 -7
  141. metadata +156 -141
  142. data/app/assets/fonts/fontawesome-webfont.eot +0 -0
  143. data/app/assets/fonts/fontawesome-webfont.svg +0 -399
  144. data/app/assets/fonts/fontawesome-webfont.ttf +0 -0
  145. data/app/assets/fonts/fontawesome-webfont.woff +0 -0
  146. data/app/assets/images/twitter/bootstrap/glyphicons-halflings-white.png +0 -0
  147. data/app/assets/images/twitter/bootstrap/glyphicons-halflings.png +0 -0
  148. data/app/assets/javascripts/twitter/bootstrap/bootstrap-affix.js +0 -117
  149. data/app/assets/javascripts/twitter/bootstrap/bootstrap-alert.js +0 -99
  150. data/app/assets/javascripts/twitter/bootstrap/bootstrap-button.js +0 -105
  151. data/app/assets/javascripts/twitter/bootstrap/bootstrap-carousel.js +0 -207
  152. data/app/assets/javascripts/twitter/bootstrap/bootstrap-collapse.js +0 -167
  153. data/app/assets/javascripts/twitter/bootstrap/bootstrap-dropdown.js +0 -169
  154. data/app/assets/javascripts/twitter/bootstrap/bootstrap-modal.js +0 -247
  155. data/app/assets/javascripts/twitter/bootstrap/bootstrap-popover.js +0 -114
  156. data/app/assets/javascripts/twitter/bootstrap/bootstrap-scrollspy.js +0 -162
  157. data/app/assets/javascripts/twitter/bootstrap/bootstrap-tab.js +0 -144
  158. data/app/assets/javascripts/twitter/bootstrap/bootstrap-tooltip.js +0 -361
  159. data/app/assets/javascripts/twitter/bootstrap/bootstrap-transition.js +0 -60
  160. data/app/assets/javascripts/twitter/bootstrap/bootstrap-typeahead.js +0 -335
  161. data/app/assets/stylesheets/twitter-bootstrap-static/fontawesome.css.erb +0 -787
  162. data/lib/twitter/bootstrap/rails/twitter-bootstrap-breadcrumbs.rb +0 -42
  163. data/test/lib/breadcrumbs_test.rb +0 -75
  164. data/test/test_helper.rb +0 -11
  165. data/vendor/static-source/fontawesome.less +0 -9
  166. data/vendor/toolkit/fontawesome/bootstrap.less +0 -84
  167. data/vendor/toolkit/fontawesome/core.less +0 -129
  168. data/vendor/toolkit/fontawesome/extras.less +0 -93
  169. data/vendor/toolkit/fontawesome/font-awesome-ie7.less +0 -1953
  170. data/vendor/toolkit/fontawesome/font-awesome.less +0 -33
  171. data/vendor/toolkit/fontawesome/icons.less +0 -381
  172. data/vendor/toolkit/fontawesome/mixins.less +0 -48
  173. data/vendor/toolkit/fontawesome/path.less +0 -14
  174. data/vendor/toolkit/fontawesome/variables.less +0 -735
  175. data/vendor/toolkit/twitter/bootstrap/accordion.less +0 -34
  176. data/vendor/toolkit/twitter/bootstrap/hero-unit.less +0 -25
  177. data/vendor/toolkit/twitter/bootstrap/labels-badges.less +0 -84
  178. data/vendor/toolkit/twitter/bootstrap/layouts.less +0 -16
  179. data/vendor/toolkit/twitter/bootstrap/reset.less +0 -216
  180. data/vendor/toolkit/twitter/bootstrap/responsive-1200px-min.less +0 -28
  181. data/vendor/toolkit/twitter/bootstrap/responsive-767px-max.less +0 -193
  182. data/vendor/toolkit/twitter/bootstrap/responsive-768px-979px.less +0 -19
  183. data/vendor/toolkit/twitter/bootstrap/responsive-navbar.less +0 -189
  184. data/vendor/toolkit/twitter/bootstrap/responsive.less +0 -48
  185. data/vendor/toolkit/twitter/bootstrap/sprites.less +0 -197
@@ -1,146 +1 @@
1
- .clearfix{*zoom:1;}.clearfix:before,.clearfix:after{display:table;content:"";line-height:0;}
2
- .clearfix:after{clear:both;}
3
- .hide-text{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0;}
4
- .input-block-level{display:block;width:100%;min-height:30px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;}
5
- [class^="icon-"],[class*=" icon-"]{display:inline-block;width:14px;height:14px;*margin-right:.3em;line-height:14px;vertical-align:text-top;background-image:url("<%= asset_path 'twitter/bootstrap/glyphicons-halflings.png' %>");background-position:14px 14px;background-repeat:no-repeat;margin-top:1px;}
6
- .icon-white,.nav-pills>.active>a>[class^="icon-"],.nav-pills>.active>a>[class*=" icon-"],.nav-list>.active>a>[class^="icon-"],.nav-list>.active>a>[class*=" icon-"],.navbar-inverse .nav>.active>a>[class^="icon-"],.navbar-inverse .nav>.active>a>[class*=" icon-"],.dropdown-menu>li>a:hover>[class^="icon-"],.dropdown-menu>li>a:focus>[class^="icon-"],.dropdown-menu>li>a:hover>[class*=" icon-"],.dropdown-menu>li>a:focus>[class*=" icon-"],.dropdown-menu>.active>a>[class^="icon-"],.dropdown-menu>.active>a>[class*=" icon-"],.dropdown-submenu:hover>a>[class^="icon-"],.dropdown-submenu:focus>a>[class^="icon-"],.dropdown-submenu:hover>a>[class*=" icon-"],.dropdown-submenu:focus>a>[class*=" icon-"]{background-image:url("<%= asset_path 'twitter/bootstrap/glyphicons-halflings-white.png' %>");}
7
- .icon-glass{background-position:0 0;}
8
- .icon-music{background-position:-24px 0;}
9
- .icon-search{background-position:-48px 0;}
10
- .icon-envelope{background-position:-72px 0;}
11
- .icon-heart{background-position:-96px 0;}
12
- .icon-star{background-position:-120px 0;}
13
- .icon-star-empty{background-position:-144px 0;}
14
- .icon-user{background-position:-168px 0;}
15
- .icon-film{background-position:-192px 0;}
16
- .icon-th-large{background-position:-216px 0;}
17
- .icon-th{background-position:-240px 0;}
18
- .icon-th-list{background-position:-264px 0;}
19
- .icon-ok{background-position:-288px 0;}
20
- .icon-remove{background-position:-312px 0;}
21
- .icon-zoom-in{background-position:-336px 0;}
22
- .icon-zoom-out{background-position:-360px 0;}
23
- .icon-off{background-position:-384px 0;}
24
- .icon-signal{background-position:-408px 0;}
25
- .icon-cog{background-position:-432px 0;}
26
- .icon-trash{background-position:-456px 0;}
27
- .icon-home{background-position:0 -24px;}
28
- .icon-file{background-position:-24px -24px;}
29
- .icon-time{background-position:-48px -24px;}
30
- .icon-road{background-position:-72px -24px;}
31
- .icon-download-alt{background-position:-96px -24px;}
32
- .icon-download{background-position:-120px -24px;}
33
- .icon-upload{background-position:-144px -24px;}
34
- .icon-inbox{background-position:-168px -24px;}
35
- .icon-play-circle{background-position:-192px -24px;}
36
- .icon-repeat{background-position:-216px -24px;}
37
- .icon-refresh{background-position:-240px -24px;}
38
- .icon-list-alt{background-position:-264px -24px;}
39
- .icon-lock{background-position:-287px -24px;}
40
- .icon-flag{background-position:-312px -24px;}
41
- .icon-headphones{background-position:-336px -24px;}
42
- .icon-volume-off{background-position:-360px -24px;}
43
- .icon-volume-down{background-position:-384px -24px;}
44
- .icon-volume-up{background-position:-408px -24px;}
45
- .icon-qrcode{background-position:-432px -24px;}
46
- .icon-barcode{background-position:-456px -24px;}
47
- .icon-tag{background-position:0 -48px;}
48
- .icon-tags{background-position:-25px -48px;}
49
- .icon-book{background-position:-48px -48px;}
50
- .icon-bookmark{background-position:-72px -48px;}
51
- .icon-print{background-position:-96px -48px;}
52
- .icon-camera{background-position:-120px -48px;}
53
- .icon-font{background-position:-144px -48px;}
54
- .icon-bold{background-position:-167px -48px;}
55
- .icon-italic{background-position:-192px -48px;}
56
- .icon-text-height{background-position:-216px -48px;}
57
- .icon-text-width{background-position:-240px -48px;}
58
- .icon-align-left{background-position:-264px -48px;}
59
- .icon-align-center{background-position:-288px -48px;}
60
- .icon-align-right{background-position:-312px -48px;}
61
- .icon-align-justify{background-position:-336px -48px;}
62
- .icon-list{background-position:-360px -48px;}
63
- .icon-indent-left{background-position:-384px -48px;}
64
- .icon-indent-right{background-position:-408px -48px;}
65
- .icon-facetime-video{background-position:-432px -48px;}
66
- .icon-picture{background-position:-456px -48px;}
67
- .icon-pencil{background-position:0 -72px;}
68
- .icon-map-marker{background-position:-24px -72px;}
69
- .icon-adjust{background-position:-48px -72px;}
70
- .icon-tint{background-position:-72px -72px;}
71
- .icon-edit{background-position:-96px -72px;}
72
- .icon-share{background-position:-120px -72px;}
73
- .icon-check{background-position:-144px -72px;}
74
- .icon-move{background-position:-168px -72px;}
75
- .icon-step-backward{background-position:-192px -72px;}
76
- .icon-fast-backward{background-position:-216px -72px;}
77
- .icon-backward{background-position:-240px -72px;}
78
- .icon-play{background-position:-264px -72px;}
79
- .icon-pause{background-position:-288px -72px;}
80
- .icon-stop{background-position:-312px -72px;}
81
- .icon-forward{background-position:-336px -72px;}
82
- .icon-fast-forward{background-position:-360px -72px;}
83
- .icon-step-forward{background-position:-384px -72px;}
84
- .icon-eject{background-position:-408px -72px;}
85
- .icon-chevron-left{background-position:-432px -72px;}
86
- .icon-chevron-right{background-position:-456px -72px;}
87
- .icon-plus-sign{background-position:0 -96px;}
88
- .icon-minus-sign{background-position:-24px -96px;}
89
- .icon-remove-sign{background-position:-48px -96px;}
90
- .icon-ok-sign{background-position:-72px -96px;}
91
- .icon-question-sign{background-position:-96px -96px;}
92
- .icon-info-sign{background-position:-120px -96px;}
93
- .icon-screenshot{background-position:-144px -96px;}
94
- .icon-remove-circle{background-position:-168px -96px;}
95
- .icon-ok-circle{background-position:-192px -96px;}
96
- .icon-ban-circle{background-position:-216px -96px;}
97
- .icon-arrow-left{background-position:-240px -96px;}
98
- .icon-arrow-right{background-position:-264px -96px;}
99
- .icon-arrow-up{background-position:-289px -96px;}
100
- .icon-arrow-down{background-position:-312px -96px;}
101
- .icon-share-alt{background-position:-336px -96px;}
102
- .icon-resize-full{background-position:-360px -96px;}
103
- .icon-resize-small{background-position:-384px -96px;}
104
- .icon-plus{background-position:-408px -96px;}
105
- .icon-minus{background-position:-433px -96px;}
106
- .icon-asterisk{background-position:-456px -96px;}
107
- .icon-exclamation-sign{background-position:0 -120px;}
108
- .icon-gift{background-position:-24px -120px;}
109
- .icon-leaf{background-position:-48px -120px;}
110
- .icon-fire{background-position:-72px -120px;}
111
- .icon-eye-open{background-position:-96px -120px;}
112
- .icon-eye-close{background-position:-120px -120px;}
113
- .icon-warning-sign{background-position:-144px -120px;}
114
- .icon-plane{background-position:-168px -120px;}
115
- .icon-calendar{background-position:-192px -120px;}
116
- .icon-random{background-position:-216px -120px;width:16px;}
117
- .icon-comment{background-position:-240px -120px;}
118
- .icon-magnet{background-position:-264px -120px;}
119
- .icon-chevron-up{background-position:-288px -120px;}
120
- .icon-chevron-down{background-position:-313px -119px;}
121
- .icon-retweet{background-position:-336px -120px;}
122
- .icon-shopping-cart{background-position:-360px -120px;}
123
- .icon-folder-close{background-position:-384px -120px;width:16px;}
124
- .icon-folder-open{background-position:-408px -120px;width:16px;}
125
- .icon-resize-vertical{background-position:-432px -119px;}
126
- .icon-resize-horizontal{background-position:-456px -118px;}
127
- .icon-hdd{background-position:0 -144px;}
128
- .icon-bullhorn{background-position:-24px -144px;}
129
- .icon-bell{background-position:-48px -144px;}
130
- .icon-certificate{background-position:-72px -144px;}
131
- .icon-thumbs-up{background-position:-96px -144px;}
132
- .icon-thumbs-down{background-position:-120px -144px;}
133
- .icon-hand-right{background-position:-144px -144px;}
134
- .icon-hand-left{background-position:-168px -144px;}
135
- .icon-hand-up{background-position:-192px -144px;}
136
- .icon-hand-down{background-position:-216px -144px;}
137
- .icon-circle-arrow-right{background-position:-240px -144px;}
138
- .icon-circle-arrow-left{background-position:-264px -144px;}
139
- .icon-circle-arrow-up{background-position:-288px -144px;}
140
- .icon-circle-arrow-down{background-position:-312px -144px;}
141
- .icon-globe{background-position:-336px -144px;}
142
- .icon-wrench{background-position:-360px -144px;}
143
- .icon-tasks{background-position:-384px -144px;}
144
- .icon-filter{background-position:-408px -144px;}
145
- .icon-briefcase{background-position:-432px -144px;}
146
- .icon-fullscreen{background-position:-456px -144px;}
1
+ @font-face{font-family:'Glyphicons Halflings';src:url('<%= asset_path 'glyphicons-halflings-regular.eot' %>');src:url('<%= asset_path 'glyphicons-halflings-regular.eot?#iefix' %>') format('embedded-opentype'),url('<%= asset_path 'glyphicons-halflings-regular.woff' %>') format('woff'),url('<%= asset_path 'glyphicons-halflings-regular.ttf' %>') format('truetype'),url('<%= asset_path 'glyphicons-halflings-regular.svg#glyphicons-halflingsregular' %>') format('svg')}.glyphicon{position:relative;top:1px;display:inline-block;font-family:'Glyphicons Halflings';font-style:normal;font-weight:normal;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.glyphicon-asterisk:before{content:"\2a"}.glyphicon-plus:before{content:"\2b"}.glyphicon-euro:before{content:"\20ac"}.glyphicon-minus:before{content:"\2212"}.glyphicon-cloud:before{content:"\2601"}.glyphicon-envelope:before{content:"\2709"}.glyphicon-pencil:before{content:"\270f"}.glyphicon-glass:before{content:"\e001"}.glyphicon-music:before{content:"\e002"}.glyphicon-search:before{content:"\e003"}.glyphicon-heart:before{content:"\e005"}.glyphicon-star:before{content:"\e006"}.glyphicon-star-empty:before{content:"\e007"}.glyphicon-user:before{content:"\e008"}.glyphicon-film:before{content:"\e009"}.glyphicon-th-large:before{content:"\e010"}.glyphicon-th:before{content:"\e011"}.glyphicon-th-list:before{content:"\e012"}.glyphicon-ok:before{content:"\e013"}.glyphicon-remove:before{content:"\e014"}.glyphicon-zoom-in:before{content:"\e015"}.glyphicon-zoom-out:before{content:"\e016"}.glyphicon-off:before{content:"\e017"}.glyphicon-signal:before{content:"\e018"}.glyphicon-cog:before{content:"\e019"}.glyphicon-trash:before{content:"\e020"}.glyphicon-home:before{content:"\e021"}.glyphicon-file:before{content:"\e022"}.glyphicon-time:before{content:"\e023"}.glyphicon-road:before{content:"\e024"}.glyphicon-download-alt:before{content:"\e025"}.glyphicon-download:before{content:"\e026"}.glyphicon-upload:before{content:"\e027"}.glyphicon-inbox:before{content:"\e028"}.glyphicon-play-circle:before{content:"\e029"}.glyphicon-repeat:before{content:"\e030"}.glyphicon-refresh:before{content:"\e031"}.glyphicon-list-alt:before{content:"\e032"}.glyphicon-lock:before{content:"\e033"}.glyphicon-flag:before{content:"\e034"}.glyphicon-headphones:before{content:"\e035"}.glyphicon-volume-off:before{content:"\e036"}.glyphicon-volume-down:before{content:"\e037"}.glyphicon-volume-up:before{content:"\e038"}.glyphicon-qrcode:before{content:"\e039"}.glyphicon-barcode:before{content:"\e040"}.glyphicon-tag:before{content:"\e041"}.glyphicon-tags:before{content:"\e042"}.glyphicon-book:before{content:"\e043"}.glyphicon-bookmark:before{content:"\e044"}.glyphicon-print:before{content:"\e045"}.glyphicon-camera:before{content:"\e046"}.glyphicon-font:before{content:"\e047"}.glyphicon-bold:before{content:"\e048"}.glyphicon-italic:before{content:"\e049"}.glyphicon-text-height:before{content:"\e050"}.glyphicon-text-width:before{content:"\e051"}.glyphicon-align-left:before{content:"\e052"}.glyphicon-align-center:before{content:"\e053"}.glyphicon-align-right:before{content:"\e054"}.glyphicon-align-justify:before{content:"\e055"}.glyphicon-list:before{content:"\e056"}.glyphicon-indent-left:before{content:"\e057"}.glyphicon-indent-right:before{content:"\e058"}.glyphicon-facetime-video:before{content:"\e059"}.glyphicon-picture:before{content:"\e060"}.glyphicon-map-marker:before{content:"\e062"}.glyphicon-adjust:before{content:"\e063"}.glyphicon-tint:before{content:"\e064"}.glyphicon-edit:before{content:"\e065"}.glyphicon-share:before{content:"\e066"}.glyphicon-check:before{content:"\e067"}.glyphicon-move:before{content:"\e068"}.glyphicon-step-backward:before{content:"\e069"}.glyphicon-fast-backward:before{content:"\e070"}.glyphicon-backward:before{content:"\e071"}.glyphicon-play:before{content:"\e072"}.glyphicon-pause:before{content:"\e073"}.glyphicon-stop:before{content:"\e074"}.glyphicon-forward:before{content:"\e075"}.glyphicon-fast-forward:before{content:"\e076"}.glyphicon-step-forward:before{content:"\e077"}.glyphicon-eject:before{content:"\e078"}.glyphicon-chevron-left:before{content:"\e079"}.glyphicon-chevron-right:before{content:"\e080"}.glyphicon-plus-sign:before{content:"\e081"}.glyphicon-minus-sign:before{content:"\e082"}.glyphicon-remove-sign:before{content:"\e083"}.glyphicon-ok-sign:before{content:"\e084"}.glyphicon-question-sign:before{content:"\e085"}.glyphicon-info-sign:before{content:"\e086"}.glyphicon-screenshot:before{content:"\e087"}.glyphicon-remove-circle:before{content:"\e088"}.glyphicon-ok-circle:before{content:"\e089"}.glyphicon-ban-circle:before{content:"\e090"}.glyphicon-arrow-left:before{content:"\e091"}.glyphicon-arrow-right:before{content:"\e092"}.glyphicon-arrow-up:before{content:"\e093"}.glyphicon-arrow-down:before{content:"\e094"}.glyphicon-share-alt:before{content:"\e095"}.glyphicon-resize-full:before{content:"\e096"}.glyphicon-resize-small:before{content:"\e097"}.glyphicon-exclamation-sign:before{content:"\e101"}.glyphicon-gift:before{content:"\e102"}.glyphicon-leaf:before{content:"\e103"}.glyphicon-fire:before{content:"\e104"}.glyphicon-eye-open:before{content:"\e105"}.glyphicon-eye-close:before{content:"\e106"}.glyphicon-warning-sign:before{content:"\e107"}.glyphicon-plane:before{content:"\e108"}.glyphicon-calendar:before{content:"\e109"}.glyphicon-random:before{content:"\e110"}.glyphicon-comment:before{content:"\e111"}.glyphicon-magnet:before{content:"\e112"}.glyphicon-chevron-up:before{content:"\e113"}.glyphicon-chevron-down:before{content:"\e114"}.glyphicon-retweet:before{content:"\e115"}.glyphicon-shopping-cart:before{content:"\e116"}.glyphicon-folder-close:before{content:"\e117"}.glyphicon-folder-open:before{content:"\e118"}.glyphicon-resize-vertical:before{content:"\e119"}.glyphicon-resize-horizontal:before{content:"\e120"}.glyphicon-hdd:before{content:"\e121"}.glyphicon-bullhorn:before{content:"\e122"}.glyphicon-bell:before{content:"\e123"}.glyphicon-certificate:before{content:"\e124"}.glyphicon-thumbs-up:before{content:"\e125"}.glyphicon-thumbs-down:before{content:"\e126"}.glyphicon-hand-right:before{content:"\e127"}.glyphicon-hand-left:before{content:"\e128"}.glyphicon-hand-up:before{content:"\e129"}.glyphicon-hand-down:before{content:"\e130"}.glyphicon-circle-arrow-right:before{content:"\e131"}.glyphicon-circle-arrow-left:before{content:"\e132"}.glyphicon-circle-arrow-up:before{content:"\e133"}.glyphicon-circle-arrow-down:before{content:"\e134"}.glyphicon-globe:before{content:"\e135"}.glyphicon-wrench:before{content:"\e136"}.glyphicon-tasks:before{content:"\e137"}.glyphicon-filter:before{content:"\e138"}.glyphicon-briefcase:before{content:"\e139"}.glyphicon-fullscreen:before{content:"\e140"}.glyphicon-dashboard:before{content:"\e141"}.glyphicon-paperclip:before{content:"\e142"}.glyphicon-heart-empty:before{content:"\e143"}.glyphicon-link:before{content:"\e144"}.glyphicon-phone:before{content:"\e145"}.glyphicon-pushpin:before{content:"\e146"}.glyphicon-usd:before{content:"\e148"}.glyphicon-gbp:before{content:"\e149"}.glyphicon-sort:before{content:"\e150"}.glyphicon-sort-by-alphabet:before{content:"\e151"}.glyphicon-sort-by-alphabet-alt:before{content:"\e152"}.glyphicon-sort-by-order:before{content:"\e153"}.glyphicon-sort-by-order-alt:before{content:"\e154"}.glyphicon-sort-by-attributes:before{content:"\e155"}.glyphicon-sort-by-attributes-alt:before{content:"\e156"}.glyphicon-unchecked:before{content:"\e157"}.glyphicon-expand:before{content:"\e158"}.glyphicon-collapse-down:before{content:"\e159"}.glyphicon-collapse-up:before{content:"\e160"}.glyphicon-log-in:before{content:"\e161"}.glyphicon-flash:before{content:"\e162"}.glyphicon-log-out:before{content:"\e163"}.glyphicon-new-window:before{content:"\e164"}.glyphicon-record:before{content:"\e165"}.glyphicon-save:before{content:"\e166"}.glyphicon-open:before{content:"\e167"}.glyphicon-saved:before{content:"\e168"}.glyphicon-import:before{content:"\e169"}.glyphicon-export:before{content:"\e170"}.glyphicon-send:before{content:"\e171"}.glyphicon-floppy-disk:before{content:"\e172"}.glyphicon-floppy-saved:before{content:"\e173"}.glyphicon-floppy-remove:before{content:"\e174"}.glyphicon-floppy-save:before{content:"\e175"}.glyphicon-floppy-open:before{content:"\e176"}.glyphicon-credit-card:before{content:"\e177"}.glyphicon-transfer:before{content:"\e178"}.glyphicon-cutlery:before{content:"\e179"}.glyphicon-header:before{content:"\e180"}.glyphicon-compressed:before{content:"\e181"}.glyphicon-earphone:before{content:"\e182"}.glyphicon-phone-alt:before{content:"\e183"}.glyphicon-tower:before{content:"\e184"}.glyphicon-stats:before{content:"\e185"}.glyphicon-sd-video:before{content:"\e186"}.glyphicon-hd-video:before{content:"\e187"}.glyphicon-subtitles:before{content:"\e188"}.glyphicon-sound-stereo:before{content:"\e189"}.glyphicon-sound-dolby:before{content:"\e190"}.glyphicon-sound-5-1:before{content:"\e191"}.glyphicon-sound-6-1:before{content:"\e192"}.glyphicon-sound-7-1:before{content:"\e193"}.glyphicon-copyright-mark:before{content:"\e194"}.glyphicon-registration-mark:before{content:"\e195"}.glyphicon-cloud-download:before{content:"\e197"}.glyphicon-cloud-upload:before{content:"\e198"}.glyphicon-tree-conifer:before{content:"\e199"}.glyphicon-tree-deciduous:before{content:"\e200"}
@@ -1,20 +1,27 @@
1
1
  module BootstrapFlashHelper
2
- ALERT_TYPES = [:error, :info, :success, :warning]
2
+ ALERT_TYPES = [:success, :info, :warning, :danger] unless const_defined?(:ALERT_TYPES)
3
3
 
4
- def bootstrap_flash
4
+ def bootstrap_flash(options = {})
5
5
  flash_messages = []
6
6
  flash.each do |type, message|
7
7
  # Skip empty messages, e.g. for devise messages set to nothing in a locale file.
8
8
  next if message.blank?
9
-
9
+
10
+ type = type.to_sym
10
11
  type = :success if type == :notice
11
- type = :error if type == :alert
12
+ type = :danger if type == :alert
13
+ type = :danger if type == :error
12
14
  next unless ALERT_TYPES.include?(type)
13
15
 
16
+ tag_class = options.extract!(:class)[:class]
17
+ tag_options = {
18
+ class: "alert fade in alert-#{type} #{tag_class}"
19
+ }.merge(options)
20
+
21
+ close_button = content_tag(:button, raw("&times;"), type: "button", class: "close", "data-dismiss" => "alert")
22
+
14
23
  Array(message).each do |msg|
15
- text = content_tag(:div,
16
- content_tag(:button, raw("&times;"), :class => "close", "data-dismiss" => "alert") +
17
- msg.html_safe, :class => "alert fade in alert-#{type}")
24
+ text = content_tag(:div, close_button + msg, tag_options)
18
25
  flash_messages << text if msg
19
26
  end
20
27
  end
@@ -0,0 +1,22 @@
1
+ module FormErrorsHelper
2
+ include ActionView::Helpers::FormTagHelper
3
+
4
+ def error_span(attribute, options = {})
5
+ options[:span_class] ||= 'help-block'
6
+ options[:error_class] ||= 'has-error'
7
+
8
+ if errors_on?(attribute)
9
+ @template.content_tag( :div, :class => options[:error_class] ) do
10
+ content_tag( :span, errors_for(attribute), :class => options[:span_class] )
11
+ end
12
+ end
13
+ end
14
+
15
+ def errors_on?(attribute)
16
+ object.errors[attribute].present? if object.respond_to?(:errors)
17
+ end
18
+
19
+ def errors_for(attribute)
20
+ object.errors[attribute].try(:join, ', ') || object.errors[attribute].try(:to_s)
21
+ end
22
+ end
@@ -1,17 +1,23 @@
1
1
  module GlyphHelper
2
2
  # ==== Examples
3
3
  # glyph(:share_alt)
4
- # # => <i class="icon-share-alt"></i>
4
+ # # => <span class="icon-share-alt"></span>
5
5
  # glyph(:lock, :white)
6
- # # => <i class="icon-lock icon-white"></i>
6
+ # # => <span class="icon-lock icon-white"></span>
7
7
  # glyph(:thumbs_up, :pull_left)
8
8
  # # => <i class="icon-thumbs-up pull-left"></i>
9
-
9
+ # glyph(:lock, {tag: :span})
10
+ # # => <span class="icon-lock"></span>
11
+ # glyph(:lock, {class: 'foo'})
12
+ # # => <i class="icon-lock foo"></i>
10
13
  def glyph(*names)
11
- names.map! { |name| name.to_s.gsub('_','-') }
14
+ options = names.last.kind_of?(Hash) ? names.pop : {}
15
+ names.map! { |name| name.to_s.tr('_', '-') }
12
16
  names.map! do |name|
13
- name =~ /pull-(?:left|right)/ ? name : "icon-#{name}"
17
+ name =~ /pull-(?:left|right)/ ? name : "glyphicon glyphicon-#{name}"
14
18
  end
15
- content_tag :i, nil, :class => names
19
+ options[:tag] = options[:tag] ||= :i
20
+ names.push options[:class] || ''
21
+ content_tag options[:tag], nil, class: names
16
22
  end
17
23
  end
@@ -2,54 +2,58 @@ module ModalHelper
2
2
 
3
3
  #modals have a header, a body, a footer for options.
4
4
  def modal_dialog(options = {}, &block)
5
- content_tag :div, :id => options[:id], :class => "bootstrap-modal modal hide fade" do
6
- modal_header(options[:header]) +
7
- modal_body(options[:body]) +
8
- modal_footer(options[:footer])
5
+ options = {:id => 'modal', :size => '', :show_close => true, :dismiss => true}.merge options
6
+ content_tag :div, :class => "bootstrap-modal modal fade", :id => options[:id] do
7
+ content_tag :div, :class => "modal-dialog #{options['size']}" do
8
+ content_tag :div, :class => "modal-content" do
9
+ modal_header(options[:header], &block) +
10
+ modal_body(options[:body], &block) +
11
+ modal_footer(options[:footer], &block)
12
+ end
13
+ end
9
14
  end
10
15
  end
11
16
 
12
- def modal_header(options = {}, &block)
17
+ def modal_header(options, &block)
13
18
  content_tag :div, :class => 'modal-header' do
14
- if options[:show_close]
19
+ if options[:show_close]
15
20
  close_button(options[:dismiss]) +
16
- content_tag(:h3, options[:title], &block)
21
+ content_tag(:h4, options[:title], :class => 'modal-title', &block)
17
22
  else
18
- content_tag(:h3, options[:title], &block)
19
- end
23
+ content_tag(:h4, options[:title], :class => 'modal-title', &block)
24
+ end
20
25
  end
21
26
  end
22
27
 
23
- def modal_body(options = {}, &block)
24
- content_tag :div, options, :class => 'modal-body', &block
28
+ def modal_body(options, &block)
29
+ content_tag :div, options[:content], :class => 'modal-body', :style => options[:style], &block
25
30
  end
26
31
 
27
- def modal_footer(options = {}, &block)
28
- content_tag :div, options, :class => 'modal-footer', &block
32
+ def modal_footer(options, &block)
33
+ content_tag :div, options[:content], :class => 'modal-footer', &block
29
34
  end
30
35
 
31
36
  def close_button(dismiss)
32
- #It doesn't seem to like content_tag, so we do this instead.
33
- raw("<button class=\"close\" data-dismiss=\"#{dismiss}\">&times;</button>")
37
+ #It doesn't seem to like content_tag, so we do this instead.
38
+ raw("<button class=\"close\" data-dismiss=\"#{dismiss}\" aria-hidden=\"true\">&times;</button>")
34
39
  end
35
40
 
36
- def modal_toggle(content_or_options = nil, options = {}, &block)
41
+ def modal_toggle(content_or_options = nil, options, &block)
37
42
  if block_given?
38
43
  options = content_or_options if content_or_options.is_a?(Hash)
39
- default_options = { :class => 'btn', "data-toggle" => "modal", "href" => options[:dialog] }.merge(options)
44
+ default_options = { :class => 'btn btn-default', "data-toggle" => "modal", "href" => options[:dialog] }.merge(options)
40
45
 
41
46
  content_tag :a, nil, default_options, true, &block
42
47
  else
43
- default_options = { :class => 'btn', "data-toggle" => "modal", "href" => options[:dialog] }.merge(options)
48
+ default_options = { :class => 'btn btn-default', "data-toggle" => "modal", "href" => options[:dialog] }.merge(options)
44
49
  content_tag :a, content_or_options, default_options, true
45
50
  end
46
51
  end
47
52
 
48
- def modal_cancel_button content, options = {}
49
- default_options = { :class => "btn bootstrap-modal-cancel-button" }
53
+ def modal_cancel_button(content, options)
54
+ default_opts = { :class => "btn bootstrap-modal-cancel-button" }
50
55
 
51
- content_tag_string "a", content, default_options.merge(options)
56
+ content_tag_string "a", content, default_opts.merge(options)
52
57
  end
53
58
 
54
59
  end
55
-
@@ -1,26 +1,27 @@
1
1
  #Credit for this goes to https://github.com/julescopeland/Rails-Bootstrap-Navbar
2
2
  module NavbarHelper
3
3
  def nav_bar(options={}, &block)
4
- nav_bar_div(options) do
5
- navbar_inner_div do
6
- container_div(options[:brand], options[:brand_link], options[:responsive], options[:fluid]) do
7
- yield if block_given?
8
- end
4
+ nav_bar_nav(options) do
5
+ container_div(options[:brand], options[:brand_link], options[:responsive], options[:fluid], options[:no_turbolink]) do
6
+ yield if block_given?
9
7
  end
10
8
  end
11
9
  end
12
10
 
13
11
  def menu_group(options={}, &block)
14
- pull_class = "pull-#{options[:pull].to_s}" if options[:pull].present?
15
- content_tag(:ul, :class => "nav #{pull_class}", &block)
12
+ pull_class = "navbar-#{options[:pull].to_s}" if options[:pull].present?
13
+ content_tag(:ul, :class => "nav navbar-nav #{pull_class}", &block)
16
14
  end
17
15
 
18
16
  def menu_item(name=nil, path="#", *args, &block)
19
17
  path = name || path if block_given?
20
18
  options = args.extract_options!
21
19
  content_tag :li, :class => is_active?(path, options) do
22
- name, path = path, options if block_given?
23
- link_to name, path, options, &block
20
+ if block_given?
21
+ link_to path, options, &block
22
+ else
23
+ link_to name, path, options, &block
24
+ end
24
25
  end
25
26
  end
26
27
 
@@ -76,6 +77,8 @@ module NavbarHelper
76
77
  # uri_state('/blog/categories/test', {method: delete}) # :inactive
77
78
  # uri_state('/blog/categories/test/3', {}) # :inactive
78
79
  def uri_state(uri, options={})
80
+ return options[:status] if options.key?(:status)
81
+
79
82
  root_url = request.host_with_port + '/'
80
83
  root = uri == '/' || uri == root_url
81
84
 
@@ -87,7 +90,7 @@ module NavbarHelper
87
90
 
88
91
  if !options[:method].nil? || !options["data-method"].nil?
89
92
  :inactive
90
- elsif uri == request_uri
93
+ elsif uri == request_uri || (options[:root] && (request_uri == '/') || (request_uri == root_url))
91
94
  :active
92
95
  else
93
96
  if request_uri.start_with?(uri) and not(root)
@@ -96,73 +99,85 @@ module NavbarHelper
96
99
  :inactive
97
100
  end
98
101
  end
99
- end
102
+ end
100
103
 
101
104
  private
102
105
 
103
- def nav_bar_div(options, &block)
106
+ def nav_bar_nav(options, &block)
104
107
 
105
108
  position = "static-#{options[:static].to_s}" if options[:static]
106
109
  position = "fixed-#{options[:fixed].to_s}" if options[:fixed]
107
110
  inverse = (options[:inverse].present? && options[:inverse] == true) ? true : false
108
111
 
109
- content_tag :div, :class => nav_bar_css_class(position, inverse) do
112
+ content_tag :nav, :class => nav_bar_css_class(position, inverse), :role => "navigation" do
110
113
  yield
111
114
  end
112
115
  end
113
116
 
114
- def navbar_inner_div(&block)
115
- content_tag :div, :class => "navbar-inner" do
116
- yield
117
- end
118
- end
117
+ def container_div(brand, brand_link, responsive, fluid, no_turbolink, &block)
118
+ div_container_class = fluid ? "container-fluid" : "container"
119
+ no_turbolink ||= false
119
120
 
120
- def container_div(brand, brand_link, responsive, fluid, &block)
121
- content_tag :div, :class => "container#{"-fluid" if fluid}" do
122
- container_div_with_block(brand, brand_link, responsive, &block)
121
+ content_tag :div, :class => div_container_class do
122
+ container_div_with_block(brand, brand_link, responsive, no_turbolink, &block)
123
123
  end
124
124
  end
125
125
 
126
- def container_div_with_block(brand, brand_link, responsive, &block)
126
+ def container_div_with_block(brand, brand_link, responsive, no_turbolink, &block)
127
127
  output = []
128
128
  if responsive == true
129
- output << responsive_button
130
- output << brand_link(brand, brand_link)
129
+ output << responsive_nav_header(brand, brand_link, no_turbolink)
131
130
  output << responsive_div { capture(&block) }
132
131
  else
133
- output << brand_link(brand, brand_link)
132
+ output << brand_link(brand, brand_link, no_turbolink)
134
133
  output << capture(&block)
135
134
  end
136
135
  output.join("\n").html_safe
137
136
  end
138
137
 
138
+ def responsive_nav_header(brand, brand_link, no_turbolink)
139
+ content_tag(:div, :class => "navbar-header") do
140
+ output = []
141
+ output << responsive_button
142
+ output << brand_link(brand, brand_link, no_turbolink)
143
+ output.join("\n").html_safe
144
+ end
145
+ end
146
+
139
147
  def nav_bar_css_class(position, inverse = false)
140
- css_class = ["navbar"]
148
+ css_class = ["navbar", "navbar-default"]
141
149
  css_class << "navbar-#{position}" if position.present?
142
150
  css_class << "navbar-inverse" if inverse
143
151
  css_class.join(" ")
144
152
  end
145
153
 
146
- def brand_link(name, url)
154
+ def brand_link(name, url, no_turbolink)
147
155
  return "" if name.blank?
148
156
  url ||= root_url
149
- link_to(name, url, :class => "brand")
157
+
158
+ if no_turbolink
159
+ link_to(name, url, :class => "navbar-brand", :data => { :no_turbolink => true})
160
+ else
161
+ link_to(name, url, :class => "navbar-brand")
162
+ end
150
163
  end
151
164
 
152
165
  def responsive_button
153
- %{<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
166
+ %{<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
167
+ <span class="sr-only">Toggle navigation</span>
154
168
  <span class="icon-bar"></span>
155
169
  <span class="icon-bar"></span>
156
170
  <span class="icon-bar"></span>
157
- </a>}
171
+ </button>}
158
172
  end
159
173
 
160
174
  def responsive_div(&block)
161
- content_tag(:div, :class => "nav-collapse collapse", &block)
175
+ content_tag(:div, :class => "navbar-collapse collapse", &block)
162
176
  end
163
177
 
164
178
  def is_active?(path, options={})
165
- "active" if uri_state(path, options).in?([:active, :chosen])
179
+ state = uri_state(path, options)
180
+ "active" if state.in?([:active, :chosen]) || state === true
166
181
  end
167
182
 
168
183
  def name_and_caret(name)