twitter-bootstrap-rails 2.2.8 → 3.2.2

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.
Files changed (189) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +160 -228
  3. data/Rakefile +4 -6
  4. data/app/assets/fonts/fontawesome-webfont.eot +0 -0
  5. data/app/assets/fonts/fontawesome-webfont.svg +279 -38
  6. data/app/assets/fonts/fontawesome-webfont.ttf +0 -0
  7. data/app/assets/fonts/fontawesome-webfont.woff +0 -0
  8. data/app/assets/fonts/glyphicons-halflings-regular.eot +0 -0
  9. data/app/assets/fonts/glyphicons-halflings-regular.svg +229 -0
  10. data/app/assets/fonts/glyphicons-halflings-regular.ttf +0 -0
  11. data/app/assets/fonts/glyphicons-halflings-regular.woff +0 -0
  12. data/app/assets/javascripts/twitter/bootstrap/affix.js +142 -0
  13. data/app/assets/javascripts/twitter/bootstrap/alert.js +92 -0
  14. data/app/assets/javascripts/twitter/bootstrap/button.js +110 -0
  15. data/app/assets/javascripts/twitter/bootstrap/carousel.js +223 -0
  16. data/app/assets/javascripts/twitter/bootstrap/collapse.js +170 -0
  17. data/app/assets/javascripts/twitter/bootstrap/dropdown.js +151 -0
  18. data/app/assets/javascripts/twitter/bootstrap/modal.js +280 -0
  19. data/app/assets/javascripts/twitter/bootstrap/popover.js +113 -0
  20. data/app/assets/javascripts/twitter/bootstrap/scrollspy.js +170 -0
  21. data/app/assets/javascripts/twitter/bootstrap/tab.js +128 -0
  22. data/app/assets/javascripts/twitter/bootstrap/tooltip.js +457 -0
  23. data/app/assets/javascripts/twitter/bootstrap/transition.js +59 -0
  24. data/app/assets/javascripts/twitter/bootstrap.js +12 -13
  25. data/app/assets/stylesheets/twitter-bootstrap-static/bootstrap.css.erb +1 -890
  26. data/app/assets/stylesheets/twitter-bootstrap-static/fontawesome.css.erb +2026 -787
  27. data/app/assets/stylesheets/twitter-bootstrap-static/sprites.css.erb +1 -146
  28. data/app/helpers/bootstrap_flash_helper.rb +14 -7
  29. data/app/helpers/form_errors_helper.rb +22 -0
  30. data/app/helpers/glyph_helper.rb +8 -5
  31. data/app/helpers/modal_helper.rb +26 -22
  32. data/app/helpers/navbar_helper.rb +47 -32
  33. data/app/helpers/twitter_breadcrumbs_helper.rb +6 -2
  34. data/app/views/twitter-bootstrap/_breadcrumbs.html.erb +8 -8
  35. data/lib/generators/bootstrap/install/install_generator.rb +3 -2
  36. data/lib/generators/bootstrap/install/templates/bootstrap_and_overrides.less +13 -11
  37. data/lib/generators/bootstrap/install/templates/en.bootstrap.yml +5 -0
  38. data/lib/generators/bootstrap/layout/layout_generator.rb +1 -4
  39. data/lib/generators/bootstrap/layout/templates/layout.html.erb +27 -48
  40. data/lib/generators/bootstrap/layout/templates/layout.html.haml +19 -34
  41. data/lib/generators/bootstrap/layout/templates/layout.html.slim +13 -30
  42. data/lib/generators/bootstrap/partial/templates/_login.html.erb +2 -3
  43. data/lib/generators/bootstrap/themed/templates/_form.html.erb +30 -10
  44. data/lib/generators/bootstrap/themed/templates/_form.html.haml +10 -8
  45. data/lib/generators/bootstrap/themed/templates/_form.html.slim +11 -9
  46. data/lib/generators/bootstrap/themed/templates/edit.html.slim +1 -1
  47. data/lib/generators/bootstrap/themed/templates/index.html.erb +2 -2
  48. data/lib/generators/bootstrap/themed/templates/index.html.haml +2 -2
  49. data/lib/generators/bootstrap/themed/templates/index.html.slim +4 -5
  50. data/lib/generators/bootstrap/themed/templates/new.html.slim +1 -1
  51. data/lib/generators/bootstrap/themed/templates/show.html.erb +5 -7
  52. data/lib/generators/bootstrap/themed/templates/show.html.haml +4 -4
  53. data/lib/generators/bootstrap/themed/templates/show.html.slim +6 -7
  54. data/lib/generators/bootstrap/themed/templates/simple_form/_form.html.erb +5 -5
  55. data/lib/generators/bootstrap/themed/templates/simple_form/_form.html.haml +3 -3
  56. data/lib/generators/bootstrap/themed/templates/simple_form/_form.html.slim +4 -4
  57. data/lib/generators/bootstrap/themed/themed_generator.rb +2 -2
  58. data/lib/twitter/bootstrap/rails/breadcrumbs.rb +69 -0
  59. data/lib/twitter/bootstrap/rails/engine.rb +17 -10
  60. data/lib/twitter/bootstrap/rails/version.rb +2 -2
  61. data/spec/lib/breadcrumbs_spec.rb +99 -0
  62. data/spec/lib/twitter_bootstrap_rails/badge_label_helper_spec.rb +12 -4
  63. data/spec/lib/twitter_bootstrap_rails/bootstrap_flash_helper_spec.rb +128 -0
  64. data/spec/lib/twitter_bootstrap_rails/form_errors_helper_spec.rb +148 -0
  65. data/spec/lib/twitter_bootstrap_rails/glyph_helper_spec.rb +24 -0
  66. data/spec/lib/twitter_bootstrap_rails/modal_helper_spec.rb +15 -15
  67. data/spec/lib/twitter_bootstrap_rails/navbar_helper_spec.rb +207 -173
  68. data/spec/lib/twitter_bootstrap_rails/uri_state_spec.rb +18 -16
  69. data/spec/spec_helper.rb +11 -1
  70. data/vendor/assets/stylesheets/twitter-bootstrap-static/bootstrap.css.erb +5796 -1
  71. data/vendor/static-source/bootstrap.less +0 -1
  72. data/vendor/static-source/fontawesome.less +0 -1
  73. data/vendor/static-source/sprites.less +1 -1
  74. data/vendor/toolkit/fontawesome/bordered-pulled.less +16 -0
  75. data/vendor/toolkit/fontawesome/core.less +8 -126
  76. data/vendor/toolkit/fontawesome/fixed-width.less +6 -0
  77. data/vendor/toolkit/fontawesome/font-awesome.less +9 -25
  78. data/vendor/toolkit/fontawesome/icons.less +549 -378
  79. data/vendor/toolkit/fontawesome/larger.less +13 -0
  80. data/vendor/toolkit/fontawesome/list.less +19 -0
  81. data/vendor/toolkit/fontawesome/mixins.less +16 -39
  82. data/vendor/toolkit/fontawesome/path.less +5 -5
  83. data/vendor/toolkit/fontawesome/rotated-flipped.less +20 -0
  84. data/vendor/toolkit/fontawesome/spinning.less +29 -0
  85. data/vendor/toolkit/fontawesome/stacked.less +20 -0
  86. data/vendor/toolkit/fontawesome/variables.less +557 -731
  87. data/vendor/toolkit/twitter/bootstrap/alerts.less +47 -58
  88. data/vendor/toolkit/twitter/bootstrap/badges.less +55 -0
  89. data/vendor/toolkit/twitter/bootstrap/bootstrap.less +26 -39
  90. data/vendor/toolkit/twitter/bootstrap/breadcrumbs.less +11 -9
  91. data/vendor/toolkit/twitter/bootstrap/button-groups.less +168 -152
  92. data/vendor/toolkit/twitter/bootstrap/buttons.less +101 -170
  93. data/vendor/toolkit/twitter/bootstrap/carousel.less +150 -65
  94. data/vendor/toolkit/twitter/bootstrap/close.less +20 -19
  95. data/vendor/toolkit/twitter/bootstrap/code.less +38 -30
  96. data/vendor/toolkit/twitter/bootstrap/component-animations.less +12 -3
  97. data/vendor/toolkit/twitter/bootstrap/dropdowns.less +115 -148
  98. data/vendor/toolkit/twitter/bootstrap/forms.less +401 -547
  99. data/vendor/toolkit/twitter/bootstrap/glyphicons.less +234 -0
  100. data/vendor/toolkit/twitter/bootstrap/grid.less +74 -11
  101. data/vendor/toolkit/twitter/bootstrap/input-groups.less +166 -0
  102. data/vendor/toolkit/twitter/bootstrap/jumbotron.less +48 -0
  103. data/vendor/toolkit/twitter/bootstrap/labels.less +64 -0
  104. data/vendor/toolkit/twitter/bootstrap/list-group.less +132 -0
  105. data/vendor/toolkit/twitter/bootstrap/media.less +8 -7
  106. data/vendor/toolkit/twitter/bootstrap/mixins/alerts.less +14 -0
  107. data/vendor/toolkit/twitter/bootstrap/mixins/background-variant.less +8 -0
  108. data/vendor/toolkit/twitter/bootstrap/mixins/border-radius.less +18 -0
  109. data/vendor/toolkit/twitter/bootstrap/mixins/buttons.less +52 -0
  110. data/vendor/toolkit/twitter/bootstrap/mixins/center-block.less +7 -0
  111. data/vendor/toolkit/twitter/bootstrap/mixins/clearfix.less +22 -0
  112. data/vendor/toolkit/twitter/bootstrap/mixins/forms.less +85 -0
  113. data/vendor/toolkit/twitter/bootstrap/mixins/gradients.less +59 -0
  114. data/vendor/toolkit/twitter/bootstrap/mixins/grid-framework.less +91 -0
  115. data/vendor/toolkit/twitter/bootstrap/mixins/grid.less +122 -0
  116. data/vendor/toolkit/twitter/bootstrap/mixins/hide-text.less +21 -0
  117. data/vendor/toolkit/twitter/bootstrap/mixins/image.less +33 -0
  118. data/vendor/toolkit/twitter/bootstrap/mixins/labels.less +12 -0
  119. data/vendor/toolkit/twitter/bootstrap/mixins/list-group.less +29 -0
  120. data/vendor/toolkit/twitter/bootstrap/mixins/nav-divider.less +10 -0
  121. data/vendor/toolkit/twitter/bootstrap/mixins/nav-vertical-align.less +9 -0
  122. data/vendor/toolkit/twitter/bootstrap/mixins/opacity.less +8 -0
  123. data/vendor/toolkit/twitter/bootstrap/mixins/pagination.less +23 -0
  124. data/vendor/toolkit/twitter/bootstrap/mixins/panels.less +24 -0
  125. data/vendor/toolkit/twitter/bootstrap/mixins/progress-bar.less +10 -0
  126. data/vendor/toolkit/twitter/bootstrap/mixins/reset-filter.less +8 -0
  127. data/vendor/toolkit/twitter/bootstrap/mixins/resize.less +6 -0
  128. data/vendor/toolkit/twitter/bootstrap/mixins/responsive-visibility.less +15 -0
  129. data/vendor/toolkit/twitter/bootstrap/mixins/size.less +10 -0
  130. data/vendor/toolkit/twitter/bootstrap/mixins/tab-focus.less +9 -0
  131. data/vendor/toolkit/twitter/bootstrap/mixins/table-row.less +28 -0
  132. data/vendor/toolkit/twitter/bootstrap/mixins/text-emphasis.less +8 -0
  133. data/vendor/toolkit/twitter/bootstrap/mixins/text-overflow.less +8 -0
  134. data/vendor/toolkit/twitter/bootstrap/mixins/vendor-prefixes.less +224 -0
  135. data/vendor/toolkit/twitter/bootstrap/mixins.less +36 -699
  136. data/vendor/toolkit/twitter/bootstrap/modals.less +109 -54
  137. data/vendor/toolkit/twitter/bootstrap/navbar.less +542 -384
  138. data/vendor/toolkit/twitter/bootstrap/navs.less +192 -359
  139. data/vendor/toolkit/twitter/bootstrap/normalize.less +425 -0
  140. data/vendor/toolkit/twitter/bootstrap/pager.less +46 -34
  141. data/vendor/toolkit/twitter/bootstrap/pagination.less +70 -105
  142. data/vendor/toolkit/twitter/bootstrap/panels.less +248 -0
  143. data/vendor/toolkit/twitter/bootstrap/popovers.less +61 -61
  144. data/vendor/toolkit/twitter/bootstrap/print.less +101 -0
  145. data/vendor/toolkit/twitter/bootstrap/progress-bars.less +51 -73
  146. data/vendor/toolkit/twitter/bootstrap/responsive-embed.less +34 -0
  147. data/vendor/toolkit/twitter/bootstrap/responsive-utilities.less +177 -42
  148. data/vendor/toolkit/twitter/bootstrap/scaffolding.less +120 -23
  149. data/vendor/toolkit/twitter/bootstrap/tables.less +171 -182
  150. data/vendor/toolkit/twitter/bootstrap/theme.less +260 -0
  151. data/vendor/toolkit/twitter/bootstrap/thumbnails.less +26 -43
  152. data/vendor/toolkit/twitter/bootstrap/tooltip.less +49 -24
  153. data/vendor/toolkit/twitter/bootstrap/type.less +208 -147
  154. data/vendor/toolkit/twitter/bootstrap/utilities.less +33 -7
  155. data/vendor/toolkit/twitter/bootstrap/variables.less +761 -215
  156. data/vendor/toolkit/twitter/bootstrap/wells.less +7 -7
  157. metadata +156 -130
  158. data/app/assets/images/twitter/bootstrap/glyphicons-halflings-white.png +0 -0
  159. data/app/assets/images/twitter/bootstrap/glyphicons-halflings.png +0 -0
  160. data/app/assets/javascripts/twitter/bootstrap/bootstrap-affix.js +0 -117
  161. data/app/assets/javascripts/twitter/bootstrap/bootstrap-alert.js +0 -99
  162. data/app/assets/javascripts/twitter/bootstrap/bootstrap-button.js +0 -105
  163. data/app/assets/javascripts/twitter/bootstrap/bootstrap-carousel.js +0 -207
  164. data/app/assets/javascripts/twitter/bootstrap/bootstrap-collapse.js +0 -167
  165. data/app/assets/javascripts/twitter/bootstrap/bootstrap-dropdown.js +0 -169
  166. data/app/assets/javascripts/twitter/bootstrap/bootstrap-modal.js +0 -247
  167. data/app/assets/javascripts/twitter/bootstrap/bootstrap-popover.js +0 -114
  168. data/app/assets/javascripts/twitter/bootstrap/bootstrap-scrollspy.js +0 -162
  169. data/app/assets/javascripts/twitter/bootstrap/bootstrap-tab.js +0 -144
  170. data/app/assets/javascripts/twitter/bootstrap/bootstrap-tooltip.js +0 -361
  171. data/app/assets/javascripts/twitter/bootstrap/bootstrap-transition.js +0 -60
  172. data/app/assets/javascripts/twitter/bootstrap/bootstrap-typeahead.js +0 -335
  173. data/lib/twitter/bootstrap/rails/twitter-bootstrap-breadcrumbs.rb +0 -42
  174. data/test/lib/breadcrumbs_test.rb +0 -75
  175. data/test/test_helper.rb +0 -11
  176. data/vendor/toolkit/fontawesome/bootstrap.less +0 -84
  177. data/vendor/toolkit/fontawesome/extras.less +0 -93
  178. data/vendor/toolkit/fontawesome/font-awesome-ie7.less +0 -1953
  179. data/vendor/toolkit/twitter/bootstrap/accordion.less +0 -34
  180. data/vendor/toolkit/twitter/bootstrap/hero-unit.less +0 -25
  181. data/vendor/toolkit/twitter/bootstrap/labels-badges.less +0 -84
  182. data/vendor/toolkit/twitter/bootstrap/layouts.less +0 -16
  183. data/vendor/toolkit/twitter/bootstrap/reset.less +0 -216
  184. data/vendor/toolkit/twitter/bootstrap/responsive-1200px-min.less +0 -28
  185. data/vendor/toolkit/twitter/bootstrap/responsive-767px-max.less +0 -193
  186. data/vendor/toolkit/twitter/bootstrap/responsive-768px-979px.less +0 -19
  187. data/vendor/toolkit/twitter/bootstrap/responsive-navbar.less +0 -189
  188. data/vendor/toolkit/twitter/bootstrap/responsive.less +0 -48
  189. 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,20 @@
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>
10
11
  def glyph(*names)
