bootstrap-component-helper 0.2.3.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 (220) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +22 -0
  3. data/README.md +39 -0
  4. data/Rakefile +14 -0
  5. data/app/helpers/bootstrap/base_helper.rb +60 -0
  6. data/app/helpers/bootstrap/component_helper.rb +570 -0
  7. data/app/helpers/bootstrap/image_helper.rb +38 -0
  8. data/app/helpers/bootstrap/tab_helper.rb +107 -0
  9. data/app/helpers/bootstrap/table_helper.rb +203 -0
  10. data/app/helpers/bootstrap/typography_helper.rb +109 -0
  11. data/lib/bootstrap-component-helper.rb +10 -0
  12. data/lib/bootstrap/component_helper/engine.rb +11 -0
  13. data/lib/bootstrap/component_helper/version.rb +5 -0
  14. data/lib/generators/bootstrap/component_helper/install/install_generator.rb +40 -0
  15. data/lib/generators/bootstrap/component_helper/install/templates/index.css.scss +7 -0
  16. data/lib/generators/bootstrap/component_helper/install/templates/index.js +3 -0
  17. data/test/dummy/README.rdoc +261 -0
  18. data/test/dummy/Rakefile +7 -0
  19. data/test/dummy/app/assets/images/favicon.ico +0 -0
  20. data/test/dummy/app/assets/javascripts/application.js +17 -0
  21. data/test/dummy/app/assets/javascripts/bootstrap_component_helper/index.js +3 -0
  22. data/test/dummy/app/assets/javascripts/holder.js +658 -0
  23. data/test/dummy/app/assets/javascripts/prettify.js +376 -0
  24. data/test/dummy/app/assets/stylesheets/application.css +156 -0
  25. data/test/dummy/app/assets/stylesheets/bootstrap_component_helper/index.css.scss +7 -0
  26. data/test/dummy/app/assets/stylesheets/prettify.css +55 -0
  27. data/test/dummy/app/controllers/application_controller.rb +3 -0
  28. data/test/dummy/app/controllers/home_controller.rb +5 -0
  29. data/test/dummy/app/helpers/application_helper.rb +2 -0
  30. data/test/dummy/app/models/order.rb +2 -0
  31. data/test/dummy/app/views/home/_flash.html.erb +43 -0
  32. data/test/dummy/app/views/home/_image.html.erb +64 -0
  33. data/test/dummy/app/views/home/_list.html.erb +106 -0
  34. data/test/dummy/app/views/home/_modal.html.erb +230 -0
  35. data/test/dummy/app/views/home/_navbar.html.erb +34 -0
  36. data/test/dummy/app/views/home/_progressbar.html.erb +47 -0
  37. data/test/dummy/app/views/home/_tab.html.erb +118 -0
  38. data/test/dummy/app/views/home/_table.html.erb +212 -0
  39. data/test/dummy/app/views/home/_thumbnails.html.erb +84 -0
  40. data/test/dummy/app/views/home/_typographic.html.erb +52 -0
  41. data/test/dummy/app/views/home/index.html.erb +108 -0
  42. data/test/dummy/app/views/layouts/application.html.erb +66 -0
  43. data/test/dummy/bin/bundle +3 -0
  44. data/test/dummy/bin/rails +4 -0
  45. data/test/dummy/bin/rake +4 -0
  46. data/test/dummy/config.ru +4 -0
  47. data/test/dummy/config/application.rb +17 -0
  48. data/test/dummy/config/boot.rb +10 -0
  49. data/test/dummy/config/database.yml +27 -0
  50. data/test/dummy/config/environment.rb +5 -0
  51. data/test/dummy/config/environments/development.rb +28 -0
  52. data/test/dummy/config/environments/production.rb +80 -0
  53. data/test/dummy/config/environments/test.rb +36 -0
  54. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  55. data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  56. data/test/dummy/config/initializers/inflections.rb +15 -0
  57. data/test/dummy/config/initializers/mime_types.rb +5 -0
  58. data/test/dummy/config/initializers/secret_token.rb +7 -0
  59. data/test/dummy/config/initializers/session_store.rb +8 -0
  60. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  61. data/test/dummy/config/locales/en.bootstrap.yml +18 -0
  62. data/test/dummy/config/locales/en.yml +14 -0
  63. data/test/dummy/config/routes.rb +7 -0
  64. data/test/dummy/db/development.sqlite3 +0 -0
  65. data/test/dummy/db/migrate/20131006012048_create_orders.rb +12 -0
  66. data/test/dummy/db/schema.rb +25 -0
  67. data/test/dummy/db/seeds.rb +3 -0
  68. data/test/dummy/db/test.sqlite3 +0 -0
  69. data/test/dummy/log/development.log +18302 -0
  70. data/test/dummy/log/test.log +1145 -0
  71. data/test/dummy/public/404.html +26 -0
  72. data/test/dummy/public/422.html +26 -0
  73. data/test/dummy/public/500.html +25 -0
  74. data/test/dummy/public/favicon.ico +0 -0
  75. data/test/dummy/tmp/cache/assets/development/sass/0bcc8f0683a417e2802dca2e2526013808c5c34c/application.css.scssc +0 -0
  76. data/test/dummy/tmp/cache/assets/development/sass/0bcc8f0683a417e2802dca2e2526013808c5c34c/components.css.scssc +0 -0
  77. data/test/dummy/tmp/cache/assets/development/sass/7eab2e6517a6682722eebb4a5df7152eb329b310/_accordion.scssc +0 -0
  78. data/test/dummy/tmp/cache/assets/development/sass/7eab2e6517a6682722eebb4a5df7152eb329b310/_alerts.scssc +0 -0
  79. data/test/dummy/tmp/cache/assets/development/sass/7eab2e6517a6682722eebb4a5df7152eb329b310/_breadcrumbs.scssc +0 -0
  80. data/test/dummy/tmp/cache/assets/development/sass/7eab2e6517a6682722eebb4a5df7152eb329b310/_button-groups.scssc +0 -0
  81. data/test/dummy/tmp/cache/assets/development/sass/7eab2e6517a6682722eebb4a5df7152eb329b310/_buttons.scssc +0 -0
  82. data/test/dummy/tmp/cache/assets/development/sass/7eab2e6517a6682722eebb4a5df7152eb329b310/_carousel.scssc +0 -0
  83. data/test/dummy/tmp/cache/assets/development/sass/7eab2e6517a6682722eebb4a5df7152eb329b310/_close.scssc +0 -0
  84. data/test/dummy/tmp/cache/assets/development/sass/7eab2e6517a6682722eebb4a5df7152eb329b310/_code.scssc +0 -0
  85. data/test/dummy/tmp/cache/assets/development/sass/7eab2e6517a6682722eebb4a5df7152eb329b310/_component-animations.scssc +0 -0
  86. data/test/dummy/tmp/cache/assets/development/sass/7eab2e6517a6682722eebb4a5df7152eb329b310/_dropdowns.scssc +0 -0
  87. data/test/dummy/tmp/cache/assets/development/sass/7eab2e6517a6682722eebb4a5df7152eb329b310/_forms.scssc +0 -0
  88. data/test/dummy/tmp/cache/assets/development/sass/7eab2e6517a6682722eebb4a5df7152eb329b310/_grid.scssc +0 -0
  89. data/test/dummy/tmp/cache/assets/development/sass/7eab2e6517a6682722eebb4a5df7152eb329b310/_hero-unit.scssc +0 -0
  90. data/test/dummy/tmp/cache/assets/development/sass/7eab2e6517a6682722eebb4a5df7152eb329b310/_labels-badges.scssc +0 -0
  91. data/test/dummy/tmp/cache/assets/development/sass/7eab2e6517a6682722eebb4a5df7152eb329b310/_layouts.scssc +0 -0
  92. data/test/dummy/tmp/cache/assets/development/sass/7eab2e6517a6682722eebb4a5df7152eb329b310/_media.scssc +0 -0
  93. data/test/dummy/tmp/cache/assets/development/sass/7eab2e6517a6682722eebb4a5df7152eb329b310/_mixins.scssc +0 -0
  94. data/test/dummy/tmp/cache/assets/development/sass/7eab2e6517a6682722eebb4a5df7152eb329b310/_modals.scssc +0 -0
  95. data/test/dummy/tmp/cache/assets/development/sass/7eab2e6517a6682722eebb4a5df7152eb329b310/_navbar.scssc +0 -0
  96. data/test/dummy/tmp/cache/assets/development/sass/7eab2e6517a6682722eebb4a5df7152eb329b310/_navs.scssc +0 -0
  97. data/test/dummy/tmp/cache/assets/development/sass/7eab2e6517a6682722eebb4a5df7152eb329b310/_pager.scssc +0 -0
  98. data/test/dummy/tmp/cache/assets/development/sass/7eab2e6517a6682722eebb4a5df7152eb329b310/_pagination.scssc +0 -0
  99. data/test/dummy/tmp/cache/assets/development/sass/7eab2e6517a6682722eebb4a5df7152eb329b310/_popovers.scssc +0 -0
  100. data/test/dummy/tmp/cache/assets/development/sass/7eab2e6517a6682722eebb4a5df7152eb329b310/_progress-bars.scssc +0 -0
  101. data/test/dummy/tmp/cache/assets/development/sass/7eab2e6517a6682722eebb4a5df7152eb329b310/_reset.scssc +0 -0
  102. data/test/dummy/tmp/cache/assets/development/sass/7eab2e6517a6682722eebb4a5df7152eb329b310/_responsive-1200px-min.scssc +0 -0
  103. data/test/dummy/tmp/cache/assets/development/sass/7eab2e6517a6682722eebb4a5df7152eb329b310/_responsive-767px-max.scssc +0 -0
  104. data/test/dummy/tmp/cache/assets/development/sass/7eab2e6517a6682722eebb4a5df7152eb329b310/_responsive-768px-979px.scssc +0 -0
  105. data/test/dummy/tmp/cache/assets/development/sass/7eab2e6517a6682722eebb4a5df7152eb329b310/_responsive-navbar.scssc +0 -0
  106. data/test/dummy/tmp/cache/assets/development/sass/7eab2e6517a6682722eebb4a5df7152eb329b310/_responsive-utilities.scssc +0 -0
  107. data/test/dummy/tmp/cache/assets/development/sass/7eab2e6517a6682722eebb4a5df7152eb329b310/_scaffolding.scssc +0 -0
  108. data/test/dummy/tmp/cache/assets/development/sass/7eab2e6517a6682722eebb4a5df7152eb329b310/_sprites.scssc +0 -0
  109. data/test/dummy/tmp/cache/assets/development/sass/7eab2e6517a6682722eebb4a5df7152eb329b310/_tables.scssc +0 -0
  110. data/test/dummy/tmp/cache/assets/development/sass/7eab2e6517a6682722eebb4a5df7152eb329b310/_thumbnails.scssc +0 -0
  111. data/test/dummy/tmp/cache/assets/development/sass/7eab2e6517a6682722eebb4a5df7152eb329b310/_tooltip.scssc +0 -0
  112. data/test/dummy/tmp/cache/assets/development/sass/7eab2e6517a6682722eebb4a5df7152eb329b310/_type.scssc +0 -0
  113. data/test/dummy/tmp/cache/assets/development/sass/7eab2e6517a6682722eebb4a5df7152eb329b310/_utilities.scssc +0 -0
  114. data/test/dummy/tmp/cache/assets/development/sass/7eab2e6517a6682722eebb4a5df7152eb329b310/_variables.scssc +0 -0
  115. data/test/dummy/tmp/cache/assets/development/sass/7eab2e6517a6682722eebb4a5df7152eb329b310/_wells.scssc +0 -0
  116. data/test/dummy/tmp/cache/assets/development/sass/7eab2e6517a6682722eebb4a5df7152eb329b310/bootstrap.scssc +0 -0
  117. data/test/dummy/tmp/cache/assets/development/sass/7eab2e6517a6682722eebb4a5df7152eb329b310/responsive.scssc +0 -0
  118. data/test/dummy/tmp/cache/assets/development/sass/84409d58037c135b28739dd3324e312869e235c7/index.css.scssc +0 -0
  119. data/test/dummy/tmp/cache/assets/development/sass/c4d7e8313a08850ac1c2652d326bf93cea20578b/bootstrap-responsive.scssc +0 -0
  120. data/test/dummy/tmp/cache/assets/development/sass/c4d7e8313a08850ac1c2652d326bf93cea20578b/bootstrap.scssc +0 -0
  121. data/test/dummy/tmp/cache/assets/development/sprockets/03dd2dfd114c5240ab978a5bce1565fd +0 -0
  122. data/test/dummy/tmp/cache/assets/development/sprockets/07ce016699b0337b14f97412576ddf9b +0 -0
  123. data/test/dummy/tmp/cache/assets/development/sprockets/13fe41fee1fe35b49d145bcc06610705 +0 -0
  124. data/test/dummy/tmp/cache/assets/development/sprockets/1482cdaf91da4a3e74c2fee962e57266 +0 -0
  125. data/test/dummy/tmp/cache/assets/development/sprockets/14a3b97c693d6129681bb6c9e63e79b4 +0 -0
  126. data/test/dummy/tmp/cache/assets/development/sprockets/16033f0fe45a392c87dc5f38f59e29e2 +0 -0
  127. data/test/dummy/tmp/cache/assets/development/sprockets/17fd81b14984c81c41a5c231cd905bcc +0 -0
  128. data/test/dummy/tmp/cache/assets/development/sprockets/186b967c502a9346f6b379dfb06fe14f +0 -0
  129. data/test/dummy/tmp/cache/assets/development/sprockets/1dc9e3618cee425126b555221e90226f +0 -0
  130. data/test/dummy/tmp/cache/assets/development/sprockets/262f97b1f0dd574bfff7cc8ecbb9f72e +0 -0
  131. data/test/dummy/tmp/cache/assets/development/sprockets/264e074302048cb000f909f2919a0c9a +0 -0
  132. data/test/dummy/tmp/cache/assets/development/sprockets/29c2f0fd8e3c5f4dcd1332efa4a0371d +0 -0
  133. data/test/dummy/tmp/cache/assets/development/sprockets/2a61f06ae5cf5f6f1d43645b9b219453 +0 -0
  134. data/test/dummy/tmp/cache/assets/development/sprockets/2e18e960f308cca4a1fdb77359d01a6c +0 -0
  135. data/test/dummy/tmp/cache/assets/development/sprockets/2eee36c2ad21295c7e21e18c150d874b +0 -0
  136. data/test/dummy/tmp/cache/assets/development/sprockets/2f5173deea6c795b8fdde723bb4b63af +0 -0
  137. data/test/dummy/tmp/cache/assets/development/sprockets/302cf2e7263ec807edde7ea7f3b65c03 +0 -0
  138. data/test/dummy/tmp/cache/assets/development/sprockets/357970feca3ac29060c1e3861e2c0953 +0 -0
  139. data/test/dummy/tmp/cache/assets/development/sprockets/3c8c07d37685b45615255078c41e3ce0 +0 -0
  140. data/test/dummy/tmp/cache/assets/development/sprockets/3d2aeae465a641db34a3cea9ba300375 +0 -0
  141. data/test/dummy/tmp/cache/assets/development/sprockets/3e27ccb3d43c940c257f6271a634069e +0 -0
  142. data/test/dummy/tmp/cache/assets/development/sprockets/3ed026ca41b91b839c4dee2c2cc51849 +0 -0
  143. data/test/dummy/tmp/cache/assets/development/sprockets/41dc3aa765e6d4c4a686f88efbd6c68e +0 -0
  144. data/test/dummy/tmp/cache/assets/development/sprockets/41f5ea237dc91ead6f4231e2147f5404 +0 -0
  145. data/test/dummy/tmp/cache/assets/development/sprockets/46fc0f6e8d72a05f2eea42eaed662e5d +0 -0
  146. data/test/dummy/tmp/cache/assets/development/sprockets/470718a7ca39bcb2f1dc6053ffc682c0 +0 -0
  147. data/test/dummy/tmp/cache/assets/development/sprockets/4a3201209795b8621efba2e0ce121a6a +0 -0
  148. data/test/dummy/tmp/cache/assets/development/sprockets/4ed14f9f7b1d5af357ddef644208340e +0 -0
  149. data/test/dummy/tmp/cache/assets/development/sprockets/516cdb0fc494c1a008f5630ee3f83ed9 +0 -0
  150. data/test/dummy/tmp/cache/assets/development/sprockets/52e41d2cb37819e3cbe438707c4693c0 +0 -0
  151. data/test/dummy/tmp/cache/assets/development/sprockets/536039d2b9042f61449290e282854f4d +0 -0
  152. data/test/dummy/tmp/cache/assets/development/sprockets/54857feec0db8fabd9e5bc2c6870cf5f +0 -0
  153. data/test/dummy/tmp/cache/assets/development/sprockets/54cc1257b927751b13f0369969e17440 +0 -0
  154. data/test/dummy/tmp/cache/assets/development/sprockets/61ad5207a209b9787578645a6950698a +0 -0
  155. data/test/dummy/tmp/cache/assets/development/sprockets/630cd0d8a55d825eaba0a90cda91122f +0 -0
  156. data/test/dummy/tmp/cache/assets/development/sprockets/698c4f478493aa93e94a2c32cdd5f1cc +0 -0
  157. data/test/dummy/tmp/cache/assets/development/sprockets/69e06cba85ef043450b628947462887c +0 -0
  158. data/test/dummy/tmp/cache/assets/development/sprockets/6d1b20df06d073df2627c4df640473c2 +0 -0
  159. data/test/dummy/tmp/cache/assets/development/sprockets/6fca826ec75b904f60239bb708e38805 +0 -0
  160. data/test/dummy/tmp/cache/assets/development/sprockets/700827acd727b6fc8361f454c68a5cd7 +0 -0
  161. data/test/dummy/tmp/cache/assets/development/sprockets/754683dc7fa0bebc9ff776512a463c80 +0 -0
  162. data/test/dummy/tmp/cache/assets/development/sprockets/76bde91ae4ac1605f8b2abe1dd436efa +0 -0
  163. data/test/dummy/tmp/cache/assets/development/sprockets/779fd39741d5f4364f4453e6d9db3a8c +0 -0
  164. data/test/dummy/tmp/cache/assets/development/sprockets/7a7d275aba66d0cd4498b2a7d2cc1d33 +0 -0
  165. data/test/dummy/tmp/cache/assets/development/sprockets/7b28ddacb7b45a6b7022eb766e2f9c62 +0 -0
  166. data/test/dummy/tmp/cache/assets/development/sprockets/7ee5964945e32a33395fd4a8b52901f8 +0 -0
  167. data/test/dummy/tmp/cache/assets/development/sprockets/805a755d6887dd3f251ee8d671113a55 +0 -0
  168. data/test/dummy/tmp/cache/assets/development/sprockets/833fa0f8ca6eda2934d5875796ac0ddb +0 -0
  169. data/test/dummy/tmp/cache/assets/development/sprockets/85f13ec6dfd4e1c1d6d4faf5579367e4 +0 -0
  170. data/test/dummy/tmp/cache/assets/development/sprockets/8816657a272738b50d9f339f83602b2b +0 -0
  171. data/test/dummy/tmp/cache/assets/development/sprockets/8ab512c9b33ac90e699b73469d71f061 +0 -0
  172. data/test/dummy/tmp/cache/assets/development/sprockets/8bd5ee2e9abbe312a72a1cec2ea714a7 +0 -0
  173. data/test/dummy/tmp/cache/assets/development/sprockets/8d55d8baa9ba44e3a712be2608138977 +0 -0
  174. data/test/dummy/tmp/cache/assets/development/sprockets/8d675d1f43c56b8b3fb27598f691101f +0 -0
  175. data/test/dummy/tmp/cache/assets/development/sprockets/8f2292d2f2a219537aa2eff8577b38f5 +0 -0
  176. data/test/dummy/tmp/cache/assets/development/sprockets/8fd90c230c6244605a4c7b4bbcf41a21 +0 -0
  177. data/test/dummy/tmp/cache/assets/development/sprockets/9689835f50540dff6e5d5107069dc71d +0 -0
  178. data/test/dummy/tmp/cache/assets/development/sprockets/9c9f438defd3bed7797b13c64eea90c0 +0 -0
  179. data/test/dummy/tmp/cache/assets/development/sprockets/a19b51f4929c5dcbda2aa927080241c1 +0 -0
  180. data/test/dummy/tmp/cache/assets/development/sprockets/a202a5609c41454fcc67a0317b10da90 +0 -0
  181. data/test/dummy/tmp/cache/assets/development/sprockets/a5b779be5a68643653ca723bce23c62c +0 -0
  182. data/test/dummy/tmp/cache/assets/development/sprockets/a899e19256a0845205636938010c6fe5 +0 -0
  183. data/test/dummy/tmp/cache/assets/development/sprockets/ac722b83b79d24471fa10acb05d4f095 +0 -0
  184. data/test/dummy/tmp/cache/assets/development/sprockets/ae0e5ab1590ad2f8651e7f29ab089d0f +0 -0
  185. data/test/dummy/tmp/cache/assets/development/sprockets/b56d14052881f9f2fd665749410513dc +0 -0
  186. data/test/dummy/tmp/cache/assets/development/sprockets/b6ff3a15ed2b320aa100de615d6acaa0 +0 -0
  187. data/test/dummy/tmp/cache/assets/development/sprockets/ba7837a3356c8c0f9d2d4dddd2db4ee2 +0 -0
  188. data/test/dummy/tmp/cache/assets/development/sprockets/bad2a2d10a1446e9b1eebb24bb7976ad +0 -0
  189. data/test/dummy/tmp/cache/assets/development/sprockets/bcca522c6302f184f12fe0e8a7d7e71a +0 -0
  190. data/test/dummy/tmp/cache/assets/development/sprockets/c13fc73ceafa45876a901b3e775b83ae +0 -0
  191. data/test/dummy/tmp/cache/assets/development/sprockets/c72afec6ec61c0d8e5e664998b2d6dd5 +0 -0
  192. data/test/dummy/tmp/cache/assets/development/sprockets/cffd775d018f68ce5dba1ee0d951a994 +0 -0
  193. data/test/dummy/tmp/cache/assets/development/sprockets/d1ca5d34c1109f4451c3f675fd522bed +0 -0
  194. data/test/dummy/tmp/cache/assets/development/sprockets/d1e7f297ee2aaac3167da0b6b6575b49 +0 -0
  195. data/test/dummy/tmp/cache/assets/development/sprockets/d66f7358aa43217d389251a399669d37 +0 -0
  196. data/test/dummy/tmp/cache/assets/development/sprockets/d771ace226fc8215a3572e0aa35bb0d6 +0 -0
  197. data/test/dummy/tmp/cache/assets/development/sprockets/d8d6bcff066ae30f590880ff044badf2 +0 -0
  198. data/test/dummy/tmp/cache/assets/development/sprockets/d90eaeee0ba225714c425461bbfa529d +0 -0
  199. data/test/dummy/tmp/cache/assets/development/sprockets/d9d7f35a4e51c382aed08175c1dd6292 +0 -0
  200. data/test/dummy/tmp/cache/assets/development/sprockets/db5ddc82768b144533c161a80bdeee2d +0 -0
  201. data/test/dummy/tmp/cache/assets/development/sprockets/dbb0a1624b85d0f9d4eaec08c03b8797 +0 -0
  202. data/test/dummy/tmp/cache/assets/development/sprockets/dc4f2c66b13e09c13320f6f21bb7ec6a +0 -0
  203. data/test/dummy/tmp/cache/assets/development/sprockets/dc664a988f31db3737b14c54d193732b +0 -0
  204. data/test/dummy/tmp/cache/assets/development/sprockets/dd7a16eba4646a5a23bb7e5f906abbd3 +0 -0
  205. data/test/dummy/tmp/cache/assets/development/sprockets/e030a7845a28abd00581260c4e8afdcd +0 -0
  206. data/test/dummy/tmp/cache/assets/development/sprockets/e256294192259b5603b8dc971d9d6a11 +0 -0
  207. data/test/dummy/tmp/cache/assets/development/sprockets/e66f24418617ac4a7ee71d67f7545ce3 +0 -0
  208. data/test/dummy/tmp/cache/assets/development/sprockets/e69c8095136c028e535371ef3123cbd1 +0 -0
  209. data/test/dummy/tmp/cache/assets/development/sprockets/ec8a4c9e797155e9996a35bb7f7d7673 +0 -0
  210. data/test/dummy/tmp/cache/assets/development/sprockets/f7cbd26ba1d28d48de824f0e94586655 +0 -0
  211. data/test/dummy/tmp/cache/assets/development/sprockets/f88b0e4100827602fa8c4f78b5e7dab3 +0 -0
  212. data/test/dummy/tmp/cache/assets/development/sprockets/f8d0320de120c037ea5d3943c8b76d0c +0 -0
  213. data/test/dummy/tmp/cache/assets/development/sprockets/fde3d3c8658f07dd5aef16cc104c05c9 +0 -0
  214. data/test/dummy/tmp/cache/assets/development/sprockets/ff8ea5d6d7296abe74b47835195461a1 +0 -0
  215. data/test/test_helper.rb +15 -0
  216. data/test/unit/helpers/bootstrap_component_helper_test.rb +92 -0
  217. data/test/unit/helpers/bootstrap_image_helper_test.rb +37 -0
  218. data/test/unit/helpers/bootstrap_tab_helper_test.rb +28 -0
  219. data/test/unit/helpers/bootstrap_typography_helper_test.rb +16 -0
  220. metadata +549 -0
