ecm_cms_navigation 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (203) hide show
  1. data/MIT-LICENSE +20 -0
  2. data/README.rdoc +3 -0
  3. data/Rakefile +38 -0
  4. data/app/admin/ecm/cms_navigation/navigation_items.rb +75 -0
  5. data/app/admin/ecm/cms_navigation/navigations.rb +51 -0
  6. data/app/assets/stylesheets/active_admin/ecm-cms-navigation.css +3 -0
  7. data/app/helpers/ecm/cms_navigation_helper.rb +37 -0
  8. data/app/models/ecm/cms_navigation/navigation.rb +24 -0
  9. data/app/models/ecm/cms_navigation/navigation_item.rb +38 -0
  10. data/config/locales/ecm.cms_navigation.de.yml +26 -0
  11. data/config/locales/ecm.cms_navigation.en.yml +26 -0
  12. data/config/locales/ecm.cms_navigation.navigation.de.yml +14 -0
  13. data/config/locales/ecm.cms_navigation.navigation.en.yml +14 -0
  14. data/config/locales/ecm.cms_navigation.navigation_item.de.yml +16 -0
  15. data/config/locales/ecm.cms_navigation.navigation_item.en.yml +16 -0
  16. data/db/migrate/001_create_ecm_cms_navigation_navigations.rb +10 -0
  17. data/db/migrate/002_create_ecm_cms_navigation_navigation_items.rb +17 -0
  18. data/lib/ecm/cms_navigation/engine.rb +34 -0
  19. data/lib/ecm/cms_navigation/version.rb +5 -0
  20. data/lib/ecm_cms_navigation.rb +2 -0
  21. data/lib/generators/ecm/cms_navigation/install/install_generator.rb +16 -0
  22. data/lib/generators/ecm/cms_navigation/navigation/navigation_generator.rb +15 -0
  23. data/lib/generators/ecm/cms_navigation/navigation/templates/navigation.rb +1 -0
  24. data/lib/tasks/ecm_cms_navigation_tasks.rake +4 -0
  25. data/test/dummy/README.rdoc +261 -0
  26. data/test/dummy/Rakefile +7 -0
  27. data/test/dummy/app/admin/admin_users.rb +32 -0
  28. data/test/dummy/app/admin/dashboards.rb +44 -0
  29. data/test/dummy/app/assets/javascripts/active_admin.js +1 -0
  30. data/test/dummy/app/assets/javascripts/application.js +15 -0
  31. data/test/dummy/app/assets/stylesheets/active_admin.css.scss +6 -0
  32. data/test/dummy/app/assets/stylesheets/application.css +13 -0
  33. data/test/dummy/app/controllers/application_controller.rb +3 -0
  34. data/test/dummy/app/controllers/home_controller.rb +4 -0
  35. data/test/dummy/app/helpers/application_helper.rb +2 -0
  36. data/test/dummy/app/models/admin_user.rb +17 -0
  37. data/test/dummy/app/views/home/index.html.erb +6 -0
  38. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  39. data/test/dummy/config/application.rb +59 -0
  40. data/test/dummy/config/boot.rb +10 -0
  41. data/test/dummy/config/database.yml +25 -0
  42. data/test/dummy/config/environment.rb +5 -0
  43. data/test/dummy/config/environments/development.rb +37 -0
  44. data/test/dummy/config/environments/production.rb +67 -0
  45. data/test/dummy/config/environments/test.rb +37 -0
  46. data/test/dummy/config/initializers/active_admin.rb +134 -0
  47. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  48. data/test/dummy/config/initializers/devise.rb +216 -0
  49. data/test/dummy/config/initializers/inflections.rb +15 -0
  50. data/test/dummy/config/initializers/mime_types.rb +5 -0
  51. data/test/dummy/config/initializers/secret_token.rb +7 -0
  52. data/test/dummy/config/initializers/session_store.rb +8 -0
  53. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  54. data/test/dummy/config/locales/admin_user.de.yml +16 -0
  55. data/test/dummy/config/locales/de.yml +161 -0
  56. data/test/dummy/config/locales/devise.en.yml +57 -0
  57. data/test/dummy/config/locales/ecm.admin.de.yml +5 -0
  58. data/test/dummy/config/locales/ecm.cms-core.de.yml +48 -0
  59. data/test/dummy/config/locales/ecm.cms-core.en.yml +48 -0
  60. data/test/dummy/config/locales/ecm.cms-navigation.de.yml +47 -0
  61. data/test/dummy/config/locales/ecm.cms-navigation.en.yml +46 -0
  62. data/test/dummy/config/locales/en.yml +5 -0
  63. data/test/dummy/config/navigation.rb +0 -0
  64. data/test/dummy/config/routes.rb +63 -0
  65. data/test/dummy/config.ru +4 -0
  66. data/test/dummy/db/development.sqlite3 +0 -0
  67. data/test/dummy/db/migrate/20120407123948_devise_create_admin_users.rb +52 -0
  68. data/test/dummy/db/migrate/20120407143959_create_admin_notes.rb +17 -0
  69. data/test/dummy/db/migrate/20120407144000_move_admin_notes_to_comments.rb +25 -0
  70. data/test/dummy/db/migrate/20120621131006_create_ecm_cms_navigation_navigations.ecm_cms_navigation_engine.rb +11 -0
  71. data/test/dummy/db/migrate/20120621131007_create_ecm_cms_navigation_navigation_items.ecm_cms_navigation_engine.rb +18 -0
  72. data/test/dummy/db/schema.rb +70 -0
  73. data/test/dummy/log/development.log +6203 -0
  74. data/test/dummy/public/404.html +26 -0
  75. data/test/dummy/public/422.html +26 -0
  76. data/test/dummy/public/500.html +25 -0
  77. data/test/dummy/public/favicon.ico +0 -0
  78. data/test/dummy/public/stylesheets/active_admin/ecm-cms-navigation.css +3 -0
  79. data/test/dummy/script/rails +6 -0
  80. data/test/dummy/test/fixtures/admin_users.yml +11 -0
  81. data/test/dummy/test/unit/admin_user_test.rb +7 -0
  82. data/test/dummy/tmp/cache/assets/C1D/230/sprockets%2F02e9e2543661cd626253c7f004464493 +0 -0
  83. data/test/dummy/tmp/cache/assets/C80/820/sprockets%2F2fcd9e4a7533803943533046c5f3d560 +0 -0
  84. data/test/dummy/tmp/cache/assets/C8D/7C0/sprockets%2F48c1ed30977942d1674d3199d08b436d +0 -0
  85. data/test/dummy/tmp/cache/assets/C8E/6C0/sprockets%2Ff6e52920f98efa019261497767e041b5 +0 -0
  86. data/test/dummy/tmp/cache/assets/CAB/C40/sprockets%2F4477e59061a7d1e7ad744e6f2670a001 +0 -0
  87. data/test/dummy/tmp/cache/assets/CBC/520/sprockets%2F4204f20b76901301c0004b9df1cdde04 +0 -0
  88. data/test/dummy/tmp/cache/assets/CBE/0D0/sprockets%2F3b521b46440e9901877e67b3d595d6ef +0 -0
  89. data/test/dummy/tmp/cache/assets/CD8/370/sprockets%2F357970feca3ac29060c1e3861e2c0953 +0 -0
  90. data/test/dummy/tmp/cache/assets/CDB/040/sprockets%2Fc732474e67003a4eb840eb44c5ca9385 +0 -0
  91. data/test/dummy/tmp/cache/assets/CDE/A60/sprockets%2Fc8fd4776f82e110ec70f1112369fc333 +0 -0
  92. data/test/dummy/tmp/cache/assets/CF0/C10/sprockets%2F48e5f698b22e7a97ebc0d7515d180827 +0 -0
  93. data/test/dummy/tmp/cache/assets/CFB/BB0/sprockets%2F03ed1ef04e988e52c1bb424143b7401a +0 -0
  94. data/test/dummy/tmp/cache/assets/CFC/CE0/sprockets%2F081e67e39b56f0f99c68593a5ef2925d +0 -0
  95. data/test/dummy/tmp/cache/assets/D08/940/sprockets%2Ff3e82f5481bc64820c2a2f270045f6fa +0 -0
  96. data/test/dummy/tmp/cache/assets/D09/9B0/sprockets%2F3169613ce57de4cdf262803a5dd2b740 +0 -0
  97. data/test/dummy/tmp/cache/assets/D0D/A80/sprockets%2F5459a5ca0e63be62545e2d4a4742b7c8 +0 -0
  98. data/test/dummy/tmp/cache/assets/D12/D00/sprockets%2Fddf374b4e6ec55510ef906085094a54c +0 -0
  99. data/test/dummy/tmp/cache/assets/D14/D40/sprockets%2Fd108c2aff238873e06a7c6fb079d7443 +0 -0
  100. data/test/dummy/tmp/cache/assets/D17/750/sprockets%2F6f150f81cc3f03a91888db0b6875af57 +0 -0
  101. data/test/dummy/tmp/cache/assets/D18/7A0/sprockets%2Fd70b33bb7e9db0e665965b947a6275e0 +0 -0
  102. data/test/dummy/tmp/cache/assets/D2D/010/sprockets%2Fd48e0f08b09c78a502d11ec2df419a00 +0 -0
  103. data/test/dummy/tmp/cache/assets/D2E/C90/sprockets%2Fd106d47b969c6805798ff5cb05f8c59f +0 -0
  104. data/test/dummy/tmp/cache/assets/D31/E50/sprockets%2F86295df08e3769c5c68b3fccc977727c +0 -0
  105. data/test/dummy/tmp/cache/assets/D32/010/sprockets%2F7f752ae9016db83230fcf2c24017c4ae +0 -0
  106. data/test/dummy/tmp/cache/assets/D32/A10/sprockets%2F13fe41fee1fe35b49d145bcc06610705 +0 -0
  107. data/test/dummy/tmp/cache/assets/D38/540/sprockets%2F86e1ad844bc9df4491a2a52b870421db +0 -0
  108. data/test/dummy/tmp/cache/assets/D39/910/sprockets%2F7a5ba442debf604fd3195483a4ba1875 +0 -0
  109. data/test/dummy/tmp/cache/assets/D3B/630/sprockets%2Fc549fd403a43fca068992bc190e32ca8 +0 -0
  110. data/test/dummy/tmp/cache/assets/D48/640/sprockets%2F9f4f18d910b678b1d0777e04cdaf6f24 +0 -0
  111. data/test/dummy/tmp/cache/assets/D4E/1B0/sprockets%2Ff7cbd26ba1d28d48de824f0e94586655 +0 -0
  112. data/test/dummy/tmp/cache/assets/D59/D70/sprockets%2Fed9f0de1b65ae8d7ef89087c83728461 +0 -0
  113. data/test/dummy/tmp/cache/assets/D5A/EA0/sprockets%2Fd771ace226fc8215a3572e0aa35bb0d6 +0 -0
  114. data/test/dummy/tmp/cache/assets/D65/A10/sprockets%2F5d2a785575b7ddc8e93e1ab10c3f201b +0 -0
  115. data/test/dummy/tmp/cache/assets/D79/910/sprockets%2F6f54ace661399cc3bf262f81d9c5a7f0 +0 -0
  116. data/test/dummy/tmp/cache/assets/D81/4B0/sprockets%2F33d0fa9de67898d28edc22d7dc7c2727 +0 -0
  117. data/test/dummy/tmp/cache/assets/D85/0C0/sprockets%2F3faa7a2282b2a4530f7253eb9a2b5bac +0 -0
  118. data/test/dummy/tmp/cache/assets/D93/4C0/sprockets%2F857ecd2092cee11f740b3cf2e373ad2a +0 -0
  119. data/test/dummy/tmp/cache/assets/D9F/990/sprockets%2Faef93bd19f09e008e68ce6f1bcb09412 +0 -0
  120. data/test/dummy/tmp/cache/assets/DA9/0B0/sprockets%2Feea56b6eec8c2eb4069704df6f15a289 +0 -0
  121. data/test/dummy/tmp/cache/assets/DA9/900/sprockets%2Fe1f74b542e4ee1ec991bb3e84209e8ee +0 -0
  122. data/test/dummy/tmp/cache/assets/DB8/A40/sprockets%2F529735aeec02af5d05bb03b1de2a5ad8 +0 -0
  123. data/test/dummy/tmp/cache/assets/DCB/210/sprockets%2F598702ccb42e02ff5db7ac4f6670afda +0 -0
  124. data/test/dummy/tmp/cache/assets/DDC/400/sprockets%2Fcffd775d018f68ce5dba1ee0d951a994 +0 -0
  125. data/test/dummy/tmp/cache/assets/DDE/420/sprockets%2Ffb8b186d5bf0307f86f65fc787d2adeb +0 -0
  126. data/test/dummy/tmp/cache/assets/DF9/680/sprockets%2F552b35d5afffa72ded4bb41f2e88d41a +0 -0
  127. data/test/dummy/tmp/cache/assets/DFE/E50/sprockets%2F7c40c693372adf7a3fafc7aae8b63af5 +0 -0
  128. data/test/dummy/tmp/cache/assets/E04/5A0/sprockets%2Fda71e1fafe3707d7ff5532b1f6c89baf +0 -0
  129. data/test/dummy/tmp/cache/assets/E04/890/sprockets%2F2f5173deea6c795b8fdde723bb4b63af +0 -0
  130. data/test/dummy/tmp/cache/sass/2e0f90a26ed3334980f9f0cefc7301c037c5e6a7/_all.css.scssc +0 -0
  131. data/test/dummy/tmp/cache/sass/2e0f90a26ed3334980f9f0cefc7301c037c5e6a7/_buttons.css.scssc +0 -0
  132. data/test/dummy/tmp/cache/sass/2e0f90a26ed3334980f9f0cefc7301c037c5e6a7/_gradients.css.scssc +0 -0
  133. data/test/dummy/tmp/cache/sass/2e0f90a26ed3334980f9f0cefc7301c037c5e6a7/_icons.css.scssc +0 -0
  134. data/test/dummy/tmp/cache/sass/2e0f90a26ed3334980f9f0cefc7301c037c5e6a7/_reset.css.scssc +0 -0
  135. data/test/dummy/tmp/cache/sass/2e0f90a26ed3334980f9f0cefc7301c037c5e6a7/_rounded.css.scssc +0 -0
  136. data/test/dummy/tmp/cache/sass/2e0f90a26ed3334980f9f0cefc7301c037c5e6a7/_sections.css.scssc +0 -0
  137. data/test/dummy/tmp/cache/sass/2e0f90a26ed3334980f9f0cefc7301c037c5e6a7/_shadows.css.scssc +0 -0
  138. data/test/dummy/tmp/cache/sass/2e0f90a26ed3334980f9f0cefc7301c037c5e6a7/_typography.scssc +0 -0
  139. data/test/dummy/tmp/cache/sass/2e0f90a26ed3334980f9f0cefc7301c037c5e6a7/_utilities.scssc +0 -0
  140. data/test/dummy/tmp/cache/sass/2e0f90a26ed3334980f9f0cefc7301c037c5e6a7/_variables.css.scssc +0 -0
  141. data/test/dummy/tmp/cache/sass/378a5efbe5b1fb270a5eba61f1413b4042bc0f25/_button.scssc +0 -0
  142. data/test/dummy/tmp/cache/sass/378a5efbe5b1fb270a5eba61f1413b4042bc0f25/_clearfix.scssc +0 -0
  143. data/test/dummy/tmp/cache/sass/378a5efbe5b1fb270a5eba61f1413b4042bc0f25/_font-family.scssc +0 -0
  144. data/test/dummy/tmp/cache/sass/378a5efbe5b1fb270a5eba61f1413b4042bc0f25/_html5-input-types.scssc +0 -0
  145. data/test/dummy/tmp/cache/sass/378a5efbe5b1fb270a5eba61f1413b4042bc0f25/_position.scssc +0 -0
  146. data/test/dummy/tmp/cache/sass/378a5efbe5b1fb270a5eba61f1413b4042bc0f25/_timing-functions.scssc +0 -0
  147. data/test/dummy/tmp/cache/sass/69c1f805ecd19454a5adf31f922b96c98249e909/_batch_actions.css.scssc +0 -0
  148. data/test/dummy/tmp/cache/sass/69c1f805ecd19454a5adf31f922b96c98249e909/_blank_slates.scssc +0 -0
  149. data/test/dummy/tmp/cache/sass/69c1f805ecd19454a5adf31f922b96c98249e909/_breadcrumbs.scssc +0 -0
  150. data/test/dummy/tmp/cache/sass/69c1f805ecd19454a5adf31f922b96c98249e909/_buttons.scssc +0 -0
  151. data/test/dummy/tmp/cache/sass/69c1f805ecd19454a5adf31f922b96c98249e909/_columns.scssc +0 -0
  152. data/test/dummy/tmp/cache/sass/69c1f805ecd19454a5adf31f922b96c98249e909/_comments.css.scssc +0 -0
  153. data/test/dummy/tmp/cache/sass/69c1f805ecd19454a5adf31f922b96c98249e909/_date_picker.css.scssc +0 -0
  154. data/test/dummy/tmp/cache/sass/69c1f805ecd19454a5adf31f922b96c98249e909/_flash_messages.css.scssc +0 -0
  155. data/test/dummy/tmp/cache/sass/69c1f805ecd19454a5adf31f922b96c98249e909/_grid.scssc +0 -0
  156. data/test/dummy/tmp/cache/sass/69c1f805ecd19454a5adf31f922b96c98249e909/_links.scssc +0 -0
  157. data/test/dummy/tmp/cache/sass/69c1f805ecd19454a5adf31f922b96c98249e909/_pagination.scssc +0 -0
  158. data/test/dummy/tmp/cache/sass/69c1f805ecd19454a5adf31f922b96c98249e909/_panels.scssc +0 -0
  159. data/test/dummy/tmp/cache/sass/69c1f805ecd19454a5adf31f922b96c98249e909/_popovers.css.scssc +0 -0
  160. data/test/dummy/tmp/cache/sass/69c1f805ecd19454a5adf31f922b96c98249e909/_scopes.scssc +0 -0
  161. data/test/dummy/tmp/cache/sass/69c1f805ecd19454a5adf31f922b96c98249e909/_status_tags.scssc +0 -0
  162. data/test/dummy/tmp/cache/sass/69c1f805ecd19454a5adf31f922b96c98249e909/_table_tools.css.scssc +0 -0
  163. data/test/dummy/tmp/cache/sass/69c1f805ecd19454a5adf31f922b96c98249e909/_tables.css.scssc +0 -0
  164. data/test/dummy/tmp/cache/sass/6d50bd3bb8f79c9ddfeb03076798c5250f1bb8b6/_footer.scssc +0 -0
  165. data/test/dummy/tmp/cache/sass/6d50bd3bb8f79c9ddfeb03076798c5250f1bb8b6/_main_structure.scssc +0 -0
  166. data/test/dummy/tmp/cache/sass/6d50bd3bb8f79c9ddfeb03076798c5250f1bb8b6/_title_bar.scssc +0 -0
  167. data/test/dummy/tmp/cache/sass/7842134ab963cf09dadd7c2615b49cc6825f6976/_bourbon.scssc +0 -0
  168. data/test/dummy/tmp/cache/sass/7fa69198e74897139322c878f468e646709df4fe/_base.css.scssc +0 -0
  169. data/test/dummy/tmp/cache/sass/7fa69198e74897139322c878f468e646709df4fe/_forms.css.scssc +0 -0
  170. data/test/dummy/tmp/cache/sass/7fa69198e74897139322c878f468e646709df4fe/_header.css.scssc +0 -0
  171. data/test/dummy/tmp/cache/sass/7fa69198e74897139322c878f468e646709df4fe/_mixins.css.scssc +0 -0
  172. data/test/dummy/tmp/cache/sass/7fa69198e74897139322c878f468e646709df4fe/_typography.css.scssc +0 -0
  173. data/test/dummy/tmp/cache/sass/7fa69198e74897139322c878f468e646709df4fe/print.css.scssc +0 -0
  174. data/test/dummy/tmp/cache/sass/93540e1dfd808fbf20fd1c5388bc9c65df2ce6a0/active_admin.css.scssc +0 -0
  175. data/test/dummy/tmp/cache/sass/97dc896013aa89b6e113ee6298b3e4ae01f2ca5c/_dashboard.scssc +0 -0
  176. data/test/dummy/tmp/cache/sass/97dc896013aa89b6e113ee6298b3e4ae01f2ca5c/_logged_out.scssc +0 -0
  177. data/test/dummy/tmp/cache/sass/abf1c7b1db7af47efaba561dc159ec42907e4376/_animation.scssc +0 -0
  178. data/test/dummy/tmp/cache/sass/abf1c7b1db7af47efaba561dc159ec42907e4376/_appearance.scssc +0 -0
  179. data/test/dummy/tmp/cache/sass/abf1c7b1db7af47efaba561dc159ec42907e4376/_background-image.scssc +0 -0
  180. data/test/dummy/tmp/cache/sass/abf1c7b1db7af47efaba561dc159ec42907e4376/_background-size.scssc +0 -0
  181. data/test/dummy/tmp/cache/sass/abf1c7b1db7af47efaba561dc159ec42907e4376/_border-image.scssc +0 -0
  182. data/test/dummy/tmp/cache/sass/abf1c7b1db7af47efaba561dc159ec42907e4376/_border-radius.scssc +0 -0
  183. data/test/dummy/tmp/cache/sass/abf1c7b1db7af47efaba561dc159ec42907e4376/_box-shadow.scssc +0 -0
  184. data/test/dummy/tmp/cache/sass/abf1c7b1db7af47efaba561dc159ec42907e4376/_box-sizing.scssc +0 -0
  185. data/test/dummy/tmp/cache/sass/abf1c7b1db7af47efaba561dc159ec42907e4376/_columns.scssc +0 -0
  186. data/test/dummy/tmp/cache/sass/abf1c7b1db7af47efaba561dc159ec42907e4376/_flex-box.scssc +0 -0
  187. data/test/dummy/tmp/cache/sass/abf1c7b1db7af47efaba561dc159ec42907e4376/_inline-block.scssc +0 -0
  188. data/test/dummy/tmp/cache/sass/abf1c7b1db7af47efaba561dc159ec42907e4376/_linear-gradient.scssc +0 -0
  189. data/test/dummy/tmp/cache/sass/abf1c7b1db7af47efaba561dc159ec42907e4376/_radial-gradient.scssc +0 -0
  190. data/test/dummy/tmp/cache/sass/abf1c7b1db7af47efaba561dc159ec42907e4376/_transform.scssc +0 -0
  191. data/test/dummy/tmp/cache/sass/abf1c7b1db7af47efaba561dc159ec42907e4376/_transition.scssc +0 -0
  192. data/test/dummy/tmp/cache/sass/abf1c7b1db7af47efaba561dc159ec42907e4376/_user-select.scssc +0 -0
  193. data/test/dummy/tmp/cache/sass/b8feec7b5dd9bdfcb6b02acda27daed749f5790a/_deprecated-webkit-gradient.scssc +0 -0
  194. data/test/dummy/tmp/cache/sass/b8feec7b5dd9bdfcb6b02acda27daed749f5790a/_flex-grid.scssc +0 -0
  195. data/test/dummy/tmp/cache/sass/b8feec7b5dd9bdfcb6b02acda27daed749f5790a/_grid-width.scssc +0 -0
  196. data/test/dummy/tmp/cache/sass/b8feec7b5dd9bdfcb6b02acda27daed749f5790a/_linear-gradient.scssc +0 -0
  197. data/test/dummy/tmp/cache/sass/b8feec7b5dd9bdfcb6b02acda27daed749f5790a/_modular-scale.scssc +0 -0
  198. data/test/dummy/tmp/cache/sass/b8feec7b5dd9bdfcb6b02acda27daed749f5790a/_radial-gradient.scssc +0 -0
  199. data/test/dummy/tmp/cache/sass/b8feec7b5dd9bdfcb6b02acda27daed749f5790a/_render-gradients.scssc +0 -0
  200. data/test/dummy/tmp/cache/sass/b8feec7b5dd9bdfcb6b02acda27daed749f5790a/_tint-shade.scssc +0 -0
  201. data/test/ecm_cms_navigation_test.rb +7 -0
  202. data/test/test_helper.rb +15 -0
  203. metadata +520 -0