12
+ options = (names.last.kind_of?(Hash)) ? names.pop : {}
11
13
  names.map! { |name| name.to_s.gsub('_','-') }
12
14
  names.map! do |name|
13
- name =~ /pull-(?:left|right)/ ? name : "icon-#{name}"
15
+ name =~ /pull-(?:left|right)/ ? name : "glyphicon glyphicon-#{name}"
14
16
  end
15
- content_tag :i, nil, :class => names
17
+ options[:tag] = options[:tag] ||= :i
18
+ content_tag options[:tag], nil, :class => names
16
19
  end
17
20
  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)
@@ -1,10 +1,14 @@
1
1
  module TwitterBreadcrumbsHelper
2
- def render_breadcrumbs(divider = '/', &block)
3
- content = render :partial => 'twitter-bootstrap/breadcrumbs', :layout => false, :locals => { :divider => divider }
2
+ def render_bootstrap_breadcrumbs(divider = '/', options={}, &block)
3
+ default_options = { :class => '', :item_class => '', :divider_class => '', :active_class => 'active' }.merge(options)
4
+ content = render :partial => 'twitter-bootstrap/breadcrumbs', :layout => false, :locals => { :divider => divider, options: options }
4
5
  if block_given?
5
6
  capture(content, &block)
6
7
  else
