twitter-bootstrap-rails 2.2.6 → 2.2.7
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.
- data/README.md +319 -18
- data/Rakefile +9 -1
- data/app/assets/fonts/fontawesome-webfont.eot +0 -0
- data/app/assets/fonts/fontawesome-webfont.svg +339 -0
- data/{vendor → app}/assets/fonts/fontawesome-webfont.ttf +0 -0
- data/app/assets/fonts/fontawesome-webfont.woff +0 -0
- data/{vendor → app}/assets/images/twitter/bootstrap/glyphicons-halflings-white.png +0 -0
- data/{vendor → app}/assets/images/twitter/bootstrap/glyphicons-halflings.png +0 -0
- data/{vendor → app}/assets/javascripts/twitter/bootstrap.js +0 -0
- data/{vendor → app}/assets/javascripts/twitter/bootstrap/bootstrap-affix.js +0 -0
- data/{vendor → app}/assets/javascripts/twitter/bootstrap/bootstrap-alert.js +0 -0
- data/{vendor → app}/assets/javascripts/twitter/bootstrap/bootstrap-button.js +0 -0
- data/{vendor → app}/assets/javascripts/twitter/bootstrap/bootstrap-carousel.js +0 -0
- data/{vendor → app}/assets/javascripts/twitter/bootstrap/bootstrap-collapse.js +0 -0
- data/{vendor → app}/assets/javascripts/twitter/bootstrap/bootstrap-dropdown.js +0 -0
- data/{vendor → app}/assets/javascripts/twitter/bootstrap/bootstrap-modal.js +0 -0
- data/{vendor → app}/assets/javascripts/twitter/bootstrap/bootstrap-popover.js +0 -0
- data/{vendor → app}/assets/javascripts/twitter/bootstrap/bootstrap-scrollspy.js +0 -0
- data/{vendor → app}/assets/javascripts/twitter/bootstrap/bootstrap-tab.js +0 -0
- data/{vendor → app}/assets/javascripts/twitter/bootstrap/bootstrap-tooltip.js +0 -0
- data/{vendor → app}/assets/javascripts/twitter/bootstrap/bootstrap-transition.js +0 -0
- data/{vendor → app}/assets/javascripts/twitter/bootstrap/bootstrap-typeahead.js +0 -0
- data/{vendor → app}/assets/javascripts/twitter/bootstrap_ujs.js +0 -0
- data/app/assets/stylesheets/twitter-bootstrap-static/bootstrap.css.erb +889 -0
- data/{vendor → app}/assets/stylesheets/twitter-bootstrap-static/fontawesome.css.erb +134 -16
- data/{vendor → app}/assets/stylesheets/twitter-bootstrap-static/sprites.css.erb +2 -2
- data/app/helpers/badge_label_helper.rb +16 -0
- data/app/helpers/bootstrap_flash_helper.rb +1 -1
- data/app/helpers/modal_helper.rb +29 -16
- data/app/helpers/navbar_helper.rb +189 -0
- data/app/helpers/twitter_breadcrumbs_helper.rb +7 -2
- data/lib/generators/bootstrap/install/install_generator.rb +10 -6
- data/lib/generators/bootstrap/install/templates/bootstrap_and_overrides.less +8 -9
- data/lib/generators/bootstrap/install/templates/en.bootstrap.yml +1 -0
- data/lib/generators/bootstrap/layout/templates/layout.html.erb +4 -4
- data/lib/generators/bootstrap/layout/templates/layout.html.haml +5 -5
- data/lib/generators/bootstrap/layout/templates/layout.html.slim +7 -5
- data/lib/generators/bootstrap/themed/templates/edit.html.erb +1 -1
- data/lib/generators/bootstrap/themed/templates/edit.html.haml +1 -1
- data/lib/generators/bootstrap/themed/templates/edit.html.slim +1 -1
- data/lib/generators/bootstrap/themed/templates/index.html.erb +1 -1
- data/lib/generators/bootstrap/themed/templates/index.html.haml +1 -1
- data/lib/generators/bootstrap/themed/templates/index.html.slim +1 -1
- data/lib/generators/bootstrap/themed/templates/new.html.erb +1 -1
- data/lib/generators/bootstrap/themed/templates/new.html.haml +1 -1
- data/lib/generators/bootstrap/themed/templates/new.html.slim +1 -1
- data/lib/generators/bootstrap/themed/templates/show.html.erb +1 -1
- data/lib/generators/bootstrap/themed/templates/show.html.haml +1 -1
- data/lib/generators/bootstrap/themed/templates/show.html.slim +1 -1
- data/lib/twitter-bootstrap-rails.rb +4 -4
- data/lib/twitter/bootstrap/rails/engine.rb +3 -0
- data/lib/twitter/bootstrap/rails/version.rb +1 -1
- data/spec/lib/twitter_bootstrap_rails/badge_label_helper_spec.rb +22 -0
- data/spec/lib/twitter_bootstrap_rails/modal_helper_spec.rb +62 -0
- data/spec/lib/twitter_bootstrap_rails/navbar_helper_spec.rb +350 -0
- data/spec/lib/twitter_bootstrap_rails/uri_state_spec.rb +40 -0
- data/spec/spec_helper.rb +11 -0
- data/test/lib/breadcrumbs_test.rb +2 -2
- data/test/test_helper.rb +3 -0
- data/vendor/static-source/fontawesome.less +8 -6
- data/vendor/toolkit/fontawesome/bootstrap.less +78 -0
- data/vendor/toolkit/fontawesome/core.less +132 -0
- data/vendor/toolkit/fontawesome/extras.less +79 -0
- data/vendor/toolkit/{fontawesome-ie7.less → fontawesome/font-awesome-ie7.less} +80 -17
- data/vendor/toolkit/fontawesome/font-awesome.less +32 -0
- data/vendor/toolkit/{fontawesome.less → fontawesome/icons.less} +69 -271
- data/vendor/toolkit/fontawesome/mixins.less +34 -0
- data/vendor/toolkit/fontawesome/path.less +14 -0
- data/vendor/toolkit/fontawesome/variables.less +9 -0
- metadata +80 -29
- data/lib/generators/bootstrap/partial/templates/_navbar.html.erb +0 -13
- data/vendor/assets/fonts/fontawesome-webfont.eot +0 -0
- data/vendor/assets/fonts/fontawesome-webfont.woff +0 -0
- data/vendor/assets/stylesheets/twitter-bootstrap-static/bootstrap.css.erb +0 -889
@@ -1,30 +1,42 @@
|
|
1
|
-
@font-face{font-family:
|
2
|
-
.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:hover>[class*=" icon-"],.dropdown-menu>.active>a>[class^="icon-"],.dropdown-menu>.active>a>[class*=" icon-"],.dropdown-submenu:hover>a>[class^="icon-"],.dropdown-submenu:hover>a>[class*=" icon-"]{background-image:none;}
|
1
|
+
@font-face{font-family:'FontAwesome';src:url("<%= asset_path 'fontawesome-webfont.eot' %>");src:url("<%= asset_path 'fontawesome-webfont.eot#iefix' %>") format('embedded-opentype'),url("<%= asset_path 'fontawesome-webfont.woff' %>") format('woff'),url("<%= asset_path 'fontawesome-webfont.ttf' %>") format('truetype'),url("<%= asset_path 'fontawesome-webfont.svg#fontawesomeregular' %>") format('svg');font-weight:normal;font-style:normal;}[class^="icon-"],[class*=" icon-"]{font-family:FontAwesome;font-weight:normal;font-style:normal;text-decoration:inherit;-webkit-font-smoothing:antialiased;*margin-right:.3em;}
|
3
2
|
[class^="icon-"]:before,[class*=" icon-"]:before{text-decoration:inherit;display:inline-block;speak:none;}
|
4
|
-
a [class^="icon-"],a [class*=" icon-"]{display:inline-block;}
|
5
3
|
.icon-large:before{vertical-align:-10%;font-size:1.3333333333333333em;}
|
6
|
-
|
7
|
-
|
8
|
-
.
|
9
|
-
|
10
|
-
ul.icons{list-style-type:none;text-indent:-0.75em;}ul.icons li [class^="icon-"],ul.icons li [class*=" icon-"]{width:.75em;}
|
4
|
+
a [class^="icon-"],a [class*=" icon-"],a [class^="icon-"]:before,a [class*=" icon-"]:before{display:inline;}
|
5
|
+
[class^="icon-"].icon-fixed-width,[class*=" icon-"].icon-fixed-width{display:inline-block;width:1.2857142857142858em;text-align:center;}[class^="icon-"].icon-fixed-width.icon-large,[class*=" icon-"].icon-fixed-width.icon-large{width:1.5714285714285714em;}
|
6
|
+
ul.icons-ul{list-style-type:none;text-indent:-0.7142857142857143em;margin-left:2.142857142857143em;}ul.icons-ul>li .icon-li{width:0.7142857142857143em;display:inline-block;text-align:center;}
|
7
|
+
[class^="icon-"].hide,[class*=" icon-"].hide{display:none;}
|
11
8
|
.icon-muted{color:#eeeeee;}
|
9
|
+
.icon-light{color:#ffffff;}
|
10
|
+
.icon-dark{color:#333333;}
|
12
11
|
.icon-border{border:solid 1px #eeeeee;padding:.2em .25em .15em;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;}
|
13
12
|
.icon-2x{font-size:2em;}.icon-2x.icon-border{border-width:2px;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;}
|
14
13
|
.icon-3x{font-size:3em;}.icon-3x.icon-border{border-width:3px;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;}
|
15
14
|
.icon-4x{font-size:4em;}.icon-4x.icon-border{border-width:4px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;}
|
15
|
+
.icon-5x{font-size:5em;}.icon-5x.icon-border{border-width:5px;-webkit-border-radius:7px;-moz-border-radius:7px;border-radius:7px;}
|
16
16
|
.pull-right{float:right;}
|
17
17
|
.pull-left{float:left;}
|
18
18
|
[class^="icon-"].pull-left,[class*=" icon-"].pull-left{margin-right:.3em;}
|
19
19
|
[class^="icon-"].pull-right,[class*=" icon-"].pull-right{margin-left:.3em;}
|
20
|
+
[class^="icon-"],[class*=" icon-"]{display:inline;width:auto;height:auto;line-height:normal;vertical-align:baseline;background-image:none;background-position:0% 0%;background-repeat:repeat;margin-top:0;}
|
21
|
+
.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:hover>[class*=" icon-"],.dropdown-menu>.active>a>[class^="icon-"],.dropdown-menu>.active>a>[class*=" icon-"],.dropdown-submenu:hover>a>[class^="icon-"],.dropdown-submenu:hover>a>[class*=" icon-"]{background-image:none;}
|
22
|
+
.btn [class^="icon-"].icon-large,.nav [class^="icon-"].icon-large,.btn [class*=" icon-"].icon-large,.nav [class*=" icon-"].icon-large{line-height:.9em;}
|
23
|
+
.btn [class^="icon-"].icon-spin,.nav [class^="icon-"].icon-spin,.btn [class*=" icon-"].icon-spin,.nav [class*=" icon-"].icon-spin{display:inline-block;}
|
24
|
+
.nav-tabs [class^="icon-"],.nav-pills [class^="icon-"],.nav-tabs [class*=" icon-"],.nav-pills [class*=" icon-"],.nav-tabs [class^="icon-"].icon-large,.nav-pills [class^="icon-"].icon-large,.nav-tabs [class*=" icon-"].icon-large,.nav-pills [class*=" icon-"].icon-large{line-height:.9em;}
|
20
25
|
.btn [class^="icon-"].pull-left.icon-2x,.btn [class*=" icon-"].pull-left.icon-2x,.btn [class^="icon-"].pull-right.icon-2x,.btn [class*=" icon-"].pull-right.icon-2x{margin-top:.18em;}
|
21
26
|
.btn [class^="icon-"].icon-spin.icon-large,.btn [class*=" icon-"].icon-spin.icon-large{line-height:.8em;}
|
22
27
|
.btn.btn-small [class^="icon-"].pull-left.icon-2x,.btn.btn-small [class*=" icon-"].pull-left.icon-2x,.btn.btn-small [class^="icon-"].pull-right.icon-2x,.btn.btn-small [class*=" icon-"].pull-right.icon-2x{margin-top:.25em;}
|
23
28
|
.btn.btn-large [class^="icon-"],.btn.btn-large [class*=" icon-"]{margin-top:0;}.btn.btn-large [class^="icon-"].pull-left.icon-2x,.btn.btn-large [class*=" icon-"].pull-left.icon-2x,.btn.btn-large [class^="icon-"].pull-right.icon-2x,.btn.btn-large [class*=" icon-"].pull-right.icon-2x{margin-top:.05em;}
|
24
29
|
.btn.btn-large [class^="icon-"].pull-left.icon-2x,.btn.btn-large [class*=" icon-"].pull-left.icon-2x{margin-right:.2em;}
|
25
30
|
.btn.btn-large [class^="icon-"].pull-right.icon-2x,.btn.btn-large [class*=" icon-"].pull-right.icon-2x{margin-left:.2em;}
|
31
|
+
.icon-stack{position:relative;display:inline-block;width:2em;height:2em;line-height:2em;vertical-align:-35%;}.icon-stack [class^="icon-"],.icon-stack [class*=" icon-"]{display:block;text-align:center;position:absolute;width:100%;height:100%;font-size:1em;line-height:inherit;*line-height:2em;}
|
32
|
+
.icon-stack .icon-stack-base{font-size:2em;*line-height:1em;}
|
26
33
|
.icon-spin{display:inline-block;-moz-animation:spin 2s infinite linear;-o-animation:spin 2s infinite linear;-webkit-animation:spin 2s infinite linear;animation:spin 2s infinite linear;}
|
27
|
-
@-moz-keyframes spin{0%{-moz-transform:rotate(0deg);} 100%{-moz-transform:rotate(359deg);}}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg);} 100%{-webkit-transform:rotate(359deg);}}@-o-keyframes spin{0%{-o-transform:rotate(0deg);} 100%{-o-transform:rotate(359deg);}}@-ms-keyframes spin{0%{-ms-transform:rotate(0deg);} 100%{-ms-transform:rotate(359deg);}}@keyframes spin{0%{transform:rotate(0deg);} 100%{transform:rotate(359deg);}}
|
34
|
+
@-moz-keyframes spin{0%{-moz-transform:rotate(0deg);} 100%{-moz-transform:rotate(359deg);}}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg);} 100%{-webkit-transform:rotate(359deg);}}@-o-keyframes spin{0%{-o-transform:rotate(0deg);} 100%{-o-transform:rotate(359deg);}}@-ms-keyframes spin{0%{-ms-transform:rotate(0deg);} 100%{-ms-transform:rotate(359deg);}}@keyframes spin{0%{transform:rotate(0deg);} 100%{transform:rotate(359deg);}}.icon-rotate-90:before{-webkit-transform:rotate(90deg);-moz-transform:rotate(90deg);-ms-transform:rotate(90deg);-o-transform:rotate(90deg);transform:rotate(90deg);filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=1);}
|
35
|
+
.icon-rotate-180:before{-webkit-transform:rotate(180deg);-moz-transform:rotate(180deg);-ms-transform:rotate(180deg);-o-transform:rotate(180deg);transform:rotate(180deg);filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=2);}
|
36
|
+
.icon-rotate-270:before{-webkit-transform:rotate(270deg);-moz-transform:rotate(270deg);-ms-transform:rotate(270deg);-o-transform:rotate(270deg);transform:rotate(270deg);filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=3);}
|
37
|
+
.icon-flip-horizontal:before{-webkit-transform:scale(-1, 1);-moz-transform:scale(-1, 1);-ms-transform:scale(-1, 1);-o-transform:scale(-1, 1);transform:scale(-1, 1);}
|
38
|
+
.icon-flip-vertical:before{-webkit-transform:scale(1, -1);-moz-transform:scale(1, -1);-ms-transform:scale(1, -1);-o-transform:scale(1, -1);transform:scale(1, -1);}
|
39
|
+
.icon-glass:before{content:"\f000";}
|
28
40
|
.icon-music:before{content:"\f001";}
|
29
41
|
.icon-search:before{content:"\f002";}
|
30
42
|
.icon-envelope:before{content:"\f003";}
|
@@ -53,7 +65,7 @@ ul.icons{list-style-type:none;text-indent:-0.75em;}ul.icons li [class^="icon-"],
|
|
53
65
|
.icon-upload:before{content:"\f01b";}
|
54
66
|
.icon-inbox:before{content:"\f01c";}
|
55
67
|
.icon-play-circle:before{content:"\f01d";}
|
56
|
-
.icon-repeat:before{content:"\f01e";}
|
68
|
+
.icon-repeat:before,.icon-rotate-right:before{content:"\f01e";}
|
57
69
|
.icon-refresh:before{content:"\f021";}
|
58
70
|
.icon-list-alt:before{content:"\f022";}
|
59
71
|
.icon-lock:before{content:"\f023";}
|
@@ -118,7 +130,7 @@ ul.icons{list-style-type:none;text-indent:-0.75em;}ul.icons li [class^="icon-"],
|
|
118
130
|
.icon-arrow-right:before{content:"\f061";}
|
119
131
|
.icon-arrow-up:before{content:"\f062";}
|
120
132
|
.icon-arrow-down:before{content:"\f063";}
|
121
|
-
.icon-share-alt:before{content:"\f064";}
|
133
|
+
.icon-share-alt:before,.icon-mail-forward:before{content:"\f064";}
|
122
134
|
.icon-resize-full:before{content:"\f065";}
|
123
135
|
.icon-resize-small:before{content:"\f066";}
|
124
136
|
.icon-plus:before{content:"\f067";}
|
@@ -224,7 +236,7 @@ ul.icons{list-style-type:none;text-indent:-0.75em;}ul.icons li [class^="icon-"],
|
|
224
236
|
.icon-sort-up:before{content:"\f0de";}
|
225
237
|
.icon-envelope-alt:before{content:"\f0e0";}
|
226
238
|
.icon-linkedin:before{content:"\f0e1";}
|
227
|
-
.icon-undo:before{content:"\f0e2";}
|
239
|
+
.icon-undo:before,.icon-rotate-left:before{content:"\f0e2";}
|
228
240
|
.icon-legal:before{content:"\f0e3";}
|
229
241
|
.icon-dashboard:before{content:"\f0e4";}
|
230
242
|
.icon-comment-alt:before{content:"\f0e5";}
|
@@ -269,17 +281,70 @@ ul.icons{list-style-type:none;text-indent:-0.75em;}ul.icons li [class^="icon-"],
|
|
269
281
|
.icon-quote-right:before{content:"\f10e";}
|
270
282
|
.icon-spinner:before{content:"\f110";}
|
271
283
|
.icon-circle:before{content:"\f111";}
|
272
|
-
.icon-reply:before{content:"\f112";}
|
273
|
-
.icon-github-alt:before{content:"\f113";}
|
284
|
+
.icon-reply:before,.icon-mail-reply:before{content:"\f112";}
|
274
285
|
.icon-folder-close-alt:before{content:"\f114";}
|
275
286
|
.icon-folder-open-alt:before{content:"\f115";}
|
287
|
+
.icon-expand-alt:before{content:"\f116";}
|
288
|
+
.icon-collapse-alt:before{content:"\f117";}
|
289
|
+
.icon-smile:before{content:"\f118";}
|
290
|
+
.icon-frown:before{content:"\f119";}
|
291
|
+
.icon-meh:before{content:"\f11a";}
|
292
|
+
.icon-gamepad:before{content:"\f11b";}
|
293
|
+
.icon-keyboard:before{content:"\f11c";}
|
294
|
+
.icon-flag-alt:before{content:"\f11d";}
|
295
|
+
.icon-flag-checkered:before{content:"\f11e";}
|
296
|
+
.icon-terminal:before{content:"\f120";}
|
297
|
+
.icon-code:before{content:"\f121";}
|
298
|
+
.icon-reply-all:before{content:"\f122";}
|
299
|
+
.icon-mail-reply-all:before{content:"\f122";}
|
300
|
+
.icon-star-half-full:before,.icon-star-half-empty:before{content:"\f123";}
|
301
|
+
.icon-location-arrow:before{content:"\f124";}
|
302
|
+
.icon-crop:before{content:"\f125";}
|
303
|
+
.icon-code-fork:before{content:"\f126";}
|
304
|
+
.icon-unlink:before{content:"\f127";}
|
305
|
+
.icon-question:before{content:"\f128";}
|
306
|
+
.icon-info:before{content:"\f129";}
|
307
|
+
.icon-exclamation:before{content:"\f12a";}
|
308
|
+
.icon-superscript:before{content:"\f12b";}
|
309
|
+
.icon-subscript:before{content:"\f12c";}
|
310
|
+
.icon-eraser:before{content:"\f12d";}
|
311
|
+
.icon-puzzle-piece:before{content:"\f12e";}
|
312
|
+
.icon-microphone:before{content:"\f130";}
|
313
|
+
.icon-microphone-off:before{content:"\f131";}
|
314
|
+
.icon-shield:before{content:"\f132";}
|
315
|
+
.icon-calendar-empty:before{content:"\f133";}
|
316
|
+
.icon-fire-extinguisher:before{content:"\f134";}
|
317
|
+
.icon-rocket:before{content:"\f135";}
|
318
|
+
.icon-maxcdn:before{content:"\f136";}
|
319
|
+
.icon-chevron-sign-left:before{content:"\f137";}
|
320
|
+
.icon-chevron-sign-right:before{content:"\f138";}
|
321
|
+
.icon-chevron-sign-up:before{content:"\f139";}
|
322
|
+
.icon-chevron-sign-down:before{content:"\f13a";}
|
323
|
+
.icon-html5:before{content:"\f13b";}
|
324
|
+
.icon-css3:before{content:"\f13c";}
|
325
|
+
.icon-anchor:before{content:"\f13d";}
|
326
|
+
.icon-unlock-alt:before{content:"\f13e";}
|
327
|
+
.icon-bullseye:before{content:"\f140";}
|
328
|
+
.icon-ellipsis-horizontal:before{content:"\f141";}
|
329
|
+
.icon-ellipsis-vertical:before{content:"\f142";}
|
330
|
+
.icon-rss-sign:before{content:"\f143";}
|
331
|
+
.icon-play-sign:before{content:"\f144";}
|
332
|
+
.icon-ticket:before{content:"\f145";}
|
333
|
+
.icon-minus-sign-alt:before{content:"\f146";}
|
334
|
+
.icon-check-minus:before{content:"\f147";}
|
335
|
+
.icon-level-up:before{content:"\f148";}
|
336
|
+
.icon-level-down:before{content:"\f149";}
|
337
|
+
.icon-check-sign:before{content:"\f14a";}
|
338
|
+
.icon-edit-sign:before{content:"\f14b";}
|
339
|
+
.icon-external-link-sign:before{content:"\f14c";}
|
340
|
+
.icon-share-sign:before{content:"\f14d";}
|
276
341
|
.icon-large{font-size:1.3333333333333333em;margin-top:-4px;padding-top:3px;margin-bottom:-4px;padding-bottom:3px;vertical-align:middle;}
|
277
342
|
.nav [class^="icon-"],.nav [class*=" icon-"]{vertical-align:inherit;margin-top:-4px;padding-top:3px;margin-bottom:-4px;padding-bottom:3px;}.nav [class^="icon-"].icon-large,.nav [class*=" icon-"].icon-large{vertical-align:-25%;}
|
278
343
|
.nav-pills [class^="icon-"].icon-large,.nav-tabs [class^="icon-"].icon-large,.nav-pills [class*=" icon-"].icon-large,.nav-tabs [class*=" icon-"].icon-large{line-height:.75em;margin-top:-7px;padding-top:5px;margin-bottom:-5px;padding-bottom:4px;}
|
344
|
+
ul.icons-ul{text-indent:-1em;margin-left:2.142857142857143em;}ul.icons-ul>li .icon-li{width:1em;margin-right:0;}
|
279
345
|
.btn [class^="icon-"].pull-left,.btn [class*=" icon-"].pull-left,.btn [class^="icon-"].pull-right,.btn [class*=" icon-"].pull-right{vertical-align:inherit;}
|
280
346
|
.btn [class^="icon-"].icon-large,.btn [class*=" icon-"].icon-large{margin-top:-0.5em;}
|
281
347
|
a [class^="icon-"],a [class*=" icon-"]{cursor:pointer;}
|
282
|
-
ul.icons{text-indent:-1.5em;margin-left:3em;}
|
283
348
|
.icon-glass{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
284
349
|
.icon-music{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
285
350
|
.icon-search{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
@@ -526,6 +591,59 @@ ul.icons{text-indent:-1.5em;margin-left:3em;}
|
|
526
591
|
.icon-spinner{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
527
592
|
.icon-circle{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
528
593
|
.icon-reply{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
529
|
-
.icon-github-alt{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
530
594
|
.icon-folder-close-alt{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
531
595
|
.icon-folder-open-alt{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
596
|
+
.icon-expand-alt{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
597
|
+
.icon-collapse-alt{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
598
|
+
.icon-smile{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
599
|
+
.icon-frown{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
600
|
+
.icon-meh{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
601
|
+
.icon-gamepad{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
602
|
+
.icon-keyboard{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
603
|
+
.icon-flag-alt{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
604
|
+
.icon-flag-checkered{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
605
|
+
.icon-terminal{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
606
|
+
.icon-code{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
607
|
+
.icon-reply-all{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
608
|
+
.icon-mail-reply-all{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
609
|
+
.icon-star-half-full,.icon-star-half-empty{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
610
|
+
.icon-location-arrow{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
611
|
+
.icon-crop{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
612
|
+
.icon-code-fork{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
613
|
+
.icon-unlink{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
614
|
+
.icon-question{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
615
|
+
.icon-info{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
616
|
+
.icon-exclamation{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
617
|
+
.icon-superscript{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
618
|
+
.icon-subscript{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
619
|
+
.icon-eraser{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
620
|
+
.icon-puzzle-piece{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
621
|
+
.icon-microphone{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
622
|
+
.icon-microphone-off{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
623
|
+
.icon-shield{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
624
|
+
.icon-calendar-empty{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
625
|
+
.icon-fire-extinguisher{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
626
|
+
.icon-rocket{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
627
|
+
.icon-maxcdn{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
628
|
+
.icon-chevron-sign-left{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
629
|
+
.icon-chevron-sign-right{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
630
|
+
.icon-chevron-sign-up{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
631
|
+
.icon-chevron-sign-down{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
632
|
+
.icon-html5{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
633
|
+
.icon-css3{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
634
|
+
.icon-anchor{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
635
|
+
.icon-unlock-alt{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
636
|
+
.icon-bullseye{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
637
|
+
.icon-ellipsis-horizontal{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
638
|
+
.icon-ellipsis-vertical{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
639
|
+
.icon-rss-sign{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
640
|
+
.icon-play-sign{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
641
|
+
.icon-ticket{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
642
|
+
.icon-minus-sign-alt{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
643
|
+
.icon-check-minus{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
644
|
+
.icon-level-up{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
645
|
+
.icon-level-down{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
646
|
+
.icon-check-sign{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
647
|
+
.icon-edit-sign{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
648
|
+
.icon-external-link-sign{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
649
|
+
.icon-share-sign{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
@@ -2,8 +2,8 @@
|
|
2
2
|
.clearfix:after{clear:both;}
|
3
3
|
.hide-text{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0;}
|
4
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("
|
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("
|
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("twitter/bootstrap/<%= 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("twitter/bootstrap/<%= asset_path 'twitter/bootstrap/glyphicons-halflings-white.png' %>");}
|
7
7
|
.icon-glass{background-position:0 0;}
|
8
8
|
.icon-music{background-position:-24px 0;}
|
9
9
|
.icon-search{background-position:-48px 0;}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module BadgeLabelHelper
|
2
|
+
def badge(*args)
|
3
|
+
badge_label(:badge, *args)
|
4
|
+
end
|
5
|
+
|
6
|
+
def tag_label(*args)
|
7
|
+
badge_label(:label, *args)
|
8
|
+
end
|
9
|
+
|
10
|
+
private
|
11
|
+
def badge_label(what, value, type = nil)
|
12
|
+
klass = [what]
|
13
|
+
klass << "#{what}-#{type}" if type.present?
|
14
|
+
content_tag :span, value, :class => "#{klass.join(' ')}"
|
15
|
+
end
|
16
|
+
end
|
@@ -15,7 +15,7 @@ module BootstrapFlashHelper
|
|
15
15
|
text = content_tag(:div,
|
16
16
|
content_tag(:button, raw("×"), :class => "close", "data-dismiss" => "alert") +
|
17
17
|
msg.html_safe, :class => "alert fade in alert-#{type}")
|
18
|
-
flash_messages << text if
|
18
|
+
flash_messages << text if msg
|
19
19
|
end
|
20
20
|
end
|
21
21
|
flash_messages.join("\n").html_safe
|
data/app/helpers/modal_helper.rb
CHANGED
@@ -1,42 +1,55 @@
|
|
1
1
|
module ModalHelper
|
2
|
-
|
3
|
-
|
4
|
-
|
2
|
+
|
3
|
+
#modals have a header, a body, a footer for options.
|
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])
|
9
|
+
end
|
5
10
|
end
|
6
11
|
|
7
|
-
def modal_header(options = {},
|
8
|
-
|
9
|
-
|
10
|
-
|
12
|
+
def modal_header(options = {}, &block)
|
13
|
+
content_tag :div, :class => 'modal-header' do
|
14
|
+
if options[:show_close]
|
15
|
+
close_button(options[:dismiss]) +
|
16
|
+
content_tag(:h3, options[:title], &block)
|
17
|
+
else
|
18
|
+
content_tag(:h3, options[:title], &block)
|
19
|
+
end
|
11
20
|
end
|
12
21
|
end
|
13
22
|
|
14
|
-
def modal_body(options = {},
|
15
|
-
|
16
|
-
content_tag :div, nil, options.merge(default_options), escape, &block
|
23
|
+
def modal_body(options = {}, &block)
|
24
|
+
content_tag :div, options, :class => 'modal-body', &block
|
17
25
|
end
|
18
26
|
|
19
|
-
def modal_footer(options = {},
|
20
|
-
|
21
|
-
|
27
|
+
def modal_footer(options = {}, &block)
|
28
|
+
content_tag :div, options, :class => 'modal-footer', &block
|
29
|
+
end
|
30
|
+
|
31
|
+
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}\">×</button>")
|
22
34
|
end
|
23
35
|
|
24
36
|
def modal_toggle(content_or_options = nil, options = {}, &block)
|
25
37
|
if block_given?
|
26
38
|
options = content_or_options if content_or_options.is_a?(Hash)
|
27
|
-
default_options = {:class => 'btn', "data-toggle" => "modal", "href" => options[:dialog]}.merge(options)
|
39
|
+
default_options = { :class => 'btn', "data-toggle" => "modal", "href" => options[:dialog] }.merge(options)
|
28
40
|
|
29
41
|
content_tag :a, nil, default_options, true, &block
|
30
42
|
else
|
31
|
-
default_options = {:class => 'btn', "data-toggle" => "modal", "href" => options[:dialog]}.merge(options)
|
43
|
+
default_options = { :class => 'btn', "data-toggle" => "modal", "href" => options[:dialog] }.merge(options)
|
32
44
|
content_tag :a, content_or_options, default_options, true
|
33
45
|
end
|
34
46
|
end
|
35
47
|
|
36
48
|
def modal_cancel_button content, options = {}
|
37
|
-
default_options = {:class => "btn bootstrap-modal-cancel-button"}
|
49
|
+
default_options = { :class => "btn bootstrap-modal-cancel-button" }
|
38
50
|
|
39
51
|
content_tag_string "a", content, default_options.merge(options)
|
40
52
|
end
|
53
|
+
|
41
54
|
end
|
42
55
|
|
@@ -0,0 +1,189 @@
|
|
1
|
+
#Credit for this goes to https://github.com/julescopeland/Rails-Bootstrap-Navbar
|
2
|
+
module NavbarHelper
|
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
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
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)
|
16
|
+
end
|
17
|
+
|
18
|
+
def menu_item(name, path="#", *args)
|
19
|
+
options = args.extract_options!
|
20
|
+
content_tag :li, :class => is_active?(path) do
|
21
|
+
link_to name, path, options
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
def drop_down(name)
|
26
|
+
content_tag :li, :class => "dropdown" do
|
27
|
+
drop_down_link(name) + drop_down_list { yield }
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
def drop_down_with_submenu(name, &block)
|
32
|
+
content_tag :li, :class => "dropdown" do
|
33
|
+
drop_down_link(name) + drop_down_sublist(&block)
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
def drop_down_sublist(&block)
|
38
|
+
content_tag :ul, :class => "dropdown-menu", &block
|
39
|
+
end
|
40
|
+
|
41
|
+
def drop_down_submenu(name, &block)
|
42
|
+
content_tag :li, :class => "dropdown-submenu" do
|
43
|
+
link_to(name, "") + drop_down_list(&block)
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
def drop_down_divider
|
48
|
+
content_tag :li, "", :class => "divider"
|
49
|
+
end
|
50
|
+
|
51
|
+
def drop_down_header(text)
|
52
|
+
content_tag :li, text, :class => "nav-header"
|
53
|
+
end
|
54
|
+
|
55
|
+
def menu_divider
|
56
|
+
content_tag :li, "", :class => "divider-vertical"
|
57
|
+
end
|
58
|
+
|
59
|
+
def menu_text(text=nil, options={}, &block)
|
60
|
+
pull = options.delete(:pull)
|
61
|
+
pull_class = pull.present? ? "pull-#{pull.to_s}" : nil
|
62
|
+
options.append_merge!(:class, pull_class)
|
63
|
+
options.append_merge!(:class, "navbar-text")
|
64
|
+
content_tag :p, options do
|
65
|
+
text || yield
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
# Returns current url or path state (useful for buttons).
|
70
|
+
# Example:
|
71
|
+
# # Assume we'r currently at blog/categories/test
|
72
|
+
# uri_state('/blog/categories/test') # :active
|
73
|
+
# uri_state('/blog/categories') # :chosen
|
74
|
+
# uri_state('/blog/categories/test/3') # :inactive
|
75
|
+
def uri_state(uri)
|
76
|
+
root_url = request.host_with_port + '/'
|
77
|
+
root = uri == '/' || uri == root_url
|
78
|
+
|
79
|
+
request_uri = if uri.start_with?(root_url)
|
80
|
+
request.url
|
81
|
+
else
|
82
|
+
request.path
|
83
|
+
end
|
84
|
+
|
85
|
+
if uri == request_uri
|
86
|
+
:active
|
87
|
+
else
|
88
|
+
if request_uri.start_with?(uri) and not(root)
|
89
|
+
:chosen
|
90
|
+
else
|
91
|
+
:inactive
|
92
|
+
end
|
93
|
+
end
|
94
|
+
end
|
95
|
+
|
96
|
+
private
|
97
|
+
|
98
|
+
def nav_bar_div(options, &block)
|
99
|
+
|
100
|
+
position = "static-#{options[:static].to_s}" if options[:static]
|
101
|
+
position = "fixed-#{options[:fixed].to_s}" if options[:fixed]
|
102
|
+
inverse = (options[:inverse].present? && options[:inverse] == true) ? true : false
|
103
|
+
|
104
|
+
content_tag :div, :class => nav_bar_css_class(position, inverse) do
|
105
|
+
yield
|
106
|
+
end
|
107
|
+
end
|
108
|
+
|
109
|
+
def navbar_inner_div(&block)
|
110
|
+
content_tag :div, :class => "navbar-inner" do
|
111
|
+
yield
|
112
|
+
end
|
113
|
+
end
|
114
|
+
|
115
|
+
def container_div(brand, brand_link, responsive, fluid, &block)
|
116
|
+
content_tag :div, :class => "container#{"-fluid" if fluid}" do
|
117
|
+
container_div_with_block(brand, brand_link, responsive, &block)
|
118
|
+
end
|
119
|
+
end
|
120
|
+
|
121
|
+
def container_div_with_block(brand, brand_link, responsive, &block)
|
122
|
+
output = []
|
123
|
+
if responsive == true
|
124
|
+
output << responsive_button
|
125
|
+
output << brand_link(brand, brand_link)
|
126
|
+
output << responsive_div { capture(&block) }
|
127
|
+
else
|
128
|
+
output << brand_link(brand, brand_link)
|
129
|
+
output << capture(&block)
|
130
|
+
end
|
131
|
+
output.join("\n").html_safe
|
132
|
+
end
|
133
|
+
|
134
|
+
def nav_bar_css_class(position, inverse = false)
|
135
|
+
css_class = ["navbar"]
|
136
|
+
css_class << "navbar-#{position}" if position.present?
|
137
|
+
css_class << "navbar-inverse" if inverse
|
138
|
+
css_class.join(" ")
|
139
|
+
end
|
140
|
+
|
141
|
+
def brand_link(name, url)
|
142
|
+
return "" if name.blank?
|
143
|
+
url ||= root_url
|
144
|
+
link_to(name, url, :class => "brand")
|
145
|
+
end
|
146
|
+
|
147
|
+
def responsive_button
|
148
|
+
%{<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
|
149
|
+
<span class="icon-bar"></span>
|
150
|
+
<span class="icon-bar"></span>
|
151
|
+
<span class="icon-bar"></span>
|
152
|
+
</a>}
|
153
|
+
end
|
154
|
+
|
155
|
+
def responsive_div(&block)
|
156
|
+
content_tag(:div, :class => "nav-collapse", &block)
|
157
|
+
end
|
158
|
+
|
159
|
+
def is_active?(path)
|
160
|
+
"active" if uri_state(path).in?(:active, :chosen)
|
161
|
+
end
|
162
|
+
|
163
|
+
def name_and_caret(name)
|
164
|
+
"#{name} #{content_tag(:b, :class => "caret") {}}".html_safe
|
165
|
+
end
|
166
|
+
|
167
|
+
def drop_down_link(name)
|
168
|
+
link_to(name_and_caret(name), "#", :class => "dropdown-toggle", "data-toggle" => "dropdown")
|
169
|
+
end
|
170
|
+
|
171
|
+
def drop_down_list(&block)
|
172
|
+
content_tag :ul, :class => "dropdown-menu", &block
|
173
|
+
end
|
174
|
+
end
|
175
|
+
|
176
|
+
class Hash
|
177
|
+
# appends a string to a hash key's value after a space character (Good for merging CSS classes in options hashes)
|
178
|
+
def append_merge!(key, value)
|
179
|
+
# just return self if value is blank
|
180
|
+
return self if value.blank?
|
181
|
+
|
182
|
+
current_value = self[key]
|
183
|
+
# just merge if it doesn't already have that key
|
184
|
+
self[key] = value and return if current_value.blank?
|
185
|
+
# raise error if we're trying to merge into something that isn't a string
|
186
|
+
raise ArgumentError, "Can only merge strings" unless current_value.is_a?(String)
|
187
|
+
self[key] = [current_value, value].compact.join(" ")
|
188
|
+
end
|
189
|
+
end
|