ab_admin 0.3.6 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (419) hide show
  1. checksums.yaml +7 -0
  2. data/{LICENSE.txt → MIT-LICENSE} +2 -4
  3. data/README.md +3 -3
  4. data/Rakefile +21 -3
  5. data/app/assets/images/admin/flags/b_de.png +0 -0
  6. data/app/assets/images/admin/flags/b_es.png +0 -0
  7. data/app/assets/images/admin/flags/b_fr.png +0 -0
  8. data/app/assets/images/admin/flags/flag_de.gif +0 -0
  9. data/app/assets/images/admin/flags/flag_de_nonact.gif +0 -0
  10. data/app/assets/images/admin/flags/flag_es.gif +0 -0
  11. data/app/assets/images/admin/flags/flag_es_nonact.gif +0 -0
  12. data/app/assets/images/admin/flags/flag_fr.gif +0 -0
  13. data/app/assets/images/admin/flags/flag_fr_nonact.gif +0 -0
  14. data/app/assets/javascripts/ab_admin/components/admin_assets.js.coffee +50 -60
  15. data/app/assets/javascripts/ab_admin/components/base_assets.js.coffee +86 -0
  16. data/app/assets/javascripts/ab_admin/components/croppable_image.js.coffee +4 -4
  17. data/app/assets/javascripts/ab_admin/components/gmaps.js.coffee +5 -0
  18. data/app/assets/javascripts/ab_admin/components/google_translate.js.coffee +0 -1
  19. data/app/assets/javascripts/ab_admin/components/in_place_edit.js.coffee +7 -3
  20. data/app/assets/javascripts/ab_admin/components/locator.js.coffee +1 -1
  21. data/app/assets/javascripts/ab_admin/components/select2_bridge.js.coffee +152 -0
  22. data/app/assets/javascripts/ab_admin/components/sortable_tree.js.coffee +1 -1
  23. data/app/assets/javascripts/ab_admin/core/batch_actions.js.coffee +5 -4
  24. data/app/assets/javascripts/ab_admin/core/columns_hider.js.coffee +4 -11
  25. data/app/assets/javascripts/ab_admin/core/confirmation.js.coffee +4 -43
  26. data/app/assets/javascripts/ab_admin/core/deprecated_utils.js.coffee +44 -0
  27. data/app/assets/javascripts/ab_admin/core/init.js.coffee +8 -25
  28. data/app/assets/javascripts/ab_admin/core/pjax.js.coffee +18 -4
  29. data/app/assets/javascripts/ab_admin/core/search_form.js.coffee +5 -5
  30. data/app/assets/javascripts/ab_admin/core/ui_utils.js.coffee +15 -86
  31. data/app/assets/javascripts/ab_admin/core/utils.js.coffee +38 -51
  32. data/app/assets/javascripts/ab_admin/core/view_layout.js.coffee +1 -1
  33. data/app/assets/javascripts/ab_admin/inputs/datetime_input.js.coffee +16 -18
  34. data/app/assets/javascripts/ab_admin/main.js +7 -7
  35. data/app/assets/stylesheets/ab_admin/bootstrap_and_overrides.css.scss +21 -8
  36. data/app/assets/stylesheets/ab_admin/components/_admin_comments.css.scss +17 -5
  37. data/app/assets/stylesheets/ab_admin/components/_base.css.scss +4 -0
  38. data/app/assets/stylesheets/ab_admin/components/_colored_tabs.css.scss +1 -4
  39. data/app/assets/stylesheets/ab_admin/components/_columns_hider.css.scss +5 -0
  40. data/app/assets/stylesheets/ab_admin/components/_form.css.scss +45 -16
  41. data/app/assets/stylesheets/ab_admin/components/_grid_view.css.scss +11 -0
  42. data/app/assets/stylesheets/ab_admin/components/_locale_tabs.css.scss +1 -1
  43. data/app/assets/stylesheets/ab_admin/components/_navigation.css.scss +11 -9
  44. data/app/assets/stylesheets/ab_admin/components/_table_view.css.scss +1 -1
  45. data/app/assets/stylesheets/ab_admin/components/_translations.css.scss +1 -0
  46. data/app/assets/stylesheets/ab_admin/components/{_sortable_tree.css.scss → _tree_view.css.scss} +8 -3
  47. data/app/assets/stylesheets/ab_admin/fileupload.css.scss +51 -43
  48. data/app/assets/stylesheets/ab_admin/main.css.scss +1 -3
  49. data/app/controllers/admin/admin_comments_controller.rb +14 -4
  50. data/app/controllers/admin/assets_controller.rb +44 -35
  51. data/app/controllers/admin/base_controller.rb +93 -38
  52. data/app/controllers/admin/locators_controller.rb +3 -2
  53. data/app/controllers/admin/manager_controller.rb +20 -9
  54. data/app/controllers/admin/structures_controller.rb +9 -1
  55. data/app/controllers/admin/users_controller.rb +1 -2
  56. data/app/views/ab_admin/devise/sessions/new.html.slim +1 -1
  57. data/app/views/admin/admin_comments/_comment.html.slim +21 -7
  58. data/app/views/admin/admin_comments/_comments.html.slim +1 -1
  59. data/app/views/admin/admin_comments/_form.html.slim +8 -3
  60. data/app/views/admin/admin_comments/_list_block.html.slim +7 -0
  61. data/app/views/admin/admin_comments/create.js.erb +3 -2
  62. data/app/views/admin/admin_comments/destroy.js.erb +1 -1
  63. data/app/views/admin/admin_comments/index.js.erb +14 -0
  64. data/app/views/admin/assets/batch_edit.html.slim +14 -0
  65. data/app/views/admin/base/_modal_form_layout.html.slim +12 -0
  66. data/app/views/admin/base/_search_layout.html.slim +4 -3
  67. data/app/views/admin/base/_table.html.slim +2 -2
  68. data/app/views/admin/base/create.js.erb +13 -8
  69. data/app/views/admin/base/history.html.slim +18 -0
  70. data/app/views/admin/base/index.html.slim +3 -3
  71. data/app/views/admin/base/new.js.erb +14 -8
  72. data/app/views/admin/base/show.html.slim +1 -2
  73. data/app/views/admin/base/show.js.erb +7 -0
  74. data/app/views/admin/fileupload/_asset_templates.html.slim +29 -0
  75. data/app/views/admin/fileupload/_container.html.slim +13 -12
  76. data/app/views/admin/fileupload/_file.html.slim +2 -2
  77. data/app/views/admin/fileupload/_image.html.slim +8 -0
  78. data/app/views/admin/fileupload/_video.html.slim +2 -2
  79. data/app/views/admin/headers/_form.html.slim +2 -0
  80. data/app/views/admin/locators/edit.html.slim +1 -1
  81. data/app/views/admin/locators/show.html.slim +1 -2
  82. data/app/views/admin/manager/_form.html.slim +17 -3
  83. data/app/views/admin/manager/_modal_form.html.slim +19 -0
  84. data/app/views/admin/manager/_table.html.slim +3 -3
  85. data/app/views/admin/manager/show.html.slim +1 -0
  86. data/app/views/admin/shared/_content_actions.html.slim +39 -0
  87. data/app/views/admin/shared/_locale_tabs.html.slim +3 -3
  88. data/app/views/admin/shared/inputs/_checkbox_tree.html.slim +9 -3
  89. data/app/views/admin/structures/_form.html.slim +4 -7
  90. data/app/views/admin/users/_form.html.slim +2 -4
  91. data/app/views/admin/users/_search_form.html.slim +0 -1
  92. data/app/views/admin/users/_table.html.slim +8 -10
  93. data/app/views/layouts/admin/_footer.html.slim +3 -4
  94. data/app/views/layouts/admin/_navigation.html.slim +2 -2
  95. data/app/views/layouts/admin/application.html.slim +7 -9
  96. data/app/views/layouts/admin/devise.html.slim +3 -4
  97. data/config/locales/de.yml +319 -0
  98. data/config/locales/en.devise.yml +44 -31
  99. data/config/locales/en.yml +166 -143
  100. data/config/locales/it.devise.yml +54 -41
  101. data/config/locales/it.yml +178 -163
  102. data/config/locales/ru.devise.yml +70 -56
  103. data/config/locales/ru.yml +280 -264
  104. data/config/routes.rb +6 -3
  105. data/db/migrate/20130101000001_create_users.rb +7 -11
  106. data/db/migrate/20130101000003_create_assets.rb +5 -5
  107. data/db/migrate/20130101000004_create_headers.rb +2 -6
  108. data/db/migrate/20130101000005_create_static_pages.rb +1 -5
  109. data/db/migrate/20130101000006_create_structures.rb +5 -9
  110. data/db/migrate/20130101000007_base_translations.rb +3 -1
  111. data/db/migrate/20130101000008_create_admin_comments.rb +5 -5
  112. data/db/migrate/20130101000009_create_tracks.rb +20 -0
  113. data/lib/ab_admin.rb +36 -4
  114. data/lib/ab_admin/abstract_resource.rb +28 -7
  115. data/lib/ab_admin/carrierwave/base_uploader.rb +85 -5
  116. data/lib/ab_admin/carrierwave/glue.rb +6 -1
  117. data/lib/ab_admin/concerns/admin_addition.rb +26 -9
  118. data/lib/ab_admin/concerns/asset_human_names.rb +23 -0
  119. data/lib/ab_admin/concerns/fileuploads.rb +102 -0
  120. data/lib/ab_admin/concerns/has_tracking.rb +32 -0
  121. data/lib/ab_admin/concerns/nested_set.rb +9 -9
  122. data/lib/ab_admin/concerns/silencer.rb +5 -5
  123. data/lib/ab_admin/concerns/utilities.rb +28 -16
  124. data/lib/ab_admin/concerns/validations.rb +1 -1
  125. data/lib/ab_admin/config/base.rb +10 -2
  126. data/lib/ab_admin/controllers/callbacks.rb +2 -2
  127. data/lib/ab_admin/controllers/can_can_manager_resource.rb +3 -2
  128. data/lib/ab_admin/controllers/fv.rb +16 -0
  129. data/lib/ab_admin/controllers/head_options.rb +6 -4
  130. data/lib/ab_admin/core_ext/hash.rb +25 -70
  131. data/lib/ab_admin/core_ext/string.rb +17 -4
  132. data/lib/ab_admin/engine.rb +2 -8
  133. data/lib/ab_admin/hooks.rb +8 -3
  134. data/lib/ab_admin/hooks/active_model_hooks.rb +1 -1
  135. data/lib/ab_admin/hooks/globalize_hooks.rb +35 -0
  136. data/lib/ab_admin/hooks/paginate_hooks.rb +3 -1
  137. data/lib/ab_admin/i18n_tools/model_translator.rb +1 -1
  138. data/lib/ab_admin/menu/abstract_builder.rb +14 -0
  139. data/lib/ab_admin/menu/base_group.rb +26 -0
  140. data/lib/ab_admin/menu/builder.rb +16 -0
  141. data/lib/ab_admin/menu/group.rb +24 -0
  142. data/lib/ab_admin/menu/item.rb +23 -0
  143. data/lib/ab_admin/models/admin_comment.rb +68 -0
  144. data/lib/ab_admin/models/asset.rb +30 -19
  145. data/lib/ab_admin/models/attachment_file.rb +2 -1
  146. data/lib/ab_admin/models/header.rb +15 -0
  147. data/lib/ab_admin/models/locator.rb +1 -3
  148. data/lib/ab_admin/models/settings.rb +10 -10
  149. data/lib/ab_admin/models/structure.rb +20 -9
  150. data/lib/ab_admin/models/track.rb +61 -0
  151. data/lib/ab_admin/models/type_model.rb +30 -17
  152. data/lib/ab_admin/models/user.rb +18 -49
  153. data/lib/ab_admin/utils.rb +16 -7
  154. data/lib/ab_admin/utils/logger.rb +11 -7
  155. data/lib/ab_admin/utils/mysql.rb +10 -0
  156. data/lib/ab_admin/version.rb +1 -1
  157. data/lib/ab_admin/views/admin_helpers.rb +20 -9
  158. data/lib/ab_admin/views/admin_navigation_helpers.rb +44 -21
  159. data/lib/ab_admin/views/content_only_wrapper.rb +14 -0
  160. data/lib/ab_admin/views/form_builder.rb +27 -89
  161. data/lib/ab_admin/views/helpers.rb +1 -28
  162. data/lib/ab_admin/views/inputs/capture_block_input.rb +16 -0
  163. data/lib/ab_admin/views/inputs/date_time_picker_input.rb +45 -0
  164. data/lib/ab_admin/views/inputs/token_input.rb +2 -1
  165. data/lib/ab_admin/views/inputs/uploader_input.rb +101 -0
  166. data/lib/ab_admin/views/manager_helpers.rb +12 -0
  167. data/lib/ab_admin/views/search_form_builder.rb +36 -13
  168. data/lib/generators/ab_admin/ckeditor_assets/ckeditor_assets_generator.rb +1 -1
  169. data/lib/generators/ab_admin/install/install_generator.rb +3 -2
  170. data/lib/generators/ab_admin/install/templates/config/ab_admin.rb.erb +1 -1
  171. data/lib/generators/ab_admin/install/templates/config/admin_menu.rb +1 -1
  172. data/lib/generators/ab_admin/install/templates/config/i18n-js.yml +1 -1
  173. data/lib/generators/ab_admin/install/templates/config/nginx.conf +22 -9
  174. data/lib/generators/ab_admin/install/templates/config/robots.txt +7 -0
  175. data/lib/generators/ab_admin/install/templates/config/seeds.rb +2 -1
  176. data/lib/generators/ab_admin/install/templates/models/ability.rb +2 -7
  177. data/lib/generators/ab_admin/install/templates/models/admin_comment.rb +3 -28
  178. data/lib/generators/ab_admin/install/templates/models/asset.rb +4 -2
  179. data/lib/generators/ab_admin/install/templates/models/attachment_file.rb +1 -1
  180. data/lib/generators/ab_admin/install/templates/models/avatar.rb +2 -2
  181. data/lib/generators/ab_admin/install/templates/models/gender_type.rb +1 -1
  182. data/lib/generators/ab_admin/install/templates/models/header.rb +2 -2
  183. data/lib/generators/ab_admin/install/templates/models/locator.rb +0 -1
  184. data/lib/generators/ab_admin/install/templates/models/picture.rb +1 -1
  185. data/lib/generators/ab_admin/install/templates/models/settings.rb +1 -1
  186. data/lib/generators/ab_admin/install/templates/models/structure.rb +6 -8
  187. data/lib/generators/ab_admin/install/templates/models/track.rb +5 -0
  188. data/lib/generators/ab_admin/install/templates/models/user.rb +2 -3
  189. data/lib/generators/ab_admin/install/templates/script/unicorn.sh +0 -2
  190. data/lib/generators/ab_admin/install/templates/spec/factories/user_factory.rb +1 -2
  191. data/lib/generators/ab_admin/install/templates/uploaders/attachment_file_uploader.rb +1 -1
  192. data/lib/generators/ab_admin/install/templates/uploaders/avatar_uploader.rb +1 -1
  193. data/lib/generators/ab_admin/install/templates/uploaders/picture_uploader.rb +1 -1
  194. data/lib/generators/ab_admin/model/templates/resource.erb +1 -1
  195. data/lib/generators/ab_admin/resource/templates/_form.slim.erb +49 -45
  196. data/lib/generators/ab_admin/resource/templates/_table.slim.erb +1 -1
  197. data/lib/generators/template.rb +32 -56
  198. data/lib/tasks/assets.rake +1 -0
  199. metadata +197 -698
  200. data/.gitignore +0 -41
  201. data/Gemfile +0 -77
  202. data/Guardfile +0 -35
  203. data/TODO +0 -4
  204. data/ab_admin.gemspec +0 -59
  205. data/app/views/admin/fileupload/_asset.html.slim +0 -8
  206. data/app/views/admin/fileupload/_ftmpl.html.slim +0 -6
  207. data/app/views/admin/fileupload/_tmpl.html.slim +0 -9
  208. data/app/views/admin/fileupload/_vtmpl.html.slim +0 -10
  209. data/app/views/admin/shared/_batch_actions.html.slim +0 -27
  210. data/cucumber.yml +0 -10
  211. data/features/dsl/action_items.feature +0 -79
  212. data/features/dsl/admin_comments.feature +0 -30
  213. data/features/dsl/batch_actions.feature +0 -69
  214. data/features/dsl/config.feature +0 -44
  215. data/features/dsl/custom_actions.feature +0 -62
  216. data/features/dsl/export.feature +0 -42
  217. data/features/dsl/form.feature +0 -77
  218. data/features/dsl/in_place_edit.feature +0 -26
  219. data/features/dsl/list_edit.feature +0 -46
  220. data/features/dsl/parent_resource.feature +0 -18
  221. data/features/dsl/resource_action_items.feature +0 -40
  222. data/features/dsl/search.feature +0 -41
  223. data/features/dsl/show.feature +0 -37
  224. data/features/dsl/table.feature +0 -71
  225. data/features/dsl/tree.feature +0 -37
  226. data/features/index_views/table.feature +0 -20
  227. data/features/locators.feature +0 -40
  228. data/features/menu.feature +0 -35
  229. data/features/settings.feature +0 -36
  230. data/features/step_definitions/configuration_steps.rb +0 -94
  231. data/features/step_definitions/dsl/action_items_steps.rb +0 -13
  232. data/features/step_definitions/dsl/admin_comments_steps.rb +0 -12
  233. data/features/step_definitions/dsl/batch_actions_steps.rb +0 -27
  234. data/features/step_definitions/dsl/in_place_edit_steps.rb +0 -7
  235. data/features/step_definitions/dsl/parent_resource_steps.rb +0 -8
  236. data/features/step_definitions/dsl/resource_action_items_steps.rb +0 -14
  237. data/features/step_definitions/dsl/show_steps.rb +0 -8
  238. data/features/step_definitions/dsl/table_steps.rb +0 -38
  239. data/features/step_definitions/dsl/tree_steps.rb +0 -28
  240. data/features/step_definitions/menu_steps.rb +0 -20
  241. data/features/step_definitions/settings_steps.rb +0 -7
  242. data/features/step_definitions/structure_steps.rb +0 -7
  243. data/features/step_definitions/table_steps.rb +0 -23
  244. data/features/step_definitions/user_steps.rb +0 -72
  245. data/features/step_definitions/web_steps/browsing_steps.rb +0 -108
  246. data/features/step_definitions/web_steps/debug_steps.rb +0 -6
  247. data/features/step_definitions/web_steps/form_steps.rb +0 -190
  248. data/features/step_definitions/web_steps/i18n_steps.rb +0 -8
  249. data/features/step_definitions/web_steps/step_scoper.rb +0 -9
  250. data/features/step_definitions/web_steps/transforms_steps.rb +0 -3
  251. data/features/structure/tree.feature +0 -21
  252. data/features/support/capybara_helpers.rb +0 -15
  253. data/features/support/carrierwave.rb +0 -21
  254. data/features/support/env.rb +0 -40
  255. data/features/support/paths.rb +0 -55
  256. data/features/support/selector_helpers.rb +0 -9
  257. data/features/support/selectors.rb +0 -43
  258. data/features/support/tolerance_for_selenium_sync_issues.rb +0 -27
  259. data/features/user/sign_in.feature +0 -27
  260. data/features/user/sign_out.feature +0 -11
  261. data/features/user/user_edit.feature +0 -19
  262. data/features/user/user_show.feature +0 -9
  263. data/lib/ab_admin/hooks/quiet_scope_page.rb +0 -16
  264. data/lib/ab_admin/hooks/simple_form_hooks.rb +0 -31
  265. data/lib/ab_admin/menu_builder.rb +0 -89
  266. data/lib/ab_admin/views/inputs/date_time_input.rb +0 -65
  267. data/lib/generators/ab_admin/install/templates/models/user_state.rb +0 -6
  268. data/lib/generators/ab_admin/resource/templates/_form.haml.erb +0 -71
  269. data/lib/generators/ab_admin/resource/templates/_search_form.haml.erb +0 -35
  270. data/lib/generators/ab_admin/resource/templates/_table.haml.erb +0 -33
  271. data/spec/ab_admin_spec.rb +0 -23
  272. data/spec/dummy/Rakefile +0 -7
  273. data/spec/dummy/app/assets/images/rails.png +0 -0
  274. data/spec/dummy/app/assets/javascripts/application.js +0 -15
  275. data/spec/dummy/app/assets/stylesheets/application.css +0 -13
  276. data/spec/dummy/app/controllers/application_controller.rb +0 -3
  277. data/spec/dummy/app/controllers/products_controller.rb +0 -5
  278. data/spec/dummy/app/controllers/welcome_controller.rb +0 -5
  279. data/spec/dummy/app/mailers/.gitkeep +0 -0
  280. data/spec/dummy/app/models/ab_admin/ab_admin_catalogue.rb +0 -5
  281. data/spec/dummy/app/models/ab_admin/ab_admin_collection.rb +0 -35
  282. data/spec/dummy/app/models/ab_admin/ab_admin_product.rb +0 -74
  283. data/spec/dummy/app/models/admin_menu.rb +0 -18
  284. data/spec/dummy/app/models/catalogue.rb +0 -10
  285. data/spec/dummy/app/models/ckeditor/asset.rb +0 -7
  286. data/spec/dummy/app/models/ckeditor/attachment_file.rb +0 -7
  287. data/spec/dummy/app/models/ckeditor/picture.rb +0 -7
  288. data/spec/dummy/app/models/collection.rb +0 -20
  289. data/spec/dummy/app/models/product.rb +0 -32
  290. data/spec/dummy/app/uploaders/ckeditor_attachment_file_uploader.rb +0 -42
  291. data/spec/dummy/app/uploaders/ckeditor_picture_uploader.rb +0 -53
  292. data/spec/dummy/app/views/admin/collections/_form.html.slim +0 -24
  293. data/spec/dummy/app/views/layouts/application.html.erb +0 -14
  294. data/spec/dummy/app/views/products/show.html.erb +0 -2
  295. data/spec/dummy/app/views/welcome/index.html.erb +0 -2
  296. data/spec/dummy/config.ru +0 -4
  297. data/spec/dummy/config/application.rb +0 -82
  298. data/spec/dummy/config/boot.rb +0 -10
  299. data/spec/dummy/config/database.yml +0 -26
  300. data/spec/dummy/config/environment.rb +0 -5
  301. data/spec/dummy/config/environments/development.rb +0 -37
  302. data/spec/dummy/config/environments/production.rb +0 -67
  303. data/spec/dummy/config/environments/test.rb +0 -37
  304. data/spec/dummy/config/i18n-js.yml +0 -21
  305. data/spec/dummy/config/initializers/ab_admin.rb +0 -15
  306. data/spec/dummy/config/initializers/backtrace_silencers.rb +0 -7
  307. data/spec/dummy/config/initializers/ckeditor.rb +0 -18
  308. data/spec/dummy/config/initializers/devise.rb +0 -232
  309. data/spec/dummy/config/initializers/inflections.rb +0 -15
  310. data/spec/dummy/config/initializers/mime_types.rb +0 -5
  311. data/spec/dummy/config/initializers/secret_token.rb +0 -7
  312. data/spec/dummy/config/initializers/session_store.rb +0 -8
  313. data/spec/dummy/config/initializers/simple_form.rb +0 -142
  314. data/spec/dummy/config/initializers/simple_form_bootstrap.rb +0 -45
  315. data/spec/dummy/config/initializers/wrap_parameters.rb +0 -14
  316. data/spec/dummy/config/locales/devise.en.yml +0 -60
  317. data/spec/dummy/config/locales/en.yml +0 -5
  318. data/spec/dummy/config/locales/simple_form.en.yml +0 -26
  319. data/spec/dummy/config/routes.rb +0 -14
  320. data/spec/dummy/config/settings/development.local.yml +0 -9
  321. data/spec/dummy/config/settings/development.yml +0 -7
  322. data/spec/dummy/db/migrate/20130129151853_create_ckeditor_assets.rb +0 -26
  323. data/spec/dummy/db/migrate/20130130161853_create_collections.rb +0 -10
  324. data/spec/dummy/db/migrate/20130130162046_create_products.rb +0 -13
  325. data/spec/dummy/db/migrate/20130130175446_create_globalize_collection_product.rb +0 -11
  326. data/spec/dummy/db/migrate/20130207224516_create_catalogues.rb +0 -16
  327. data/spec/dummy/db/migrate/20130209223506_add_lat_lon_zoom_to_products.rb +0 -7
  328. data/spec/dummy/db/seeds.rb +0 -46
  329. data/spec/dummy/lib/assets/.gitkeep +0 -0
  330. data/spec/dummy/lib/capybara_irb.rb +0 -42
  331. data/spec/dummy/lib/tasks/.gitkeep +0 -0
  332. data/spec/dummy/lib/tasks/cucumber.rake +0 -65
  333. data/spec/dummy/lib/templates/slim/scaffold/_form.html.slim +0 -10
  334. data/spec/dummy/log/.gitkeep +0 -0
  335. data/spec/dummy/public/404.html +0 -26
  336. data/spec/dummy/public/422.html +0 -26
  337. data/spec/dummy/public/500.html +0 -25
  338. data/spec/dummy/public/favicon.ico +0 -0
  339. data/spec/dummy/script/cucumber +0 -10
  340. data/spec/dummy/script/rails +0 -6
  341. data/spec/factories/assets.rb +0 -52
  342. data/spec/factories/catalogues.rb +0 -7
  343. data/spec/factories/collections.rb +0 -8
  344. data/spec/factories/files/rails.png +0 -0
  345. data/spec/factories/products.rb +0 -17
  346. data/spec/factories/sequences.rb +0 -7
  347. data/spec/factories/structures.rb +0 -17
  348. data/spec/factories/users.rb +0 -30
  349. data/spec/generators/ckeditor_assets_generator_spec.rb +0 -19
  350. data/spec/generators/install_generator_spec.rb +0 -48
  351. data/spec/generators/model_generator_spec.rb +0 -31
  352. data/spec/generators/resource_generator_spec.rb +0 -36
  353. data/spec/models/ab_admin/abstract_resource_spec.rb +0 -5
  354. data/spec/models/avatar_spec.rb +0 -162
  355. data/spec/models/picture_uploader_spec.rb +0 -49
  356. data/spec/models/structure_spec.rb +0 -69
  357. data/spec/models/user_spec.rb +0 -159
  358. data/spec/shared_behaviors/concerns.rb +0 -20
  359. data/spec/spec_helper.rb +0 -96
  360. data/spec/support/controller_macros.rb +0 -52
  361. data/spec/support/custom_capybara_matchers.rb +0 -58
  362. data/spec/support/mailer_macros.rb +0 -17
  363. data/spec/support/shared_connection.rb +0 -11
  364. data/vendor/assets/images/ab_admin/clear.png +0 -0
  365. data/vendor/assets/images/ab_admin/loading.gif +0 -0
  366. data/vendor/assets/javascripts/ab_admin/bootstrap-datepicker/core.js +0 -899
  367. data/vendor/assets/javascripts/ab_admin/bootstrap-datepicker/index.js +0 -2
  368. data/vendor/assets/javascripts/ab_admin/bootstrap-datepicker/locales/bootstrap-datepicker.bg.js +0 -14
  369. data/vendor/assets/javascripts/ab_admin/bootstrap-datepicker/locales/bootstrap-datepicker.br.js +0 -13
  370. data/vendor/assets/javascripts/ab_admin/bootstrap-datepicker/locales/bootstrap-datepicker.cs.js +0 -14
  371. data/vendor/assets/javascripts/ab_admin/bootstrap-datepicker/locales/bootstrap-datepicker.da.js +0 -14
  372. data/vendor/assets/javascripts/ab_admin/bootstrap-datepicker/locales/bootstrap-datepicker.de.js +0 -14
  373. data/vendor/assets/javascripts/ab_admin/bootstrap-datepicker/locales/bootstrap-datepicker.es.js +0 -14
  374. data/vendor/assets/javascripts/ab_admin/bootstrap-datepicker/locales/bootstrap-datepicker.fi.js +0 -14
  375. data/vendor/assets/javascripts/ab_admin/bootstrap-datepicker/locales/bootstrap-datepicker.fr.js +0 -14
  376. data/vendor/assets/javascripts/ab_admin/bootstrap-datepicker/locales/bootstrap-datepicker.id.js +0 -13
  377. data/vendor/assets/javascripts/ab_admin/bootstrap-datepicker/locales/bootstrap-datepicker.is.js +0 -14
  378. data/vendor/assets/javascripts/ab_admin/bootstrap-datepicker/locales/bootstrap-datepicker.it.js +0 -14
  379. data/vendor/assets/javascripts/ab_admin/bootstrap-datepicker/locales/bootstrap-datepicker.ja.js +0 -13
  380. data/vendor/assets/javascripts/ab_admin/bootstrap-datepicker/locales/bootstrap-datepicker.kr.js +0 -13
  381. data/vendor/assets/javascripts/ab_admin/bootstrap-datepicker/locales/bootstrap-datepicker.lt.js +0 -15
  382. data/vendor/assets/javascripts/ab_admin/bootstrap-datepicker/locales/bootstrap-datepicker.lv.js +0 -16
  383. data/vendor/assets/javascripts/ab_admin/bootstrap-datepicker/locales/bootstrap-datepicker.ms.js +0 -14
  384. data/vendor/assets/javascripts/ab_admin/bootstrap-datepicker/locales/bootstrap-datepicker.nb.js +0 -14
  385. data/vendor/assets/javascripts/ab_admin/bootstrap-datepicker/locales/bootstrap-datepicker.nl.js +0 -14
  386. data/vendor/assets/javascripts/ab_admin/bootstrap-datepicker/locales/bootstrap-datepicker.pl.js +0 -14
  387. data/vendor/assets/javascripts/ab_admin/bootstrap-datepicker/locales/bootstrap-datepicker.pt-BR.js +0 -14
  388. data/vendor/assets/javascripts/ab_admin/bootstrap-datepicker/locales/bootstrap-datepicker.pt.js +0 -14
  389. data/vendor/assets/javascripts/ab_admin/bootstrap-datepicker/locales/bootstrap-datepicker.ro.js +0 -15
  390. data/vendor/assets/javascripts/ab_admin/bootstrap-datepicker/locales/bootstrap-datepicker.ru.js +0 -14
  391. data/vendor/assets/javascripts/ab_admin/bootstrap-datepicker/locales/bootstrap-datepicker.sk.js +0 -14
  392. data/vendor/assets/javascripts/ab_admin/bootstrap-datepicker/locales/bootstrap-datepicker.sl.js +0 -14
  393. data/vendor/assets/javascripts/ab_admin/bootstrap-datepicker/locales/bootstrap-datepicker.sv.js +0 -14
  394. data/vendor/assets/javascripts/ab_admin/bootstrap-datepicker/locales/bootstrap-datepicker.th.js +0 -14
  395. data/vendor/assets/javascripts/ab_admin/bootstrap-datepicker/locales/bootstrap-datepicker.tr.js +0 -15
  396. data/vendor/assets/javascripts/ab_admin/bootstrap-datepicker/locales/bootstrap-datepicker.zh-CN.js +0 -14
  397. data/vendor/assets/javascripts/ab_admin/bootstrap-datepicker/locales/bootstrap-datepicker.zh-TW.js +0 -13
  398. data/vendor/assets/javascripts/ab_admin/bootstrap-editable-inline.js +0 -2895
  399. data/vendor/assets/javascripts/ab_admin/bootstrap-editable.js +0 -4523
  400. data/vendor/assets/javascripts/ab_admin/bootstrap-tab-multi.js +0 -135
  401. data/vendor/assets/javascripts/ab_admin/bootstrap-timepicker.js +0 -377
  402. data/vendor/assets/javascripts/ab_admin/fileupload/admin-fileuploader.js.coffee +0 -111
  403. data/vendor/assets/javascripts/ab_admin/fileupload/fileuploader.js +0 -1301
  404. data/vendor/assets/javascripts/ab_admin/jquery.Jcrop.js +0 -1083
  405. data/vendor/assets/javascripts/ab_admin/jquery_nested_form.js.coffee +0 -66
  406. data/vendor/assets/javascripts/bootstrap-wysihtml5/locales/ru.js +0 -48
  407. data/vendor/assets/javascripts/handlebars.min.js +0 -1
  408. data/vendor/assets/javascripts/jquery.cookie.js +0 -42
  409. data/vendor/assets/javascripts/jquery.hotkeys.js +0 -106
  410. data/vendor/assets/javascripts/jquery.pjax.js +0 -688
  411. data/vendor/assets/javascripts/jquery.tmpl.min.js +0 -10
  412. data/vendor/assets/javascripts/jquery.ui.nestedSortable.js +0 -356
  413. data/vendor/assets/javascripts/jquery/jquery-ui.min.js +0 -15
  414. data/vendor/assets/javascripts/jquery/jquery.min.js +0 -4
  415. data/vendor/assets/javascripts/underscore.min.js +0 -5
  416. data/vendor/assets/stylesheets/ab_admin/bootstrap-datepicker.css.scss +0 -274
  417. data/vendor/assets/stylesheets/ab_admin/bootstrap-editable.scss +0 -461
  418. data/vendor/assets/stylesheets/ab_admin/bootstrap-timepicker.css.scss +0 -88
  419. data/vendor/assets/stylesheets/ab_admin/jquery.Jcrop.min.css.scss +0 -28
