rvnstat 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (271) hide show
  1. checksums.yaml +7 -0
  2. data/._README.md +0 -0
  3. data/._ss.png +0 -0
  4. data/.gitignore +17 -0
  5. data/Gemfile +6 -0
  6. data/LICENSE.txt +22 -0
  7. data/README.md +34 -0
  8. data/Rakefile +1 -0
  9. data/bin/._rvnstat +0 -0
  10. data/bin/rvnstat +9 -0
  11. data/config.ru +4 -0
  12. data/config.yml +3 -0
  13. data/lib/._app.rb +0 -0
  14. data/lib/._config.rb +0 -0
  15. data/lib/._require.rb +0 -0
  16. data/lib/._rvnstat.rb +0 -0
  17. data/lib/._vnstat.rb +0 -0
  18. data/lib/app.rb +102 -0
  19. data/lib/config.rb +13 -0
  20. data/lib/require.rb +10 -0
  21. data/lib/rvnstat.rb +5 -0
  22. data/lib/rvnstat/._version.rb +0 -0
  23. data/lib/rvnstat/version.rb +3 -0
  24. data/lib/vnstat.rb +74 -0
  25. data/public/CNAME +1 -0
  26. data/public/CONTRIBUTING.md +192 -0
  27. data/public/Gruntfile.js +418 -0
  28. data/public/LICENSE +21 -0
  29. data/public/README.md +173 -0
  30. data/public/_config.yml +35 -0
  31. data/public/bower.json +24 -0
  32. data/public/browserstack.json +44 -0
  33. data/public/composer.json +25 -0
  34. data/public/dist/css/._custom.css +0 -0
  35. data/public/dist/css/bootstrap-theme.css +347 -0
  36. data/public/dist/css/bootstrap-theme.css.map +1 -0
  37. data/public/dist/css/bootstrap-theme.min.css +7 -0
  38. data/public/dist/css/bootstrap.css +5831 -0
  39. data/public/dist/css/bootstrap.css.map +1 -0
  40. data/public/dist/css/bootstrap.min.css +7 -0
  41. data/public/dist/css/custom.css +20 -0
  42. data/public/dist/fonts/glyphicons-halflings-regular.eot +0 -0
  43. data/public/dist/fonts/glyphicons-halflings-regular.svg +229 -0
  44. data/public/dist/fonts/glyphicons-halflings-regular.ttf +0 -0
  45. data/public/dist/fonts/glyphicons-halflings-regular.woff +0 -0
  46. data/public/dist/js/bootstrap.js +1951 -0
  47. data/public/dist/js/bootstrap.min.js +6 -0
  48. data/public/docs/LICENSE +319 -0
  49. data/public/docs/_data/glyphicons.yml +203 -0
  50. data/public/docs/_data/showcase.yml +19 -0
  51. data/public/docs/_includes/ads.html +1 -0
  52. data/public/docs/_includes/customizer-variables.html +1690 -0
  53. data/public/docs/_includes/footer.html +70 -0
  54. data/public/docs/_includes/header.html +42 -0
  55. data/public/docs/_includes/nav-about.html +9 -0
  56. data/public/docs/_includes/nav-components.html +138 -0
  57. data/public/docs/_includes/nav-css.html +127 -0
  58. data/public/docs/_includes/nav-customize.html +46 -0
  59. data/public/docs/_includes/nav-getting-started.html +62 -0
  60. data/public/docs/_includes/nav-javascript.html +89 -0
  61. data/public/docs/_includes/nav-main.html +36 -0
  62. data/public/docs/_includes/nav-migration.html +12 -0
  63. data/public/docs/_includes/social-buttons.html +16 -0
  64. data/public/docs/_layouts/default.html +55 -0
  65. data/public/docs/_layouts/home.html +18 -0
  66. data/public/docs/about.html +149 -0
  67. data/public/docs/assets/css/docs.css +1394 -0
  68. data/public/docs/assets/css/docs.min.css +6 -0
  69. data/public/docs/assets/css/pygments-manni.css +66 -0
  70. data/public/docs/assets/ico/apple-touch-icon-144-precomposed.png +0 -0
  71. data/public/docs/assets/ico/favicon.ico +0 -0
  72. data/public/docs/assets/img/components.png +0 -0
  73. data/public/docs/assets/img/devices.png +0 -0
  74. data/public/docs/assets/img/sass-less.png +0 -0
  75. data/public/docs/assets/js/application.js +101 -0
  76. data/public/docs/assets/js/customize.min.js +49 -0
  77. data/public/docs/assets/js/customizer.js +348 -0
  78. data/public/docs/assets/js/docs.min.js +16 -0
  79. data/public/docs/assets/js/ie8-responsive-file-warning.js +12 -0
  80. data/public/docs/assets/js/raw-files.min.js +8 -0
  81. data/public/docs/assets/js/vendor/blob.js +166 -0
  82. data/public/docs/assets/js/vendor/filesaver.js +236 -0
  83. data/public/docs/assets/js/vendor/holder.js +645 -0
  84. data/public/docs/assets/js/vendor/jszip.js +1474 -0
  85. data/public/docs/assets/js/vendor/less.min.js +16 -0
  86. data/public/docs/assets/js/vendor/uglify.min.js +14 -0
  87. data/public/docs/components.html +3001 -0
  88. data/public/docs/css.html +3346 -0
  89. data/public/docs/customize.html +356 -0
  90. data/public/docs/customizer-nav.jade +15 -0
  91. data/public/docs/customizer-variables.jade +21 -0
  92. data/public/docs/dist/css/bootstrap-theme.css.map +1 -0
  93. data/public/docs/dist/css/bootstrap-theme.min.css +7 -0
  94. data/public/docs/dist/css/bootstrap.css.map +1 -0
  95. data/public/docs/dist/css/bootstrap.min.css +7 -0
  96. data/public/docs/dist/fonts/glyphicons-halflings-regular.eot +0 -0
  97. data/public/docs/dist/fonts/glyphicons-halflings-regular.svg +229 -0
  98. data/public/docs/dist/fonts/glyphicons-halflings-regular.ttf +0 -0
  99. data/public/docs/dist/fonts/glyphicons-halflings-regular.woff +0 -0
  100. data/public/docs/dist/js/bootstrap.min.js +7 -0
  101. data/public/docs/examples/blog/blog.css +168 -0
  102. data/public/docs/examples/blog/index.html +171 -0
  103. data/public/docs/examples/carousel/carousel.css +148 -0
  104. data/public/docs/examples/carousel/index.html +206 -0
  105. data/public/docs/examples/cover/cover.css +161 -0
  106. data/public/docs/examples/cover/index.html +75 -0
  107. data/public/docs/examples/dashboard/dashboard.css +93 -0
  108. data/public/docs/examples/dashboard/index.html +243 -0
  109. data/public/docs/examples/grid/grid.css +28 -0
  110. data/public/docs/examples/grid/index.html +152 -0
  111. data/public/docs/examples/jumbotron-narrow/index.html +82 -0
  112. data/public/docs/examples/jumbotron-narrow/jumbotron-narrow.css +79 -0
  113. data/public/docs/examples/jumbotron/index.html +99 -0
  114. data/public/docs/examples/jumbotron/jumbotron.css +5 -0
  115. data/public/docs/examples/justified-nav/index.html +84 -0
  116. data/public/docs/examples/justified-nav/justified-nav.css +88 -0
  117. data/public/docs/examples/navbar-fixed-top/index.html +91 -0
  118. data/public/docs/examples/navbar-fixed-top/navbar-fixed-top.css +4 -0
  119. data/public/docs/examples/navbar-static-top/index.html +92 -0
  120. data/public/docs/examples/navbar-static-top/navbar-static-top.css +7 -0
  121. data/public/docs/examples/navbar/index.html +90 -0
  122. data/public/docs/examples/navbar/navbar.css +8 -0
  123. data/public/docs/examples/non-responsive/index.html +105 -0
  124. data/public/docs/examples/non-responsive/non-responsive.css +120 -0
  125. data/public/docs/examples/offcanvas/index.html +130 -0
  126. data/public/docs/examples/offcanvas/offcanvas.css +51 -0
  127. data/public/docs/examples/offcanvas/offcanvas.js +5 -0
  128. data/public/docs/examples/screenshots/blog.jpg +0 -0
  129. data/public/docs/examples/screenshots/carousel.jpg +0 -0
  130. data/public/docs/examples/screenshots/cover.jpg +0 -0
  131. data/public/docs/examples/screenshots/dashboard.jpg +0 -0
  132. data/public/docs/examples/screenshots/grid.jpg +0 -0
  133. data/public/docs/examples/screenshots/jumbotron-narrow.jpg +0 -0
  134. data/public/docs/examples/screenshots/jumbotron.jpg +0 -0
  135. data/public/docs/examples/screenshots/justified-nav.jpg +0 -0
  136. data/public/docs/examples/screenshots/navbar-fixed.jpg +0 -0
  137. data/public/docs/examples/screenshots/navbar-static.jpg +0 -0
  138. data/public/docs/examples/screenshots/navbar.jpg +0 -0
  139. data/public/docs/examples/screenshots/non-responsive.jpg +0 -0
  140. data/public/docs/examples/screenshots/offcanvas.jpg +0 -0
  141. data/public/docs/examples/screenshots/sign-in.jpg +0 -0
  142. data/public/docs/examples/screenshots/starter-template.jpg +0 -0
  143. data/public/docs/examples/screenshots/sticky-footer-navbar.jpg +0 -0
  144. data/public/docs/examples/screenshots/sticky-footer.jpg +0 -0
  145. data/public/docs/examples/screenshots/theme.jpg +0 -0
  146. data/public/docs/examples/signin/index.html +50 -0
  147. data/public/docs/examples/signin/signin.css +40 -0
  148. data/public/docs/examples/starter-template/index.html +68 -0
  149. data/public/docs/examples/starter-template/starter-template.css +7 -0
  150. data/public/docs/examples/sticky-footer-navbar/index.html +91 -0
  151. data/public/docs/examples/sticky-footer-navbar/sticky-footer-navbar.css +45 -0
  152. data/public/docs/examples/sticky-footer/index.html +55 -0
  153. data/public/docs/examples/sticky-footer/sticky-footer.css +38 -0
  154. data/public/docs/examples/theme/index.html +384 -0
  155. data/public/docs/examples/theme/theme.css +14 -0
  156. data/public/docs/getting-started.html +773 -0
  157. data/public/docs/grunt/bs-glyphicons-data-generator.js +33 -0
  158. data/public/docs/grunt/bs-lessdoc-parser.js +236 -0
  159. data/public/docs/grunt/bs-raw-files-generator.js +31 -0
  160. data/public/docs/index.html +72 -0
  161. data/public/docs/javascript.html +2141 -0
  162. data/public/docs/migration.html +423 -0
  163. data/public/fonts/glyphicons-halflings-regular.eot +0 -0
  164. data/public/fonts/glyphicons-halflings-regular.svg +229 -0
  165. data/public/fonts/glyphicons-halflings-regular.ttf +0 -0
  166. data/public/fonts/glyphicons-halflings-regular.woff +0 -0
  167. data/public/js/._exporting.js +0 -0
  168. data/public/js/._highcharts-all.js +0 -0
  169. data/public/js/._jquery-min.js +0 -0
  170. data/public/js/.jscs.json +15 -0
  171. data/public/js/.jshintrc +14 -0
  172. data/public/js/affix.js +137 -0
  173. data/public/js/alert.js +88 -0
  174. data/public/js/bootstrap.min.js +6 -0
  175. data/public/js/button.js +107 -0
  176. data/public/js/carousel.js +205 -0
  177. data/public/js/collapse.js +170 -0
  178. data/public/js/dropdown.js +147 -0
  179. data/public/js/highcharts.js +294 -0
  180. data/public/js/jquery-1.11.0.min.js +4 -0
  181. data/public/js/modal.js +243 -0
  182. data/public/js/popover.js +110 -0
  183. data/public/js/scrollspy.js +153 -0
  184. data/public/js/tab.js +125 -0
  185. data/public/js/tests/index.html +54 -0
  186. data/public/js/tests/unit/affix.js +50 -0
  187. data/public/js/tests/unit/alert.js +62 -0
  188. data/public/js/tests/unit/button.js +122 -0
  189. data/public/js/tests/unit/carousel.js +110 -0
  190. data/public/js/tests/unit/collapse.js +164 -0
  191. data/public/js/tests/unit/dropdown.js +218 -0
  192. data/public/js/tests/unit/modal.js +195 -0
  193. data/public/js/tests/unit/phantom.js +69 -0
  194. data/public/js/tests/unit/popover.js +133 -0
  195. data/public/js/tests/unit/scrollspy.js +36 -0
  196. data/public/js/tests/unit/tab.js +86 -0
  197. data/public/js/tests/unit/tooltip.js +432 -0
  198. data/public/js/tests/vendor/jquery.js +6 -0
  199. data/public/js/tests/vendor/qunit.css +245 -0
  200. data/public/js/tests/vendor/qunit.js +2210 -0
  201. data/public/js/tooltip.js +399 -0
  202. data/public/js/transition.js +48 -0
  203. data/public/less/.csscomb.json +297 -0
  204. data/public/less/.csslintrc +19 -0
  205. data/public/less/alerts.less +67 -0
  206. data/public/less/badges.less +55 -0
  207. data/public/less/bootstrap.less +49 -0
  208. data/public/less/breadcrumbs.less +26 -0
  209. data/public/less/button-groups.less +226 -0
  210. data/public/less/buttons.less +155 -0
  211. data/public/less/carousel.less +232 -0
  212. data/public/less/close.less +33 -0
  213. data/public/less/code.less +63 -0
  214. data/public/less/component-animations.less +29 -0
  215. data/public/less/dropdowns.less +213 -0
  216. data/public/less/forms.less +419 -0
  217. data/public/less/glyphicons.less +233 -0
  218. data/public/less/grid.less +100 -0
  219. data/public/less/input-groups.less +157 -0
  220. data/public/less/jumbotron.less +44 -0
  221. data/public/less/labels.less +64 -0
  222. data/public/less/list-group.less +110 -0
  223. data/public/less/media.less +56 -0
  224. data/public/less/mixins.less +926 -0
  225. data/public/less/modals.less +138 -0
  226. data/public/less/navbar.less +616 -0
  227. data/public/less/navs.less +242 -0
  228. data/public/less/normalize.less +423 -0
  229. data/public/less/pager.less +55 -0
  230. data/public/less/pagination.less +88 -0
  231. data/public/less/panels.less +230 -0
  232. data/public/less/popovers.less +133 -0
  233. data/public/less/print.less +101 -0
  234. data/public/less/progress-bars.less +80 -0
  235. data/public/less/responsive-utilities.less +93 -0
  236. data/public/less/scaffolding.less +134 -0
  237. data/public/less/tables.less +233 -0
  238. data/public/less/theme.less +247 -0
  239. data/public/less/thumbnails.less +36 -0
  240. data/public/less/tooltip.less +95 -0
  241. data/public/less/type.less +296 -0
  242. data/public/less/utilities.less +56 -0
  243. data/public/less/variables.less +827 -0
  244. data/public/less/wells.less +29 -0
  245. data/public/package.json +71 -0
  246. data/public/test-infra/README.md +100 -0
  247. data/public/test-infra/npm-shrinkwrap.canonical.json +1 -0
  248. data/public/test-infra/requirements.txt +1 -0
  249. data/public/test-infra/s3_cache.py +107 -0
  250. data/public/test-infra/sauce_browsers.yml +83 -0
  251. data/public/test-infra/shrinkwrap.js +24 -0
  252. data/public/test-infra/uncached-npm-install.sh +4 -0
  253. data/rvnstat.gemspec +26 -0
  254. data/rvnstat.yml +3 -0
  255. data/ss.png +0 -0
  256. data/untitled.txt +0 -0
  257. data/views/._hourly.erb +0 -0
  258. data/views/._index.erb +0 -0
  259. data/views/._live_traffic.erb +0 -0
  260. data/views/._monthly.erb +0 -0
  261. data/views/._top_ten.erb +0 -0
  262. data/views/day_detail.erb +44 -0
  263. data/views/day_total.erb +42 -0
  264. data/views/graph_test.erb +2 -0
  265. data/views/hourly.erb +19 -0
  266. data/views/index.erb +71 -0
  267. data/views/layout.erb +28 -0
  268. data/views/live_traffic.erb +57 -0
  269. data/views/monthly.erb +21 -0
  270. data/views/top_ten.erb +21 -0
  271. metadata +385 -0
