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,379 @@
1
+ // Place any jQuery/helper plugins in here.
2
+ // Lightbox
3
+
4
+ /*
5
+ Lightbox v2.51
6
+ by Lokesh Dhakar - http://www.lokeshdhakar.com
7
+
8
+ For more information, visit:
9
+ http://lokeshdhakar.com/projects/lightbox2/
10
+
11
+ Licensed under the Creative Commons Attribution 2.5 License - http://creativecommons.org/licenses/by/2.5/
12
+ - free for use in both personal and commercial projects
13
+ - attribution requires leaving author name, author link, and the license info intact
14
+
15
+ Thanks
16
+ - Scott Upton(uptonic.com), Peter-Paul Koch(quirksmode.com), and Thomas Fuchs(mir.aculo.us) for ideas, libs, and snippets.
17
+ - Artemy Tregubenko (arty.name) for cleanup and help in updating to latest proto-aculous in v2.05.
18
+
19
+
20
+ Table of Contents
21
+ =================
22
+ LightboxOptions
23
+
24
+ Lightbox
25
+ - constructor
26
+ - init
27
+ - enable
28
+ - build
29
+ - start
30
+ - changeImage
31
+ - sizeContainer
32
+ - showImage
33
+ - updateNav
34
+ - updateDetails
35
+ - preloadNeigbhoringImages
36
+ - enableKeyboardNav
37
+ - disableKeyboardNav
38
+ - keyboardAction
39
+ - end
40
+
41
+ options = new LightboxOptions
42
+ lightbox = new Lightbox options
43
+ */
44
+
45
+ (function() {
46
+ var $, Lightbox, LightboxOptions;
47
+
48
+ $ = jQuery;
49
+
50
+ LightboxOptions = (function() {
51
+
52
+ function LightboxOptions() {
53
+ this.fileLoadingImage = '<%= asset_path('3rd_party/lightbox/loading.gif') %>';
54
+ this.fileCloseImage = '<%= asset_path('3rd_party/lightbox/close.png') %>';
55
+ this.resizeDuration = 700;
56
+ this.fadeDuration = 500;
57
+ this.labelImage = "Image";
58
+ this.labelOf = "of";
59
+ }
60
+
61
+ return LightboxOptions;
62
+
63
+ })();
64
+
65
+ Lightbox = (function() {
66
+
67
+ function Lightbox(options) {
68
+ this.options = options;
69
+ this.album = [];
70
+ this.currentImageIndex = void 0;
71
+ this.init();
72
+ }
73
+
74
+ Lightbox.prototype.init = function() {
75
+ this.enable();
76
+ return this.build();
77
+ };
78
+
79
+ Lightbox.prototype.enable = function() {
80
+ var _this = this;
81
+ return $('body').on('click', 'a[data-lightbox], area[data-lightbox]', function(e) {
82
+ _this.start($(e.currentTarget));
83
+ return false;
84
+ });
85
+ };
86
+
87
+ Lightbox.prototype.build = function() {
88
+ var $lightbox,
89
+ _this = this;
90
+ $("<div>", {
91
+ id: 'lightboxOverlay'
92
+ }).after($('<div/>', {
93
+ id: 'lightbox'
94
+ }).append($('<div/>', {
95
+ "class": 'lb-outerContainer'
96
+ }).append($('<div/>', {
97
+ "class": 'lb-container'
98
+ }).append($('<img/>', {
99
+ "class": 'lb-image'
100
+ }), $('<div/>', {
101
+ "class": 'lb-nav'
102
+ }).append($('<a/>', {
103
+ "class": 'lb-prev'
104
+ }), $('<a/>', {
105
+ "class": 'lb-next'
106
+ })), $('<div/>', {
107
+ "class": 'lb-loader'
108
+ }).append($('<a/>', {
109
+ "class": 'lb-cancel'
110
+ }).append($('<img/>', {
111
+ src: this.options.fileLoadingImage
112
+ }))))), $('<div/>', {
113
+ "class": 'lb-dataContainer'
114
+ }).append($('<div/>', {
115
+ "class": 'lb-data'
116
+ }).append($('<div/>', {
117
+ "class": 'lb-details'
118
+ }).append($('<span/>', {
119
+ "class": 'lb-caption'
120
+ }), $('<span/>', {
121
+ "class": 'lb-number'
122
+ })), $('<div/>', {
123
+ "class": 'lb-closeContainer'
124
+ }).append($('<a/>', {
125
+ "class": 'lb-close'
126
+ }).append($('<img/>', {
127
+ src: this.options.fileCloseImage
128
+ }))))))).appendTo($('body'));
129
+ $('#lightboxOverlay').hide().on('click', function(e) {
130
+ _this.end();
131
+ return false;
132
+ });
133
+ $lightbox = $('#lightbox');
134
+ $lightbox.hide().on('click', function(e) {
135
+ if ($(e.target).attr('id') === 'lightbox') _this.end();
136
+ return false;
137
+ });
138
+ $lightbox.find('.lb-outerContainer').on('click', function(e) {
139
+ if ($(e.target).attr('id') === 'lightbox') _this.end();
140
+ return false;
141
+ });
142
+ $lightbox.find('.lb-prev').on('click', function(e) {
143
+ _this.changeImage(_this.currentImageIndex - 1);
144
+ return false;
145
+ });
146
+ $lightbox.find('.lb-next').on('click', function(e) {
147
+ _this.changeImage(_this.currentImageIndex + 1);
148
+ return false;
149
+ });
150
+ $lightbox.find('.lb-loader, .lb-close').on('click', function(e) {
151
+ _this.end();
152
+ return false;
153
+ });
154
+ };
155
+
156
+ Lightbox.prototype.start = function($link) {
157
+ var $lightbox, $window, a, i, imageNumber, left, top, _len, _ref;
158
+ $(window).on("resize", this.sizeOverlay);
159
+ $('select, object, embed').css({
160
+ visibility: "hidden"
161
+ });
162
+ $('#lightboxOverlay').width($(document).width()).height($(document).height()).fadeIn(this.options.fadeDuration);
163
+ this.album = [];
164
+ imageNumber = 0;
165
+ if ($link.attr('data-lightbox-group') == undefined) {
166
+ this.album.push({
167
+ link: $link.attr('href'),
168
+ title: $link.attr('title')
169
+ });
170
+ } else {
171
+ _ref = $($link.prop("tagName") + '[data-lightbox-group="' + $link.attr('data-lightbox-group') + '"]');
172
+ for (i = 0, _len = _ref.length; i < _len; i++) {
173
+ a = _ref[i];
174
+ this.album.push({
175
+ link: $(a).attr('href'),
176
+ title: $(a).attr('title')
177
+ });
178
+ if ($(a).attr('href') === $link.attr('href')) imageNumber = i;
179
+ }
180
+ }
181
+ $window = $(window);
182
+ top = $window.scrollTop() + $window.height() / 10;
183
+ left = $window.scrollLeft();
184
+ $lightbox = $('#lightbox');
185
+ $lightbox.css({
186
+ top: top + 'px',
187
+ left: left + 'px'
188
+ }).fadeIn(this.options.fadeDuration);
189
+ this.changeImage(imageNumber);
190
+ };
191
+
192
+ Lightbox.prototype.changeImage = function(imageNumber) {
193
+ var $image, $lightbox, preloader,
194
+ _this = this;
195
+ this.disableKeyboardNav();
196
+ $lightbox = $('#lightbox');
197
+ $image = $lightbox.find('.lb-image');
198
+ this.sizeOverlay();
199
+ $('#lightboxOverlay').fadeIn(this.options.fadeDuration);
200
+ $('.loader').fadeIn('slow');
201
+ $lightbox.find('.lb-image, .lb-nav, .lb-prev, .lb-next, .lb-dataContainer, .lb-numbers, .lb-caption').hide();
202
+ $lightbox.find('.lb-outerContainer').addClass('animating');
203
+ preloader = new Image;
204
+ preloader.onload = function() {
205
+ $image.attr('src', _this.album[imageNumber].link);
206
+
207
+ var containerWidth, containerHeight;
208
+ var doc = {
209
+ w: $(window).width() - 100,
210
+ h: $(window).height() - 160
211
+ };
212
+ var cont = {
213
+ w: preloader.width,
214
+ h: preloader.height
215
+ };
216
+
217
+ var aspect = preloader.width / preloader.height;
218
+ if(preloader.width > doc.w) {
219
+ if(doc.w / aspect > doc.h) {
220
+ cont.w = doc.h * aspect;
221
+ cont.h = doc.h;
222
+ } else {
223
+ cont.w = doc.w;
224
+ cont.h = doc.w / aspect;
225
+ }
226
+ } else if(preloader.height > doc.h) {
227
+ cont.w = doc.h * aspect;
228
+ cont.h = doc.h;
229
+ }
230
+ $image.css({
231
+ height: cont.h,
232
+ width: cont.w
233
+ });
234
+ return _this.sizeContainer(cont.w, cont.h);
235
+ };
236
+ preloader.src = this.album[imageNumber].link;
237
+ this.currentImageIndex = imageNumber;
238
+ };
239
+
240
+ Lightbox.prototype.sizeOverlay = function() {
241
+ return $('#lightboxOverlay').width($(document).width()).height($(document).height());
242
+ };
243
+
244
+ Lightbox.prototype.sizeContainer = function(imageWidth, imageHeight) {
245
+ var $container, $lightbox, $outerContainer, containerBottomPadding, containerLeftPadding, containerRightPadding, containerTopPadding, newHeight, newWidth, oldHeight, oldWidth,
246
+ _this = this;
247
+ $lightbox = $('#lightbox');
248
+ $outerContainer = $lightbox.find('.lb-outerContainer');
249
+ oldWidth = $outerContainer.outerWidth();
250
+ oldHeight = $outerContainer.outerHeight();
251
+ $container = $lightbox.find('.lb-container');
252
+ containerTopPadding = parseInt($container.css('padding-top'), 10);
253
+ containerRightPadding = parseInt($container.css('padding-right'), 10);
254
+ containerBottomPadding = parseInt($container.css('padding-bottom'), 10);
255
+ containerLeftPadding = parseInt($container.css('padding-left'), 10);
256
+ newWidth = imageWidth + containerLeftPadding + containerRightPadding;
257
+ newHeight = imageHeight + containerTopPadding + containerBottomPadding;
258
+ if (newWidth !== oldWidth && newHeight !== oldHeight) {
259
+ $outerContainer.animate({
260
+ width: newWidth,
261
+ height: newHeight
262
+ }, this.options.resizeDuration, 'swing');
263
+ } else if (newWidth !== oldWidth) {
264
+ $outerContainer.animate({
265
+ width: newWidth
266
+ }, this.options.resizeDuration, 'swing');
267
+ } else if (newHeight !== oldHeight) {
268
+ $outerContainer.animate({
269
+ height: newHeight
270
+ }, this.options.resizeDuration, 'swing');
271
+ }
272
+ setTimeout(function() {
273
+ $lightbox.find('.lb-dataContainer').width(newWidth);
274
+ $lightbox.find('.lb-prevLink').height(newHeight);
275
+ $lightbox.find('.lb-nextLink').height(newHeight);
276
+ _this.showImage();
277
+ }, this.options.resizeDuration);
278
+ };
279
+
280
+ Lightbox.prototype.showImage = function() {
281
+ var $lightbox;
282
+ $lightbox = $('#lightbox');
283
+ $lightbox.find('.lb-loader').hide();
284
+ $lightbox.find('.lb-image').fadeIn('slow');
285
+ this.updateNav();
286
+ this.updateDetails();
287
+ this.preloadNeighboringImages();
288
+ this.enableKeyboardNav();
289
+ };
290
+
291
+ Lightbox.prototype.updateNav = function() {
292
+ var $lightbox;
293
+ $lightbox = $('#lightbox');
294
+ $lightbox.find('.lb-nav').show();
295
+ if (this.currentImageIndex > 0) $lightbox.find('.lb-prev').show();
296
+ if (this.currentImageIndex < this.album.length - 1) {
297
+ $lightbox.find('.lb-next').show();
298
+ }
299
+ };
300
+
301
+ Lightbox.prototype.updateDetails = function() {
302
+ var $lightbox,
303
+ _this = this;
304
+ $lightbox = $('#lightbox');
305
+ if (typeof this.album[this.currentImageIndex].title !== 'undefined' && this.album[this.currentImageIndex].title !== "") {
306
+ $lightbox.find('.lb-caption').html(this.album[this.currentImageIndex].title).fadeIn('fast');
307
+ }
308
+ if (this.album.length > 1) {
309
+ $lightbox.find('.lb-number').html(this.options.labelImage + ' ' + (this.currentImageIndex + 1) + ' ' + this.options.labelOf + ' ' + this.album.length).fadeIn('fast');
310
+ } else {
311
+ $lightbox.find('.lb-number').hide();
312
+ }
313
+ $lightbox.find('.lb-outerContainer').removeClass('animating');
314
+ $lightbox.find('.lb-dataContainer').fadeIn(this.resizeDuration, function() {
315
+ return _this.sizeOverlay();
316
+ });
317
+ };
318
+
319
+ Lightbox.prototype.preloadNeighboringImages = function() {
320
+ var preloadNext, preloadPrev;
321
+ if (this.album.length > this.currentImageIndex + 1) {
322
+ preloadNext = new Image;
323
+ preloadNext.src = this.album[this.currentImageIndex + 1].link;
324
+ }
325
+ if (this.currentImageIndex > 0) {
326
+ preloadPrev = new Image;
327
+ preloadPrev.src = this.album[this.currentImageIndex - 1].link;
328
+ }
329
+ };
330
+
331
+ Lightbox.prototype.enableKeyboardNav = function() {
332
+ $(document).on('keyup.keyboard', $.proxy(this.keyboardAction, this));
333
+ };
334
+
335
+ Lightbox.prototype.disableKeyboardNav = function() {
336
+ $(document).off('.keyboard');
337
+ };
338
+
339
+ Lightbox.prototype.keyboardAction = function(event) {
340
+ var KEYCODE_ESC, KEYCODE_LEFTARROW, KEYCODE_RIGHTARROW, key, keycode;
341
+ KEYCODE_ESC = 27;
342
+ KEYCODE_LEFTARROW = 37;
343
+ KEYCODE_RIGHTARROW = 39;
344
+ keycode = event.keyCode;
345
+ key = String.fromCharCode(keycode).toLowerCase();
346
+ if (keycode === KEYCODE_ESC || key.match(/x|o|c/)) {
347
+ this.end();
348
+ } else if (key === 'p' || keycode === KEYCODE_LEFTARROW) {
349
+ if (this.currentImageIndex !== 0) {
350
+ this.changeImage(this.currentImageIndex - 1);
351
+ }
352
+ } else if (key === 'n' || keycode === KEYCODE_RIGHTARROW) {
353
+ if (this.currentImageIndex !== this.album.length - 1) {
354
+ this.changeImage(this.currentImageIndex + 1);
355
+ }
356
+ }
357
+ };
358
+
359
+ Lightbox.prototype.end = function() {
360
+ this.disableKeyboardNav();
361
+ $(window).off("resize", this.sizeOverlay);
362
+ $('#lightbox').fadeOut(this.options.fadeDuration);
363
+ $('#lightboxOverlay').fadeOut(this.options.fadeDuration);
364
+ return $('select, object, embed').css({
365
+ visibility: "visible"
366
+ });
367
+ };
368
+
369
+ return Lightbox;
370
+
371
+ })();
372
+
373
+ $(function() {
374
+ var lightbox, options;
375
+ options = new LightboxOptions;
376
+ return lightbox = new Lightbox(options);
377
+ });
378
+
379
+ }).call(this);
@@ -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 3rd_party/jquery_ui
@@ -0,0 +1,8 @@
1
+ if ((document) && (document.getElementById)) {
2
+ var jsClassName = 'javascriptOn';
3
+ if (document.body.className)
4
+ {
5
+ jsClassName = ' '.concat(jsClassName);
6
+ }
7
+ document.body.className = document.body.className.concat(jsClassName);
8
+ }
@@ -0,0 +1,169 @@
1
+ // EXAMPLE: var newurl = new RequestUrl().add({ 'do': 'import', ajax: 1 }).getUrl();
2
+
3
+ // constructor
4
+ function RequestUrl( params )
5
+ {
6
+ if( params === undefined )
7
+ {
8
+ params = {};
9
+ }
10
+ var keepCurrentQuery = true;
11
+ if( params === false || params.baseUrl !== undefined )
12
+ {
13
+ keepCurrentQuery = false;
14
+ }
15
+ if( typeof params == 'string' )
16
+ {
17
+ params = { baseUrl: params };
18
+ }
19
+ // setup members
20
+ this.path = '';
21
+ this.query = {};
22
+ // get url
23
+ var baseUrl = params.baseUrl || location.href;
24
+ // remove anchor
25
+ baseUrl = baseUrl.split( '#' ).shift();
26
+ // split url
27
+ var urlParts = baseUrl.split( '?' );
28
+ this.path = urlParts.shift();
29
+ if( keepCurrentQuery && urlParts.length > 0 )
30
+ {
31
+ var queryParts = urlParts.shift().split( '&' );
32
+ for( var i = 0; i < queryParts.length; i++ )
33
+ {
34
+ var variable = queryParts[ i ].split( '=' );
35
+ var name = variable.shift();
36
+
37
+ if( variable.length > 0 )
38
+ {
39
+ var value = variable.shift();
40
+ }
41
+ else
42
+ {
43
+ var value = '';
44
+ }
45
+
46
+ if( unescape( name ).substr( unescape( name ).length - 2, 2 ) == '[]' )
47
+ {
48
+ name = unescape( name );
49
+ }
50
+
51
+ if( name.substr( name.length - 2, 2 ) == '[]' )
52
+ {
53
+ name = name.substr( 0, name.length - 2 );
54
+ if( this.query[ name ] === undefined || !(this.query[ name ] instanceof Array) )
55
+ {
56
+ this.query[ name ] = [];
57
+ }
58
+ this.query[ name ].push( value );
59
+ }
60
+ else
61
+ {
62
+ this.query[ name ] = value;
63
+ }
64
+ }
65
+ }
66
+ if( params.keep !== undefined && params.keep instanceof Array )
67
+ {
68
+ var filteredQuery = {};
69
+ for( var i = 0; i < params.keep.length; i++ )
70
+ {
71
+ if( this.query[ params.keep[i] ] !== undefined )
72
+ {
73
+ filteredQuery[ params.keep[i] ] = this.query[ params.keep[i] ];
74
+ }
75
+ }
76
+ this.query = filteredQuery;
77
+ }
78
+ }
79
+
80
+ RequestUrl.prototype.add = function( params, value )
81
+ {
82
+ if( params instanceof Array )
83
+ {
84
+ for( var i = 0; i < params.length; i++ )
85
+ {
86
+ if( params[ i ].name !== undefined && params[ i ].value !== undefined )
87
+ {
88
+ this.query[ params[ i ].name ] = params[ i ].value;
89
+ }
90
+ }
91
+ }
92
+ else if( params instanceof Object )
93
+ {
94
+ for( var i in params )
95
+ {
96
+ this.query[ i ] = params[ i ];
97
+ }
98
+ }
99
+ else if( typeof params == 'string' )
100
+ {
101
+ if( value === undefined )
102
+ {
103
+ var temp = new RequestUrl( '?' + params );
104
+ for( var i in temp.query )
105
+ {
106
+ this.query[ i ] = temp.query[i];
107
+ }
108
+ }
109
+ else
110
+ {
111
+ this.query[ params ] = value;
112
+ }
113
+ }
114
+ return this;
115
+ }
116
+
117
+ RequestUrl.prototype.removeAll = function( preserveParams )
118
+ {
119
+ for( var i in this.query )
120
+ {
121
+ if( preserveParams === undefined || jQuery.inArray(i, preserveParams) == -1 )
122
+ {
123
+ this.remove(i);
124
+ }
125
+ }
126
+ return this;
127
+ }
128
+
129
+ RequestUrl.prototype.remove = function( name )
130
+ {
131
+ delete this.query[ name ];
132
+ return this;
133
+ }
134
+
135
+ RequestUrl.prototype.get = function( name )
136
+ {
137
+ if( this.query[ name ] !== undefined )
138
+ {
139
+ return this.query[ name ];
140
+ }
141
+ return null;
142
+ }
143
+
144
+ RequestUrl.prototype.getUrl = function()
145
+ {
146
+ var query = '';
147
+ var isFirst = true;
148
+ for( var i in this.query )
149
+ {
150
+ if( !isFirst )
151
+ {
152
+ query += '&';
153
+ }
154
+ else
155
+ {
156
+ isFirst = false;
157
+ }
158
+ if( this.query[ i ] instanceof Array )
159
+ {
160
+ query += i + '[]=' + this.query[ i ].join( '&' + i + '[]=' );
161
+ }
162
+ else
163
+ {
164
+ query += i + '=' + this.query[ i ];
165
+ }
166
+ }
167
+
168
+ return this.path + '?' + query;
169
+ }