7
8
  content
8
9
  end
9
10
  end
11
+
12
+ # Add backward compatible alias unless BC on rails present
13
+ alias_method :render_breadcrumbs, :render_bootstrap_breadcrumbs unless defined?(::BreadcrumbsOnRails)
10
14
  end
@@ -1,14 +1,14 @@
1
- <% if @breadcrumbs.present? %>
2
- <ul class="breadcrumb">
3
- <% separator = divider.html_safe %>
4
- <% @breadcrumbs[0..-2].each do |crumb| %>
5
- <li>
1
+ <% if @__bs_breadcrumbs.present? %>
2
+ <ul class="breadcrumb <%= options[:class] %>">
3
+ <% separator = divider.html_safe if divider %>
4
+ <% @__bs_breadcrumbs[0..-2].each do |crumb| %>
5
+ <li class="<%= options[:item_class] %>">
6
6
  <%= link_to crumb[:name], crumb[:url], crumb[:options] %>
7
- <span class="divider"><%= separator %></span>
7
+ <span class="divider <%= options[:divider_class] %>"><%= separator if separator %></span>
8
8
  </li>
9
9
  <% end %>
10
- <li class="active">
11
- <%= @breadcrumbs.last[:name] %>
10
+ <li class="<%= options[:active_class] %>">
11
+ <%= @__bs_breadcrumbs.last[:name] %>
12
12
  </li>