@@ -0,0 +1,29 @@
1
+ //
2
+ // Component animations
3
+ // --------------------------------------------------
4
+
5
+ // Heads up!
6
+ //
7
+ // We don't use the `.opacity()` mixin here since it causes a bug with text
8
+ // fields in IE7-8. Source: https://github.com/twitter/bootstrap/pull/3552.
9
+
10
+ .fade {
11
+ opacity: 0;
12
+ .transition(opacity .15s linear);
13
+ &.in {
14
+ opacity: 1;
15
+ }
16
+ }
17
+
18
+ .collapse {
19
+ display: none;
20
+ &.in {
21
+ display: block;
22
+ }
23
+ }
24
+ .collapsing {
25
+ position: relative;
26
+ height: 0;
27
+ overflow: hidden;
28
+ .transition(height .35s ease);
29
+ }
@@ -0,0 +1,213 @@
1
+ //
2
+ // Dropdown menus
3
+ // --------------------------------------------------
4
+
5
+
6
+ // Dropdown arrow/caret
7
+ .caret {
8
+ display: inline-block;
9
+ width: 0;
10
+ height: 0;
11
+ margin-left: 2px;
12
+ vertical-align: middle;
13
+ border-top: @caret-width-base solid;
14
+ border-right: @caret-width-base solid transparent;
15
+ border-left: @caret-width-base solid transparent;
16
+ }
17
+
18
+ // The dropdown wrapper (div)
19
+ .dropdown {
20
+ position: relative;
21
+ }
22
+
23
+ // Prevent the focus on the dropdown toggle when closing dropdowns
24
+ .dropdown-toggle:focus {
25
+ outline: 0;
26
+ }
27
+
28
+ // The dropdown menu (ul)
29
+ .dropdown-menu {
30
+ position: absolute;
31
+ top: 100%;
32
+ left: 0;
33
+ z-index: @zindex-dropdown;
34
+ display: none; // none by default, but block on "open" of the menu
35
+ float: left;
36
+ min-width: 160px;
37
+ padding: 5px 0;
38
+ margin: 2px 0 0; // override default ul
39
+ list-style: none;
40
+ font-size: @font-size-base;
41
+ background-color: @dropdown-bg;
42
+ border: 1px solid @dropdown-fallback-border; // IE8 fallback
43
+ border: 1px solid @dropdown-border;
44
+ border-radius: @border-radius-base;
45
+ .box-shadow(0 6px 12px rgba(0,0,0,.175));
46
+ background-clip: padding-box;
47
+
48
+ // Aligns the dropdown menu to right
49
+ //
50
+ // Deprecated as of 3.1.0 in favor of `.dropdown-menu-[dir]`
51
+ &.pull-right {
52
+ right: 0;
53
+ left: auto;
54
+ }
55
+
56
+ // Dividers (basically an hr) within the dropdown
57
+ .divider {
58
+ .nav-divider(@dropdown-divider-bg);
59
+ }
60
+
61
+ // Links within the dropdown menu
62
+ > li > a {
63
+ display: block;
64
+ padding: 3px 20px;
65
+ clear: both;
66
+ font-weight: normal;
67
+ line-height: @line-height-base;
68
+ color: @dropdown-link-color;
69
+ white-space: nowrap; // prevent links from randomly breaking onto new lines
70
+ }
71
+ }
72
+
73
+ // Hover/Focus state
74
+ .dropdown-menu > li > a {
75
+ &:hover,
76
+ &:focus {
77
+ text-decoration: none;
78
+ color: @dropdown-link-hover-color;
79
+ background-color: @dropdown-link-hover-bg;
80
+ }
81
+ }
82
+
83
+ // Active state
84
+ .dropdown-menu > .active > a {
85
+ &,
86
+ &:hover,
87
+ &:focus {
88
+ color: @dropdown-link-active-color;
89
+ text-decoration: none;
90
+ outline: 0;
91
+ background-color: @dropdown-link-active-bg;
92
+ }
93
+ }
94
+
95
+ // Disabled state
96
+ //
97
+ // Gray out text and ensure the hover/focus state remains gray
98
+
99
+ .dropdown-menu > .disabled > a {
100
+ &,
101
+ &:hover,
102
+ &:focus {
103
+ color: @dropdown-link-disabled-color;
104
+ }
105
+ }
106
+ // Nuke hover/focus effects
107
+ .dropdown-menu > .disabled > a {
108
+ &:hover,
109
+ &:focus {
110
+ text-decoration: none;
111
+ background-color: transparent;
112
+ background-image: none; // Remove CSS gradient
113
+ .reset-filter();
114
+ cursor: not-allowed;
115
+ }
116
+ }
117
+
118
+ // Open state for the dropdown
119
+ .open {
120
+ // Show the menu
121
+ > .dropdown-menu {
122
+ display: block;
123
+ }
124
+
125
+ // Remove the outline when :focus is triggered
126
+ > a {
127
+ outline: 0;
128
+ }
129
+ }
130
+
131
+ // Menu positioning
132
+ //
133
+ // Add extra class to `.dropdown-menu` to flip the alignment of the dropdown
134
+ // menu with the parent.
135
+ .dropdown-menu-right {
136
+ left: auto; // Reset the default from `.dropdown-menu`
137
+ right: 0;
138
+ }
139
+ // With v3, we enabled auto-flipping if you have a dropdown within a right
140
+ // aligned nav component. To enable the undoing of that, we provide an override
141
+ // to restore the default dropdown menu alignment.
142
+ //
143
+ // This is only for left-aligning a dropdown menu within a `.navbar-right` or
144
+ // `.pull-right` nav component.
145
+ .dropdown-menu-left {
146
+ left: 0;
147
+ right: auto;
148
+ }
149
+
150
+ // Dropdown section headers
151
+ .dropdown-header {
152
+ display: block;
153
+ padding: 3px 20px;
154
+ font-size: @font-size-small;
155
+ line-height: @line-height-base;
156
+ color: @dropdown-header-color;
157
+ }
158
+
159
+ // Backdrop to catch body clicks on mobile, etc.
160
+ .dropdown-backdrop {
161
+ position: fixed;
162
+ left: 0;
163
+ right: 0;
164
+ bottom: 0;
165
+ top: 0;
166
+ z-index: (@zindex-dropdown - 10);
167
+ }
168
+
169
+ // Right aligned dropdowns
170
+ .pull-right > .dropdown-menu {
171
+ right: 0;
172
+ left: auto;
173
+ }
174
+
175
+ // Allow for dropdowns to go bottom up (aka, dropup-menu)
176
+ //
177
+ // Just add .dropup after the standard .dropdown class and you're set, bro.
178
+ // TODO: abstract this so that the navbar fixed styles are not placed here?
179
+
180
+ .dropup,
181
+ .navbar-fixed-bottom .dropdown {
182
+ // Reverse the caret
183
+ .caret {
184
+ border-top: 0;
185
+ border-bottom: @caret-width-base solid;
186
+ content: "";
187
+ }
188
+ // Different positioning for bottom up menu
189
+ .dropdown-menu {
190
+ top: auto;
191
+ bottom: 100%;
192
+ margin-bottom: 1px;
193
+ }
194
+ }
195
+
196
+
197
+ // Component alignment
198
+ //
199
+ // Reiterate per navbar.less and the modified component alignment there.
200
+
201
+ @media (min-width: @grid-float-breakpoint) {
202
+ .navbar-right {
203
+ .dropdown-menu {
204
+ .dropdown-menu-right();
205
+ }
206
+ // Necessary for overrides of the default right aligned menu.
207
+ // Will remove come v4 in all likelihood.
208
+ .dropdown-menu-left {
209
+ .dropdown-menu-left();
210
+ }
211
+ }
212
+ }
213
+
@@ -0,0 +1,419 @@
1
+ //
2
+ // Forms
3
+ // --------------------------------------------------
4
+
5
+
6
+ // Normalize non-controls
7
+ //
8
+ // Restyle and baseline non-control form elements.
9
+
10
+ fieldset {
11
+ padding: 0;
12
+ margin: 0;
13
+ border: 0;
14
+ // Chrome and Firefox set a `min-width: -webkit-min-content;` on fieldsets,
15
+ // so we reset that to ensure it behaves more like a standard block element.
16
+ // See https://github.com/twbs/bootstrap/issues/12359.
17
+ min-width: 0;
18
+ }
19
+
20
+ legend {
21
+ display: block;
22
+ width: 100%;
23
+ padding: 0;
24
+ margin-bottom: @line-height-computed;
25
+ font-size: (@font-size-base * 1.5);
26
+ line-height: inherit;
27
+ color: @legend-color;
28
+ border: 0;
29
+ border-bottom: 1px solid @legend-border-color;
30
+ }
31
+
32
+ label {
33
+ display: inline-block;
34
+ margin-bottom: 5px;
35
+ font-weight: bold;
36
+ }
37
+
38
+
39
+ // Normalize form controls
40
+ //
41
+ // While most of our form styles require extra classes, some basic normalization
42
+ // is required to ensure optimum display with or without those classes to better
43
+ // address browser inconsistencies.
44
+
45
+ // Override content-box in Normalize (* isn't specific enough)
46
+ input[type="search"] {
47
+ .box-sizing(border-box);
48
+ }
49
+
50
+ // Position radios and checkboxes better
51
+ input[type="radio"],
52
+ input[type="checkbox"] {
53
+ margin: 4px 0 0;
54
+ margin-top: 1px \9; /* IE8-9 */
55
+ line-height: normal;
56
+ }
57
+
58
+ // Set the height of file controls to match text inputs
59
+ input[type="file"] {
60
+ display: block;
61
+ }
62
+
63
+ // Make range inputs behave like textual form controls
64
+ input[type="range"] {
65
+ display: block;
66
+ width: 100%;
67
+ }
68
+
69
+ // Make multiple select elements height not fixed
70
+ select[multiple],
71
+ select[size] {
72
+ height: auto;
73
+ }
74
+
75
+ // Focus for file, radio, and checkbox
76
+ input[type="file"]:focus,
77
+ input[type="radio"]:focus,
78
+ input[type="checkbox"]:focus {
79
+ .tab-focus();
80
+ }
81
+
82
+ // Adjust output element
83
+ output {
84
+ display: block;
85
+ padding-top: (@padding-base-vertical + 1);
86
+ font-size: @font-size-base;
87
+ line-height: @line-height-base;
88
+ color: @input-color;
89
+ }
90
+
91
+
92
+ // Common form controls
93
+ //
94
+ // Shared size and type resets for form controls. Apply `.form-control` to any
95
+ // of the following form controls:
96
+ //
97
+ // select
98
+ // textarea
99
+ // input[type="text"]
100
+ // input[type="password"]
101
+ // input[type="datetime"]
102
+ // input[type="datetime-local"]
103
+ // input[type="date"]
104
+ // input[type="month"]
105
+ // input[type="time"]
106
+ // input[type="week"]
107
+ // input[type="number"]
108
+ // input[type="email"]
109
+ // input[type="url"]
110
+ // input[type="search"]
111
+ // input[type="tel"]
112
+ // input[type="color"]
113
+
114
+ .form-control {
115
+ display: block;
116
+ width: 100%;
117
+ height: @input-height-base; // Make inputs at least the height of their button counterpart (base line-height + padding + border)
118
+ padding: @padding-base-vertical @padding-base-horizontal;
119
+ font-size: @font-size-base;
120
+ line-height: @line-height-base;
121
+ color: @input-color;
122
+ background-color: @input-bg;
123
+ background-image: none; // Reset unusual Firefox-on-Android default style; see https://github.com/necolas/normalize.css/issues/214
124
+ border: 1px solid @input-border;
125
+ border-radius: @input-border-radius;
126
+ .box-shadow(inset 0 1px 1px rgba(0,0,0,.075));
127
+ .transition(~"border-color ease-in-out .15s, box-shadow ease-in-out .15s");
128
+
129
+ // Customize the `:focus` state to imitate native WebKit styles.
130
+ .form-control-focus();
131
+
132
+ // Placeholder
133
+ .placeholder();
134
+
135
+ // Disabled and read-only inputs
136
+ // Note: HTML5 says that controls under a fieldset > legend:first-child won't
137
+ // be disabled if the fieldset is disabled. Due to implementation difficulty,
138
+ // we don't honor that edge case; we style them as disabled anyway.
139
+ &[disabled],
140
+ &[readonly],
141
+ fieldset[disabled] & {
142
+ cursor: not-allowed;
143
+ background-color: @input-bg-disabled;
144
+ opacity: 1; // iOS fix for unreadable disabled content
145
+ }
146
+
147
+ // Reset height for `textarea`s
148
+ textarea& {
149
+ height: auto;
150
+ }
151
+ }
152
+
153
+ // Special styles for iOS date input
154
+ //
155
+ // In Mobile Safari, date inputs require a pixel line-height that matches the
156
+ // given height of the input.
157
+ input[type="date"] {
158
+ line-height: @input-height-base;
159
+ }
160
+
161
+
162
+ // Form groups
163
+ //
164
+ // Designed to help with the organization and spacing of vertical forms. For
165
+ // horizontal forms, use the predefined grid classes.
166
+
167
+ .form-group {
168
+ margin-bottom: 15px;
169
+ }
170
+
171
+
172
+ // Checkboxes and radios
173
+ //
174
+ // Indent the labels to position radios/checkboxes as hanging controls.
175
+
176
+ .radio,
177
+ .checkbox {
178
+ display: block;
179
+ min-height: @line-height-computed; // clear the floating input if there is no label text
180
+ margin-top: 10px;
181
+ margin-bottom: 10px;
182
+ padding-left: 20px;
183
+ label {
184
+ display: inline;
185
+ font-weight: normal;
186
+ cursor: pointer;
187
+ }
188
+ }
189
+ .radio input[type="radio"],
190
+ .radio-inline input[type="radio"],
191
+ .checkbox input[type="checkbox"],
192
+ .checkbox-inline input[type="checkbox"] {
193
+ float: left;
194
+ margin-left: -20px;
195
+ }
196
+ .radio + .radio,
197
+ .checkbox + .checkbox {
198
+ margin-top: -5px; // Move up sibling radios or checkboxes for tighter spacing
199
+ }
200
+
201
+ // Radios and checkboxes on same line
202
+ .radio-inline,
203
+ .checkbox-inline {
204
+ display: inline-block;
205
+ padding-left: 20px;
206
+ margin-bottom: 0;
207
+ vertical-align: middle;
208
+ font-weight: normal;
209
+ cursor: pointer;
210
+ }
211
+ .radio-inline + .radio-inline,
212
+ .checkbox-inline + .checkbox-inline {
213
+ margin-top: 0;
214
+ margin-left: 10px; // space out consecutive inline controls
215
+ }
216
+
217
+ // Apply same disabled cursor tweak as for inputs
218
+ //
219
+ // Note: Neither radios nor checkboxes can be readonly.
220
+ input[type="radio"],
221
+ input[type="checkbox"],
222
+ .radio,
223
+ .radio-inline,
224
+ .checkbox,
225
+ .checkbox-inline {
226
+ &[disabled],
227
+ fieldset[disabled] & {
228
+ cursor: not-allowed;
229
+ }
230
+ }
231
+
232
+
233
+ // Form control sizing
234
+ //
235
+ // Build on `.form-control` with modifier classes to decrease or increase the
236
+ // height and font-size of form controls.
237
+
238
+ .input-sm {
239
+ .input-size(@input-height-small; @padding-small-vertical; @padding-small-horizontal; @font-size-small; @line-height-small; @border-radius-small);
240
+ }
241
+
242
+ .input-lg {
243
+ .input-size(@input-height-large; @padding-large-vertical; @padding-large-horizontal; @font-size-large; @line-height-large; @border-radius-large);
244
+ }
245
+
246
+
247
+ // Form control feedback states
248
+ //
249
+ // Apply contextual and semantic states to individual form controls.
250
+
251
+ .has-feedback {
252
+ // Enable absolute positioning
253
+ position: relative;
254
+
255
+ // Ensure icons don't overlap text
256
+ .form-control {
257
+ padding-right: (@input-height-base * 1.25);
258
+ }
259
+
260
+ // Feedback icon (requires .glyphicon classes)
261
+ .form-control-feedback {
262
+ position: absolute;
263
+ top: (@line-height-computed + 5); // Height of the `label` and its margin
264
+ right: 0;
265
+ display: block;
266
+ width: @input-height-base;
267
+ height: @input-height-base;
268
+ line-height: @input-height-base;
269
+ text-align: center;
270
+ }
271
+ }
272
+
273
+ // Feedback states
274
+ .has-success {
275
+ .form-control-validation(@state-success-text; @state-success-text; @state-success-bg);
276
+ }
277
+ .has-warning {
278
+ .form-control-validation(@state-warning-text; @state-warning-text; @state-warning-bg);
279
+ }
280
+ .has-error {
281
+ .form-control-validation(@state-danger-text; @state-danger-text; @state-danger-bg);
282
+ }
283
+
284
+
285
+ // Static form control text
286
+ //
287
+ // Apply class to a `p` element to make any string of text align with labels in
288
+ // a horizontal form layout.
289
+
290
+ .form-control-static {
291
+ margin-bottom: 0; // Remove default margin from `p`
292
+ }
293
+
294
+
295
+ // Help text
296
+ //
297
+ // Apply to any element you wish to create light text for placement immediately
298
+ // below a form control. Use for general help, formatting, or instructional text.
299
+
300
+ .help-block {
301
+ display: block; // account for any element using help-block
302
+ margin-top: 5px;
303
+ margin-bottom: 10px;
304
+ color: lighten(@text-color, 25%); // lighten the text some for contrast
305
+ }
306
+
307
+
308
+
309
+ // Inline forms
310
+ //
311
+ // Make forms appear inline(-block) by adding the `.form-inline` class. Inline
312
+ // forms begin stacked on extra small (mobile) devices and then go inline when
313
+ // viewports reach <768px.
314
+ //
315
+ // Requires wrapping inputs and labels with `.form-group` for proper display of
316
+ // default HTML form controls and our custom form controls (e.g., input groups).
317
+ //
318
+ // Heads up! This is mixin-ed into `.navbar-form` in navbars.less.
319
+
320
+ .form-inline {
321
+
322
+ // Kick in the inline
323
+ @media (min-width: @screen-sm-min) {
324
+ // Inline-block all the things for "inline"
325
+ .form-group {
326
+ display: inline-block;
327
+ margin-bottom: 0;
328
+ vertical-align: middle;
329
+ }
330
+
331
+ // In navbar-form, allow folks to *not* use `.form-group`
332
+ .form-control {
333
+ display: inline-block;
334
+ width: auto; // Prevent labels from stacking above inputs in `.form-group`
335
+ vertical-align: middle;
336
+ }
337
+
338
+ .control-label {
339
+ margin-bottom: 0;
340
+ vertical-align: middle;
341
+ }
342
+
343
+ // Remove default margin on radios/checkboxes that were used for stacking, and
344
+ // then undo the floating of radios and checkboxes to match (which also avoids
345
+ // a bug in WebKit: https://github.com/twbs/bootstrap/issues/1969).
346
+ .radio,
347
+ .checkbox {
348
+ display: inline-block;
349
+ margin-top: 0;
350
+ margin-bottom: 0;
351
+ padding-left: 0;
352
+ vertical-align: middle;
353
+ }
354
+ .radio input[type="radio"],
355
+ .checkbox input[type="checkbox"] {
356
+ float: none;
357
+ margin-left: 0;
358
+ }
359
+
360
+ // Validation states
361
+ //
362
+ // Reposition the icon because it's now within a grid column and columns have
363
+ // `position: relative;` on them. Also accounts for the grid gutter padding.
364
+ .has-feedback .form-control-feedback {
365
+ top: 0;
366
+ }
367
+ }
368
+ }
369
+
370
+
371
+ // Horizontal forms
372
+ //
373
+ // Horizontal forms are built on grid classes and allow you to create forms with
374
+ // labels on the left and inputs on the right.
375
+
376
+ .form-horizontal {
377
+
378
+ // Consistent vertical alignment of labels, radios, and checkboxes
379
+ .control-label,
380
+ .radio,
381
+ .checkbox,
382
+ .radio-inline,
383
+ .checkbox-inline {
384
+ margin-top: 0;
385
+ margin-bottom: 0;
386
+ padding-top: (@padding-base-vertical + 1); // Default padding plus a border
387
+ }
388
+ // Account for padding we're adding to ensure the alignment and of help text
389
+ // and other content below items
390
+ .radio,
391
+ .checkbox {
392
+ min-height: (@line-height-computed + (@padding-base-vertical + 1));
393
+ }
394
+
395
+ // Make form groups behave like rows
396
+ .form-group {
397
+ .make-row();
398
+ }
399
+
400
+ .form-control-static {
401
+ padding-top: (@padding-base-vertical + 1);
402
+ }
403
+
404
+ // Only right align form labels here when the columns stop stacking
405
+ @media (min-width: @screen-sm-min) {
406
+ .control-label {
407
+ text-align: right;
408
+ }
409
+ }
410
+
411
+ // Validation states
412
+ //
413
+ // Reposition the icon because it's now within a grid column and columns have
414
+ // `position: relative;` on them. Also accounts for the grid gutter padding.
415
+ .has-feedback .form-control-feedback {
416
+ top: 0;
417
+ right: (@grid-gutter-width / 2);
418
+ }
419
+ }