releaf 0.1.2 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (322) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +19 -21
  3. data/lib/releaf.rb +1 -34
  4. data/lib/releaf/all.rb +3 -0
  5. data/lib/releaf/rspec.rb +4 -0
  6. data/lib/releaf/rspec/features_matchers.rb +76 -0
  7. data/lib/releaf/rspec/helpers.rb +227 -0
  8. data/lib/releaf/rspec/matchers.rb +16 -0
  9. data/lib/releaf/test.rb +5 -0
  10. data/spec/factories/author.rb +6 -0
  11. data/spec/factories/book.rb +5 -0
  12. data/spec/factories/chapter.rb +7 -0
  13. data/spec/factories/common.rb +5 -0
  14. data/spec/factories/home_page.rb +5 -0
  15. data/spec/factories/node.rb +43 -0
  16. data/spec/factories/node_route.rb +7 -0
  17. data/spec/factories/publisher.rb +5 -0
  18. data/spec/factories/role.rb +21 -0
  19. data/spec/factories/text_page.rb +5 -0
  20. data/spec/factories/user.rb +22 -0
  21. data/spec/rails_helper.rb +122 -0
  22. data/spec/spec_helper.rb +81 -24
  23. data/spec/support/controller_macros.rb +8 -0
  24. data/spec/support/excel_helpers.rb +63 -0
  25. data/spec/support/shared/service_includer.rb +9 -0
  26. data/spec/support/wait_steps.rb +23 -0
  27. metadata +141 -499
  28. data/README.md +0 -77
  29. data/Rakefile +0 -70
  30. data/app/assets/images/releaf/3rd_party/jquery-ui-1.9.2.custom/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  31. data/app/assets/images/releaf/3rd_party/jquery-ui-1.9.2.custom/ui-bg_flat_75_ffffff_40x100.png +0 -0
  32. data/app/assets/images/releaf/3rd_party/jquery-ui-1.9.2.custom/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  33. data/app/assets/images/releaf/3rd_party/jquery-ui-1.9.2.custom/ui-bg_glass_65_ffffff_1x400.png +0 -0
  34. data/app/assets/images/releaf/3rd_party/jquery-ui-1.9.2.custom/ui-bg_glass_75_dadada_1x400.png +0 -0
  35. data/app/assets/images/releaf/3rd_party/jquery-ui-1.9.2.custom/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  36. data/app/assets/images/releaf/3rd_party/jquery-ui-1.9.2.custom/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  37. data/app/assets/images/releaf/3rd_party/jquery-ui-1.9.2.custom/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  38. data/app/assets/images/releaf/3rd_party/jquery-ui-1.9.2.custom/ui-icons_222222_256x240.png +0 -0
  39. data/app/assets/images/releaf/3rd_party/jquery-ui-1.9.2.custom/ui-icons_2e83ff_256x240.png +0 -0
  40. data/app/assets/images/releaf/3rd_party/jquery-ui-1.9.2.custom/ui-icons_454545_256x240.png +0 -0
  41. data/app/assets/images/releaf/3rd_party/jquery-ui-1.9.2.custom/ui-icons_888888_256x240.png +0 -0
  42. data/app/assets/images/releaf/3rd_party/jquery-ui-1.9.2.custom/ui-icons_cd0a0a_256x240.png +0 -0
  43. data/app/assets/images/releaf/3rd_party/lightbox/close.png +0 -0
  44. data/app/assets/images/releaf/3rd_party/lightbox/loading.gif +0 -0
  45. data/app/assets/images/releaf/3rd_party/lightbox/next.png +0 -0
  46. data/app/assets/images/releaf/3rd_party/lightbox/prev.png +0 -0
  47. data/app/assets/images/releaf/add.png +0 -0
  48. data/app/assets/images/releaf/background.jpg +0 -0
  49. data/app/assets/images/releaf/button/button_bgr.gif +0 -0
  50. data/app/assets/images/releaf/button/button_hover_bgr.png +0 -0
  51. data/app/assets/images/releaf/controllers/content/close.gif +0 -0
  52. data/app/assets/images/releaf/controllers/content/close_active.gif +0 -0
  53. data/app/assets/images/releaf/controllers/content/close_hover.gif +0 -0
  54. data/app/assets/images/releaf/controllers/content/global_fields_bgr.png +0 -0
  55. data/app/assets/images/releaf/controllers/content/open.gif +0 -0
  56. data/app/assets/images/releaf/controllers/content/open_2.gif +0 -0
  57. data/app/assets/images/releaf/controllers/content/open_active.gif +0 -0
  58. data/app/assets/images/releaf/controllers/content/open_hover.gif +0 -0
  59. data/app/assets/images/releaf/controllers/sessions/background.jpg +0 -0
  60. data/app/assets/images/releaf/controllers/sessions/logo.jpg +0 -0
  61. data/app/assets/images/releaf/expand_tool/close.png +0 -0
  62. data/app/assets/images/releaf/expand_tool/close_hover.png +0 -0
  63. data/app/assets/images/releaf/expand_tool/close_hover_shim.png +0 -0
  64. data/app/assets/images/releaf/expand_tool/close_shim.png +0 -0
  65. data/app/assets/images/releaf/expand_tool/loader.gif +0 -0
  66. data/app/assets/images/releaf/expand_tool/open.png +0 -0
  67. data/app/assets/images/releaf/expand_tool/open_hover.png +0 -0
  68. data/app/assets/images/releaf/expand_tool/open_hover_shim.png +0 -0
  69. data/app/assets/images/releaf/expand_tool/open_shim.png +0 -0
  70. data/app/assets/images/releaf/favicon.ico +0 -0
  71. data/app/assets/images/releaf/globalFieldContainerBgr.png +0 -0
  72. data/app/assets/images/releaf/icons/129.png +0 -0
  73. data/app/assets/images/releaf/icons/130.png +0 -0
  74. data/app/assets/images/releaf/icons/accept.png +0 -0
  75. data/app/assets/images/releaf/icons/add.png +0 -0
  76. data/app/assets/images/releaf/icons/arrow_down.png +0 -0
  77. data/app/assets/images/releaf/icons/arrow_left.png +0 -0
  78. data/app/assets/images/releaf/icons/arrow_refresh.png +0 -0
  79. data/app/assets/images/releaf/icons/arrow_up.png +0 -0
  80. data/app/assets/images/releaf/icons/bin_empty.png +0 -0
  81. data/app/assets/images/releaf/icons/bullet_black.png +0 -0
  82. data/app/assets/images/releaf/icons/bullet_connect.png +0 -0
  83. data/app/assets/images/releaf/icons/bullet_start.png +0 -0
  84. data/app/assets/images/releaf/icons/bullet_tick.png +0 -0
  85. data/app/assets/images/releaf/icons/chrome.png +0 -0
  86. data/app/assets/images/releaf/icons/control_play.png +0 -0
  87. data/app/assets/images/releaf/icons/date.png +0 -0
  88. data/app/assets/images/releaf/icons/delete.png +0 -0
  89. data/app/assets/images/releaf/icons/disk.png +0 -0
  90. data/app/assets/images/releaf/icons/drag-handle.png +0 -0
  91. data/app/assets/images/releaf/icons/error.png +0 -0
  92. data/app/assets/images/releaf/icons/eye.png +0 -0
  93. data/app/assets/images/releaf/icons/firefox.png +0 -0
  94. data/app/assets/images/releaf/icons/google-not-available.gif +0 -0
  95. data/app/assets/images/releaf/icons/google.gif +0 -0
  96. data/app/assets/images/releaf/icons/keyboard.png +0 -0
  97. data/app/assets/images/releaf/icons/left_16.png +0 -0
  98. data/app/assets/images/releaf/icons/link.png +0 -0
  99. data/app/assets/images/releaf/icons/magnifier.png +0 -0
  100. data/app/assets/images/releaf/icons/notAllowed.png +0 -0
  101. data/app/assets/images/releaf/icons/page_white_add.png +0 -0
  102. data/app/assets/images/releaf/icons/page_white_edit.png +0 -0
  103. data/app/assets/images/releaf/icons/page_white_put.png +0 -0
  104. data/app/assets/images/releaf/icons/page_white_text.png +0 -0
  105. data/app/assets/images/releaf/icons/pencil.png +0 -0
  106. data/app/assets/images/releaf/icons/picture.png +0 -0
  107. data/app/assets/images/releaf/icons/right_16.png +0 -0
  108. data/app/assets/images/releaf/icons/tick.png +0 -0
  109. data/app/assets/images/releaf/icons/warning.png +0 -0
  110. data/app/assets/images/releaf/icons/world_go.png +0 -0
  111. data/app/assets/images/releaf/icons/world_link.png +0 -0
  112. data/app/assets/images/releaf/input/autocompleteExpandIcon.png +0 -0
  113. data/app/assets/images/releaf/input/input_bgr.gif +0 -0
  114. data/app/assets/images/releaf/language_root.png +0 -0
  115. data/app/assets/images/releaf/loader.gif +0 -0
  116. data/app/assets/images/releaf/logout.png +0 -0
  117. data/app/assets/images/releaf/main_menu/active_bgr.png +0 -0
  118. data/app/assets/images/releaf/main_menu/bgr.png +0 -0
  119. data/app/assets/images/releaf/main_menu/hover_bgr.png +0 -0
  120. data/app/assets/images/releaf/module.png +0 -0
  121. data/app/assets/images/releaf/panel_layout/active_bgr.png +0 -0
  122. data/app/assets/images/releaf/panel_layout/secondary_panel_horizontal_bgr.png +0 -0
  123. data/app/assets/images/releaf/panel_layout/secondary_panel_vertical_bgr.png +0 -0
  124. data/app/assets/images/releaf/releaf_table/selected_bgr.png +0 -0
  125. data/app/assets/images/releaf/releaf_table/th_bgr.gif +0 -0
  126. data/app/assets/javascripts/releaf/3rd_party/jquery-cookie/README.md +0 -73
  127. data/app/assets/javascripts/releaf/3rd_party/jquery-cookie/jquery.cookie.js +0 -47
  128. data/app/assets/javascripts/releaf/3rd_party/jquery-cookie/server.js +0 -24
  129. data/app/assets/javascripts/releaf/3rd_party/jquery-cookie/test.html +0 -19
  130. data/app/assets/javascripts/releaf/3rd_party/jquery-cookie/test.js +0 -80
  131. data/app/assets/javascripts/releaf/3rd_party/jquery-ui-timepicker-addon.js +0 -1882
  132. data/app/assets/javascripts/releaf/3rd_party/lightbox.js.erb +0 -379
  133. data/app/assets/javascripts/releaf/application.js +0 -14
  134. data/app/assets/javascripts/releaf/controllers/base.js +0 -130
  135. data/app/assets/javascripts/releaf/controllers/releaf/content.js +0 -90
  136. data/app/assets/javascripts/releaf/controllers/releaf/translations.js +0 -31
  137. data/app/assets/javascripts/releaf/include/continuous_scroll.js +0 -321
  138. data/app/assets/javascripts/releaf/include/field.type_autocomplete.js +0 -58
  139. data/app/assets/javascripts/releaf/include/field.type_date_or_datetime_or_time.js +0 -43
  140. data/app/assets/javascripts/releaf/include/field.type_richtext.js +0 -90
  141. data/app/assets/javascripts/releaf/include/localization.js +0 -12
  142. data/app/assets/javascripts/releaf/include/nested_fields.js +0 -64
  143. data/app/assets/javascripts/releaf/include/sortable.js +0 -29
  144. data/app/assets/javascripts/releaf/lib/request_url.js +0 -183
  145. data/app/assets/stylesheets/releaf/3rd_party/jquery-ui-1.9.2.custom.css.erb +0 -464
  146. data/app/assets/stylesheets/releaf/3rd_party/jquery-ui-timepicker-addon.css +0 -10
  147. data/app/assets/stylesheets/releaf/3rd_party/lightbox.css.erb +0 -157
  148. data/app/assets/stylesheets/releaf/application.css.erb +0 -122
  149. data/app/assets/stylesheets/releaf/controllers/base.css.erb +0 -205
  150. data/app/assets/stylesheets/releaf/controllers/releaf/content.css.erb +0 -422
  151. data/app/assets/stylesheets/releaf/controllers/releaf/sessions.css.scss.erb +0 -116
  152. data/app/assets/stylesheets/releaf/controllers/releaf/translations.css.erb +0 -205
  153. data/app/assets/stylesheets/releaf/include/button.css.erb +0 -176
  154. data/app/assets/stylesheets/releaf/include/field.css.erb +0 -281
  155. data/app/assets/stylesheets/releaf/include/input.css.erb +0 -40
  156. data/app/assets/stylesheets/releaf/include/main_menu.css.erb +0 -66
  157. data/app/assets/stylesheets/releaf/include/pagination.css.erb +0 -29
  158. data/app/assets/stylesheets/releaf/include/panel_layout.css.erb +0 -251
  159. data/app/assets/stylesheets/releaf/include/releaf_table.css.erb +0 -112
  160. data/app/assets/stylesheets/releaf/include/sortable.css.erb +0 -12
  161. data/app/controllers/releaf/admins_controller.rb +0 -55
  162. data/app/controllers/releaf/application_controller.rb +0 -11
  163. data/app/controllers/releaf/base_application_controller.rb +0 -18
  164. data/app/controllers/releaf/base_controller.rb +0 -571
  165. data/app/controllers/releaf/content_controller.rb +0 -183
  166. data/app/controllers/releaf/roles_controller.rb +0 -38
  167. data/app/controllers/releaf/sessions_controller.rb +0 -27
  168. data/app/controllers/releaf/tinymce_assets_controller.rb +0 -26
  169. data/app/controllers/releaf/translations_controller.rb +0 -117
  170. data/app/helpers/releaf/admin_helper.rb +0 -59
  171. data/app/helpers/releaf/application_helper.rb +0 -4
  172. data/app/helpers/releaf/pagination_renderer.rb +0 -44
  173. data/app/helpers/releaf/releaf_devise_helper.rb +0 -8
  174. data/app/models/releaf/admin.rb +0 -60
  175. data/app/models/releaf/blank_node_base.rb +0 -29
  176. data/app/models/releaf/node.rb +0 -222
  177. data/app/models/releaf/node_base.rb +0 -31
  178. data/app/models/releaf/role.rb +0 -126
  179. data/app/models/releaf/tinymce_asset.rb +0 -6
  180. data/app/views/layouts/releaf/admin.html.haml +0 -57
  181. data/app/views/layouts/releaf/devise.html.haml +0 -32
  182. data/app/views/releaf/aliases/_edit.body.html.haml +0 -50
  183. data/app/views/releaf/aliases/_edit.header.html.haml +0 -19
  184. data/app/views/releaf/aliases/_index.row.html.haml +0 -5
  185. data/app/views/releaf/aliases/_secondary_panel.html.haml +0 -13
  186. data/app/views/releaf/base/_edit.body.html.haml +0 -11
  187. data/app/views/releaf/base/_edit.field.html.haml +0 -23
  188. data/app/views/releaf/base/_edit.field_type_autocomplete.html.haml +0 -15
  189. data/app/views/releaf/base/_edit.field_type_boolean.html.haml +0 -5
  190. data/app/views/releaf/base/_edit.field_type_date.html.haml +0 -8
  191. data/app/views/releaf/base/_edit.field_type_datetime.html.haml +0 -8
  192. data/app/views/releaf/base/_edit.field_type_delete_nested.html.haml +0 -3
  193. data/app/views/releaf/base/_edit.field_type_file.html.haml +0 -10
  194. data/app/views/releaf/base/_edit.field_type_image.html.haml +0 -12
  195. data/app/views/releaf/base/_edit.field_type_item.html.haml +0 -31
  196. data/app/views/releaf/base/_edit.field_type_link.html.haml +0 -4
  197. data/app/views/releaf/base/_edit.field_type_link_i18n.html.haml +0 -26
  198. data/app/views/releaf/base/_edit.field_type_password.html.haml +0 -4
  199. data/app/views/releaf/base/_edit.field_type_richtext.html.haml +0 -4
  200. data/app/views/releaf/base/_edit.field_type_richtext_i18n.html.haml +0 -27
  201. data/app/views/releaf/base/_edit.field_type_text.html.haml +0 -4
  202. data/app/views/releaf/base/_edit.field_type_text_i18n.html.haml +0 -27
  203. data/app/views/releaf/base/_edit.field_type_textarea.html.haml +0 -4
  204. data/app/views/releaf/base/_edit.field_type_textarea_i18n.html.haml +0 -27
  205. data/app/views/releaf/base/_edit.field_type_time.html.haml +0 -8
  206. data/app/views/releaf/base/_edit.fields.association.html.haml +0 -48
  207. data/app/views/releaf/base/_edit.fields.has_many_template.html.haml +0 -15
  208. data/app/views/releaf/base/_edit.fields.html.haml +0 -20
  209. data/app/views/releaf/base/_edit.footer.html.haml +0 -14
  210. data/app/views/releaf/base/_edit.form.html.haml +0 -4
  211. data/app/views/releaf/base/_edit.header.html.haml +0 -3
  212. data/app/views/releaf/base/_index.body.html.haml +0 -6
  213. data/app/views/releaf/base/_index.cell.html.haml +0 -20
  214. data/app/views/releaf/base/_index.footer.html.haml +0 -28
  215. data/app/views/releaf/base/_index.header.html.haml +0 -4
  216. data/app/views/releaf/base/_index.row.html.haml +0 -6
  217. data/app/views/releaf/base/_index.search.html.haml +0 -5
  218. data/app/views/releaf/base/_index.table.html.haml +0 -24
  219. data/app/views/releaf/base/_secondary_panel.html.haml +0 -10
  220. data/app/views/releaf/base/_show.body.html.haml +0 -3
  221. data/app/views/releaf/base/_show.field.html.haml +0 -20
  222. data/app/views/releaf/base/_show.field_type_date.html.haml +0 -9
  223. data/app/views/releaf/base/_show.field_type_date_time.html.haml +0 -9
  224. data/app/views/releaf/base/_show.field_type_email.html.haml +0 -6
  225. data/app/views/releaf/base/_show.field_type_file.html.haml +0 -7
  226. data/app/views/releaf/base/_show.field_type_image.html.haml +0 -10
  227. data/app/views/releaf/base/_show.field_type_item.html.haml +0 -11
  228. data/app/views/releaf/base/_show.field_type_link.html.haml +0 -14
  229. data/app/views/releaf/base/_show.field_type_password.html.haml +0 -6
  230. data/app/views/releaf/base/_show.field_type_richtext.html.haml +0 -6
  231. data/app/views/releaf/base/_show.field_type_text.html.haml +0 -6
  232. data/app/views/releaf/base/_show.field_type_textarea.html.haml +0 -6
  233. data/app/views/releaf/base/_show.field_type_time.html.haml +0 -9
  234. data/app/views/releaf/base/_show.field_type_url.html.haml +0 -7
  235. data/app/views/releaf/base/_show.fields.association.html.haml +0 -36
  236. data/app/views/releaf/base/_show.fields.has_many_template.html.haml +0 -12
  237. data/app/views/releaf/base/_show.fields.html.haml +0 -17
  238. data/app/views/releaf/base/_show.footer.html.haml +0 -18
  239. data/app/views/releaf/base/_show.header.html.haml +0 -3
  240. data/app/views/releaf/base/confirm_destroy.html.haml +0 -17
  241. data/app/views/releaf/base/edit.html.haml +0 -1
  242. data/app/views/releaf/base/index.html.haml +0 -3
  243. data/app/views/releaf/base/new.html.haml +0 -1
  244. data/app/views/releaf/base/show.html.haml +0 -3
  245. data/app/views/releaf/content/_edit.body.html.haml +0 -46
  246. data/app/views/releaf/content/_edit.content_fields.html.haml +0 -11
  247. data/app/views/releaf/content/_edit.fields.html.haml +0 -17
  248. data/app/views/releaf/content/_edit.slug.html.haml +0 -12
  249. data/app/views/releaf/content/_get_content_form.html.haml +0 -7
  250. data/app/views/releaf/content/_secondary_panel.html.haml +0 -3
  251. data/app/views/releaf/content/_tree_level.html.haml +0 -16
  252. data/app/views/releaf/content/ajax.new.html.haml +0 -3
  253. data/app/views/releaf/content/index.html.haml +0 -0
  254. data/app/views/releaf/roles/_edit.field.permissions.html.haml +0 -5
  255. data/app/views/releaf/roles/_show.field.default.html.haml +0 -6
  256. data/app/views/releaf/roles/_show.field.permissions.html.haml +0 -11
  257. data/app/views/releaf/sessions/new.html.haml +0 -17
  258. data/app/views/releaf/translations/_edit.body.html.haml +0 -50
  259. data/app/views/releaf/translations/_edit.header.html.haml +0 -19
  260. data/app/views/releaf/translations/_index.row.html.haml +0 -5
  261. data/app/views/releaf/translations/_secondary_panel.html.haml +0 -13
  262. data/bin/releaf +0 -25
  263. data/lib/generators/releaf/install_generator.rb +0 -87
  264. data/lib/generators/releaf/templates/config/common_fields.yml.example +0 -17
  265. data/lib/generators/releaf/templates/controllers/home_controller.rb +0 -4
  266. data/lib/generators/releaf/templates/images/3rd_party/jquery_ui/smoothness/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  267. data/lib/generators/releaf/templates/images/3rd_party/jquery_ui/smoothness/ui-bg_flat_75_ffffff_40x100.png +0 -0
  268. data/lib/generators/releaf/templates/images/3rd_party/jquery_ui/smoothness/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  269. data/lib/generators/releaf/templates/images/3rd_party/jquery_ui/smoothness/ui-bg_glass_65_ffffff_1x400.png +0 -0
  270. data/lib/generators/releaf/templates/images/3rd_party/jquery_ui/smoothness/ui-bg_glass_75_dadada_1x400.png +0 -0
  271. data/lib/generators/releaf/templates/images/3rd_party/jquery_ui/smoothness/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  272. data/lib/generators/releaf/templates/images/3rd_party/jquery_ui/smoothness/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  273. data/lib/generators/releaf/templates/images/3rd_party/jquery_ui/smoothness/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  274. data/lib/generators/releaf/templates/images/3rd_party/jquery_ui/smoothness/ui-icons_222222_256x240.png +0 -0
  275. data/lib/generators/releaf/templates/images/3rd_party/jquery_ui/smoothness/ui-icons_2e83ff_256x240.png +0 -0
  276. data/lib/generators/releaf/templates/images/3rd_party/jquery_ui/smoothness/ui-icons_454545_256x240.png +0 -0
  277. data/lib/generators/releaf/templates/images/3rd_party/jquery_ui/smoothness/ui-icons_888888_256x240.png +0 -0
  278. data/lib/generators/releaf/templates/images/3rd_party/jquery_ui/smoothness/ui-icons_cd0a0a_256x240.png +0 -0
  279. data/lib/generators/releaf/templates/images/3rd_party/lightbox/close.png +0 -0
  280. data/lib/generators/releaf/templates/images/3rd_party/lightbox/loading.gif +0 -0
  281. data/lib/generators/releaf/templates/images/3rd_party/lightbox/next.png +0 -0
  282. data/lib/generators/releaf/templates/images/3rd_party/lightbox/prev.png +0 -0
  283. data/lib/generators/releaf/templates/initializers/releaf.rb +0 -20
  284. data/lib/generators/releaf/templates/initializers/releaf_i18n.rb +0 -25
  285. data/lib/generators/releaf/templates/initializers/releaf_store_current_template.rb +0 -25
  286. data/lib/generators/releaf/templates/javascripts/3rd_party/jquery.jcarousel.js +0 -1058
  287. data/lib/generators/releaf/templates/javascripts/3rd_party/jquery_ui.js +0 -14850
  288. data/lib/generators/releaf/templates/javascripts/3rd_party/lightbox.js.erb +0 -379
  289. data/lib/generators/releaf/templates/javascripts/application.js +0 -15
  290. data/lib/generators/releaf/templates/javascripts/lib/init_jcarousel.js +0 -40
  291. data/lib/generators/releaf/templates/javascripts/lib/js_check.js +0 -8
  292. data/lib/generators/releaf/templates/javascripts/lib/request_url.js +0 -169
  293. data/lib/generators/releaf/templates/javascripts/lib/sortable.js +0 -29
  294. data/lib/generators/releaf/templates/migrations/create_releaf_admins.rb +0 -53
  295. data/lib/generators/releaf/templates/migrations/create_releaf_nodes.rb +0 -25
  296. data/lib/generators/releaf/templates/migrations/create_releaf_roles.rb +0 -12
  297. data/lib/generators/releaf/templates/migrations/create_releaf_tinymce_assets.rb +0 -11
  298. data/lib/generators/releaf/templates/migrations/create_releaf_translations.rb +0 -31
  299. data/lib/generators/releaf/templates/models/admin_ability.rb +0 -51
  300. data/lib/generators/releaf/templates/seeds.rb +0 -64
  301. data/lib/generators/releaf/templates/stylesheets/3rd_party/jquery_ui/smoothness.css.erb +0 -1174
  302. data/lib/generators/releaf/templates/stylesheets/3rd_party/lightbox.css.erb +0 -157
  303. data/lib/generators/releaf/templates/stylesheets/3rd_party/reset.css +0 -48
  304. data/lib/generators/releaf/templates/stylesheets/application.scss +0 -15
  305. data/lib/generators/releaf/templates/stylesheets/style.scss +0 -45
  306. data/lib/generators/releaf/templates/views/home/index.html.haml +0 -1
  307. data/lib/generators/releaf/templates/views/layouts/application.html.haml +0 -26
  308. data/lib/i18n/backend/releaf.rb +0 -97
  309. data/lib/i18n/backend/releaf/translation.rb +0 -61
  310. data/lib/i18n/backend/releaf/translation_data.rb +0 -39
  311. data/lib/i18n/backend/releaf/translation_group.rb +0 -34
  312. data/lib/i18n/releaf.rb +0 -1
  313. data/lib/releaf/boolean_at.rb +0 -77
  314. data/lib/releaf/engine.rb +0 -4
  315. data/lib/releaf/globalize3/fallbacks.rb +0 -19
  316. data/lib/releaf/resources.rb +0 -101
  317. data/lib/releaf/slug.rb +0 -118
  318. data/lib/releaf/version.rb +0 -3
  319. data/lib/tasks/releaf_tasks.rake +0 -4
  320. data/spec/factories/factories.rb +0 -24
  321. data/spec/features/admin_spec.rb +0 -41
  322. data/templates/releaf/installer.rb +0 -207