13
13
  </ul>
14
14
  <% end %>
@@ -5,8 +5,9 @@ module Bootstrap
5
5
  class InstallGenerator < ::Rails::Generators::Base
6
6
 
7
7
  source_root File.expand_path("../templates", __FILE__)
8
- desc "This generator installs Twitter Bootstrap to Asset Pipeline"
8
+ desc "This generator installs Bootstrap to Asset Pipeline"
9
9
  argument :stylesheets_type, :type => :string, :default => 'less', :banner => '*less or static'
10
+ class_option :'no-coffeescript', :type => :boolean, :default => false, :desc => 'Skips coffeescript replacement into app generators'
10
11
 
11
12
  def add_assets
12
13
 
@@ -60,7 +61,6 @@ module Bootstrap
60
61
  def cleanup_legacy
61
62
  # Remove old requires (if any) that included twitter/bootstrap directly:
62
63
  gsub_file("app/assets/stylesheets/application.css", %r|\s*\*=\s*twitter/bootstrap\s*\n|, "")
63
- gsub_file("app/assets/stylesheets/application.css", %r|\s*\*=\s*twitter/bootstrap_responsive\s*\n|, "")
64
64
  if File.exist?('app/assets/stylesheets/bootstrap_override.css.less')
65
65
  puts <<-EOM