@@ -0,0 +1,34 @@
1
+ require 'rubygems'
2
+
3
+ require 'simple-navigation'
4
+ require 'awesome_nested_set'
5
+
6
+ # Ecm::Admin should do this!
7
+ require 'activeadmin'
8
+ require 'sass-rails'
9
+ require 'meta_search'
10
+
11
+ module Ecm
12
+ module CmsNavigation
13
+ class Engine < Rails::Engine
14
+ paths["config/locales"] << File.dirname(__FILE__) + '/../../../config/locales'
15
+
16
+ # Enabling assets precompiling under rails 3.1 or greater
17
+ if Rails.version >= '3.1'
18
+ initializer "ecm_cms_navigation.asset_pipeline" do |app|
19
+ app.config.assets.precompile << 'active_admin/ecm-cms-navigation.css'
20
+ end
21
+ end
22
+
23
+ config.to_prepare do
24
+ ApplicationController.helper(Ecm::CmsNavigationHelper)
25
+ end
26
+
27
+ initializer :ecm_pictures_engine do
28
+ ActiveAdmin.setup do |active_admin_config|
29
+ active_admin_config.load_paths += Dir[File.dirname(__FILE__) + '/../../../app/admin']
30
+ end
31
+ end
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,5 @@
1
+ module Ecm
2
+ module CmsNavigation
3
+ VERSION = "0.0.4"
4
+ end
5
+ end
@@ -0,0 +1,2 @@
1
+ require 'ecm/cms_navigation/engine'
2
+ require 'ecm/cms_navigation/version'
@@ -0,0 +1,16 @@
1
+ module Ecm
2
+ module CmsNavigation
3
+ module Generators
4
+ class InstallGenerator < ::Rails::Generators::Base
5
+ include Rails::Generators::Migration
6
+
7
+ desc "Installs the ECM CMS Navigation module"
8
+
9
+ def generate_navigation
10
+ generate 'ecm:cms_navigation:navigation'
11
+ end
12
+ end
13
+ end
14
+ end
15
+ end
16
+
@@ -0,0 +1,15 @@
1
+ module Ecm
2
+ module CmsNavigation
3
+ module Generators
4
+ class NavigationGenerator < Rails::Generators::Base
5
+ desc "Generates the navigation.rb file"
6
+
7
+ source_root File.expand_path('../templates', __FILE__)
8
+
9
+ def generate_navigation
10
+ copy_file "navigation.rb", "config/navigation.rb"
11
+ end
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1 @@
1
+ # Empty navigation.rb file for simple-navigation.
@@ -0,0 +1,4 @@
1
+ # desc "Explaining what the task does"
2
+ # task :ecm_cms_navigation do
3
+ # # Task goes here
4
+ # end
@@ -0,0 +1,261 @@
1
+ == Welcome to Rails
2
+
3
+ Rails is a web-application framework that includes everything needed to create
4
+ database-backed web applications according to the Model-View-Control pattern.
5
+
6
+ This pattern splits the view (also called the presentation) into "dumb"
7
+ templates that are primarily responsible for inserting pre-built data in between
8
+ HTML tags. The model contains the "smart" domain objects (such as Account,
9
+ Product, Person, Post) that holds all the business logic and knows how to
10
+ persist themselves to a database. The controller handles the incoming requests
11
+ (such as Save New Account, Update Product, Show Post) by manipulating the model
12
+ and directing data to the view.
13
+
14
+ In Rails, the model is handled by what's called an object-relational mapping
15
+ layer entitled Active Record. This layer allows you to present the data from
16
+ database rows as objects and embellish these data objects with business logic
17
+ methods. You can read more about Active Record in
18
+ link:files/vendor/rails/activerecord/README.html.
19
+
20
+ The controller and view are handled by the Action Pack, which handles both
21
+ layers by its two parts: Action View and Action Controller. These two layers
22
+ are bundled in a single package due to their heavy interdependence. This is
23
+ unlike the relationship between the Active Record and Action Pack that is much
24
+ more separate. Each of these packages can be used independently outside of
25
+ Rails. You can read more about Action Pack in
26
+ link:files/vendor/rails/actionpack/README.html.
27
+
28
+
29
+ == Getting Started
30
+
31
+ 1. At the command prompt, create a new Rails application:
32
+ <tt>rails new myapp</tt> (where <tt>myapp</tt> is the application name)
33
+
34
+ 2. Change directory to <tt>myapp</tt> and start the web server:
35
+ <tt>cd myapp; rails server</tt> (run with --help for options)
36
+
37
+ 3. Go to http://localhost:3000/ and you'll see:
38
+ "Welcome aboard: You're riding Ruby on Rails!"
39
+
40
+ 4. Follow the guidelines to start developing your application. You can find
41
+ the following resources handy:
42
+
43
+ * The Getting Started Guide: http://guides.rubyonrails.org/getting_started.html
44
+ * Ruby on Rails Tutorial Book: http://www.railstutorial.org/
45
+
46
+
47
+ == Debugging Rails
48
+
49
+ Sometimes your application goes wrong. Fortunately there are a lot of tools that
50
+ will help you debug it and get it back on the rails.
51
+
52
+ First area to check is the application log files. Have "tail -f" commands
53
+ running on the server.log and development.log. Rails will automatically display
54
+ debugging and runtime information to these files. Debugging info will also be
55
+ shown in the browser on requests from 127.0.0.1.
56
+
57
+ You can also log your own messages directly into the log file from your code
58
+ using the Ruby logger class from inside your controllers. Example:
59
+
60
+ class WeblogController < ActionController::Base
61
+ def destroy
62
+ @weblog = Weblog.find(params[:id])
63
+ @weblog.destroy
64
+ logger.info("#{Time.now} Destroyed Weblog ID ##{@weblog.id}!")
65
+ end
66
+ end
67
+
68
+ The result will be a message in your log file along the lines of:
69
+
70
+ Mon Oct 08 14:22:29 +1000 2007 Destroyed Weblog ID #1!
71
+
72
+ More information on how to use the logger is at http://www.ruby-doc.org/core/
73
+
74
+ Also, Ruby documentation can be found at http://www.ruby-lang.org/. There are
75
+ several books available online as well:
76
+
77
+ * Programming Ruby: http://www.ruby-doc.org/docs/ProgrammingRuby/ (Pickaxe)
78
+ * Learn to Program: http://pine.fm/LearnToProgram/ (a beginners guide)
79
+
80
+ These two books will bring you up to speed on the Ruby language and also on
81
+ programming in general.
82
+
83
+
84
+ == Debugger
85
+
86
+ Debugger support is available through the debugger command when you start your
87
+ Mongrel or WEBrick server with --debugger. This means that you can break out of
88
+ execution at any point in the code, investigate and change the model, and then,
89
+ resume execution! You need to install ruby-debug to run the server in debugging
90
+ mode. With gems, use <tt>sudo gem install ruby-debug</tt>. Example:
91
+
92
+ class WeblogController < ActionController::Base
93
+ def index
94
+ @posts = Post.all
95
+ debugger
96
+ end
97
+ end
98
+
99
+ So the controller will accept the action, run the first line, then present you
100
+ with a IRB prompt in the server window. Here you can do things like:
101
+
102
+ >> @posts.inspect
103
+ => "[#<Post:0x14a6be8
104
+ @attributes={"title"=>nil, "body"=>nil, "id"=>"1"}>,
105
+ #<Post:0x14a6620
106
+ @attributes={"title"=>"Rails", "body"=>"Only ten..", "id"=>"2"}>]"
107
+ >> @posts.first.title = "hello from a debugger"
108
+ => "hello from a debugger"
109
+
110
+ ...and even better, you can examine how your runtime objects actually work:
111
+
112
+ >> f = @posts.first
113
+ => #<Post:0x13630c4 @attributes={"title"=>nil, "body"=>nil, "id"=>"1"}>
114
+ >> f.
115
+ Display all 152 possibilities? (y or n)
116
+
117
+ Finally, when you're ready to resume execution, you can enter "cont".
118
+
119
+
120
+ == Console
121
+
122
+ The console is a Ruby shell, which allows you to interact with your
123
+ application's domain model. Here you'll have all parts of the application
124
+ configured, just like it is when the application is running. You can inspect
125
+ domain models, change values, and save to the database. Starting the script
126
+ without arguments will launch it in the development environment.
127
+
128
+ To start the console, run <tt>rails console</tt> from the application
129
+ directory.
130
+
131
+ Options:
132
+
133
+ * Passing the <tt>-s, --sandbox</tt> argument will rollback any modifications
134
+ made to the database.
135
+ * Passing an environment name as an argument will load the corresponding
136
+ environment. Example: <tt>rails console production</tt>.
137
+
138
+ To reload your controllers and models after launching the console run
139
+ <tt>reload!</tt>
140
+
141
+ More information about irb can be found at:
142
+ link:http://www.rubycentral.org/pickaxe/irb.html
143
+
144
+
145
+ == dbconsole
146
+
147
+ You can go to the command line of your database directly through <tt>rails
148
+ dbconsole</tt>. You would be connected to the database with the credentials
149
+ defined in database.yml. Starting the script without arguments will connect you
150
+ to the development database. Passing an argument will connect you to a different
151
+ database, like <tt>rails dbconsole production</tt>. Currently works for MySQL,
152
+ PostgreSQL and SQLite 3.
153
+
154
+ == Description of Contents
155
+
156
+ The default directory structure of a generated Ruby on Rails application:
157
+
158
+ |-- app
159
+ | |-- assets
160
+ | |-- images
161
+ | |-- javascripts
162
+ | `-- stylesheets
163
+ | |-- controllers
164
+ | |-- helpers
165
+ | |-- mailers
166
+ | |-- models
167
+ | `-- views
168
+ | `-- layouts
169
+ |-- config
170
+ | |-- environments
171
+ | |-- initializers
172
+ | `-- locales
173
+ |-- db
174
+ |-- doc
175
+ |-- lib
176
+ | `-- tasks
177
+ |-- log
178
+ |-- public
179
+ |-- script
180
+ |-- test
181
+ | |-- fixtures
182
+ | |-- functional
183
+ | |-- integration
184
+ | |-- performance
185
+ | `-- unit
186
+ |-- tmp
187
+ | |-- cache
188
+ | |-- pids
189
+ | |-- sessions
190
+ | `-- sockets
191
+ `-- vendor
192
+ |-- assets
193
+ `-- stylesheets
194
+ `-- plugins
195
+
196
+ app
197
+ Holds all the code that's specific to this particular application.
198
+
199
+ app/assets
200
+ Contains subdirectories for images, stylesheets, and JavaScript files.
201
+
202
+ app/controllers
203
+ Holds controllers that should be named like weblogs_controller.rb for
204
+ automated URL mapping. All controllers should descend from
205
+ ApplicationController which itself descends from ActionController::Base.
206
+
207
+ app/models
208
+ Holds models that should be named like post.rb. Models descend from
209
+ ActiveRecord::Base by default.
210
+
211
+ app/views
212
+ Holds the template files for the view that should be named like
213
+ weblogs/index.html.erb for the WeblogsController#index action. All views use
214
+ eRuby syntax by default.
215
+
216
+ app/views/layouts
217
+ Holds the template files for layouts to be used with views. This models the
218
+ common header/footer method of wrapping views. In your views, define a layout
219
+ using the <tt>layout :default</tt> and create a file named default.html.erb.
220
+ Inside default.html.erb, call <% yield %> to render the view using this
221
+ layout.
222
+
223
+ app/helpers
224
+ Holds view helpers that should be named like weblogs_helper.rb. These are
225
+ generated for you automatically when using generators for controllers.
226
+ Helpers can be used to wrap functionality for your views into methods.
227
+
228
+ config
229
+ Configuration files for the Rails environment, the routing map, the database,
230
+ and other dependencies.
231
+
232
+ db
233
+ Contains the database schema in schema.rb. db/migrate contains all the
234
+ sequence of Migrations for your schema.
235
+
236
+ doc
237
+ This directory is where your application documentation will be stored when
238
+ generated using <tt>rake doc:app</tt>
239
+
240
+ lib
241
+ Application specific libraries. Basically, any kind of custom code that
242
+ doesn't belong under controllers, models, or helpers. This directory is in
243
+ the load path.
244
+
245
+ public
246
+ The directory available for the web server. Also contains the dispatchers and the
247
+ default HTML files. This should be set as the DOCUMENT_ROOT of your web
248
+ server.
249
+
250
+ script
251
+ Helper scripts for automation and generation.
252
+
253
+ test
254
+ Unit and functional tests along with fixtures. When using the rails generate
255
+ command, template test files will be generated for you and placed in this
256
+ directory.
257
+
258
+ vendor
259
+ External libraries that the application depends on. Also includes the plugins
260
+ subdirectory. If the app has frozen rails, those gems also go here, under
261
+ vendor/rails/. This directory is in the load path.
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env rake
2
+ # Add your own tasks in files placed in lib/tasks ending in .rake,
3
+ # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
4
+
5
+ require File.expand_path('../config/application', __FILE__)
6
+
7
+ Dummy::Application.load_tasks
@@ -0,0 +1,32 @@
1
+ ActiveAdmin.register AdminUser do
2
+ filter :email
3
+
4
+ index do
5
+ selectable_column
6
+ column :email
7
+ column :last_sign_in_at
8
+ column :created_at
9
+ column :sign_in_count
10
+ default_actions
11
+ end
12
+
13
+ show :title => :email do
14
+ attributes_table do
15
+ row :email
16
+ row :last_sign_in_at
17
+ row :last_sign_in_ip
18
+ row :created_at
19
+ row :sign_in_count
20
+ end
21
+ active_admin_comments
22
+ end
23
+
24
+ form do |f|
25
+ f.inputs do
26
+ f.input :email
27
+ f.input :password
28
+ f.input :password_confirmation
29
+ end
30
+ f.buttons
31
+ end
32
+ end
@@ -0,0 +1,44 @@
1
+ ActiveAdmin::Dashboards.build do
2
+
3
+ # Define your dashboard sections here. Each block will be
4
+ # rendered on the dashboard in the context of the view. So just
5
+ # return the content which you would like to display.
6
+
7
+ # == Simple Dashboard Section
8
+ # Here is an example of a simple dashboard section
9
+ #
10
+ # section "Recent Posts" do
11
+ # ul do
12
+ # Post.recent(5).collect do |post|
13
+ # li link_to(post.title, admin_post_path(post))
14
+ # end
15
+ # end
16
+ # end
17
+
18
+ # == Render Partial Section
19
+ # The block is rendered within the context of the view, so you can
20
+ # easily render a partial rather than build content in ruby.
21
+ #
22
+ # section "Recent Posts" do
23
+ # div do
24
+ # render 'recent_posts' # => this will render /app/views/admin/dashboard/_recent_posts.html.erb
25
+ # end
26
+ # end
27
+
28
+ # == Section Ordering
29
+ # The dashboard sections are ordered by a given priority from top left to
30
+ # bottom right. The default priority is 10. By giving a section numerically lower
31
+ # priority it will be sorted higher. For example:
32
+ #
33
+ # section "Recent Posts", :priority => 10
34
+ # section "Recent User", :priority => 1
35
+ #
36
+ # Will render the "Recent Users" then the "Recent Posts" sections on the dashboard.
37
+
38
+ # == Conditionally Display
39
+ # Provide a method name or Proc object to conditionally render a section at run time.
40
+ #
41
+ # section "Membership Summary", :if => :memberships_enabled?
42
+ # section "Membership Summary", :if => Proc.new { current_admin_user.account.memberships.any? }
43
+
44
+ end
@@ -0,0 +1 @@
1
+ //= require active_admin/base
@@ -0,0 +1,15 @@
1
+ // This is a manifest file that'll be compiled into application.js, which will include all the files
2
+ // listed below.
3
+ //
4
+ // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5
+ // or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
6
+ //
7
+ // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8
+ // the compiled file.
9
+ //
10
+ // WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
11
+ // GO AFTER THE REQUIRES BELOW.
12
+ //
13
+ //= require jquery
14
+ //= require jquery_ujs
15
+ //= require_tree .