@@ -1,4 +0,0 @@
1
- module Releaf
2
- module ApplicationHelper
3
- end
4
- end
@@ -1,44 +0,0 @@
1
- module Releaf
2
- module PaginationRenderer
3
- # This class does the heavy lifting of actually building the pagination
4
- # links. It is used by +will_paginate+ helper internally.
5
-
6
- # This is used in admin/base/_index.footer view
7
-
8
- class LinkRenderer < WillPaginate::ActionView::LinkRenderer
9
-
10
- protected
11
-
12
- def page_number(page)
13
- unless page == current_page
14
- link(page, page, :rel => rel_value(page), :class => 'button')
15
- else
16
- tag(:em, "<span>#{page}</span>", :class => 'current active button')
17
- end
18
- end
19
-
20
- def gap
21
- text = '&hellip;'
22
- %(<span class="gap button disabled">#{text}</span>)
23
- end
24
-
25
- def previous_or_next_page(page, text, classname)
26
- if page
27
- link(text, page, :class => classname + ' button')
28
- else
29
- tag(:span, "<span>#{text}</span>", :class => classname + ' button disabled')
30
- end
31
- end
32
-
33
- def link(text, target, attributes = {})
34
- if target.is_a? Fixnum
35
- attributes[:rel] = rel_value(target)
36
- target = url(target)
37
- end
38
- attributes[:href] = target
39
- tag(:a, "<span>#{text}</span>", attributes)
40
- end
41
-
42
- end
43
- end
44
- end
@@ -1,8 +0,0 @@
1
- module Releaf
2
- module ReleafDeviseHelper
3
- # FIXME need better name
4
- def self.devise_admin_model_name
5
- Releaf.devise_for.underscore.tr('/', '_')
6
- end
7
- end
8
- end
@@ -1,60 +0,0 @@
1
- module Releaf
2
- class Admin < ActiveRecord::Base
3
- self.table_name = 'releaf_admins'
4
-
5
- # Include default devise modules. Others available are:
6
- # :token_authenticatable, :confirmable,
7
- # :lockable, :timeoutable and :omniauthable
8
- # :registerable
9
- devise :database_authenticatable, :recoverable, :rememberable, :trackable, :validatable
10
-
11
- validates_presence_of :name, :surname, :role_id, :email
12
- validates_uniqueness_of :email, :case_sensitive => false
13
- belongs_to :role
14
-
15
- image_accessor :avatar
16
-
17
- attr_accessible \
18
- :avater,
19
- :name,
20
- :surname,
21
- :role_id,
22
- :email,
23
- :password,
24
- :password_confirmation
25
-
26
- scope :filter, lambda {|params|
27
- fields = []
28
- values = {}
29
-
30
- if !params.empty?
31
- if !params[:search].blank?
32
- params[:search].strip.split(" ").each_with_index do|word, i|
33
- fields << "email LIKE :email#{i}"
34
- values["email#{i}".to_sym] = '%' + word + '%'
35
- end
36
- end
37
- end
38
-
39
- if !fields.empty?
40
- where(fields.join(' AND '), values)
41
- end
42
- }
43
-
44
- def display_name
45
- [self.name, self.surname].join(' ')
46
- end
47
- alias :to_text :display_name
48
-
49
- def role
50
- super || Role.default
51
- end
52
-
53
- protected
54
-
55
- def password_required?
56
- self.new_record? || self.encrypted_password.blank?
57
- end
58
-
59
- end
60
- end
@@ -1,29 +0,0 @@
1
- module Releaf
2
- class BlankNodeBase
3
- # returns only bottom level, not /^Releaf::/ subclasses
4
- def self.node_classes
5
- return _node_classes(self).reject { |n| n.name =~ /^Releaf::/ }
6
- end
7
-
8
- def self.releaf_fields_to_display action
9
- []
10
- end
11
-
12
- def self.node_type
13
- "Releaf::BlankNodeBase"
14
- end
15
-
16
- private
17
-
18
- def self._node_classes(klass)
19
- classes = [klass]
20
-
21
- klass.subclasses.each do |sublcass|
22
- classes += _node_classes(sublcass)
23
- end
24
-
25
- return classes
26
- end
27
-
28
- end
29
- end
@@ -1,222 +0,0 @@
1
- module Releaf
2
- class Node < ActiveRecord::Base
3
- COMMON_FIELD_NAME_PREFIX = 'data_'
4
-
5
- acts_as_nested_set
6
- acts_as_list :scope => :parent_id
7
- include Slug
8
- self.table_name = 'releaf_nodes'
9
-
10
- serialize :data, Hash
11
- default_scope :order => 'position'
12
-
13
- validates_presence_of :name, :slug, :content_type
14
- validates_uniqueness_of :slug, :scope => :parent_id
15
-
16
- alias_attribute :to_text, :name
17
-
18
- belongs_to :content, :polymorphic => true, :dependent => :destroy
19
- accepts_nested_attributes_for :content
20
-
21
- # FIXME get rid of attr_protected
22
- attr_protected :none
23
-
24
- acts_as_url :name, :url_attribute => :slug, :scope => :parent_id #, :only_when_blank => true, :limit => 255
25
-
26
- def content_object
27
- self.content
28
- end
29
-
30
- def content_object_attributes=(new_attr)
31
- if self.content
32
- self.content.update_attributes(new_attr)
33
- else
34
- nc = new_content(new_attr)
35
- nc.save
36
-
37
- self.content = nc
38
- self.update_attribute(:content_id, nc.id)
39
- end
40
- end
41
-
42
- ##
43
- # Return node public url
44
-
45
- def url
46
- if parent_id
47
- url = parent.url + "/" + slug.to_s
48
- else
49
- url = "/" + slug.to_s
50
- end
51
-
52
- url
53
- end
54
-
55
- ##
56
- # Return node content object public controller
57
-
58
- def controller
59
- raise "Missing content object" if content_type.blank?
60
- return "#{content_type.classify.pluralize}Controller".constantize
61
- end
62
-
63
- def self.get_object_from_path path, params = {}
64
- raise ArgumentError, 'path must be String or Array' unless path.is_a?(String) || path.is_a?(Array)
65
- node = nil
66
- parent_node = nil
67
-
68
- if path.is_a? String
69
- path = path.split('?').first.split("/").reject(&:empty?)
70
- end
71
-
72
- unless params[:locale].nil?
73
- parent_node = Node.roots.find_by_slug(params[:locale])
74
- end
75
-
76
- path.each do |part|
77
- node = Node.where(:parent_id => (parent_node ? parent_node.id : nil), :slug => part).first
78
- if node
79
- parent_node = node
80
- else
81
- unless params[:strict].blank?
82
- node = nil
83
- else
84
- node = parent_node
85
- end
86
- break
87
- end
88
- end
89
-
90
- unless params[:controller].nil?
91
- if params[:controller] != node.controller.to_s
92
- node = nil
93
- end
94
- end
95
-
96
- node
97
- end
98
-
99
- def to_s
100
- name
101
- end
102
-
103
- def method_missing(method, *args, &block)
104
- if self.class.column_names.include?('data')
105
- case method.to_s
106
- when /^(#{COMMON_FIELD_NAME_PREFIX}(.+))=$/ then
107
- if common_field_names.include? $1
108
- return common_field_setter($2, args[0])
109
- end
110
- when /^(#{COMMON_FIELD_NAME_PREFIX}(.+))$/ then
111
- if common_field_names.include? $1
112
- return common_field_getter($2)
113
- end
114
- end
115
- end
116
-
117
- return super(method, *args, &block)
118
- end
119
-
120
- def respond_to? method_id, include_private = false
121
- # this is needed for mass asignment (update_attributes) to work with common_fields
122
- rt = super(method_id, include_private)
123
- return true if rt
124
- return common_field_names.include?(method_id.to_s.sub(/=$/, ''))
125
- end
126
-
127
- def common_fields_schema
128
- @_common_fields_schema ||= common_fields_schema_for_instance
129
- end
130
-
131
- def common_field_names
132
- @_common_field_names ||= common_fields_schema.map { |f| "#{COMMON_FIELD_NAME_PREFIX}#{f['field_name']}" }
133
- end
134
-
135
- def common_field_field_type(field_name)
136
- common_field_options(field_name.sub(/^#{COMMON_FIELD_NAME_PREFIX}/, ''))['field_type']
137
- end
138
-
139
- def self.load_common_fields_schema
140
-
141
- common_fields_schema_file = Rails.root.to_s+ '/config/common_fields.yml'
142
- cfschema = if File.exists?(common_fields_schema_file)
143
- YAML::load_file(common_fields_schema_file)
144
- else
145
- []
146
- end
147
-
148
- raise "common_fields common_fields_schema is not an array" unless cfschema.is_a? Array
149
- cfschema.each_with_index do |field,i|
150
- raise "common_fields common_fields_schema contains non-hash element in root node" unless field.is_a? Hash
151
- raise "field_name not defined for field ##{i}" unless field.has_key?('field_name')
152
- raise "field_name must be string" unless field['field_name'].is_a? String
153
- raise "field_type not defined for #{field['field_type']} field" unless field.has_key?('field_type')
154
- raise "apply_to not defined for #{field['apply_to']} field" unless field.has_key?('apply_to')
155
- end
156
- return cfschema
157
- end
158
-
159
- private
160
-
161
- def common_fields_schema_for_instance
162
-
163
- full_schema =if defined?(COMMON_FIELDS_SCHEMA)
164
- COMMON_FIELDS_SCHEMA.dup
165
- else
166
- self.class.load_common_fields_schema.dup
167
- end
168
-
169
- full_schema.delete_if do |field|
170
- keep = false
171
-
172
- if field['apply_to'].is_a?(String) && (field['apply_to'] == '*' || field['apply_to'] == self.content_type)
173
- keep = true
174
- elsif field['apply_to'].is_a?(Array) && field['apply_to'].include?(self.content_type)
175
- keep = true
176
- else
177
- keep = false
178
- end
179
-
180
- if keep == true && field.has_key?('deny_for')
181
- if field['deny_for'].is_a?(String) && (field['deny_for'] == '*' || field['deny_for'] == self.content_type)
182
- keep = false
183
- elsif field['deny_for'].is_a?(Array) && field['deny_for'].include?(self.content_type)
184
- keep = false
185
- end
186
- end
187
-
188
- if keep == true && field.has_key?('levels')
189
- keep = false unless field['levels'].include? level
190
- end
191
-
192
- !keep
193
- end
194
-
195
- return full_schema
196
- end
197
-
198
- def common_field_setter(key, value)
199
- self.data[key] = value
200
- end
201
-
202
- def common_field_getter(key)
203
- self.data.has_key?(key) ? self.data[key] : common_field_default_value(key)
204
- end
205
-
206
- def common_field_options(key)
207
- common_fields_schema.each do |field|
208
- return field if field['field_name'] == key
209
- end
210
- end
211
-
212
- def common_field_default_value(key)
213
- common_field_options(key)['default']
214
- end
215
-
216
- def new_content(attr)
217
- raise RuntimeError, 'content_type must be set' unless content_type
218
- self.content_type.constantize.new(attr)
219
- end
220
-
221
- end
222
- end
@@ -1,31 +0,0 @@
1
- module Releaf
2
- class NodeBase < ActiveRecord::Base
3
- self.abstract_class = true
4
-
5
- # returns only bottom level, not /^Releaf::/ subclasses
6
- def self.node_classes
7
- return _node_classes(self).reject { |n| n.name =~ /^Releaf::/ }
8
- end
9
-
10
- def self.releaf_fields_to_display action
11
- column_names - %w[id created_at updated_at position]
12
- end
13
-
14
- def self.node_type
15
- "Releaf::NodeBase"
16
- end
17
-
18
- private
19
-
20
- def self._node_classes(klass)
21
- classes = [klass]
22
-
23
- klass.subclasses.each do |sublcass|
24
- classes += _node_classes(sublcass)
25
- end
26
-
27
- return classes
28
- end
29
-
30
- end
31
- end
@@ -1,126 +0,0 @@
1
- module Releaf
2
- class Role < ActiveRecord::Base
3
- self.table_name = 'releaf_roles'
4
-
5
- validates_presence_of :name
6
- validates_uniqueness_of :name, :case_sensitive => false
7
-
8
- has_many :admins
9
-
10
- before_save :update_permissions
11
- after_save :update_default_role
12
-
13
- attr_accessible \
14
- :name,
15
- :default,
16
- :default_controller
17
-
18
- alias_attribute :to_text, :name
19
-
20
- ::AdminAbility::PERMISSIONS.each do |perms|
21
- if perms.is_a? Array
22
- attr_accessible :"#{perms[0]}_permissions"
23
- define_method :"#{perms[0]}_permissions=" do |p|
24
- return if p.nil?
25
- raise ArgumentError, "permission must be one of: #{perms[1].join(', ')}" unless perms[1].include? p.to_s
26
- self.instance_variable_set "@#{perms[0]}_permissions", p.to_s
27
- end
28
-
29
- define_method "#{perms[0]}_permissions" do
30
- iv = self.instance_variable_get "@#{perms[0]}_permissions"
31
- return iv unless iv.nil?
32
- perms[1].each do |perm|
33
- xperm = [perms[0], perm].join('__')
34
- return perm if permissions.include? xperm
35
- end
36
- return perms[1].first
37
- end
38
- alias_method "#{perms[0]}_permissions?", "#{perms[0]}_permissions"
39
-
40
- elsif perms.is_a? String
41
- attr_accessible :"#{perms}_permission"
42
- define_method "#{perms}_permission=" do |p|
43
- return if p.nil?
44
-
45
- raise ArgumentError, "permission must be one of: true, false, '0', '1'" unless [true, false, '0', '1'].include? p
46
- self.instance_variable_set "@#{perms}_permission", (p == true || p == '1')
47
- end
48
-
49
- define_method "#{perms}_permission" do
50
- iv = self.instance_variable_get "@#{perms}_permission"
51
- return (iv == '1' || iv == true) unless iv.nil?
52
- permissions.include? perms
53
- end
54
- alias_method "#{perms}_permission?", "#{perms}_permission"
55
- end
56
- end
57
-
58
- scope :order_by, lambda { |field=:name| order(field) }
59
-
60
- def self.default
61
- Role.find_by_default(true)
62
- end
63
-
64
- def default
65
- return true if @set_default
66
- self.default?
67
- end
68
-
69
- def default=(is_default=true)
70
- return unless is_default == true or is_default == '1'
71
- @set_default = true
72
- end
73
-
74
- def destroy
75
- if (self.default? == false) && (!self.permissions.include?('admin') || (self.permissions.include?('admin') && Role.admin_roles_count > 1))
76
- super
77
- end
78
- end
79
-
80
- def self.admin_roles_count
81
- Role.where('permissions LIKE "%\n- admin\n%"').count
82
- end
83
-
84
- protected
85
-
86
- def permissions
87
- perm = read_attribute :permissions
88
- return YAML::load(perm) if perm
89
- return []
90
- end
91
-
92
- def permissions=(perm=[])
93
- raise ArgumentError unless perm.is_a? Array
94
- new_perm = perm.clone
95
- new_perm.delete_if { |p| p.blank? }
96
- write_attribute :permissions, YAML::dump(new_perm)
97
- end
98
-
99
- private
100
-
101
- def update_default_role
102
- if @set_default && self.id
103
- Role.update_all 'releaf_roles.default = false', ['releaf_roles.id <> ?', self.id]
104
- Role.update_all 'releaf_roles.default = true', ['releaf_roles.id = ?', self.id]
105
- @set_default = false
106
- self.reload
107
- end
108
- end
109
-
110
- def update_permissions
111
- my_permissions = []
112
- AdminAbility::PERMISSIONS.each do |perms|
113
- p = nil
114
- if perms.is_a? Array
115
- p = [perms[0], self.send(:"#{perms[0]}_permissions")].join('__')
116
- p = nil if p == [perms[0], perms[1].first].join('__')
117
- elsif perms.is_a? String
118
- p = perms if self.send(:"#{perms}_permission")
119
- end
120
- my_permissions.push p if p.blank? == false
121
- end
122
- self.permissions = my_permissions
123
- end
124
-
125
- end
126
- end