@@ -1,71 +0,0 @@
1
- @dsl
2
- Feature: Table index view
3
-
4
- Background:
5
- Given I am logged in
6
- And products exists with attributes:
7
- | sku | price | name |
8
- | t-12 | 234 | Table |
9
- | dc_1 | 12 | Chair |
10
-
11
- Scenario: Table columns
12
- Given a configuration of:
13
- """
14
- class AbAdminProduct < AbAdmin::AbstractResource
15
- table do
16
- field :sku
17
- field :name
18
- end
19
- end
20
- """
21
- When I am on the admin products page
22
- Then I should see list of products
23
-
24
- Scenario: Columns data formatting
25
- Given a configuration of:
26
- """
27
- class AbAdminProduct < AbAdmin::AbstractResource
28
- table do
29
- field :sku
30
- field :price
31
- field(:picture) { |item| item_image_link(item) }
32
- field :created_at
33
- field :is_visible
34
- field :collection
35
- end
36
- end
37
- """
38
- When I am on the admin products page
39
- Then I should see pretty formatted products
40
-
41
- Scenario Outline: Sortable columns
42
- Given a configuration of:
43
- """
44
- class AbAdminProduct < AbAdmin::AbstractResource
45
- table do
46
- field :price
47
- field <config>
48
- end
49
- end
50
- """
51
- And I am on the admin products page
52
- When I follow "<column>"
53
- Then I should see products ordered by "<ordering>"
54
-
55
- Examples:
56
- | column | config | ordering |
57
- | Sku | :sku | sku |
58
- | Name | :name, sortable: :id | id |
59
- | Name | :name, sortable: {column: :price, default_order: 'desc'} | price desc |
60
-
61
- Scenario: Disabled sortable column
62
- Given a configuration of:
63
- """
64
- class AbAdminProduct < AbAdmin::AbstractResource
65
- table do
66
- field :created_at, sortable: false
67
- end
68
- end
69
- """
70
- And I am on the admin products page
71
- Then I should not see "Created at" link
@@ -1,37 +0,0 @@
1
- @dsl
2
- Feature: Sortable tree index view
3
-
4
- Background:
5
- Given I am logged in
6
- And catalogues tree exists:
7
- | title | parent_name |
8
- | _1_ | |
9
- | _1-1_ | _1_ |
10
- | _1-2_ | _1_ |
11
- | _2_ | |
12
- | _2-1_ | _2_ |
13
- | _2-1-1_ | _2-1_ |
14
-
15
- Scenario: Index view as tree
16
- Given a configuration of:
17
- """
18
- class AbAdminCatalogue < AbAdmin::AbstractResource
19
- settings index_view: 'tree'
20
- end
21
- """
22
- And I am on the admin catalogues page
23
- Then I should see catalogues tree
24
-
25
- Scenario: Custom node view
26
- Given a configuration of:
27
- """
28
- class AbAdminCatalogue < AbAdmin::AbstractResource
29
- settings index_view: 'tree'
30
-
31
- tree do |node|
32
- link_to "Custom node title", root_path, class: 'tree-item_link'
33
- end
34
- end
35
- """
36
- And I am on the admin catalogues page
37
- Then I should see "Custom node title"
@@ -1,20 +0,0 @@
1
- Feature: Table view
2
- Background:
3
- Given I am logged in as "test@example.com"
4
- And users exists with attributes:
5
- | email | first_name |
6
- | bob@example.com | Bob |
7
- | alex@example.com | Alex |
8
- | jack@example.com | Jack |
9
- And I am on the admin users page
10
-
11
- Scenario: List of users
12
- Then I should see list of users
13
-
14
- Scenario: Filtering users
15
- Given I see search form with "Email" filter
16
- When I fill in "Email" with "bob"
17
- And I press "Filter"
18
- Then I should see "bob@example.com"
19
- And I should not see "alex@example.com"
20
-
@@ -1,40 +0,0 @@
1
- @locator
2
- Feature: Locale files editor
3
- In order to change site localization
4
- As an admin
5
- I want to edit locale files
6
-
7
- Background:
8
- Given I am logged in
9
- And "config/locales/en.test.yml" contains:
10
- """
11
- en:
12
- site:
13
- title: "Dummy app"
14
- """
15
- And am on the admin locators page
16
-
17
- Scenario: Locale file editing
18
- Then I follow "en.test.yml"
19
- And I fill in "locale_hash_site_title" with "Great app"
20
- And press "Save"
21
- When "config/locales/en.test.yml" should contain:
22
- """
23
- en:
24
- site:
25
- title: "Great app"
26
- """
27
-
28
- Scenario: Merging locale files
29
- Then I follow "Prepare localization files"
30
- When "config/locales/ru.test.yml" should contain:
31
- """
32
- ru:
33
- site:
34
- title: ""
35
- """
36
-
37
- # Scenario: Reloading localization
38
- # Then I follow "Update localization"
39
- # When I should see "Translations successfully reloaded"
40
- # And i18n key "site.title" should have "Dummy app" value
@@ -1,35 +0,0 @@
1
- Feature: Admin menu
2
-
3
- Background:
4
- Given I am logged in
5
- Given i18n key "admin.navigation.system" with value "System"
6
- And i18n key "admin.navigation.for_admin" with value "for admin"
7
- And a menu configuration of:
8
- """
9
- AbAdmin::MenuBuilder.draw do
10
- model User
11
- group :system do
12
- model Structure
13
- model Settings, url: edit_admin_settings_path
14
- end
15
- group 'Moderator', if: proc { moderator? } do
16
- link 'for moderator', 'dummy_path'
17
- end
18
- group 'Admin', if: :admin? do
19
- link :for_admin, 'dummy_path'
20
- end
21
- end
22
- """
23
-
24
- Scenario: Show menu tree
25
- When I am on the dashboard page
26
- Then I should see menu item for "User" with path "/admin/users"
27
- Then I should see menu item for "Settings" with path "/admin/settings/edit"
28
- And I should see group "System" with menu item for "Structure"
29
- And I should see group "Moderator" with menu item for "for moderator"
30
- And I should see group "Admin" with menu item for "for admin"
31
-
32
- Scenario: Active menu link for current resource
33
- When I am on the admin structures page
34
- Then menu item for "Structure" should be active
35
- And menu item for "User" should not be active
@@ -1,36 +0,0 @@
1
- Feature: App settings
2
- In order to tune my application
3
- As an admin user
4
- I wand to customize settings
5
-
6
- Background:
7
- Given I am logged in
8
-
9
- Scenario: Editing user settings
10
- Given "config/settings/test.local.yml" contains:
11
- """
12
- mailer:
13
- from: no-reply@test.com
14
- reply_to: info@test.com
15
- subject_prefix: "[Dummy] "
16
- custom:
17
- integer: 111
18
- bool: false
19
- string: aaa
20
- """
21
- And I am on the edit admin settings page
22
- When I click "Custom"
23
- And I fill in the following:
24
- | Bool (checkbox) | check |
25
- | Integer | 321 |
26
- | String | Hello |
27
- And press "Save"
28
-
29
- Then the "Bool" checkbox should be checked
30
- And the "Integer" field should contain "321"
31
- And the "String" field should contain "Hello"
32
-
33
- Then the "custom.bool" setting should be true
34
- Then the "custom.integer" setting should be equal "321"
35
- Then the "custom.string" setting should be equal "Hello"
36
-
@@ -1,94 +0,0 @@
1
- module AbAdminContentsRollback
2
-
3
- def self.recorded_files
4
- @files ||= {}
5
- end
6
-
7
- # Records the contents of a file the first time we are
8
- # about to change it
9
- def self.record(filename)
10
- contents = File.read(filename) rescue nil
11
- recorded_files[filename] = contents unless recorded_files.has_key?(filename)
12
- end
13
-
14
- # Rolls the recorded files back to their original states
15
- def self.rollback!
16
- recorded_files.each do |filename, contents|
17
- # contents will be nil if the file didin't exist
18
- if contents.present?
19
- File.open(filename, 'w') {|f| f << contents }
20
- else
21
- File.delete(filename)
22
-
23
- # Delete parent directories
24
- begin
25
- dir = File.dirname(filename)
26
- until dir == Rails.root
27
- Dir.rmdir(dir)
28
- dir = dir.split('/')[0..-2].join('/')
29
- end
30
- rescue Errno::ENOTEMPTY
31
- # Directory not empty
32
- end
33
-
34
- end
35
- end
36
-
37
- @files = {}
38
- end
39
-
40
- end
41
-
42
- After do
43
- AbAdminContentsRollback.rollback!
44
- end
45
-
46
- Given /^a configuration of:$/ do |config|
47
- AbAdmin::AbstractResource.descendants.each { |c| Object.send(:remove_const, c.name.to_sym) rescue false }
48
- eval config
49
- end
50
-
51
- Given /^"([^"]*)" should contain:$/ do |filename, contents|
52
- filepath = Rails.root + filename
53
- File.read(filepath).strip.should == contents.strip
54
- end
55
-
56
- Given /^"([^"]*)" contains:$/ do |filename, contents|
57
- require 'fileutils'
58
- filepath = Rails.root + filename
59
- FileUtils.mkdir_p File.dirname(filepath)
60
- AbAdminContentsRollback.record(filepath)
61
-
62
- File.open(filepath, 'w+'){|f| f << contents }
63
- end
64
-
65
- Given /^I add "([^"]*)" to the "([^"]*)" model$/ do |code, model_name|
66
- filename = File.join(Rails.root, 'app', 'models', "#{model_name}.rb")
67
- AbAdminContentsRollback.record(filename)
68
-
69
- # Update the file
70
- contents = File.read(filename)
71
- File.open(filename, 'w+') do |f|
72
- f << contents.gsub(/^(class .+)$/, "\\1\n #{code}\n")
73
- end
74
-
75
- ActiveSupport::Dependencies.clear
76
- end
77
-
78
- Given /^I should see routing error when follow "([^"]*)"$/ do |link|
79
- expect {
80
- click_link(link)
81
- }.to raise_error(ActionController::RoutingError)
82
- end
83
-
84
- Given /^I should see routing error on (.+)$/ do |page_name|
85
- expect {
86
- visit path_to(page_name)
87
- }.to raise_error(ActionController::RoutingError)
88
- end
89
-
90
- Given /^I should not see routing error on (.+)$/ do |page_name|
91
- expect {
92
- visit path_to(page_name)
93
- }.to_not raise_error(ActionController::RoutingError)
94
- end
@@ -1,13 +0,0 @@
1
- Then /^I should see an action item to "([^"]*)"$/ do |link|
2
- page.should have_css('.resource_actions a', text: link)
3
- end
4
-
5
- Then /^I should not see an action item to "([^"]*)"$/ do |link|
6
- page.should_not have_css('.resource_actions a', text: link)
7
- end
8
-
9
- Then /^I should see action items:$/ do |table|
10
- table.raw.first.each do |link|
11
- page.should have_css('.resource_actions a', text: link)
12
- end
13
- end
@@ -1,12 +0,0 @@
1
- Then /^I should see "(.*?)" comment with author$/ do |comment|
2
- within('#admin_comments') do
3
- page.should have_content(comment)
4
- page.should have_content(@me.name)
5
- end
6
- end
7
-
8
- Given /^comment "(.*?)" exists$/ do |comment|
9
- AdminComment.create(resource_id: @product.id, resource_type: 'Product', body: comment) do |c|
10
- c.author = @me
11
- end
12
- end
@@ -1,27 +0,0 @@
1
- Given /^(\d+) products? exists$/ do |n|
2
- n.to_i.times{ @product = FactoryGirl.create(:product) }
3
- end
4
-
5
- When /^I check (\d+) products in the list$/ do |n|
6
- Product.limit(n.to_i).pluck(:id).each do |p_id|
7
- check("batch_action_item_#{p_id}")
8
- end
9
- end
10
-
11
- Then /^I should see confirmation dialog$/ do
12
- find('#confirmation_dialog').should be_visible
13
- end
14
-
15
- When /^I choose batch action "(.*?)"$/ do |action|
16
- find('.batch_actions .dropdown-toggle').click
17
- find('.dropdown-menu a', text: action).click
18
- end
19
-
20
- Then /^I should see (\d+) item in the list$/ do |n|
21
- all('#list tbody tr').count.should == n.to_i
22
- end
23
-
24
- Then /^I should see (\d+) published item in the list$/ do |n|
25
- all('#list .badge-success').count.should == n.to_i
26
- end
27
-
@@ -1,7 +0,0 @@
1
- When /^I fill in place with "(.*?)"$/ do |value|
2
- find('#list .editableform input').set(value)
3
- end
4
-
5
- When /^I submit in place form$/ do
6
- find('#list .editableform .editable-submit').click()
7
- end
@@ -1,8 +0,0 @@
1
- Given /^collection "(.*?)" with (\d+) products$/ do |collection, num|
2
- @collection = FactoryGirl.create(:collection, name: collection)
3
- num.times { FactoryGirl.create(:product, collection: @collection) }
4
- end
5
-
6
- Then /^I should see (\d+) products$/ do |num|
7
- all('#list tbody tr').count.should == num
8
- end
@@ -1,14 +0,0 @@
1
- Then /^I should see resource action items:$/ do |table|
2
- table.raw.first.each do |link|
3
- page.should have_css("#list td.actions a[title='#{link}']")
4
- end
5
- end
6
-
7
- Then /^I should not see resource action item "(.*?)"$/ do |link|
8
- page.should_not have_css("#list td.actions a[title='#{link}']")
9
- end
10
-
11
- Then /^I should see resource action item "(.*?)"$/ do |link|
12
- page.should have_css("#list td.actions a[title='#{link}']")
13
- end
14
-
@@ -1,8 +0,0 @@
1
- Then /^I should see attributes table:$/ do |table|
2
- within 'table' do
3
- table.rows_hash.each do |attr, value|
4
- page.should have_content(attr)
5
- page.should have_content(value)
6
- end
7
- end
8
- end