66
66
  Warning:
@@ -76,6 +76,7 @@ module Bootstrap
76
76
  end
77
77
 
78
78
  def use_coffeescript?
79
+ return false if options[:'no-coffeescript']
79
80
  ::Rails.configuration.app_generators.rails[:javascript_engine] == :coffee
80
81
  end
81
82
  end
@@ -1,22 +1,24 @@
1
1
  @import "twitter/bootstrap/bootstrap";
2
- @import "twitter/bootstrap/responsive";
3
2
 
4
- // Set the correct sprite paths
5
- @iconSpritePath: image-url("twitter/bootstrap/glyphicons-halflings.png");
6
- @iconWhiteSpritePath: image-url("twitter/bootstrap/glyphicons-halflings-white.png");
3
+ // Set correct font paths
4
+ @glyphiconsEotPath: font-url("glyphicons-halflings-regular.eot");
5
+ @glyphiconsEotPath_iefix: font-url("glyphicons-halflings-regular.eot?#iefix");
6
+ @glyphiconsWoffPath: font-url("glyphicons-halflings-regular.woff");
7
+ @glyphiconsTtfPath: font-url("glyphicons-halflings-regular.ttf");
8
+ @glyphiconsSvgPath: font-url("glyphicons-halflings-regular.svg#glyphicons_halflingsregular");
7
9
 
