releaf 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (323) hide show
  1. data/LICENSE +24 -0
  2. data/README.md +74 -0
  3. data/Rakefile +62 -0
  4. data/app/assets/images/releaf/3rd_party/jquery-ui-1.9.2.custom/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  5. data/app/assets/images/releaf/3rd_party/jquery-ui-1.9.2.custom/ui-bg_flat_75_ffffff_40x100.png +0 -0
  6. data/app/assets/images/releaf/3rd_party/jquery-ui-1.9.2.custom/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  7. data/app/assets/images/releaf/3rd_party/jquery-ui-1.9.2.custom/ui-bg_glass_65_ffffff_1x400.png +0 -0
  8. data/app/assets/images/releaf/3rd_party/jquery-ui-1.9.2.custom/ui-bg_glass_75_dadada_1x400.png +0 -0
  9. data/app/assets/images/releaf/3rd_party/jquery-ui-1.9.2.custom/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  10. data/app/assets/images/releaf/3rd_party/jquery-ui-1.9.2.custom/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  11. data/app/assets/images/releaf/3rd_party/jquery-ui-1.9.2.custom/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  12. data/app/assets/images/releaf/3rd_party/jquery-ui-1.9.2.custom/ui-icons_222222_256x240.png +0 -0
  13. data/app/assets/images/releaf/3rd_party/jquery-ui-1.9.2.custom/ui-icons_2e83ff_256x240.png +0 -0
  14. data/app/assets/images/releaf/3rd_party/jquery-ui-1.9.2.custom/ui-icons_454545_256x240.png +0 -0
  15. data/app/assets/images/releaf/3rd_party/jquery-ui-1.9.2.custom/ui-icons_888888_256x240.png +0 -0
  16. data/app/assets/images/releaf/3rd_party/jquery-ui-1.9.2.custom/ui-icons_cd0a0a_256x240.png +0 -0
  17. data/app/assets/images/releaf/3rd_party/lightbox/close.png +0 -0
  18. data/app/assets/images/releaf/3rd_party/lightbox/loading.gif +0 -0
  19. data/app/assets/images/releaf/3rd_party/lightbox/next.png +0 -0
  20. data/app/assets/images/releaf/3rd_party/lightbox/prev.png +0 -0
  21. data/app/assets/images/releaf/add.png +0 -0
  22. data/app/assets/images/releaf/background.jpg +0 -0
  23. data/app/assets/images/releaf/button/button_bgr.gif +0 -0
  24. data/app/assets/images/releaf/button/button_hover_bgr.png +0 -0
  25. data/app/assets/images/releaf/controllers/content/close.gif +0 -0
  26. data/app/assets/images/releaf/controllers/content/close_active.gif +0 -0
  27. data/app/assets/images/releaf/controllers/content/close_hover.gif +0 -0
  28. data/app/assets/images/releaf/controllers/content/global_fields_bgr.png +0 -0
  29. data/app/assets/images/releaf/controllers/content/open.gif +0 -0
  30. data/app/assets/images/releaf/controllers/content/open_2.gif +0 -0
  31. data/app/assets/images/releaf/controllers/content/open_active.gif +0 -0
  32. data/app/assets/images/releaf/controllers/content/open_hover.gif +0 -0
  33. data/app/assets/images/releaf/controllers/sessions/background.jpg +0 -0
  34. data/app/assets/images/releaf/controllers/sessions/logo.jpg +0 -0
  35. data/app/assets/images/releaf/expand_tool/close.png +0 -0
  36. data/app/assets/images/releaf/expand_tool/close_hover.png +0 -0
  37. data/app/assets/images/releaf/expand_tool/close_hover_shim.png +0 -0
  38. data/app/assets/images/releaf/expand_tool/close_shim.png +0 -0
  39. data/app/assets/images/releaf/expand_tool/loader.gif +0 -0
  40. data/app/assets/images/releaf/expand_tool/open.png +0 -0
  41. data/app/assets/images/releaf/expand_tool/open_hover.png +0 -0
  42. data/app/assets/images/releaf/expand_tool/open_hover_shim.png +0 -0
  43. data/app/assets/images/releaf/expand_tool/open_shim.png +0 -0
  44. data/app/assets/images/releaf/favicon.ico +0 -0
  45. data/app/assets/images/releaf/globalFieldContainerBgr.png +0 -0
  46. data/app/assets/images/releaf/icons/129.png +0 -0
  47. data/app/assets/images/releaf/icons/130.png +0 -0
  48. data/app/assets/images/releaf/icons/accept.png +0 -0
  49. data/app/assets/images/releaf/icons/add.png +0 -0
  50. data/app/assets/images/releaf/icons/arrow_down.png +0 -0
  51. data/app/assets/images/releaf/icons/arrow_left.png +0 -0
  52. data/app/assets/images/releaf/icons/arrow_refresh.png +0 -0
  53. data/app/assets/images/releaf/icons/arrow_up.png +0 -0
  54. data/app/assets/images/releaf/icons/bin_empty.png +0 -0
  55. data/app/assets/images/releaf/icons/bullet_black.png +0 -0
  56. data/app/assets/images/releaf/icons/bullet_connect.png +0 -0
  57. data/app/assets/images/releaf/icons/bullet_start.png +0 -0
  58. data/app/assets/images/releaf/icons/bullet_tick.png +0 -0
  59. data/app/assets/images/releaf/icons/chrome.png +0 -0
  60. data/app/assets/images/releaf/icons/control_play.png +0 -0
  61. data/app/assets/images/releaf/icons/date.png +0 -0
  62. data/app/assets/images/releaf/icons/delete.png +0 -0
  63. data/app/assets/images/releaf/icons/disk.png +0 -0
  64. data/app/assets/images/releaf/icons/drag-handle.png +0 -0
  65. data/app/assets/images/releaf/icons/error.png +0 -0
  66. data/app/assets/images/releaf/icons/eye.png +0 -0
  67. data/app/assets/images/releaf/icons/firefox.png +0 -0
  68. data/app/assets/images/releaf/icons/google-not-available.gif +0 -0
  69. data/app/assets/images/releaf/icons/google.gif +0 -0
  70. data/app/assets/images/releaf/icons/keyboard.png +0 -0
  71. data/app/assets/images/releaf/icons/left_16.png +0 -0
  72. data/app/assets/images/releaf/icons/link.png +0 -0
  73. data/app/assets/images/releaf/icons/magnifier.png +0 -0
  74. data/app/assets/images/releaf/icons/notAllowed.png +0 -0
  75. data/app/assets/images/releaf/icons/page_white_add.png +0 -0
  76. data/app/assets/images/releaf/icons/page_white_edit.png +0 -0
  77. data/app/assets/images/releaf/icons/page_white_put.png +0 -0
  78. data/app/assets/images/releaf/icons/page_white_text.png +0 -0
  79. data/app/assets/images/releaf/icons/pencil.png +0 -0
  80. data/app/assets/images/releaf/icons/picture.png +0 -0
  81. data/app/assets/images/releaf/icons/right_16.png +0 -0
  82. data/app/assets/images/releaf/icons/tick.png +0 -0
  83. data/app/assets/images/releaf/icons/warning.png +0 -0
  84. data/app/assets/images/releaf/icons/world_go.png +0 -0
  85. data/app/assets/images/releaf/icons/world_link.png +0 -0
  86. data/app/assets/images/releaf/input/autocompleteExpandIcon.png +0 -0
  87. data/app/assets/images/releaf/input/input_bgr.gif +0 -0
  88. data/app/assets/images/releaf/language_root.png +0 -0
  89. data/app/assets/images/releaf/loader.gif +0 -0
  90. data/app/assets/images/releaf/logout.png +0 -0
  91. data/app/assets/images/releaf/main_menu/active_bgr.png +0 -0
  92. data/app/assets/images/releaf/main_menu/bgr.png +0 -0
  93. data/app/assets/images/releaf/main_menu/hover_bgr.png +0 -0
  94. data/app/assets/images/releaf/module.png +0 -0
  95. data/app/assets/images/releaf/panel_layout/active_bgr.png +0 -0
  96. data/app/assets/images/releaf/panel_layout/secondary_panel_horizontal_bgr.png +0 -0
  97. data/app/assets/images/releaf/panel_layout/secondary_panel_vertical_bgr.png +0 -0
  98. data/app/assets/images/releaf/releaf_table/selected_bgr.png +0 -0
  99. data/app/assets/images/releaf/releaf_table/th_bgr.gif +0 -0
  100. data/app/assets/javascripts/releaf/3rd_party/jquery-cookie/README.md +73 -0
  101. data/app/assets/javascripts/releaf/3rd_party/jquery-cookie/jquery.cookie.js +47 -0
  102. data/app/assets/javascripts/releaf/3rd_party/jquery-cookie/server.js +24 -0
  103. data/app/assets/javascripts/releaf/3rd_party/jquery-cookie/test.html +19 -0
  104. data/app/assets/javascripts/releaf/3rd_party/jquery-cookie/test.js +80 -0
  105. data/app/assets/javascripts/releaf/3rd_party/jquery-ui-timepicker-addon.js +1882 -0
  106. data/app/assets/javascripts/releaf/3rd_party/lightbox.js.erb +379 -0
  107. data/app/assets/javascripts/releaf/application.js +14 -0
  108. data/app/assets/javascripts/releaf/controllers/base.js +170 -0
  109. data/app/assets/javascripts/releaf/controllers/releaf/content.js +90 -0
  110. data/app/assets/javascripts/releaf/controllers/releaf/translations.js +31 -0
  111. data/app/assets/javascripts/releaf/include/continuous_scroll.js +321 -0
  112. data/app/assets/javascripts/releaf/include/field.type_autocomplete.js +58 -0
  113. data/app/assets/javascripts/releaf/include/field.type_richtext.js +90 -0
  114. data/app/assets/javascripts/releaf/include/localization.js +12 -0
  115. data/app/assets/javascripts/releaf/include/nested_fields.js +71 -0
  116. data/app/assets/javascripts/releaf/include/sortable.js +27 -0
  117. data/app/assets/javascripts/releaf/lib/request_url.js +183 -0
  118. data/app/assets/stylesheets/releaf/3rd_party/jquery-ui-1.9.2.custom.css.erb +464 -0
  119. data/app/assets/stylesheets/releaf/3rd_party/jquery-ui-timepicker-addon.css +10 -0
  120. data/app/assets/stylesheets/releaf/3rd_party/lightbox.css.erb +157 -0
  121. data/app/assets/stylesheets/releaf/application.css.erb +122 -0
  122. data/app/assets/stylesheets/releaf/controllers/base.css.erb +205 -0
  123. data/app/assets/stylesheets/releaf/controllers/releaf/content.css.erb +416 -0
  124. data/app/assets/stylesheets/releaf/controllers/releaf/sessions.css.scss.erb +116 -0
  125. data/app/assets/stylesheets/releaf/controllers/releaf/translations.css.erb +205 -0
  126. data/app/assets/stylesheets/releaf/include/button.css.erb +176 -0
  127. data/app/assets/stylesheets/releaf/include/field.css.erb +257 -0
  128. data/app/assets/stylesheets/releaf/include/input.css.erb +40 -0
  129. data/app/assets/stylesheets/releaf/include/main_menu.css.erb +66 -0
  130. data/app/assets/stylesheets/releaf/include/pagination.css.erb +29 -0
  131. data/app/assets/stylesheets/releaf/include/panel_layout.css.erb +251 -0
  132. data/app/assets/stylesheets/releaf/include/releaf_table.css.erb +112 -0
  133. data/app/assets/stylesheets/releaf/include/sortable.css.erb +12 -0
  134. data/app/controllers/releaf/admins_controller.rb +48 -0
  135. data/app/controllers/releaf/application_controller.rb +11 -0
  136. data/app/controllers/releaf/base_application_controller.rb +15 -0
  137. data/app/controllers/releaf/base_controller.rb +310 -0
  138. data/app/controllers/releaf/content_controller.rb +166 -0
  139. data/app/controllers/releaf/roles_controller.rb +36 -0
  140. data/app/controllers/releaf/sessions_controller.rb +5 -0
  141. data/app/controllers/releaf/tinymce_assets_controller.rb +26 -0
  142. data/app/controllers/releaf/translations_controller.rb +121 -0
  143. data/app/helpers/releaf/admin_helper.rb +79 -0
  144. data/app/helpers/releaf/application_helper.rb +4 -0
  145. data/app/helpers/releaf/pagination_renderer.rb +44 -0
  146. data/app/helpers/releaf/releaf_devise_helper.rb +8 -0
  147. data/app/models/releaf/admin.rb +51 -0
  148. data/app/models/releaf/node.rb +221 -0
  149. data/app/models/releaf/node_base.rb +25 -0
  150. data/app/models/releaf/role.rb +119 -0
  151. data/app/models/releaf/tinymce_asset.rb +6 -0
  152. data/app/views/layouts/releaf/admin.html.haml +51 -0
  153. data/app/views/releaf/aliases/_edit.body.haml +50 -0
  154. data/app/views/releaf/aliases/_edit.header.haml +19 -0
  155. data/app/views/releaf/aliases/_index.row.haml +5 -0
  156. data/app/views/releaf/aliases/_secondary_panel.haml +13 -0
  157. data/app/views/releaf/base/_edit.body.haml +19 -0
  158. data/app/views/releaf/base/_edit.field.haml +96 -0
  159. data/app/views/releaf/base/_edit.field.type_autocomplete.haml +15 -0
  160. data/app/views/releaf/base/_edit.field.type_checkbox.haml +5 -0
  161. data/app/views/releaf/base/_edit.field.type_date.haml +8 -0
  162. data/app/views/releaf/base/_edit.field.type_datetime.haml +8 -0
  163. data/app/views/releaf/base/_edit.field.type_delete_nested.haml +3 -0
  164. data/app/views/releaf/base/_edit.field.type_file.haml +10 -0
  165. data/app/views/releaf/base/_edit.field.type_image.haml +14 -0
  166. data/app/views/releaf/base/_edit.field.type_link.haml +4 -0
  167. data/app/views/releaf/base/_edit.field.type_password.haml +4 -0
  168. data/app/views/releaf/base/_edit.field.type_richtext.haml +4 -0
  169. data/app/views/releaf/base/_edit.field.type_richtext_i18n.haml +27 -0
  170. data/app/views/releaf/base/_edit.field.type_select.haml +11 -0
  171. data/app/views/releaf/base/_edit.field.type_text.haml +4 -0
  172. data/app/views/releaf/base/_edit.field.type_text_i18n.haml +27 -0
  173. data/app/views/releaf/base/_edit.field.type_textarea.haml +4 -0
  174. data/app/views/releaf/base/_edit.field.type_textarea_i18n.haml +27 -0
  175. data/app/views/releaf/base/_edit.field.type_time.haml +8 -0
  176. data/app/views/releaf/base/_edit.footer.haml +14 -0
  177. data/app/views/releaf/base/_edit.form.haml +4 -0
  178. data/app/views/releaf/base/_edit.has_many_associations.haml +45 -0
  179. data/app/views/releaf/base/_edit.header.haml +3 -0
  180. data/app/views/releaf/base/_index.body.haml +6 -0
  181. data/app/views/releaf/base/_index.cell.haml +19 -0
  182. data/app/views/releaf/base/_index.footer.haml +22 -0
  183. data/app/views/releaf/base/_index.header.haml +4 -0
  184. data/app/views/releaf/base/_index.row.haml +6 -0
  185. data/app/views/releaf/base/_index.search.haml +5 -0
  186. data/app/views/releaf/base/_index.table.haml +8 -0
  187. data/app/views/releaf/base/_secondary_panel.haml +9 -0
  188. data/app/views/releaf/base/_show.body.haml +7 -0
  189. data/app/views/releaf/base/_show.field.haml +78 -0
  190. data/app/views/releaf/base/_show.field.type_html.haml +1 -0
  191. data/app/views/releaf/base/_show.footer.haml +16 -0
  192. data/app/views/releaf/base/_show.header.haml +3 -0
  193. data/app/views/releaf/base/confirm_destroy.haml +10 -0
  194. data/app/views/releaf/base/edit.haml +1 -0
  195. data/app/views/releaf/base/index.haml +3 -0
  196. data/app/views/releaf/base/new.haml +1 -0
  197. data/app/views/releaf/base/show.haml +3 -0
  198. data/app/views/releaf/content/_edit.body.haml +45 -0
  199. data/app/views/releaf/content/_edit.content_fields.haml +19 -0
  200. data/app/views/releaf/content/_edit.slug.haml +12 -0
  201. data/app/views/releaf/content/_get_content_form.haml +7 -0
  202. data/app/views/releaf/content/_secondary_panel.haml +3 -0
  203. data/app/views/releaf/content/_show.field.content.haml +11 -0
  204. data/app/views/releaf/content/_tree_level.haml +16 -0
  205. data/app/views/releaf/content/ajax.new.haml +3 -0
  206. data/app/views/releaf/content/index.haml +0 -0
  207. data/app/views/releaf/roles/_edit.field.admins.haml +0 -0
  208. data/app/views/releaf/roles/_edit.field.permissions.haml +5 -0
  209. data/app/views/releaf/roles/_show.field.default.haml +6 -0
  210. data/app/views/releaf/roles/_show.field.permissions.haml +11 -0
  211. data/app/views/releaf/sessions/new.html.haml +17 -0
  212. data/app/views/releaf/translations/_edit.body.haml +50 -0
  213. data/app/views/releaf/translations/_edit.header.haml +19 -0
  214. data/app/views/releaf/translations/_index.row.haml +5 -0
  215. data/app/views/releaf/translations/_secondary_panel.haml +13 -0
  216. data/bin/releaf +25 -0
  217. data/lib/generators/releaf/install_generator.rb +87 -0
  218. data/lib/generators/releaf/templates/config/common_fields.yml.example +17 -0
  219. data/lib/generators/releaf/templates/controllers/home_controller.rb +4 -0
  220. data/lib/generators/releaf/templates/images/3rd_party/jquery_ui/smoothness/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  221. data/lib/generators/releaf/templates/images/3rd_party/jquery_ui/smoothness/ui-bg_flat_75_ffffff_40x100.png +0 -0
  222. data/lib/generators/releaf/templates/images/3rd_party/jquery_ui/smoothness/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  223. data/lib/generators/releaf/templates/images/3rd_party/jquery_ui/smoothness/ui-bg_glass_65_ffffff_1x400.png +0 -0
  224. data/lib/generators/releaf/templates/images/3rd_party/jquery_ui/smoothness/ui-bg_glass_75_dadada_1x400.png +0 -0
  225. data/lib/generators/releaf/templates/images/3rd_party/jquery_ui/smoothness/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  226. data/lib/generators/releaf/templates/images/3rd_party/jquery_ui/smoothness/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  227. data/lib/generators/releaf/templates/images/3rd_party/jquery_ui/smoothness/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  228. data/lib/generators/releaf/templates/images/3rd_party/jquery_ui/smoothness/ui-icons_222222_256x240.png +0 -0
  229. data/lib/generators/releaf/templates/images/3rd_party/jquery_ui/smoothness/ui-icons_2e83ff_256x240.png +0 -0
  230. data/lib/generators/releaf/templates/images/3rd_party/jquery_ui/smoothness/ui-icons_454545_256x240.png +0 -0
  231. data/lib/generators/releaf/templates/images/3rd_party/jquery_ui/smoothness/ui-icons_888888_256x240.png +0 -0
  232. data/lib/generators/releaf/templates/images/3rd_party/jquery_ui/smoothness/ui-icons_cd0a0a_256x240.png +0 -0
  233. data/lib/generators/releaf/templates/images/3rd_party/lightbox/close.png +0 -0
  234. data/lib/generators/releaf/templates/images/3rd_party/lightbox/loading.gif +0 -0
  235. data/lib/generators/releaf/templates/images/3rd_party/lightbox/next.png +0 -0
  236. data/lib/generators/releaf/templates/images/3rd_party/lightbox/prev.png +0 -0
  237. data/lib/generators/releaf/templates/initializers/releaf.rb +59 -0
  238. data/lib/generators/releaf/templates/initializers/releaf_i18n.rb +8 -0
  239. data/lib/generators/releaf/templates/initializers/releaf_store_current_template.rb +25 -0
  240. data/lib/generators/releaf/templates/javascripts/3rd_party/jquery_ui.js +14850 -0
  241. data/lib/generators/releaf/templates/javascripts/3rd_party/lightbox.js.erb +379 -0
  242. data/lib/generators/releaf/templates/javascripts/application.js +15 -0
  243. data/lib/generators/releaf/templates/javascripts/lib/js_check.js +8 -0
  244. data/lib/generators/releaf/templates/javascripts/lib/request_url.js +169 -0
  245. data/lib/generators/releaf/templates/javascripts/lib/sortable.js +29 -0
  246. data/lib/generators/releaf/templates/migrations/create_releaf_admins.rb +53 -0
  247. data/lib/generators/releaf/templates/migrations/create_releaf_nodes.rb +25 -0
  248. data/lib/generators/releaf/templates/migrations/create_releaf_roles.rb +11 -0
  249. data/lib/generators/releaf/templates/migrations/create_releaf_tinymce_assets.rb +10 -0
  250. data/lib/generators/releaf/templates/migrations/create_releaf_translations.rb +31 -0
  251. data/lib/generators/releaf/templates/models/admin_ability.rb +51 -0
  252. data/lib/generators/releaf/templates/seeds.rb +64 -0
  253. data/lib/generators/releaf/templates/stylesheets/3rd_party/jquery_ui/smoothness.css.erb +1174 -0
  254. data/lib/generators/releaf/templates/stylesheets/3rd_party/lightbox.css.erb +157 -0
  255. data/lib/generators/releaf/templates/stylesheets/3rd_party/reset.css +48 -0
  256. data/lib/generators/releaf/templates/stylesheets/application.scss +15 -0
  257. data/lib/generators/releaf/templates/stylesheets/style.scss +45 -0
  258. data/lib/generators/releaf/templates/views/home/index.html.haml +1 -0
  259. data/lib/generators/releaf/templates/views/layouts/application.html.haml +26 -0
  260. data/lib/i18n/backend/releaf.rb +96 -0
  261. data/lib/i18n/backend/releaf/translation.rb +56 -0
  262. data/lib/i18n/backend/releaf/translation_data.rb +32 -0
  263. data/lib/i18n/backend/releaf/translation_group.rb +30 -0
  264. data/lib/i18n/releaf.rb +1 -0
  265. data/lib/releaf.rb +30 -0
  266. data/lib/releaf/engine.rb +4 -0
  267. data/lib/releaf/slug.rb +79 -0
  268. data/lib/releaf/version.rb +3 -0
  269. data/lib/tasks/releaf_tasks.rake +4 -0
  270. data/spec/dummy/README.rdoc +261 -0
  271. data/spec/dummy/Rakefile +7 -0
  272. data/spec/dummy/app/assets/images/rails.png +0 -0
  273. data/spec/dummy/app/assets/javascripts/application.js +15 -0
  274. data/spec/dummy/app/assets/stylesheets/application.css +13 -0
  275. data/spec/dummy/app/controllers/application_controller.rb +3 -0
  276. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  277. data/spec/dummy/app/models/admin_ability.rb +51 -0
  278. data/spec/dummy/app/models/settings.rb +2 -0
  279. data/spec/dummy/app/views/layouts/application.html.haml +10 -0
  280. data/spec/dummy/config.ru +4 -0
  281. data/spec/dummy/config/application.rb +68 -0
  282. data/spec/dummy/config/boot.rb +6 -0
  283. data/spec/dummy/config/common_fields.yml.example +17 -0
  284. data/spec/dummy/config/database.yml +42 -0
  285. data/spec/dummy/config/environment.rb +5 -0
  286. data/spec/dummy/config/environments/development.rb +37 -0
  287. data/spec/dummy/config/environments/production.rb +67 -0
  288. data/spec/dummy/config/environments/test.rb +37 -0
  289. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  290. data/spec/dummy/config/initializers/devise.rb +232 -0
  291. data/spec/dummy/config/initializers/dragonfly.rb +1 -0
  292. data/spec/dummy/config/initializers/inflections.rb +15 -0
  293. data/spec/dummy/config/initializers/mime_types.rb +5 -0
  294. data/spec/dummy/config/initializers/releaf.rb +59 -0
  295. data/spec/dummy/config/initializers/releaf_i18n.rb +8 -0
  296. data/spec/dummy/config/initializers/releaf_store_current_template.rb +25 -0
  297. data/spec/dummy/config/initializers/secret_token.rb +7 -0
  298. data/spec/dummy/config/initializers/session_store.rb +8 -0
  299. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  300. data/spec/dummy/config/locales/devise.en.yml +58 -0
  301. data/spec/dummy/config/locales/en.yml +5 -0
  302. data/spec/dummy/config/routes.rb +11 -0
  303. data/spec/dummy/db/migrate/20130204164516_create_settings.rb +17 -0
  304. data/spec/dummy/db/migrate/20130204164523_create_releaf_nodes.rb +25 -0
  305. data/spec/dummy/db/migrate/20130204164524_create_releaf_roles.rb +11 -0
  306. data/spec/dummy/db/migrate/20130204164525_create_releaf_translations.rb +31 -0
  307. data/spec/dummy/db/migrate/20130204164526_create_releaf_admins.rb +53 -0
  308. data/spec/dummy/db/schema.rb +112 -0
  309. data/spec/dummy/db/seeds.rb +64 -0
  310. data/spec/dummy/doc/README_FOR_APP +2 -0
  311. data/spec/dummy/log/development.log +74 -0
  312. data/spec/dummy/log/test.log +129 -0
  313. data/spec/dummy/public/404.html +26 -0
  314. data/spec/dummy/public/422.html +26 -0
  315. data/spec/dummy/public/500.html +25 -0
  316. data/spec/dummy/public/favicon.ico +0 -0
  317. data/spec/dummy/script/rails +6 -0
  318. data/spec/dummy/tmp/cache/9C5/660/settings%3Ai18n_updated_at +1 -0
  319. data/spec/factories/factories.rb +24 -0
  320. data/spec/features/admin_spec.rb +41 -0
  321. data/spec/spec_helper.rb +23 -0
  322. data/templates/releaf/installer.rb +196 -0
  323. metadata +777 -0