@@ -0,0 +1,38 @@
1
+ module Bootstrap
2
+ module ImageHelper
3
+
4
+ # Public: Rounded image helper. Use it as the same as image_tag.
5
+ def r_image_tag(source, options = {})
6
+ image_tag(source, merge_predef_class('img-rounded', options))
7
+ end
8
+
9
+ # Public: Circle image helper. Use it as the same as image_tag.
10
+ def c_image_tag(source, options = {})
11
+ image_tag(source, merge_predef_class('img-circle', options))
12
+ end
13
+
14
+ # public: Polaroid image helper. Use it as the same as image_tag.
15
+ def p_image_tag(source, options = {})
16
+ image_tag(source, merge_predef_class('img-polaroid', options))
17
+ end
18
+
19
+ # Public: Bootstrap icons helpers by Glyphicons.
20
+ #
21
+ # names - icon names, passed in one by one.
22
+ #
23
+ # Examples
24
+ #
25
+ # glyph_icon(:plus)
26
+ # # => <i class="icon-plus"></i>
27
+ #
28
+ # glyph_icon(:align_justify, :white)
29
+ # # => <i class="icon-align-justify icon-white"></i>
30
+ #
31
+ # glyph_icon(%w(plus white))
32
+ #
33
+ # Returns an i tag with icon classes.
34
+ def glyph_icon(*names)
35
+ content_tag :i, nil, class: names.flatten.map { |name| "icon-#{name.to_s.gsub('_', '-')}" }
36
+ end
37
+ end
38
+ end
@@ -0,0 +1,107 @@
1
+ module Bootstrap
2
+ module TabHelper
3
+ class Tabs
4
+ attr_reader :tabs, :default_index, :options, :template, :inline, :stacked,
5
+ :index, :id, :type, :position, :align, :content_options
6
+
7
+ def initialize(template,
8
+ index: 0,
9
+ inline: false,
10
+ stacked: false,
11
+ id: 'tabs',
12
+ type: 'tabs',
13
+ position: 'top',
14
+ align: 'left',
15
+ content_options: {},
16
+ **options)
17
+ @default_index = index
18
+ @inline = inline
19
+ @stacked = stacked
20
+ @id = id
21
+ @type = type
22
+ @position = position
23
+ @align = align
24
+ @content_options = content_options
25
+ @options = options
26
+ @template = template
27
+ @tabs = {}
28
+ end
29
+
30
+ # tab label and content of tabs
31
+ #
32
+ # label - label of tab
33
+ # options -
34
+ # disabled - true, false default: false
35
+ # clickable - true, false default: true
36
+ # other options that can be accpted by li
37
+ # pane_options -
38
+ # every option that can be accepted by div
39
+ def tab(label, disabled: false, pane_options: {}, **options, &block)
40
+ tabs[label] = { disabled: disabled, pane_options: pane_options,
41
+ options: options, content: block }
42
+ end
43
+
44
+ def to_s
45
+ tab_wrapper_options = { style: "display: #{inline ? 'inline-block' : 'block'};",
46
+ class: " tabbable tabs-#{position}" }
47
+
48
+ template.div(tab_wrapper_options) do
49
+ tab_content = ''
50
+ tab_content << template.nav(options.merge!(type: type, stacked: stacked)) do |item|
51
+ tabs.keys.each_with_index do |k, i|
52
+ li_options = (i == default_index.to_i) ? { class: "active" } : {}
53
+ item.add(render_label(type, k, "#{id}-tab-#{i}", tabs[k]), li_options)
54
+ end
55
+ end
56
+
57
+ tab_content << template.div(template.merge_predef_class('tab-content', content_options)) do
58
+ tab_panes = ''
59
+ tabs.values.each_with_index do |v, i|
60
+ tab_panes << render_content(i == default_index.to_i, "#{id}-tab-#{i}", v)
61
+
62
+ end
63
+ tab_panes.html_safe
64
+ end
65
+
66
+ tab_content.html_safe
67
+ end
68
+
69
+ end
70
+
71
+ private
72
+ def render_label(type, title, link_id, tab)
73
+ tab_class = tab[:disabled] ? ' disabled' : ''
74
+ tab[:options].merge!(data: { toggle: type.singularize })
75
+
76
+ template.link_to(title.html_safe, "##{link_id}",
77
+ template.merge_predef_class(tab_class, tab[:options]))
78
+ end
79
+
80
+ def render_content(active, link_id, tab)
81
+ pane_class = " tab-pane #{active ? 'active' : ''}"
82
+ tab[:pane_options][:id] = link_id
83
+
84
+ template.div(template.merge_predef_class(pane_class, tab[:pane_options])) do
85
+ template.capture(&tab[:content]) if tab[:content]
86
+ end
87
+ end
88
+ end
89
+
90
+ # Show Tabs
91
+ # options:
92
+ # index: show which tab default
93
+ # type: pills, tabs default: tabs
94
+ # position: below, left, right direction of tab
95
+ # align: left, right. the alignment of tab, NOT AVAILABLE NOW
96
+ # inline: true ,false default: false
97
+ # stacked: true, false default: false
98
+ # content_options
99
+ # every option that can be accepted by tab content div
100
+ def tabs(options = {}, &block)
101
+ new_tabs = Tabs.new(self, options)
102
+ capture(new_tabs, &block) if block_given?
103
+ new_tabs.to_s
104
+ end
105
+
106
+ end
107
+ end
@@ -0,0 +1,203 @@
1
+ module Bootstrap
2
+ module TableHelper
3
+
4
+ class Row
5
+ attr_reader :columns, :options, :template
6
+
7
+ def initialize(template, options = {})
8
+ @template = template
9
+ @options = options
10
+ @columns = []
11
+ end
12
+
13
+ def column(width: nil, align: 'left', text: nil, tag: :td, **options, &block)
14
+ if width && width.to_i <= 12 && width.to_i > 0
15
+ template.merge_predef_class("span#{width.to_i}", options)
16
+ end
17
+
18
+ columns << {
19
+ options: options,
20
+ align: align,
21
+ text: text,
22
+ tag: tag,
23
+ content: block
24
+ }
25
+ end
26
+
27
+ def header(tag: :th, **options, &block)
28
+ if block_given?
29
+ column(options.merge!(tag: tag)) do
30
+ template.capture(&block)
31
+ end
32
+ else
33
+ column(options.merge!(tag: tag))
34
+ end
35
+ end
36
+
37
+ def to_s
38
+ template.content_tag(:tr, nil, options) do
39
+ tr_content = ''
40
+ columns.each do |c|
41
+ column_options = c[:options]
42
+ column_options[:style] ||= ''
43
+ column_options[:style] << "text-align: #{c[:align]};"
44
+
45
+ tr_content << template.content_tag(c[:tag], nil, column_options) do
46
+ if c[:content]
47
+ template.capture(&c[:content])
48
+ else
49
+ c[:text]
50
+ end
51
+ end
52
+ end
53
+
54
+ tr_content.html_safe
55
+ end
56
+ end
57
+
58
+ end
59
+
60
+ class Table
61
+ attr_reader :headers, :columns, :rows, :options, :default_row_options,
62
+ :template, :caption, :caption_options, :collection, :type, :show_header
63
+
64
+ def initialize(template,
65
+ default_row_options: {},
66
+ collection: [],
67
+ caption: nil,
68
+ caption_options: {},
69
+ type: 'hover',
70
+ show_header: true,
71
+ **options)
72
+ @template = template
73
+ @type = type
74
+ @default_row_options = default_row_options
75
+ @options = options
76
+ @collection = collection
77
+ @caption = caption
78
+ @caption_options = caption_options
79
+ @show_header = show_header
80
+ @headers = []
81
+ @rows = []
82
+ @columns = []
83
+ @cust_header = false
84
+ end
85
+
86
+ # options
87
+ # width - 1~12
88
+ # method - object's method, use send(method) to get value
89
+ # align - text alignment: left, center and right
90
+ # header_options - options of header
91
+ def column(method: nil, header_options: {}, **options, &block)
92
+ if show_header && !@cust_header
93
+
94
+ text = if method
95
+ collection.try(:model).try(:human_attribute_name, method)
96
+ end
97
+
98
+ header(header_options.reverse_merge!(width: options[:width],
99
+ align: options[:align],
100
+ text: text))
101
+ end
102
+
103
+ columns << { method: method, options: options, content: block }
104
+ end
105
+
106
+ def row(options = {}, &block)
107
+ new_row = Row.new(template, options.reverse_merge!(default_row_options))
108
+ template.capture(new_row, &block)
109
+ rows << new_row
110
+ end
111
+
112
+ def header_row(&block)
113
+ if @cust_header == false
114
+ @cust_header = true
115
+ headers.clear
116
+ end
117
+
118
+ new_row = Row.new(template)
119
+ template.capture(new_row, &block)
120
+ headers << new_row
121
+ end
122
+
123
+ def to_s
124
+ table_class = 'table'
125
+ type.split(' ').each do |table_type|
126
+ table_class << " table-#{table_type}"
127
+ end
128
+
129
+ template.merge_predef_class(table_class, options)
130
+ template.content_tag(:table, nil, options) do
131
+ content = ''
132
+ content << template.content_tag('caption', caption, caption_options) if caption
133
+
134
+ if show_header && headers.any?
135
+ content << template.content_tag('thead') do
136
+ header_content = ''
137
+ headers.each do |h|
138
+ header_content << h.to_s
139
+ end
140
+ header_content.html_safe
141
+ end
142
+ end
143
+
144
+ content << template.content_tag(:tbody) do
145
+ tbody_content = ''
146
+ if collection && collection.any?
147
+ collection.each_with_index do |o, i|
148
+ row(default_row_options) do |r|
149
+ columns.each do |c|
150
+ column_options = c[:options].dup
151
+
152
+ text = if c[:method] && o.respond_to?(c[:method])
153
+ o.send(c[:method])
154
+ end
155
+
156
+ if c[:content]
157
+ r.column(column_options.merge!(text: text)) do
158
+ template.capture(o, i, &c[:content])
159
+ end
160
+ else
161
+ r.column(column_options.merge!(text: text))
162
+ end
163
+ end
164
+ end
165
+ end
166
+ end
167
+
168
+ rows.each do |r|
169
+ tbody_content << r.to_s
170
+ end
171
+
172
+ tbody_content.html_safe
173
+ end
174
+
175
+ content.html_safe
176
+ end
177
+
178
+ end
179
+
180
+ private
181
+
182
+ def header(options = {})
183
+ headers << Row.new(template) if headers.empty?
184
+ headers.last.header(options)
185
+ end
186
+ end
187
+
188
+ # Show bootstrap style table
189
+ #
190
+ # options: Hash
191
+ # caption: caption of table.
192
+ # caption_options: caption's options
193
+ # collection: the collection for generating table.
194
+ # type: bootstrap table type, a string is splited by spaces. default: 'hover'
195
+ # for example: 'hover striped', 'hover fluid bordered'...
196
+ # other options can be accepted by table
197
+ def table(options={})
198
+ table = Table.new(self, options)
199
+ yield table
200
+ table.to_s
201
+ end
202
+ end
203
+ end
@@ -0,0 +1,109 @@
1
+ module Bootstrap
2
+ module TypographyHelper
3
+
4
+ # Internal: List class that represents a ul, li list with Bootstrap styles.
5
+ #
6
+ # template - ActionView::Template instance.
7
+ # li_options - Default options of all li tags. ( default: {} )
8
+ # type - Type of the list, can be unordered, ordered or unstyled.
9
+ # ( default: 'unordered' )
10
+ # options - Options can be accepted by ol or ul.
11
+ class List
12
+
13
+ attr_reader :collection, :options, :template, :li_options, :type
14
+
15
+ def initialize(templte, li_options: {}, type: 'unordered', **options)
16
+ @template = templte
17
+ @type = type
18
+ @options = options
19
+ @li_options = li_options
20
+ @collection = []
21
+ end
22
+
23
+ def add(content_or_options = nil, options = {})
24
+ content_or_options, options = '', content_or_options if content_or_options.is_a?(Hash)
25
+
26
+ collection << {options: options, content: content_or_options}
27
+ end
28
+
29
+ alias_method :<<, :add
30
+
31
+ def to_s
32
+ tag = (type == 'ordered') ? 'ol' : 'ul'
33
+ unstyled_class = (type == 'unstyled') ? 'unstyled ' : ''
34
+
35
+ template.content_tag(tag, nil, template.merge_predef_class(unstyled_class, options)) do
36
+ tag_content = ''
37
+
38
+ collection.each do |obj|
39
+ tag_content << template.content_tag('li', nil, obj[:options].reverse_merge(li_options)) do
40
+ obj[:content].html_safe
41
+ end
42
+ end
43
+
44
+ tag_content.html_safe
45
+ end
46
+ end
47
+ end
48
+
49
+ # Typography
50
+ # Headings not implemented
51
+ # Lead not implemented
52
+ # Small not implemented
53
+ # Bold not implemented
54
+ # Italics not implemented
55
+ # muted, text-warning, text-error, text-info, text-success not implemented
56
+ # Abbreviations not implemented
57
+ # Addresses not implemented
58
+ # Blockquotes not implemented
59
+
60
+ # Lists
61
+ ############################################################################
62
+
63
+ # Public: Bootstrap Typography List, wraps List class to generate ul or ol
64
+ # tags with html options.
65
+ #
66
+ # options - options can be accepted by ul or ol.
67
+ # :type - unordered, ordered, unstyled.
68
+ # ( default: 'unordered' )
69
+ # :li_options - common li options in ul ( default: {} )
70
+ # other options can be accepted by ul or ol.
71
+ # block - yield with List object, used to add li tags into ul or ol.
72
+ # Also can add nested lists.
73
+ #
74
+ # Examples
75
+ #
76
+ # = list(type: 'ordered') do |i|
77
+ # - i.add('line 1')
78
+ # - i.add('line 2')
79
+ # - i.add(link_to('line 3', hello_world_path), class: "li-class")
80
+ # - i.add 'line 4' + list(type: 'unstyled') do |nested_li|
81
+ # - nested_li.add('line 4.1')
82
+ # - nested_li.add('line 4.2')
83
+ # # => <ol>
84
+ # <li>line 1</li>
85
+ # <li>line 2</li>
86
+ # <li class="li-class">
87
+ # <a href="/hello_world">line 3</a>
88
+ # </li>
89
+ # <li>
90
+ # line 4
91
+ # <ul class="unstyled">
92
+ # <li>line 4.1</li>
93
+ # <li>line 4.2</li>
94
+ # </ul>
95
+ # </li>
96
+ # </ol>
97
+ #
98
+ #
99
+ # Returns html content of the list.
100
+ def list(options = {}, &block)
101
+ builder = List.new(self, options)
102
+ capture(builder, &block) if block_given?
103
+ builder.to_s
104
+ end
105
+
106
+ # Inline not implemented
107
+ # Description not implemented
108
+ end
109
+ end