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,12 +0,0 @@
1
- .list[data-sortable] > .item {
2
- position: relative;
3
- }
4
-
5
- .list[data-sortable] > .item > .handle {
6
- top: 5px;
7
- right: 50px;
8
- width: 24px;
9
- height: 24px;
10
- position: absolute;
11
- background: url(<%= asset_path('releaf/icons/drag-handle.png') %>) center center no-repeat;
12
- }
@@ -1,55 +0,0 @@
1
- module Releaf
2
- class AdminsController < BaseController
3
-
4
- def resource_class
5
- Releaf::Admin
6
- end
7
-
8
- def fields_to_display
9
- fields = super - %w[
10
- authentication_token
11
- confirmation_sent_at
12
- confirmation_token
13
- confirmed_at
14
- current_sign_in_at
15
- current_sign_in_ip
16
- encrypted_password
17
- failed_attempts
18
- last_sign_in_at
19
- last_sign_in_ip
20
- locked_at
21
- remember_created_at
22
- reset_password_sent_at
23
- reset_password_token
24
- sign_in_count
25
- unconfirmed_email
26
- unlock_token
27
- ]
28
-
29
- if params[:action] == 'index'
30
- fields -= ['avatar_uid']
31
- end
32
-
33
- if %w[new create edit update].include? params[:action]
34
- fields += ['password', 'password_confirmation']
35
- end
36
-
37
- return fields
38
- end
39
-
40
- def new
41
- super
42
- if Releaf::Role.default
43
- @resource.role = Releaf::Role.default
44
- end
45
- end
46
-
47
- protected
48
-
49
- def resource_params
50
- return [] unless %w[create update].include? params[:action]
51
- %w[name surname role_id email password password_confirmation phone avatar retained_avatar]
52
- end
53
-
54
- end
55
- end
@@ -1,11 +0,0 @@
1
- module Releaf
2
- class ApplicationController < BaseController
3
- # I've no idea where this route to releaf/application.index comes from
4
-
5
- def index
6
- respond_to do |format|
7
- format.html { redirect_to url_for(:action => 'index', :controller => 'releaf/content') }
8
- end
9
- end
10
- end
11
- end
@@ -1,18 +0,0 @@
1
- module Releaf
2
- class BaseApplicationController < ActionController::Base
3
-
4
- before_filter "authenticate_#{ReleafDeviseHelper.devise_admin_model_name}!"
5
- # check_authorization :unless => :devise_controller?
6
- layout Releaf.layout
7
- protect_from_forgery
8
-
9
- def current_ability
10
- @current_ability ||= AdminAbility.new(self.send("current_#{ReleafDeviseHelper.devise_admin_model_name}"))
11
- end
12
-
13
- def full_controller_name
14
- self.class.name.sub(/Controller$/, '').underscore
15
- end
16
-
17
- end
18
- end
@@ -1,571 +0,0 @@
1
- module Releaf
2
- class FeatureDisabled < StandardError; end
3
-
4
- class BaseController < BaseApplicationController
5
- helper_method :build_secondary_panel_variables,
6
- :fields_to_display,
7
- :resource_class,
8
- :find_parent_template,
9
- :has_template?,
10
- :list_action,
11
- :render_field_type,
12
- :render_parent_template,
13
- :secondary_panel,
14
- :current_feature,
15
- :resource_to_text,
16
- :resource_to_text_method
17
-
18
- before_filter do
19
- filter_templates
20
- set_locale
21
- setup
22
- end
23
-
24
-
25
- # Helper that returns current feature
26
- def current_feature
27
- case params[:action].to_sym
28
- when :index
29
- return :index
30
- when :new, :create
31
- return :create
32
- when :edit, :update
33
- return :edit
34
- when :destroy, :confirm_destroy
35
- return :destroy
36
- else
37
- return params[:action].to_sym
38
- end
39
- end
40
-
41
-
42
- def autocomplete
43
- authorize! :edit, resource_class
44
-
45
- c_obj = resource_class
46
-
47
- if params[:query_field] and params[:q] and params[:field] #and params[:field] =~ /_id\z/ and c_obj.column_names.include?(params[:field]) and c_obj.respond_to?(:reflect_on_association) and c_obj.reflect_on_association(params[:field].sub(/_id\z/, '').to_sym)
48
-
49
- obj = c_obj.reflect_on_association(params[:field].sub(/_id\z/, '').to_sym).klass
50
- obj_fields = obj.column_names
51
-
52
- sql = []
53
- sql_params = {}
54
-
55
- params[:q].split(' ').each_with_index do |part, i|
56
- sql.push "#{params[:query_field]} LIKE :part#{i}"
57
- sql_params[:"part#{i}"] = "%#{part}%"
58
- end
59
-
60
- order_by = nil
61
-
62
- if params[:order]
63
- order_by = []
64
-
65
- params[:order].split(',').each do |order_part|
66
- if obj_fields.include? order_part.sub(/ (asc|desc)\z/i, '')
67
- order_by.push order_part
68
- end
69
- end
70
- end
71
-
72
- order_by = [params[:query_field],'id'] if order_by.blank?
73
-
74
- query = obj.where(sql.join(' AND '), sql_params).order(order_by.join(', '))
75
-
76
- matching_items_count = query.count
77
- list = query.limit(20)
78
-
79
- @resources = []
80
- list.each do |resource|
81
- @resources.push({ :id => resource.id, :text => resource.to_text })
82
- end
83
-
84
- respond_to do |format|
85
- format.json { render :json => {:matching_items_count => matching_items_count, :query => params[:q], :results => @resources } }
86
- end
87
-
88
- else
89
- respond_to do |format|
90
- format.json { raise }
91
- end
92
- end
93
- end
94
-
95
- def index
96
- authorize! :list, resource_class
97
- if resource_class.respond_to? :filter
98
- @resources = resource_class.filter(:search => params[:search])
99
- else
100
- @resources = resource_class
101
- end
102
-
103
- if resource_class.respond_to? :order_by
104
- @resources = @resources.order_by(valid_order_by)
105
- end
106
-
107
- @resources = @resources.includes(relations_for_includes).page( params[:page] ).per_page( @resources_per_page )
108
-
109
- unless params[:ajax].blank?
110
- render :layout => false
111
- end
112
- end
113
-
114
- def urls
115
- respond_to do |format|
116
- format.json do
117
- json = {}
118
- params[:ids].each do |id|
119
- json[id] = url_for( :action => params[:to_action], :id => id, :only_path => true )
120
- end
121
- render :json => json, :layout => false
122
- end
123
- end
124
- end
125
-
126
- def new
127
- authorize! :create, resource_class
128
- raise FeatureDisabled unless @features[:create]
129
- @resource = resource_class.new
130
- end
131
-
132
- def show
133
- @resource = resource_class.includes(relations_for_includes).find(params[:id])
134
- authorize! :show, @resource
135
- raise FeatureDisabled unless @features[:show]
136
- end
137
-
138
- def edit
139
- @resource = resource_class.includes(relations_for_includes).find(params[:id])
140
- authorize! :edit, @resource
141
- raise FeatureDisabled unless @features[:edit]
142
- end
143
-
144
- def create
145
- authorize! :create, resource_class
146
- raise FeatureDisabled unless @features[:create]
147
-
148
- @resource = resource_class.new
149
-
150
- @resource.assign_attributes required_params.permit(*resource_params)
151
-
152
- respond_to do |format|
153
- if @resource.save
154
- format.html { redirect_to url_for( :action => @features[:show] ? 'show' : 'index', :id => @resource.id ) }
155
- else
156
- format.html { render :action => "new" }
157
- end
158
- end
159
- end
160
-
161
- def update
162
- @resource = resource_class.find(params[:id])
163
- authorize! :edit, @resource
164
- raise FeatureDisabled unless @features[:edit]
165
-
166
- respond_to do |format|
167
- if @resource.update_attributes( required_params.permit(*resource_params) )
168
- format.html { redirect_to url_for( :action => @features[:show] ? 'show' : 'index', :id => @resource.id ) }
169
- else
170
- format.html { render :action => "edit" }
171
- end
172
- end
173
- end
174
-
175
- def confirm_destroy
176
- @resource = resource_class.find(params[:id])
177
- authorize! :destroy, @resource
178
- raise FeatureDisabled unless @features[:destroy]
179
- end
180
-
181
- def destroy
182
- @resource = resource_class.find(params[:id])
183
- authorize! :destroy, @resource
184
- raise FeatureDisabled unless @features[:destroy]
185
- @resource.destroy
186
-
187
- respond_to do |format|
188
- format.html { redirect_to url_for( :action => 'index' ) }
189
- end
190
- end
191
-
192
-
193
-
194
-
195
-
196
-
197
- # Helper methods ##############################################################################
198
-
199
-
200
- def list_action
201
- if !cookies['base_module:list_action'].blank?
202
- feature = cookies['base_module:list_action']
203
- if feature == 'confirm_destroy'
204
- feature = 'destroy'
205
- end
206
- feature = feature.to_sym
207
- if @features[feature]
208
- return cookies['base_module:list_action']
209
- end
210
- end
211
-
212
- return 'show' if @features[:show]
213
- return 'edit'
214
- end
215
-
216
- # Defines which fields/associations should be rendered.
217
- #
218
- # By default renders resource columns except few (check source).
219
- #
220
- # You can override this method to make it possible to render pretty complex
221
- # views which inludes nested fields.
222
- #
223
- # To render field you simply need to add it's name to array.
224
- #
225
- # belongs_to relations will be automatically rendered (by default) as
226
- # select field. For belongs_to to be recognized you need to use Integer
227
- # field that ends with <tt>_id</tt>
228
- #
229
- # You can also render has_many associations. For these associations you
230
- # need to add either association name, or a Hash. Hash keys must match
231
- # association name, hash value must be array with nested fields to be
232
- # rendered.
233
- #
234
- # NOTE: currently if you add has_many associations name to array, then it
235
- # will render all fields (except created_at etc.) including <tt>belongs_to
236
- # :parent</tt>. This is know bug https://github.com/cubesystems/releaf/issues/64
237
- #
238
- # @example
239
- # def fields_to_display
240
- # case params[:action]
241
- # when 'edit', 'update', 'create', 'new'
242
- # return [
243
- # 'name',
244
- # 'category_id',
245
- # 'description',
246
- # {'offer_card_types' => ['card_type_id', 'name', 'description']},
247
- # 'show_banner',
248
- # 'published',
249
- # 'item_count',
250
- # {'images' => ['image_uid']},
251
- # 'partner_id',
252
- # 'offer_checkout_places' => ['checkout_place_id']
253
- # ]
254
- # else
255
- # return super
256
- # end
257
- # end
258
- #
259
- # Fields will be rendered in same order as specified in array
260
- #
261
- # @return array that represent which fields to render
262
- def fields_to_display
263
- cols = resource_class.column_names - %w[id created_at updated_at encrypted_password position]
264
- unless %w[new edit update create].include? params[:action]
265
- cols -= %w[password password_confirmation]
266
- end
267
- return cols
268
- end
269
-
270
-
271
- def secondary_panel
272
- return '' unless @panel_layout
273
- @_secondary_panel ||= render_to_string( :partial => "secondary_panel", :layout => false, :locals => build_secondary_panel_variables)
274
- end
275
-
276
- def build_secondary_panel_variables
277
- menu_item_name = self.class.name.underscore.sub(/_controller$/, '')
278
-
279
- # if this item is defined in main menu, then there will be no altmenu
280
- # defined for it in alt menu, instead this method should be overriden in
281
- # particular controller to return structure needed to render alt menu
282
- return {} if Releaf.main_menu.include? menu_item_name
283
-
284
- # if this item was not found in main menu, then we need to find it in one
285
- # of alt menus. This way we'll know which alt menu to render.
286
- base_menus = Releaf.main_menu.reject { |item| item[0] != '*' }
287
- base_menus.each do |base_menu_name|
288
- if view_context.base_menu_items(base_menu_name).include?(menu_item_name)
289
- build_menu = { :menu => {} }
290
-
291
- base_menu = Releaf.base_menu[base_menu_name]
292
-
293
- base_menu.each do |section|
294
- section_name = section[0].to_sym
295
- build_menu[:menu][section_name] = []
296
- section[1].each do |item|
297
- build_menu[:menu][section_name].push({:controller => item.split(/#/, 2).first})
298
- end
299
- end
300
-
301
- return build_menu
302
- end
303
- end
304
-
305
- # coundn't find current controller in base_menu
306
- return {}
307
- end
308
-
309
- # Tries to return resource class.
310
- #
311
- # If it fails to return proper resource class for your controller, or your
312
- # controllers name has no relation to resource class name, then simply
313
- # override this method to return class that you want.
314
- #
315
- # @return class
316
- def resource_class
317
- @resource_class ||= self.class.name.split('::').last.sub(/Controller$/, '').classify.constantize
318
- end
319
-
320
-
321
- # Cheheck if there is a template in lookup_context with given name.
322
- #
323
- # @return `true` or `false`
324
- def has_template? name
325
- lookup_context.template_exists?( name, lookup_context.prefixes, false )
326
- end
327
-
328
- def find_parent_template( name )
329
- lookup_context.find_template( name, lookup_context.prefixes.slice( 1, lookup_context.prefixes.length ), false )
330
- end
331
-
332
- def render_parent_template( name, locals = {} )
333
- template = find_parent_template( name )
334
- if template.blank?
335
- return 'blank'
336
- end
337
- arguments = { :layout => false, :locals => locals, :template => template.virtual_path }
338
- return render_to_string( arguments ).html_safe
339
- end
340
-
341
- # Helps to determinate which template to render in :show and :edit feature
342
- # for given objects attribute.
343
- #
344
- # @return [field_type, use_i18n]
345
- #
346
- # where field_type is a string representing field type
347
- # and use_i18n is a `true` or `false`. If use_i18n is true, then template
348
- # with localization features should be used (if exists)
349
- #
350
- # This helper is used by views.
351
- #
352
- # @todo document rendering conventions
353
- def render_field_type( obj, attribute_name )
354
- field_type = nil
355
- use_i18n = false
356
- obj_class = obj.class
357
-
358
- if obj_class.respond_to?(:translations_table_name)
359
- use_i18n = obj_class.translates.include?(attribute_name.to_sym)
360
- end
361
-
362
- column_type = :string
363
- if attribute_name.to_s =~ /^#{Releaf::Node::COMMON_FIELD_NAME_PREFIX}/
364
- column_type = obj.common_field_field_type(attribute_name)
365
- else
366
- column_type = obj_class.columns_hash[attribute_name.to_s].try(:type) || :string
367
- end
368
-
369
- case column_type.to_sym
370
- when :boolean
371
- field_type = 'boolean'
372
-
373
- when :string
374
- case attribute_name.to_s
375
- when /(thumbnail|image|photo|picture|avatar|logo|banner|icon)_uid$/
376
- field_type = 'image'
377
-
378
- when /_uid$/
379
- field_type = 'file'
380
-
381
- when /password/, 'pin'
382
- field_type = 'password'
383
-
384
- when /_email$/, 'email'
385
- field_type = 'email'
386
-
387
- when /_link$/, 'link'
388
- field_type = 'link'
389
-
390
- else
391
- field_type = 'text'
392
- end
393
-
394
- when :integer
395
- if attribute_name.to_s =~ /_id$/ and obj_class.reflect_on_association( attribute_name[0..-4].to_sym )
396
- field_type = 'item'
397
- else
398
- field_type = 'text'
399
- end
400
-
401
- when :text
402
- case attribute_name.to_s
403
- when /_(url|homepage)$/, 'homepage', 'url'
404
- field_type = 'url'
405
-
406
- when /_link$/, 'url'
407
- field_type = 'link_or_url'
408
-
409
- when /_html$/, 'html'
410
- field_type = 'richtext'
411
-
412
- else
413
- field_type = 'textarea'
414
- end
415
-
416
- when :datetime
417
- field_type = 'datetime'
418
-
419
- when :date
420
- field_type = 'date'
421
-
422
- when :time
423
- field_type = 'time'
424
-
425
- end
426
-
427
- return [field_type || 'text', use_i18n]
428
- end
429
-
430
- # calls `#to_text` on resource if resource supports it. Otherwise calls
431
- # fallback method
432
- def resource_to_text resource, fallback=:to_s
433
- resource.send resource_to_text_method(resource, fallback)
434
- end
435
-
436
- # @return `:to_text` if resource supports `#to_text`, otherwise fallback.
437
- def resource_to_text_method resource, fallback=:to_s
438
- if resource.respond_to?(:to_text)
439
- return :to_text
440
- else
441
- Rails.logger.warn "Re:Leaf: #{resource.class.name} doesn't support #to_text method. Please define it"
442
- return fallback
443
- end
444
- end
445
-
446
- protected
447
-
448
- def required_params
449
- params.require(:resource)
450
- end
451
-
452
- # Called before each request by before_filter.
453
- # It sets various instance variables, that are later used in views and # controllers
454
- #
455
- # == Defines
456
- # @fetures::
457
- # Hash with symbol keys and boolean values. Each key represents action
458
- # (currently only `:edit`, `:create`, `:show`, `:destroy` are supported). If one
459
- # of features is disabled, then routing to it will raise <tt>Releaf::FeatureDisabled</tt>
460
- # error
461
- #
462
- # @continuous_scroll::
463
- # Boolean. If set to `true` will enable continuous scrool in `#index` view
464
- #
465
- # @resources_per_page::
466
- # Integer - sets the number of resources to display on `#index` view
467
- #
468
- # To change controller settings `setup` method should be overriden like this
469
- #
470
- # @example
471
- # def setup
472
- # super
473
- # @fetures[:show] = false
474
- # @resources_per_page = 20
475
- # end
476
- def setup
477
- @features = {
478
- :edit => true,
479
- :create => true,
480
- :show => true,
481
- :destroy => true
482
- }
483
- @continuous_scroll = false
484
- @panel_layout = true
485
- @resources_per_page = 40
486
- end
487
-
488
- # Returns which resource attributes can be updated with mass assignment.
489
- #
490
- # The resulting array will be passed to strong_parameters ``permit``
491
- def resource_params
492
- return unless %w[create update].include? params[:action]
493
- resource_class.column_names
494
- end
495
-
496
- private
497
-
498
- def relations_for_includes
499
- return nil
500
- # XXX there's a problem with relations that have conditions with proc.
501
- # If you refer to models attribute in proc, this function will break.
502
- # As temp workaround we'll simply skip including relations that have conditions for now.
503
- rels = []
504
- fields_to_display.each do |field|
505
- if (field.is_a? String or field.is_a? Symbol) and field =~ /_id$/
506
- reflection = resource_class.reflect_on_association(field[0..-4].to_sym)
507
- next if reflection.blank?
508
- next unless reflection.conditions.blank?
509
- rels.push field[0..-4]
510
- elsif field.is_a? Hash
511
- field.keys.each do |key|
512
- if key =~ /_id$/
513
- reflection = resource_class.reflect_on_association(key[0..-4].to_sym)
514
- next if reflection.blank?
515
- next unless reflection.conditions.blank?
516
- rels.push key[0..-4] if resource_class.reflect_on_association(key[0..-4].to_sym)
517
- else
518
- reflection = resource_class.reflect_on_association(key.to_sym)
519
- next if reflection.blank?
520
- next unless reflection.conditions.blank?
521
- rels.push key if resource_class.reflect_on_association(key.to_sym)
522
- end
523
- end
524
- end
525
- end
526
- return rels
527
- end
528
-
529
- def valid_order_by
530
- return nil if params[:order_by].blank?
531
- return nil unless resource_class.column_names.include?(params[:order_by].sub(/-reverse$/, ''))
532
- return resource_class.table_name + '.' + params[:order_by].sub(/-reverse$/, ' DESC')
533
- end
534
-
535
- def set_locale
536
- I18n.locale = if params[:locale] && Settings.i18n_locales.include?(params[:locale])
537
- params[:locale]
538
- elsif cookies[:locale] && Settings.i18n_locales.include?(cookies[:locale])
539
- cookies[:locale]
540
- else
541
- I18n.default_locale
542
- end
543
-
544
- Releaf::Globalize3::Fallbacks.set
545
- end
546
-
547
- def filter_templates
548
- filter_templates_from_hash params
549
- end
550
-
551
- def filter_templates_from_array arr
552
- return unless arr.is_a? Array
553
- arr.each do |item|
554
- if item.is_a? Hash
555
- filter_templates_from_hash item
556
- elsif item.is_a? Array
557
- filter_templates_from_array item
558
- end
559
- end
560
- end
561
-
562
- def filter_templates_from_hash hsk
563
- return unless hsk.is_a? Hash
564
- hsk.delete :_template_
565
- hsk.delete '_template_'
566
-
567
- filter_templates_from_array hsk.values
568
- end
569
-
570
- end
571
- end