@@ -0,0 +1,64 @@
1
+ # encoding: UTF-8
2
+
3
+ Releaf::Role.delete_all
4
+ Releaf::Admin.delete_all
5
+
6
+ Settings.delete_all
7
+
8
+ # Role {{{
9
+
10
+ puts "Creating roles"
11
+ roles = {
12
+ default: {
13
+ name: 'default role',
14
+ default: true
15
+ },
16
+ admins: {
17
+ name: 'admins',
18
+ default: false,
19
+ admin_permission: true
20
+ }
21
+ }
22
+
23
+ roles.each_value do |value|
24
+ value[:id] = Releaf::Role.create!(value).id
25
+ end
26
+
27
+ # }}}
28
+ # Admin {{{
29
+
30
+ puts "Creating admins"
31
+ admins = {
32
+ admin: {
33
+ name: 'Admin',
34
+ surname: 'User',
35
+ password: 'password',
36
+ password_confirmation: 'password',
37
+ email: 'admin@example.com',
38
+ role_id: roles[:admins][:id],
39
+ },
40
+ janis: {
41
+ name: 'Simple',
42
+ surname: 'User',
43
+ password: 'LetMeIn',
44
+ password_confirmation: 'LetMeIn',
45
+ email: 'user@example.com',
46
+ role_id: roles[:default][:id]
47
+ }
48
+ }
49
+
50
+ admins.each_value do |value|
51
+ value[:id] = Releaf::Admin.create!(value).id
52
+ end
53
+
54
+ # }}}
55
+ # Settings {{{
56
+
57
+ puts "Creating settings"
58
+ Settings.i18n_locales = %w[en]
59
+ Settings.email_from = "do_not_reply@example.com"
60
+
61
+ # }}}
62
+
63
+
64
+ # vim: set fdm=marker:
@@ -0,0 +1,2 @@
1
+ Use this README file to introduce your application and point to useful places in the API for learning more.
2
+ Run "rake doc:app" to generate API documentation for your models, controllers, helpers, and libraries.
@@ -0,0 +1,74 @@
1
+ Connecting to database specified by database.yml
2
+ Connecting to database specified by database.yml
3
+ Connecting to database specified by database.yml
4
+ Connecting to database specified by database.yml
5
+  (228.2ms) CREATE TABLE `schema_migrations` (`version` varchar(255) NOT NULL) ENGINE=InnoDB
6
+  (428.0ms) CREATE UNIQUE INDEX `unique_schema_migrations` ON `schema_migrations` (`version`)
7
+  (39.0ms) SELECT `schema_migrations`.`version` FROM `schema_migrations` 
8
+ Migrating to CreateSettings (20130204164516)
9
+  (123.7ms) CREATE TABLE `settings` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `var` varchar(255) NOT NULL, `value` text, `thing_id` int(11), `thing_type` varchar(30), `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL) ENGINE=InnoDB
10
+  (172.7ms) CREATE UNIQUE INDEX `index_settings_on_thing_type_and_thing_id_and_var` ON `settings` (`thing_type`, `thing_id`, `var`)
11
+  (1.0ms) INSERT INTO `schema_migrations` (`version`) VALUES ('20130204164516')
12
+ Migrating to CreateReleafNodes (20130204164523)
13
+  (121.1ms) CREATE TABLE `releaf_nodes` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `name` varchar(255), `slug` varchar(255), `parent_id` int(11), `lft` int(11), `rgt` int(11), `content_type` varchar(255), `content_id` int(11), `data` text, `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL, `content_string` varchar(255), `position` int(11), `visible` tinyint(1) DEFAULT 1 NOT NULL, `protected` tinyint(1) DEFAULT 0 NOT NULL) ENGINE=InnoDB
14
+  (178.6ms) CREATE INDEX `index_releaf_nodes_on_parent_id` ON `releaf_nodes` (`parent_id`)
15
+  (145.3ms) CREATE INDEX `index_releaf_nodes_on_content_type_and_content_id` ON `releaf_nodes` (`content_type`, `content_id`)
16
+  (147.1ms) CREATE INDEX `index_releaf_nodes_on_lft` ON `releaf_nodes` (`lft`)
17
+  (148.0ms) CREATE INDEX `index_releaf_nodes_on_rgt` ON `releaf_nodes` (`rgt`)
18
+  (156.3ms) CREATE INDEX `index_releaf_nodes_on_slug` ON `releaf_nodes` (`slug`)
19
+  (2.8ms) INSERT INTO `schema_migrations` (`version`) VALUES ('20130204164523')
20
+ Migrating to CreateReleafRoles (20130204164524)
21
+  (128.0ms) CREATE TABLE `releaf_roles` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `name` varchar(255) NOT NULL, `permissions` text, `default` tinyint(1) DEFAULT 0 NOT NULL, `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL) ENGINE=InnoDB
22
+  (2.2ms) INSERT INTO `schema_migrations` (`version`) VALUES ('20130204164524')
23
+ Migrating to CreateReleafTranslations (20130204164525)
24
+  (147.8ms) CREATE TABLE `releaf_translation_groups` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `scope` varchar(255) NOT NULL, `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL) ENGINE=InnoDB
25
+  (140.7ms) CREATE UNIQUE INDEX `index_releaf_translation_groups_on_scope` ON `releaf_translation_groups` (`scope`)
26
+  (131.7ms) CREATE TABLE `releaf_translations` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `group_id` int(11) NOT NULL, `key` varchar(255) NOT NULL, `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL) ENGINE=InnoDB
27
+  (149.0ms) CREATE UNIQUE INDEX `index_releaf_translations_on_group_id_and_key` ON `releaf_translations` (`group_id`, `key`)
28
+  (138.1ms) CREATE INDEX `index_releaf_translations_on_group_id` ON `releaf_translations` (`group_id`)
29
+  (133.4ms) CREATE TABLE `releaf_translation_data` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `translation_id` int(11) NOT NULL, `lang` varchar(5) NOT NULL, `localization` text, `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL) ENGINE=InnoDB
30
+  (138.5ms) CREATE INDEX `index_releaf_translation_data_on_lang` ON `releaf_translation_data` (`lang`)
31
+  (135.2ms) CREATE INDEX `index_releaf_translation_data_on_translation_id` ON `releaf_translation_data` (`translation_id`)
32
+  (132.7ms) CREATE UNIQUE INDEX `index_releaf_translation_data_on_lang_and_translation_id` ON `releaf_translation_data` (`lang`, `translation_id`)
33
+  (1.8ms) INSERT INTO `schema_migrations` (`version`) VALUES ('20130204164525')
34
+ Migrating to CreateReleafAdmins (20130204164526)
35
+  (125.1ms) CREATE TABLE `releaf_admins` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `name` varchar(255) NOT NULL, `surname` varchar(255) NOT NULL, `phone` varchar(255), `avatar_uid` varchar(255), `role_id` int(11), `email` varchar(255) DEFAULT '' NOT NULL, `encrypted_password` varchar(255) DEFAULT '' NOT NULL, `reset_password_token` varchar(255), `reset_password_sent_at` datetime, `remember_created_at` datetime, `sign_in_count` int(11) DEFAULT 0, `current_sign_in_at` datetime, `last_sign_in_at` datetime, `current_sign_in_ip` varchar(255), `last_sign_in_ip` varchar(255), `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL) ENGINE=InnoDB
36
+  (169.1ms) CREATE INDEX `index_releaf_admins_on_role_id` ON `releaf_admins` (`role_id`)
37
+  (145.9ms) CREATE UNIQUE INDEX `index_releaf_admins_on_email` ON `releaf_admins` (`email`)
38
+  (140.5ms) CREATE UNIQUE INDEX `index_releaf_admins_on_reset_password_token` ON `releaf_admins` (`reset_password_token`)
39
+  (0.9ms) INSERT INTO `schema_migrations` (`version`) VALUES ('20130204164526')
40
+  (0.2ms) SELECT `schema_migrations`.`version` FROM `schema_migrations` 
41
+ Connecting to database specified by database.yml
42
+  (3.0ms) SELECT `schema_migrations`.`version` FROM `schema_migrations` 
43
+  (0.5ms) DROP DATABASE IF EXISTS `dummy_test`
44
+  (0.4ms) CREATE DATABASE `dummy_test` DEFAULT CHARACTER SET `utf8` COLLATE `utf8_unicode_ci`
45
+  (80.0ms) CREATE TABLE `releaf_admins` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `name` varchar(255) NOT NULL, `surname` varchar(255) NOT NULL, `phone` varchar(255), `avatar_uid` varchar(255), `role_id` int(11), `email` varchar(255) DEFAULT '' NOT NULL, `encrypted_password` varchar(255) DEFAULT '' NOT NULL, `reset_password_token` varchar(255), `reset_password_sent_at` datetime, `remember_created_at` datetime, `sign_in_count` int(11) DEFAULT 0, `current_sign_in_at` datetime, `last_sign_in_at` datetime, `current_sign_in_ip` varchar(255), `last_sign_in_ip` varchar(255), `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL) ENGINE=InnoDB
46
+  (216.6ms) CREATE UNIQUE INDEX `index_releaf_admins_on_email` ON `releaf_admins` (`email`)
47
+  (184.8ms) CREATE UNIQUE INDEX `index_releaf_admins_on_reset_password_token` ON `releaf_admins` (`reset_password_token`)
48
+  (152.5ms) CREATE INDEX `index_releaf_admins_on_role_id` ON `releaf_admins` (`role_id`)
49
+  (119.1ms) CREATE TABLE `releaf_nodes` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `name` varchar(255), `slug` varchar(255), `parent_id` int(11), `lft` int(11), `rgt` int(11), `content_type` varchar(255), `content_id` int(11), `data` text, `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL, `content_string` varchar(255), `position` int(11), `visible` tinyint(1) DEFAULT 1 NOT NULL, `protected` tinyint(1) DEFAULT 0 NOT NULL) ENGINE=InnoDB
50
+  (170.6ms) CREATE INDEX `index_releaf_nodes_on_content_type_and_content_id` ON `releaf_nodes` (`content_type`, `content_id`)
51
+  (128.7ms) CREATE INDEX `index_releaf_nodes_on_lft` ON `releaf_nodes` (`lft`)
52
+  (247.4ms) CREATE INDEX `index_releaf_nodes_on_parent_id` ON `releaf_nodes` (`parent_id`)
53
+  (354.3ms) CREATE INDEX `index_releaf_nodes_on_rgt` ON `releaf_nodes` (`rgt`)
54
+  (595.0ms) CREATE INDEX `index_releaf_nodes_on_slug` ON `releaf_nodes` (`slug`)
55
+  (213.0ms) CREATE TABLE `releaf_roles` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `name` varchar(255) NOT NULL, `permissions` text, `default` tinyint(1) DEFAULT 0 NOT NULL, `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL) ENGINE=InnoDB
56
+  (136.7ms) CREATE TABLE `releaf_translation_data` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `translation_id` int(11) NOT NULL, `lang` varchar(5) NOT NULL, `localization` text, `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL) ENGINE=InnoDB
57
+  (132.8ms) CREATE UNIQUE INDEX `index_releaf_translation_data_on_lang_and_translation_id` ON `releaf_translation_data` (`lang`, `translation_id`)
58
+  (135.4ms) CREATE INDEX `index_releaf_translation_data_on_lang` ON `releaf_translation_data` (`lang`)
59
+  (159.7ms) CREATE INDEX `index_releaf_translation_data_on_translation_id` ON `releaf_translation_data` (`translation_id`)
60
+  (126.1ms) CREATE TABLE `releaf_translation_groups` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `scope` varchar(255) NOT NULL, `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL) ENGINE=InnoDB
61
+  (154.6ms) CREATE UNIQUE INDEX `index_releaf_translation_groups_on_scope` ON `releaf_translation_groups` (`scope`)
62
+  (125.9ms) CREATE TABLE `releaf_translations` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `group_id` int(11) NOT NULL, `key` varchar(255) NOT NULL, `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL) ENGINE=InnoDB
63
+  (180.7ms) CREATE UNIQUE INDEX `index_releaf_translations_on_group_id_and_key` ON `releaf_translations` (`group_id`, `key`)
64
+  (152.6ms) CREATE INDEX `index_releaf_translations_on_group_id` ON `releaf_translations` (`group_id`)
65
+  (138.6ms) CREATE TABLE `settings` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `var` varchar(255) NOT NULL, `value` text, `thing_id` int(11), `thing_type` varchar(30), `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL) ENGINE=InnoDB
66
+  (151.2ms) CREATE UNIQUE INDEX `index_settings_on_thing_type_and_thing_id_and_var` ON `settings` (`thing_type`, `thing_id`, `var`)
67
+  (137.6ms) CREATE TABLE `schema_migrations` (`version` varchar(255) NOT NULL) ENGINE=InnoDB
68
+  (155.5ms) CREATE UNIQUE INDEX `unique_schema_migrations` ON `schema_migrations` (`version`)
69
+  (0.2ms) SELECT version FROM `schema_migrations`
70
+  (2.3ms) INSERT INTO `schema_migrations` (version) VALUES ('20130204164526')
71
+  (0.8ms) INSERT INTO `schema_migrations` (version) VALUES ('20130204164516')
72
+  (0.8ms) INSERT INTO `schema_migrations` (version) VALUES ('20130204164523')
73
+  (0.8ms) INSERT INTO `schema_migrations` (version) VALUES ('20130204164524')
74
+  (1.8ms) INSERT INTO `schema_migrations` (version) VALUES ('20130204164525')
@@ -0,0 +1,129 @@
1
+ Connecting to database specified by database.yml
2
+  (3.0ms) SELECT lang FROM `releaf_translation_data` WHERE (lang IS NOT NULL) GROUP BY lang
3
+ I18n::Backend::Releaf::Translation Load (2.6ms) SELECT releaf_translations.*, releaf_translation_data.lang as "lang", releaf_translation_data.localization as "localization", releaf_translation_groups.scope as "scope" FROM `releaf_translations` INNER JOIN `releaf_translation_data` ON `releaf_translation_data`.`translation_id` = `releaf_translations`.`id` INNER JOIN `releaf_translation_groups` ON `releaf_translation_groups`.`id` = `releaf_translations`.`group_id` WHERE (releaf_translation_data.lang IS NOT NULL) AND (`releaf_translations`.`id` >= 0) ORDER BY `releaf_translations`.`id` ASC LIMIT 1000
4
+ Settings Load (0.5ms) SELECT `settings`.* FROM `settings` WHERE `settings`.`thing_type` IS NULL AND `settings`.`thing_id` IS NULL AND `settings`.`var` = 'i18n_updated_at' LIMIT 1
5
+  (0.2ms) BEGIN
6
+  (0.2ms) SAVEPOINT active_record_1
7
+ Releaf::Role Exists (0.4ms) SELECT 1 AS one FROM `releaf_roles` WHERE `releaf_roles`.`name` = 'role 1' LIMIT 1
8
+ SQL (0.3ms) INSERT INTO `releaf_roles` (`created_at`, `default`, `name`, `permissions`, `updated_at`) VALUES ('2013-02-04 16:45:47', 0, 'role 1', '---\n- admin\n', '2013-02-04 16:45:47')
9
+  (0.1ms) RELEASE SAVEPOINT active_record_1
10
+  (0.2ms) SAVEPOINT active_record_1
11
+ Releaf::Admin Exists (0.4ms) SELECT 1 AS one FROM `releaf_admins` WHERE `releaf_admins`.`email` = BINARY 'person-1@example.com' LIMIT 1
12
+ Releaf::Admin Exists (0.2ms) SELECT 1 AS one FROM `releaf_admins` WHERE `releaf_admins`.`email` = 'person-1@example.com' LIMIT 1
13
+ SQL (0.3ms) INSERT INTO `releaf_admins` (`avatar_uid`, `created_at`, `current_sign_in_at`, `current_sign_in_ip`, `email`, `encrypted_password`, `last_sign_in_at`, `last_sign_in_ip`, `name`, `phone`, `remember_created_at`, `reset_password_sent_at`, `reset_password_token`, `role_id`, `sign_in_count`, `surname`, `updated_at`) VALUES (NULL, '2013-02-04 16:45:47', NULL, NULL, 'person-1@example.com', '$2a$04$pbE/3hbHRSgPEIHt6LqKy.IRJ58PwHnDM2wF8TUxYxhOyzchHY3ty', NULL, NULL, 'admin', NULL, NULL, NULL, NULL, 1, 0, 'admin', '2013-02-04 16:45:47')
14
+  (0.1ms) RELEASE SAVEPOINT active_record_1
15
+ Started GET "/admin" for 127.0.0.1 at 2013-02-04 18:45:47 +0200
16
+ Processing by Releaf::ContentController#index as HTML
17
+ Completed 401 Unauthorized in 1ms
18
+ I18n::Backend::Releaf::Translation Exists (0.4ms) SELECT 1 AS one FROM `releaf_translations` WHERE (releaf_translations.key IN ('devise.failure.releaf_admin.unauthenticated','devise.failure.unauthenticated','devise.unauthenticated','unauthenticated')) LIMIT 1
19
+ I18n::Backend::Releaf::TranslationGroup Load (0.2ms) SELECT `releaf_translation_groups`.* FROM `releaf_translation_groups` WHERE `releaf_translation_groups`.`scope` = 'devise.failure.releaf_admin' LIMIT 1
20
+  (0.1ms) SAVEPOINT active_record_1
21
+ SQL (0.4ms) INSERT INTO `releaf_translation_groups` (`created_at`, `scope`, `updated_at`) VALUES ('2013-02-04 16:45:47', 'devise.failure.releaf_admin', '2013-02-04 16:45:47')
22
+  (0.1ms) RELEASE SAVEPOINT active_record_1
23
+ I18n::Backend::Releaf::TranslationGroup Load (0.2ms) SELECT `releaf_translation_groups`.* FROM `releaf_translation_groups` WHERE `releaf_translation_groups`.`scope` = 'devise.failure' LIMIT 1
24
+  (0.1ms) SAVEPOINT active_record_1
25
+ SQL (0.2ms) INSERT INTO `releaf_translation_groups` (`created_at`, `scope`, `updated_at`) VALUES ('2013-02-04 16:45:47', 'devise.failure', '2013-02-04 16:45:47')
26
+  (0.1ms) RELEASE SAVEPOINT active_record_1
27
+ I18n::Backend::Releaf::TranslationGroup Load (0.2ms) SELECT `releaf_translation_groups`.* FROM `releaf_translation_groups` WHERE `releaf_translation_groups`.`scope` = 'devise' LIMIT 1
28
+  (0.1ms) SAVEPOINT active_record_1
29
+ SQL (0.2ms) INSERT INTO `releaf_translation_groups` (`created_at`, `scope`, `updated_at`) VALUES ('2013-02-04 16:45:47', 'devise', '2013-02-04 16:45:47')
30
+  (0.1ms) RELEASE SAVEPOINT active_record_1
31
+ I18n::Backend::Releaf::Translation Load (0.3ms) SELECT `releaf_translations`.* FROM `releaf_translations` WHERE `releaf_translations`.`group_id` = 1 AND `releaf_translations`.`key` = 'devise.failure.releaf_admin.unauthenticated' ORDER BY releaf_translations.key LIMIT 1
32
+  (0.1ms) SAVEPOINT active_record_1
33
+ I18n::Backend::Releaf::Translation Exists (0.4ms) SELECT 1 AS one FROM `releaf_translations` WHERE (`releaf_translations`.`key` = BINARY 'devise.failure.releaf_admin.unauthenticated' AND `releaf_translations`.`group_id` = 1) LIMIT 1
34
+ SQL (0.2ms) INSERT INTO `releaf_translations` (`created_at`, `group_id`, `key`, `updated_at`) VALUES ('2013-02-04 16:45:47', 1, 'devise.failure.releaf_admin.unauthenticated', '2013-02-04 16:45:47')
35
+  (0.1ms) RELEASE SAVEPOINT active_record_1
36
+ I18n::Backend::Releaf::Translation Exists (0.2ms) SELECT 1 AS one FROM `releaf_translations` WHERE (releaf_translations.key IN ('devise.failure.unauthenticated','devise.unauthenticated','unauthenticated')) LIMIT 1
37
+ I18n::Backend::Releaf::TranslationGroup Load (0.2ms) SELECT `releaf_translation_groups`.* FROM `releaf_translation_groups` WHERE `releaf_translation_groups`.`scope` = 'devise.failure' LIMIT 1
38
+ I18n::Backend::Releaf::TranslationGroup Load (0.3ms) SELECT `releaf_translation_groups`.* FROM `releaf_translation_groups` WHERE `releaf_translation_groups`.`scope` = 'devise' LIMIT 1
39
+ I18n::Backend::Releaf::Translation Load (0.3ms) SELECT `releaf_translations`.* FROM `releaf_translations` WHERE `releaf_translations`.`group_id` = 2 AND `releaf_translations`.`key` = 'devise.failure.unauthenticated' ORDER BY releaf_translations.key LIMIT 1
40
+  (0.1ms) SAVEPOINT active_record_1
41
+ I18n::Backend::Releaf::Translation Exists (0.3ms) SELECT 1 AS one FROM `releaf_translations` WHERE (`releaf_translations`.`key` = BINARY 'devise.failure.unauthenticated' AND `releaf_translations`.`group_id` = 2) LIMIT 1
42
+ SQL (0.2ms) INSERT INTO `releaf_translations` (`created_at`, `group_id`, `key`, `updated_at`) VALUES ('2013-02-04 16:45:47', 2, 'devise.failure.unauthenticated', '2013-02-04 16:45:47')
43
+  (0.1ms) RELEASE SAVEPOINT active_record_1
44
+ Started GET "/admin/sign_in" for 127.0.0.1 at 2013-02-04 18:45:48 +0200
45
+ Processing by Releaf::SessionsController#new as HTML
46
+ Rendered /Users/miks/code/releaf/app/views/releaf/sessions/new.html.haml within layouts/releaf/admin (5.5ms)
47
+ Completed 200 OK in 26ms (Views: 25.2ms | ActiveRecord: 0.0ms)
48
+ Started POST "/admin/sign_in" for 127.0.0.1 at 2013-02-04 18:45:48 +0200
49
+ Processing by Releaf::SessionsController#create as HTML
50
+ Parameters: {"utf8"=>"✓", "releaf_admin"=>{"email"=>"person-1@example.com", "password"=>"[FILTERED]"}}
51
+ Releaf::Admin Load (0.4ms) SELECT `releaf_admins`.* FROM `releaf_admins` WHERE `releaf_admins`.`email` = 'person-1@example.com' LIMIT 1
52
+  (0.1ms) SAVEPOINT active_record_1
53
+  (0.4ms) UPDATE `releaf_admins` SET `last_sign_in_at` = '2013-02-04 16:45:48', `current_sign_in_at` = '2013-02-04 16:45:48', `last_sign_in_ip` = '127.0.0.1', `current_sign_in_ip` = '127.0.0.1', `sign_in_count` = 1, `updated_at` = '2013-02-04 16:45:48' WHERE `releaf_admins`.`id` = 1
54
+  (0.1ms) RELEASE SAVEPOINT active_record_1
55
+ I18n::Backend::Releaf::Translation Exists (0.3ms) SELECT 1 AS one FROM `releaf_translations` WHERE (releaf_translations.key IN ('devise.sessions.releaf_admin.signed_in','devise.sessions.signed_in','devise.signed_in','signed_in')) LIMIT 1
56
+ I18n::Backend::Releaf::TranslationGroup Load (0.2ms) SELECT `releaf_translation_groups`.* FROM `releaf_translation_groups` WHERE `releaf_translation_groups`.`scope` = 'devise.sessions.releaf_admin' LIMIT 1
57
+  (0.1ms) SAVEPOINT active_record_1
58
+ SQL (0.2ms) INSERT INTO `releaf_translation_groups` (`created_at`, `scope`, `updated_at`) VALUES ('2013-02-04 16:45:48', 'devise.sessions.releaf_admin', '2013-02-04 16:45:48')
59
+  (0.1ms) RELEASE SAVEPOINT active_record_1
60
+ I18n::Backend::Releaf::TranslationGroup Load (0.2ms) SELECT `releaf_translation_groups`.* FROM `releaf_translation_groups` WHERE `releaf_translation_groups`.`scope` = 'devise.sessions' LIMIT 1
61
+  (0.1ms) SAVEPOINT active_record_1
62
+ SQL (0.2ms) INSERT INTO `releaf_translation_groups` (`created_at`, `scope`, `updated_at`) VALUES ('2013-02-04 16:45:48', 'devise.sessions', '2013-02-04 16:45:48')
63
+  (0.1ms) RELEASE SAVEPOINT active_record_1
64
+ I18n::Backend::Releaf::TranslationGroup Load (0.2ms) SELECT `releaf_translation_groups`.* FROM `releaf_translation_groups` WHERE `releaf_translation_groups`.`scope` = 'devise' LIMIT 1
65
+ I18n::Backend::Releaf::Translation Load (0.2ms) SELECT `releaf_translations`.* FROM `releaf_translations` WHERE `releaf_translations`.`group_id` = 4 AND `releaf_translations`.`key` = 'devise.sessions.releaf_admin.signed_in' ORDER BY releaf_translations.key LIMIT 1
66
+  (0.1ms) SAVEPOINT active_record_1
67
+ I18n::Backend::Releaf::Translation Exists (0.3ms) SELECT 1 AS one FROM `releaf_translations` WHERE (`releaf_translations`.`key` = BINARY 'devise.sessions.releaf_admin.signed_in' AND `releaf_translations`.`group_id` = 4) LIMIT 1
68
+ SQL (0.2ms) INSERT INTO `releaf_translations` (`created_at`, `group_id`, `key`, `updated_at`) VALUES ('2013-02-04 16:45:48', 4, 'devise.sessions.releaf_admin.signed_in', '2013-02-04 16:45:48')
69
+  (0.1ms) RELEASE SAVEPOINT active_record_1
70
+ I18n::Backend::Releaf::Translation Exists (0.2ms) SELECT 1 AS one FROM `releaf_translations` WHERE (releaf_translations.key IN ('devise.sessions.signed_in','devise.signed_in','signed_in')) LIMIT 1
71
+ I18n::Backend::Releaf::TranslationGroup Load (0.2ms) SELECT `releaf_translation_groups`.* FROM `releaf_translation_groups` WHERE `releaf_translation_groups`.`scope` = 'devise.sessions' LIMIT 1
72
+ I18n::Backend::Releaf::TranslationGroup Load (0.2ms) SELECT `releaf_translation_groups`.* FROM `releaf_translation_groups` WHERE `releaf_translation_groups`.`scope` = 'devise' LIMIT 1
73
+ I18n::Backend::Releaf::Translation Load (0.2ms) SELECT `releaf_translations`.* FROM `releaf_translations` WHERE `releaf_translations`.`group_id` = 5 AND `releaf_translations`.`key` = 'devise.sessions.signed_in' ORDER BY releaf_translations.key LIMIT 1
74
+  (0.1ms) SAVEPOINT active_record_1
75
+ I18n::Backend::Releaf::Translation Exists (0.3ms) SELECT 1 AS one FROM `releaf_translations` WHERE (`releaf_translations`.`key` = BINARY 'devise.sessions.signed_in' AND `releaf_translations`.`group_id` = 5) LIMIT 1
76
+ SQL (0.2ms) INSERT INTO `releaf_translations` (`created_at`, `group_id`, `key`, `updated_at`) VALUES ('2013-02-04 16:45:48', 5, 'devise.sessions.signed_in', '2013-02-04 16:45:48')
77
+  (0.1ms) RELEASE SAVEPOINT active_record_1
78
+ Redirected to http://www.example.com/admin
79
+ Completed 302 Found in 35ms (ActiveRecord: 0.0ms)
80
+ Started GET "/admin" for 127.0.0.1 at 2013-02-04 18:45:48 +0200
81
+ Processing by Releaf::ContentController#index as HTML
82
+ Releaf::Admin Load (0.4ms) SELECT `releaf_admins`.* FROM `releaf_admins` WHERE `releaf_admins`.`id` = 1 LIMIT 1
83
+ Releaf::Role Load (0.3ms) SELECT `releaf_roles`.* FROM `releaf_roles` WHERE `releaf_roles`.`id` = 1 LIMIT 1
84
+ Rendered /Users/miks/code/releaf/app/views/releaf/content/index.haml within layouts/releaf/admin (0.7ms)
85
+ I18n::Backend::Releaf::Translation Exists (0.3ms) SELECT 1 AS one FROM `releaf_translations` WHERE (releaf_translations.key IN ('global.logout','logout')) LIMIT 1
86
+ I18n::Backend::Releaf::TranslationGroup Load (0.2ms) SELECT `releaf_translation_groups`.* FROM `releaf_translation_groups` WHERE `releaf_translation_groups`.`scope` = 'global' LIMIT 1
87
+  (0.1ms) SAVEPOINT active_record_1
88
+ SQL (0.2ms) INSERT INTO `releaf_translation_groups` (`created_at`, `scope`, `updated_at`) VALUES ('2013-02-04 16:45:48', 'global', '2013-02-04 16:45:48')
89
+  (0.1ms) RELEASE SAVEPOINT active_record_1
90
+ I18n::Backend::Releaf::Translation Load (0.2ms) SELECT `releaf_translations`.* FROM `releaf_translations` WHERE `releaf_translations`.`group_id` = 6 AND `releaf_translations`.`key` = 'global.logout' ORDER BY releaf_translations.key LIMIT 1
91
+  (0.1ms) SAVEPOINT active_record_1
92
+ I18n::Backend::Releaf::Translation Exists (0.3ms) SELECT 1 AS one FROM `releaf_translations` WHERE (`releaf_translations`.`key` = BINARY 'global.logout' AND `releaf_translations`.`group_id` = 6) LIMIT 1
93
+ SQL (0.2ms) INSERT INTO `releaf_translations` (`created_at`, `group_id`, `key`, `updated_at`) VALUES ('2013-02-04 16:45:48', 6, 'global.logout', '2013-02-04 16:45:48')
94
+  (0.1ms) RELEASE SAVEPOINT active_record_1
95
+ I18n::Backend::Releaf::Translation Exists (0.3ms) SELECT 1 AS one FROM `releaf_translations` WHERE (releaf_translations.key IN ('admin.main_menu.releaf/content','admin.releaf/content','releaf/content')) LIMIT 1
96
+ I18n::Backend::Releaf::TranslationGroup Load (0.3ms) SELECT `releaf_translation_groups`.* FROM `releaf_translation_groups` WHERE `releaf_translation_groups`.`scope` = 'admin.main_menu' LIMIT 1
97
+  (0.1ms) SAVEPOINT active_record_1
98
+ SQL (0.2ms) INSERT INTO `releaf_translation_groups` (`created_at`, `scope`, `updated_at`) VALUES ('2013-02-04 16:45:48', 'admin.main_menu', '2013-02-04 16:45:48')
99
+  (0.1ms) RELEASE SAVEPOINT active_record_1
100
+ I18n::Backend::Releaf::TranslationGroup Load (0.2ms) SELECT `releaf_translation_groups`.* FROM `releaf_translation_groups` WHERE `releaf_translation_groups`.`scope` = 'admin' LIMIT 1
101
+  (0.1ms) SAVEPOINT active_record_1
102
+ SQL (0.2ms) INSERT INTO `releaf_translation_groups` (`created_at`, `scope`, `updated_at`) VALUES ('2013-02-04 16:45:48', 'admin', '2013-02-04 16:45:48')
103
+  (0.1ms) RELEASE SAVEPOINT active_record_1
104
+ I18n::Backend::Releaf::Translation Load (0.2ms) SELECT `releaf_translations`.* FROM `releaf_translations` WHERE `releaf_translations`.`group_id` = 7 AND `releaf_translations`.`key` = 'admin.main_menu.releaf/content' ORDER BY releaf_translations.key LIMIT 1
105
+  (0.1ms) SAVEPOINT active_record_1
106
+ I18n::Backend::Releaf::Translation Exists (0.3ms) SELECT 1 AS one FROM `releaf_translations` WHERE (`releaf_translations`.`key` = BINARY 'admin.main_menu.releaf/content' AND `releaf_translations`.`group_id` = 7) LIMIT 1
107
+ SQL (0.2ms) INSERT INTO `releaf_translations` (`created_at`, `group_id`, `key`, `updated_at`) VALUES ('2013-02-04 16:45:48', 7, 'admin.main_menu.releaf/content', '2013-02-04 16:45:48')
108
+  (0.1ms) RELEASE SAVEPOINT active_record_1
109
+ I18n::Backend::Releaf::Translation Exists (0.3ms) SELECT 1 AS one FROM `releaf_translations` WHERE (releaf_translations.key IN ('admin.main_menu.*permissions','admin.*permissions','*permissions')) LIMIT 1
110
+ I18n::Backend::Releaf::TranslationGroup Load (0.2ms) SELECT `releaf_translation_groups`.* FROM `releaf_translation_groups` WHERE `releaf_translation_groups`.`scope` = 'admin.main_menu' LIMIT 1
111
+ I18n::Backend::Releaf::TranslationGroup Load (0.2ms) SELECT `releaf_translation_groups`.* FROM `releaf_translation_groups` WHERE `releaf_translation_groups`.`scope` = 'admin' LIMIT 1
112
+ I18n::Backend::Releaf::Translation Load (0.2ms) SELECT `releaf_translations`.* FROM `releaf_translations` WHERE `releaf_translations`.`group_id` = 7 AND `releaf_translations`.`key` = 'admin.main_menu.*permissions' ORDER BY releaf_translations.key LIMIT 1
113
+  (0.1ms) SAVEPOINT active_record_1
114
+ I18n::Backend::Releaf::Translation Exists (0.3ms) SELECT 1 AS one FROM `releaf_translations` WHERE (`releaf_translations`.`key` = BINARY 'admin.main_menu.*permissions' AND `releaf_translations`.`group_id` = 7) LIMIT 1
115
+ SQL (0.2ms) INSERT INTO `releaf_translations` (`created_at`, `group_id`, `key`, `updated_at`) VALUES ('2013-02-04 16:45:48', 7, 'admin.main_menu.*permissions', '2013-02-04 16:45:48')
116
+  (0.1ms) RELEASE SAVEPOINT active_record_1
117
+ I18n::Backend::Releaf::Translation Exists (0.3ms) SELECT 1 AS one FROM `releaf_translations` WHERE (releaf_translations.key IN ('admin.main_menu.releaf/translations','admin.releaf/translations','releaf/translations')) LIMIT 1
118
+ I18n::Backend::Releaf::TranslationGroup Load (0.2ms) SELECT `releaf_translation_groups`.* FROM `releaf_translation_groups` WHERE `releaf_translation_groups`.`scope` = 'admin.main_menu' LIMIT 1
119
+ I18n::Backend::Releaf::TranslationGroup Load (0.2ms) SELECT `releaf_translation_groups`.* FROM `releaf_translation_groups` WHERE `releaf_translation_groups`.`scope` = 'admin' LIMIT 1
120
+ I18n::Backend::Releaf::Translation Load (0.2ms) SELECT `releaf_translations`.* FROM `releaf_translations` WHERE `releaf_translations`.`group_id` = 7 AND `releaf_translations`.`key` = 'admin.main_menu.releaf/translations' ORDER BY releaf_translations.key LIMIT 1
121
+  (0.1ms) SAVEPOINT active_record_1
122
+ I18n::Backend::Releaf::Translation Exists (0.3ms) SELECT 1 AS one FROM `releaf_translations` WHERE (`releaf_translations`.`key` = BINARY 'admin.main_menu.releaf/translations' AND `releaf_translations`.`group_id` = 7) LIMIT 1
123
+ SQL (0.2ms) INSERT INTO `releaf_translations` (`created_at`, `group_id`, `key`, `updated_at`) VALUES ('2013-02-04 16:45:48', 7, 'admin.main_menu.releaf/translations', '2013-02-04 16:45:48')
124
+  (0.1ms) RELEASE SAVEPOINT active_record_1
125
+ Releaf::Node Load (0.4ms) SELECT `releaf_nodes`.* FROM `releaf_nodes` WHERE `releaf_nodes`.`parent_id` IS NULL ORDER BY position, `releaf_nodes`.`lft`
126
+ Rendered /Users/miks/code/releaf/app/views/releaf/content/_tree_level.haml (10.9ms)
127
+ Rendered /Users/miks/code/releaf/app/views/releaf/content/_secondary_panel.haml (16.6ms)
128
+ Completed 200 OK in 112ms (Views: 85.3ms | ActiveRecord: 12.3ms)
129
+  (1.5ms) ROLLBACK
@@ -0,0 +1,26 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The page you were looking for doesn't exist (404)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/404.html -->
21
+ <div class="dialog">
22
+ <h1>The page you were looking for doesn't exist.</h1>
23
+ <p>You may have mistyped the address or the page may have moved.</p>
24
+ </div>
25
+ </body>
26
+ </html>
@@ -0,0 +1,26 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The change you wanted was rejected (422)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/422.html -->
21
+ <div class="dialog">
22
+ <h1>The change you wanted was rejected.</h1>
23
+ <p>Maybe you tried to change something you didn't have access to.</p>
24
+ </div>
25
+ </body>
26
+ </html>
@@ -0,0 +1,25 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>We're sorry, but something went wrong (500)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/500.html -->
21
+ <div class="dialog">
22
+ <h1>We're sorry, but something went wrong.</h1>
23
+ </div>
24
+ </body>
25
+ </html>
File without changes
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+ # This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
3
+
4
+ APP_PATH = File.expand_path('../../config/application', __FILE__)
5
+ require File.expand_path('../../config/boot', __FILE__)
6
+ require 'rails/commands'
@@ -0,0 +1 @@
1
+ o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1359996345.613906: @value0
@@ -0,0 +1,24 @@
1
+ FactoryGirl.define do
2
+ sequence(:email) {|n| "person-#{n}@example.com" }
3
+
4
+ factory :admin, :class => :'Releaf::Admin' do
5
+ email
6
+ name 'admin'
7
+ surname 'admin'
8
+ password 'password'
9
+ password_confirmation 'password'
10
+ end
11
+
12
+ factory :role, :class => :'Releaf::Role' do
13
+ sequence(:name) {|n| "role #{n}"}
14
+
15
+ trait :admin do
16
+ admin_permission true
17
+ end
18
+
19
+ trait :default do
20
+ default true
21
+ end
22
+ end
23
+
24
+ end
@@ -0,0 +1,41 @@
1
+ require 'spec_helper'
2
+ describe "home page" do
3
+ before do
4
+ module Leaf
5
+ end
6
+ @role = create(:role, :admin)
7
+ @admin = build(:admin)
8
+ @admin.role_id = @role.id
9
+ @admin.save
10
+
11
+ end
12
+
13
+ describe "login as admin procedure" do
14
+ before do
15
+ visit "/admin"
16
+ within("form.login_form") do
17
+ fill_in 'Email', :with => @admin.email
18
+ fill_in 'Password', :with => @admin.password
19
+ end
20
+ click_button 'Sign in'
21
+ end
22
+
23
+ it "admin page content" do
24
+ page.should have_content 'Logout'
25
+ page.should have_content 'Releaf/content'
26
+ page.should have_content '*permissions'
27
+ page.should have_content 'Releaf/translations'
28
+ end
29
+
30
+ it "logout sequence" do
31
+ click_link 'Logout'
32
+
33
+ page.should have_content 'Welcome to re:Leaf'
34
+
35
+ visit "/admin"
36
+ page.should have_content 'Sign in'
37
+ end
38
+
39
+
40
+ end
41
+ end
@@ -0,0 +1,23 @@
1
+ ENV['RAILS_ENV'] ||= 'test'
2
+ require File.expand_path("../dummy/config/environment.rb", __FILE__)
3
+ require 'rspec/rails'
4
+ require 'rspec/autorun'
5
+ require 'factory_girl'
6
+ require 'capybara/rspec'
7
+ Rails.backtrace_cleaner.remove_silencers!
8
+ # Load support files
9
+ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
10
+ RSpec.configure do |config|
11
+ config.mock_with :rspec
12
+ config.use_transactional_fixtures = true
13
+ config.infer_base_class_for_anonymous_controllers = false
14
+ config.order = "random"
15
+
16
+ # DEVISE
17
+ config.include Devise::TestHelpers, :type => :controller
18
+
19
+ # FactoryGirl
20
+ config.include FactoryGirl::Syntax::Methods
21
+ end
22
+
23
+ Dir["#{File.dirname(__FILE__)}/factories/*.rb"].each { |f| require f }