8
10
  // Set the Font Awesome (Font Awesome is default. You can disable by commenting below lines)
9
- @fontAwesomeEotPath: asset-url("fontawesome-webfont.eot");
10
- @fontAwesomeEotPath_iefix: asset-url("fontawesome-webfont.eot?#iefix");
11
- @fontAwesomeWoffPath: asset-url("fontawesome-webfont.woff");
12
- @fontAwesomeTtfPath: asset-url("fontawesome-webfont.ttf");
13
- @fontAwesomeSvgPath: asset-url("fontawesome-webfont.svg#fontawesomeregular");
11
+ @fontAwesomeEotPath: font-url("fontawesome-webfont.eot");
12
+ @fontAwesomeEotPath_iefix: font-url("fontawesome-webfont.eot?#iefix");
13
+ @fontAwesomeWoffPath: font-url("fontawesome-webfont.woff");
14
+ @fontAwesomeTtfPath: font-url("fontawesome-webfont.ttf");
15
+ @fontAwesomeSvgPath: font-url("fontawesome-webfont.svg#fontawesomeregular");
14
16
 
15
17
  // Font Awesome
16
18
  @import "fontawesome/font-awesome";
17
19
 
18
20
  // Glyphicons
19
- //@import "twitter/bootstrap/sprites.less";
21
+ //@import "twitter/bootstrap/glyphicons.less";
20
22
 
21
23
  // Your custom LESS stylesheets goes here
22
24
  //
@@ -27,4 +29,4 @@
27
29
  // See http://twitter.github.com/bootstrap/customize.html#variables for their names and documentation
28
30
  //
29
31
  // Example:
30
- // @linkColor: #ff0000;
32
+ // @link-color: #ff0000;
@@ -2,6 +2,11 @@
2
2
  # See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
3
3
 
4
4
  en:
5
+ breadcrumbs:
6
+ application:
7
+ root: "Index"
8
+ pages:
9
+ pages: "Pages"
5
10
  helpers:
6
11
  actions: "Actions"
7
12
  links:
@@ -6,15 +6,12 @@ module Bootstrap
6
6
  source_root File.expand_path("../templates", __FILE__)
7
7
  desc "This generator generates layout file with navigation."
8
8
  argument :layout_name, :type => :string, :default => "application"
9
- argument :layout_type, :type => :string, :default => "fixed",
10
- :banner => "*fixed or fluid"
11
9
 
12
- attr_reader :app_name, :container_class
10
+ attr_reader :app_name
13
11
 
14
12
  def generate_layout
15
13
  app = ::Rails.application
16
14
  @app_name = app.class.to_s.split("::").first
17
- @container_class = layout_type == "fluid" ? "container-fluid" : "container"
18
15
  ext = app.config.generators.options[:rails][:template_engine] || :erb
19
16
  template "layout.html.#{ext}", "app/views/layouts/#{layout_name}.html.#{ext}"
20
17
  end