locomotivecms 3.0.0.pre.alpha.3 → 3.0.0.pre.beta.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (361) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +15 -8
  3. data/app/api/locomotive/api.rb +1 -0
  4. data/app/api/locomotive/api/entities/content_entry_entity.rb +1 -0
  5. data/app/api/locomotive/api/entities/content_type_entity.rb +2 -1
  6. data/app/api/locomotive/api/entities/site_entity.rb +4 -0
  7. data/app/api/locomotive/api/entities/theme_asset_entity.rb +3 -3
  8. data/app/api/locomotive/api/forms/base_form.rb +0 -6
  9. data/app/api/locomotive/api/forms/content_type_field_form.rb +6 -10
  10. data/app/api/locomotive/api/forms/content_type_form.rb +26 -4
  11. data/app/api/locomotive/api/middlewares/params_decoder_middleware.rb +91 -0
  12. data/app/api/locomotive/api/resources/content_type_resource.rb +7 -2
  13. data/app/api/locomotive/api/resources/current_site_resource.rb +10 -2
  14. data/app/assets/images/locomotive/favicon.png +0 -0
  15. data/app/assets/javascripts/locomotive/not_logged_in.js.coffee +11 -1
  16. data/app/assets/javascripts/locomotive/views/application_view.js.coffee +0 -76
  17. data/app/assets/javascripts/locomotive/views/content_assets/edit_image_view.js.coffee +3 -1
  18. data/app/assets/javascripts/locomotive/views/dashboard/show_view.js.coffee +33 -1
  19. data/app/assets/javascripts/locomotive/views/developers_documentation/show_view.js.coffee +9 -0
  20. data/app/assets/javascripts/locomotive/views/editable_elements/edit_view.js.coffee +3 -1
  21. data/app/assets/javascripts/locomotive/views/editable_elements/index_view.js.coffee +11 -11
  22. data/app/assets/javascripts/locomotive/views/inputs/text_view.js.coffee +16 -0
  23. data/app/assets/javascripts/locomotive/views/pages/_form_view.js.coffee +0 -158
  24. data/app/assets/javascripts/locomotive/views/pages/edit_view.js.coffee +0 -41
  25. data/app/assets/javascripts/locomotive/views/public_submission_accounts/edit_view.js.coffee +7 -0
  26. data/app/assets/javascripts/locomotive/views/shared/form_view.js.coffee +11 -3
  27. data/app/assets/javascripts/locomotive/views/shared/list_view.js.coffee +4 -2
  28. data/app/assets/javascripts/locomotive/views/translations/index_view.js.coffee +5 -0
  29. data/app/assets/stylesheets/locomotive/application.scss +4 -0
  30. data/app/assets/stylesheets/locomotive/base/_fonts.scss +5 -5
  31. data/app/assets/stylesheets/locomotive/base/form/_base.scss +9 -1
  32. data/app/assets/stylesheets/locomotive/components/_activity_feed.scss +66 -0
  33. data/app/assets/stylesheets/locomotive/components/_content_assets.scss +27 -8
  34. data/app/assets/stylesheets/locomotive/components/_developers.scss +34 -0
  35. data/app/assets/stylesheets/locomotive/components/_error.scss +37 -0
  36. data/app/assets/stylesheets/locomotive/components/_list.scss +6 -0
  37. data/app/assets/stylesheets/locomotive/components/_main.scss +4 -0
  38. data/app/assets/stylesheets/locomotive/components/_misc.scss +1 -0
  39. data/app/assets/stylesheets/locomotive/components/_translations.scss +13 -0
  40. data/app/assets/stylesheets/locomotive/components/header/_base.scss +7 -2
  41. data/app/assets/stylesheets/locomotive/components/misc/_modal.scss +13 -0
  42. data/app/assets/stylesheets/locomotive/components/misc/_notify.scss +2 -2
  43. data/app/assets/stylesheets/locomotive/components/not_logged_in/_sign_in_and_up.scss +11 -1
  44. data/app/assets/stylesheets/locomotive/components/sidebar/_pages_tree.scss +2 -2
  45. data/app/assets/stylesheets/locomotive/error.scss +12 -0
  46. data/app/assets/stylesheets/locomotive/globals/_bootstrap.scss +1 -1
  47. data/app/assets/stylesheets/locomotive/globals/_mixins.scss +8 -4
  48. data/app/assets/stylesheets/locomotive/globals/_variables.scss +2 -0
  49. data/app/assets/stylesheets/locomotive/not_logged_in.scss +4 -0
  50. data/app/controllers/locomotive/accounts_controller.rb +6 -1
  51. data/app/controllers/locomotive/base_controller.rb +1 -1
  52. data/app/controllers/locomotive/concerns/exception_controller.rb +2 -1
  53. data/app/controllers/locomotive/concerns/site_dispatcher_controller.rb +2 -1
  54. data/app/controllers/locomotive/content_assets_controller.rb +2 -2
  55. data/app/controllers/locomotive/content_entries_controller.rb +2 -2
  56. data/app/controllers/locomotive/current_site_controller.rb +5 -1
  57. data/app/controllers/locomotive/custom_fields/select_options_controller.rb +1 -1
  58. data/app/controllers/locomotive/dashboard_controller.rb +2 -0
  59. data/app/controllers/locomotive/developers_documentation_controller.rb +11 -0
  60. data/app/controllers/locomotive/editable_elements_controller.rb +11 -10
  61. data/app/controllers/locomotive/errors_controller.rb +15 -0
  62. data/app/controllers/locomotive/pages_controller.rb +3 -3
  63. data/app/controllers/locomotive/public_submission_accounts_controller.rb +42 -0
  64. data/app/controllers/locomotive/translations_controller.rb +9 -23
  65. data/app/helpers/locomotive/base_helper.rb +25 -23
  66. data/app/helpers/locomotive/content_assets_helper.rb +8 -0
  67. data/app/helpers/locomotive/content_entries_helper.rb +13 -19
  68. data/app/helpers/locomotive/content_types_helper.rb +9 -12
  69. data/app/helpers/locomotive/custom_fields_helper.rb +1 -0
  70. data/app/helpers/locomotive/dashboard_helper.rb +91 -0
  71. data/app/helpers/locomotive/developers_documentation_helper.rb +32 -0
  72. data/app/helpers/locomotive/editable_elements_helper.rb +25 -14
  73. data/app/helpers/locomotive/errors_helper.rb +21 -0
  74. data/app/helpers/locomotive/my_account_helper.rb +10 -8
  75. data/app/helpers/locomotive/pages_helper.rb +1 -1
  76. data/app/helpers/locomotive/public_submission_accounts_helper.rb +11 -0
  77. data/app/helpers/locomotive/shared/accounts_helper.rb +2 -2
  78. data/app/helpers/locomotive/sites_helper.rb +15 -11
  79. data/app/helpers/locomotive/translations_helper.rb +21 -13
  80. data/app/inputs/locomotive/api_key_input.rb +2 -0
  81. data/app/inputs/locomotive/array_input.rb +8 -3
  82. data/app/inputs/locomotive/code_input.rb +1 -47
  83. data/app/inputs/locomotive/document_picker_input.rb +1 -0
  84. data/app/inputs/locomotive/rte_input.rb +2 -0
  85. data/app/inputs/locomotive/toggle_input.rb +2 -0
  86. data/app/models/locomotive/activity.rb +32 -0
  87. data/app/models/locomotive/concerns/content_entry/localized.rb +12 -1
  88. data/app/models/locomotive/concerns/content_type/entry_template.rb +52 -0
  89. data/app/models/locomotive/concerns/page/editable_elements.rb +0 -111
  90. data/app/models/locomotive/concerns/page/layout.rb +21 -6
  91. data/app/models/locomotive/concerns/site/access_points.rb +24 -3
  92. data/app/models/locomotive/concerns/site/locales.rb +7 -27
  93. data/app/models/locomotive/content_asset.rb +0 -4
  94. data/app/models/locomotive/content_entry.rb +10 -8
  95. data/app/models/locomotive/content_type.rb +12 -1
  96. data/app/models/locomotive/editable_element.rb +11 -106
  97. data/app/models/locomotive/editable_file.rb +6 -53
  98. data/app/models/locomotive/editable_model.rb +13 -0
  99. data/app/models/locomotive/editable_text.rb +0 -51
  100. data/app/models/locomotive/page.rb +31 -17
  101. data/app/models/locomotive/site.rb +12 -13
  102. data/app/models/locomotive/theme_asset.rb +0 -4
  103. data/app/models/locomotive/translation.rb +50 -35
  104. data/app/policies/locomotive/content_type_policy.rb +4 -0
  105. data/app/policies/locomotive/site_policy.rb +4 -0
  106. data/app/services/locomotive/concerns/activity_service.rb +27 -0
  107. data/app/services/locomotive/content_asset_service.rb +16 -2
  108. data/app/services/locomotive/content_entry_service.rb +77 -8
  109. data/app/services/locomotive/content_type_service.rb +6 -2
  110. data/app/services/locomotive/editable_element_service.rb +11 -4
  111. data/app/services/locomotive/membership_service.rb +20 -4
  112. data/app/services/locomotive/page_parsing_service.rb +94 -23
  113. data/app/services/locomotive/page_service.rb +61 -3
  114. data/app/services/locomotive/site_service.rb +43 -1
  115. data/app/services/locomotive/translation_service.rb +51 -0
  116. data/app/uploaders/locomotive/picture_uploader.rb +5 -1
  117. data/app/views/locomotive/accounts/{new.html.haml → new.html.slim} +0 -0
  118. data/app/views/locomotive/content_assets/{_dropzone.html.haml → _dropzone.html.slim} +4 -3
  119. data/app/views/locomotive/content_assets/{_list.html.haml → _list.html.slim} +11 -9
  120. data/app/views/locomotive/content_assets/{_nav.html.haml → _nav.html.slim} +5 -5
  121. data/app/views/locomotive/content_assets/{_search_form.html.haml → _search_form.html.slim} +1 -1
  122. data/app/views/locomotive/content_assets/edit_in_drawer.html.slim +27 -0
  123. data/app/views/locomotive/content_assets/{index.html.haml → index.html.slim} +4 -4
  124. data/app/views/locomotive/content_assets/{index_in_drawer.html.haml → index_in_drawer.html.slim} +1 -1
  125. data/app/views/locomotive/content_entries/{_entry.html.haml → _entry.html.slim} +3 -3
  126. data/app/views/locomotive/content_entries/{_list.html.haml → _list.html.slim} +9 -8
  127. data/app/views/locomotive/content_entries/{edit.html.haml → edit.html.slim} +5 -0
  128. data/app/views/locomotive/content_entries/form/{_actions.html.haml → _actions.html.slim} +0 -0
  129. data/app/views/locomotive/content_entries/form/{_advanced.html.haml → _advanced.html.slim} +0 -0
  130. data/app/views/locomotive/content_entries/form/{_main.html.haml → _main.html.slim} +0 -0
  131. data/app/views/locomotive/content_entries/form/{_panes.html.haml → _panes.html.slim} +0 -0
  132. data/app/views/locomotive/content_entries/form/{_seo.html.haml → _seo.html.slim} +0 -0
  133. data/app/views/locomotive/content_entries/form/_tabs.html.slim +13 -0
  134. data/app/views/locomotive/content_entries/{index.html.haml → index.html.slim} +22 -9
  135. data/app/views/locomotive/content_entries/{new.html.haml → new.html.slim} +0 -0
  136. data/app/views/locomotive/current_site/{_domain.html.haml → _domain.html.slim} +3 -3
  137. data/app/views/locomotive/current_site/{_locale.html.haml → _locale.html.slim} +4 -4
  138. data/app/views/locomotive/current_site/{_membership.html.haml → _membership.html.slim} +7 -6
  139. data/app/views/locomotive/current_site/{edit.html.haml → edit.html.slim} +1 -1
  140. data/app/views/locomotive/current_site/form/{_access_points.html.haml → _access_points.html.slim} +1 -0
  141. data/app/views/locomotive/current_site/form/{_advanced.html.haml → _advanced.html.slim} +0 -0
  142. data/app/views/locomotive/current_site/form/{_main.html.haml → _main.html.slim} +0 -0
  143. data/app/views/locomotive/current_site/form/{_panes.html.haml → _panes.html.slim} +0 -0
  144. data/app/views/locomotive/current_site/form/{_seo.html.haml → _seo.html.slim} +0 -0
  145. data/app/views/locomotive/current_site/form/_tabs.html.slim +14 -0
  146. data/app/views/locomotive/custom_fields/select_options/{_option.html.haml → _option.html.slim} +7 -7
  147. data/app/views/locomotive/custom_fields/select_options/{edit.html.haml → edit.html.slim} +0 -0
  148. data/app/views/locomotive/dashboard/show.html.slim +28 -0
  149. data/app/views/locomotive/developers_documentation/_api.html.slim +44 -0
  150. data/app/views/locomotive/developers_documentation/_wagon.html.slim +42 -0
  151. data/app/views/locomotive/developers_documentation/show.html.slim +11 -0
  152. data/app/views/locomotive/devise_mailer/reset_password_instructions.html.slim +12 -0
  153. data/app/views/locomotive/editable_elements/_edit.html.slim +52 -0
  154. data/app/views/locomotive/editable_elements/{_form.html.haml → _form.html.slim} +12 -3
  155. data/app/views/locomotive/editable_elements/index.html.slim +8 -0
  156. data/app/views/locomotive/editable_elements/{index_without_preview.html.haml → index_without_preview.html.slim} +5 -4
  157. data/app/views/locomotive/errors/404.html.slim +2 -0
  158. data/app/views/locomotive/errors/500.html.slim +2 -0
  159. data/app/views/locomotive/errors/no_site.html.slim +7 -0
  160. data/app/views/locomotive/layouts/application.html.slim +42 -0
  161. data/app/views/locomotive/layouts/error.html.slim +24 -0
  162. data/app/views/locomotive/layouts/{live_editing.html.haml → live_editing.html.slim} +10 -10
  163. data/app/views/locomotive/layouts/not_logged_in.html.slim +26 -0
  164. data/app/views/locomotive/layouts/{without_site.html.haml → without_site.html.slim} +9 -6
  165. data/app/views/locomotive/memberships/{edit.html.haml → edit.html.slim} +0 -0
  166. data/app/views/locomotive/memberships/{new.html.haml → new.html.slim} +0 -0
  167. data/app/views/locomotive/my_account/{edit.html.haml → edit.html.slim} +1 -1
  168. data/app/views/locomotive/my_account/form/{_actions.html.haml → _actions.html.slim} +0 -0
  169. data/app/views/locomotive/my_account/form/{_api.html.haml → _api.html.slim} +0 -1
  170. data/app/views/locomotive/my_account/form/{_credentials.html.haml → _credentials.html.slim} +0 -0
  171. data/app/views/locomotive/my_account/form/{_main.html.haml → _main.html.slim} +0 -0
  172. data/app/views/locomotive/my_account/form/{_panes.html.haml → _panes.html.slim} +1 -1
  173. data/app/views/locomotive/my_account/form/_tabs.html.slim +7 -0
  174. data/app/views/locomotive/notifications/{new_content_entry.html.haml → new_content_entry.html.slim} +11 -11
  175. data/app/views/locomotive/pages/{edit.html.haml → edit.html.slim} +0 -0
  176. data/app/views/locomotive/pages/form/{_actions.html.haml → _actions.html.slim} +0 -0
  177. data/app/views/locomotive/pages/form/{_main.html.haml → _main.html.slim} +0 -0
  178. data/app/views/locomotive/pages/form/{_panes.html.haml → _panes.html.slim} +0 -0
  179. data/app/views/locomotive/pages/form/{_seo.html.haml → _seo.html.slim} +0 -0
  180. data/app/views/locomotive/pages/form/{_tabs.html.haml → _tabs.html.slim} +1 -1
  181. data/app/views/locomotive/pages/{new.html.haml → new.html.slim} +0 -0
  182. data/app/views/locomotive/pages/show.html.slim +2 -0
  183. data/app/views/locomotive/passwords/{edit.html.haml → edit.html.slim} +6 -6
  184. data/app/views/locomotive/passwords/{new.html.haml → new.html.slim} +6 -6
  185. data/app/views/locomotive/public_submission_accounts/_account.html.slim +19 -0
  186. data/app/views/locomotive/public_submission_accounts/edit.html.slim +16 -0
  187. data/app/views/locomotive/registrations/{new.html.haml → new.html.slim} +2 -4
  188. data/app/views/locomotive/sessions/{new.html.haml → new.html.slim} +2 -4
  189. data/app/views/locomotive/shared/_footer.html.slim +2 -0
  190. data/app/views/locomotive/shared/{_form_actions.html.haml → _form_actions.html.slim} +4 -4
  191. data/app/views/locomotive/shared/_head.html.slim +39 -0
  192. data/app/views/locomotive/shared/{_header.html.haml → _header.html.slim} +10 -10
  193. data/app/views/locomotive/shared/_locale_picker_link.html.slim +11 -0
  194. data/app/views/locomotive/shared/{_main_app_head.html.haml → _main_app_head.html.slim} +0 -0
  195. data/app/views/locomotive/shared/{_main_app_head_before_backbone.html.haml → _main_app_head_before_backbone.html.slim} +0 -0
  196. data/app/views/locomotive/shared/{_main_app_header.html.haml → _main_app_header.html.slim} +0 -0
  197. data/app/views/locomotive/shared/{_sidebar.html.haml → _sidebar.html.slim} +6 -0
  198. data/app/views/locomotive/shared/{_sidebar_without_site.html.haml → _sidebar_without_site.html.slim} +0 -0
  199. data/app/views/locomotive/shared/actions/{_contents.html.haml → _contents.html.slim} +1 -1
  200. data/app/views/locomotive/shared/header/{_account.html.haml → _account.html.slim} +1 -1
  201. data/app/views/locomotive/shared/header/_account_menu.html.slim +5 -0
  202. data/app/views/locomotive/shared/header/_brand.html.slim +5 -0
  203. data/app/views/locomotive/shared/header/{_site.html.haml → _site.html.slim} +2 -2
  204. data/app/views/locomotive/shared/rte/{_image_popover.html.haml → _image_popover.html.slim} +5 -5
  205. data/app/views/locomotive/shared/rte/{_link_popover.html.haml → _link_popover.html.slim} +5 -5
  206. data/app/views/locomotive/shared/rte/_toolbar.html.slim +62 -0
  207. data/app/views/locomotive/shared/sidebar/_content_types.html.slim +16 -0
  208. data/app/views/locomotive/shared/sidebar/_link.html.slim +10 -0
  209. data/app/views/locomotive/shared/sidebar/{_my_account.html.haml → _my_account.html.slim} +2 -2
  210. data/app/views/locomotive/shared/sidebar/_page.html.slim +33 -0
  211. data/app/views/locomotive/shared/sidebar/_pages.html.slim +11 -0
  212. data/app/views/locomotive/sites/{_site.html.haml → _site.html.slim} +3 -3
  213. data/app/views/locomotive/sites/{index.html.haml → index.html.slim} +3 -3
  214. data/app/views/locomotive/sites/{new.html.haml → new.html.slim} +0 -0
  215. data/app/views/locomotive/translations/_form.html.slim +9 -0
  216. data/app/views/locomotive/translations/edit.html.slim +7 -0
  217. data/app/views/locomotive/translations/index.html.slim +41 -0
  218. data/config/initializers/slim.rb +1 -0
  219. data/config/initializers/time_format.rb +15 -0
  220. data/config/locales/admin_ui.en.yml +65 -49
  221. data/config/locales/default.en.yml +3 -0
  222. data/config/locales/default.fr.yml +4 -1
  223. data/config/locales/simple_form.en.yml +14 -8
  224. data/config/routes.rb +6 -0
  225. data/features/support/env.rb +1 -1
  226. data/lib/generators/locomotive/install/install_generator.rb +48 -0
  227. data/lib/generators/locomotive/install/templates/heroku.rb +29 -0
  228. data/lib/generators/locomotive/install/templates/locomotive.rb +5 -2
  229. data/lib/generators/locomotive/install/templates/mongoid.yml +1 -1
  230. data/lib/generators/locomotive/install/templates/mongoid_heroku.yml +78 -0
  231. data/lib/locomotive.rb +0 -1
  232. data/lib/locomotive/configuration.rb +2 -6
  233. data/lib/locomotive/dependencies.rb +1 -2
  234. data/lib/locomotive/dragonfly.rb +4 -5
  235. data/lib/locomotive/engine.rb +10 -13
  236. data/lib/locomotive/middlewares.rb +0 -1
  237. data/lib/locomotive/middlewares/custom_public_exceptions.rb +19 -0
  238. data/lib/locomotive/middlewares/site.rb +49 -16
  239. data/lib/locomotive/simple_form.rb +67 -26
  240. data/lib/locomotive/steam/middlewares/missing_translations.rb +48 -0
  241. data/lib/locomotive/steam/middlewares/page_editing.rb +48 -0
  242. data/lib/locomotive/steam/services/api_entry_submission_service.rb +38 -0
  243. data/lib/locomotive/steam_adaptor.rb +25 -6
  244. data/lib/locomotive/version.rb +1 -1
  245. data/lib/tasks/locomotive.rake +27 -47
  246. data/spec/dummy/app/views/foo/index.html.slim +1 -0
  247. data/spec/dummy/app/views/locomotive/shared/{_main_app_head.html.haml → _main_app_head.html.slim} +0 -0
  248. data/spec/dummy/config.ru +4 -0
  249. data/spec/dummy/config/application.rb +4 -0
  250. data/spec/dummy/config/environments/profile.rb +48 -0
  251. data/spec/dummy/config/mongoid.yml +6 -6
  252. data/spec/lib/locomotive/steam/services/api_entry_submission_service_spec.rb +39 -0
  253. data/spec/models/locomotive/concerns/content_type/entry_template_spec.rb +55 -0
  254. data/spec/models/locomotive/concerns/page/layout_spec.rb +2 -2
  255. data/spec/models/locomotive/concerns/site/access_points_spec.rb +87 -2
  256. data/spec/models/locomotive/concerns/site/locales_spec.rb +2 -3
  257. data/spec/models/locomotive/content_entry_spec.rb +22 -37
  258. data/spec/models/locomotive/page_spec.rb +11 -0
  259. data/spec/models/locomotive/site_spec.rb +0 -36
  260. data/spec/requests/site_spec.rb +28 -0
  261. data/spec/support/capybara.rb +27 -0
  262. data/spec/support/factories.rb +9 -0
  263. data/spec/support/features/session_helpers.rb +21 -0
  264. data/spec/support/locomotive.rb +0 -4
  265. data/spec/support/matchers.rb +0 -25
  266. data/vendor/assets/javascripts/locomotive/highlight.pack.js +1 -0
  267. data/vendor/assets/stylesheets/locomotive/highlightjs/default.css +155 -0
  268. data/vendor/assets/stylesheets/locomotive/highlightjs/github.css +123 -0
  269. metadata +179 -195
  270. data/app/assets/images/locomotive/background/body.png +0 -0
  271. data/app/assets/images/locomotive/form/error-arrow.png +0 -0
  272. data/app/assets/images/locomotive/form/input-sep.png +0 -0
  273. data/app/assets/images/locomotive/icons/start.png +0 -0
  274. data/app/assets/images/locomotive/list/empty.png +0 -0
  275. data/app/assets/images/locomotive/list/item-left.png +0 -0
  276. data/app/assets/images/locomotive/nocoffee.png +0 -0
  277. data/app/assets/images/locomotive/plugins/sites_picker_top_arrow.png +0 -0
  278. data/app/assets/images/locomotive/rails.png +0 -0
  279. data/app/assets/javascripts/locomotive/views/pages/index_view.js.coffee +0 -11
  280. data/app/cells/locomotive/content_locale_picker/show.html.haml +0 -7
  281. data/app/cells/locomotive/content_locale_picker_cell.rb +0 -21
  282. data/app/helpers/locomotive/installation_helper.rb +0 -9
  283. data/app/inputs/locomotive/locale_input.rb +0 -41
  284. data/app/inputs/locomotive/small_code_input.rb +0 -23
  285. data/app/models/locomotive/concerns/content_entry/notifications.rb +0 -33
  286. data/app/models/locomotive/concerns/content_type/item_template.rb +0 -49
  287. data/app/models/locomotive/concerns/page/parse.rb +0 -133
  288. data/app/presenters/locomotive/account_presenter.rb +0 -20
  289. data/app/presenters/locomotive/base_presenter.rb +0 -144
  290. data/app/presenters/locomotive/content_asset_presenter.rb +0 -51
  291. data/app/presenters/locomotive/content_entry_presenter.rb +0 -177
  292. data/app/presenters/locomotive/content_field_presenter.rb +0 -76
  293. data/app/presenters/locomotive/content_type_presenter.rb +0 -82
  294. data/app/presenters/locomotive/editable_control_presenter.rb +0 -19
  295. data/app/presenters/locomotive/editable_element_presenter.rb +0 -46
  296. data/app/presenters/locomotive/editable_file_presenter.rb +0 -36
  297. data/app/presenters/locomotive/editable_text_presenter.rb +0 -40
  298. data/app/presenters/locomotive/membership_presenter.rb +0 -35
  299. data/app/presenters/locomotive/page_presenter.rb +0 -81
  300. data/app/presenters/locomotive/site_presenter.rb +0 -40
  301. data/app/presenters/locomotive/snippet_presenter.rb +0 -22
  302. data/app/presenters/locomotive/theme_asset_presenter.rb +0 -61
  303. data/app/presenters/locomotive/translation_presenter.rb +0 -9
  304. data/app/views/locomotive/content_assets/edit_in_drawer.html.haml +0 -26
  305. data/app/views/locomotive/content_entries/form/_tabs.html.haml +0 -9
  306. data/app/views/locomotive/current_site/form/_tabs.html.haml +0 -14
  307. data/app/views/locomotive/dashboard/show.html.haml +0 -0
  308. data/app/views/locomotive/devise_mailer/reset_password_instructions.html.haml +0 -12
  309. data/app/views/locomotive/editable_elements/_edit.html.haml +0 -49
  310. data/app/views/locomotive/editable_elements/_edit_with_content_entry.html.haml +0 -21
  311. data/app/views/locomotive/editable_elements/index.html.haml +0 -8
  312. data/app/views/locomotive/errors/404.html.haml +0 -7
  313. data/app/views/locomotive/errors/500.html.haml +0 -7
  314. data/app/views/locomotive/errors/no_page.html.haml +0 -1
  315. data/app/views/locomotive/errors/no_site.html.haml +0 -1
  316. data/app/views/locomotive/layouts/application.html.haml +0 -42
  317. data/app/views/locomotive/layouts/error.html.haml +0 -1
  318. data/app/views/locomotive/layouts/not_logged_in.html.haml +0 -18
  319. data/app/views/locomotive/my_account/form/_tabs.html.haml +0 -7
  320. data/app/views/locomotive/pages/_editable_elements.html.haml +0 -64
  321. data/app/views/locomotive/pages/index.html.haml +0 -22
  322. data/app/views/locomotive/pages/show.html.haml +0 -2
  323. data/app/views/locomotive/shared/_footer.html.haml +0 -2
  324. data/app/views/locomotive/shared/_head.html.haml +0 -40
  325. data/app/views/locomotive/shared/_locale_picker_link.html.haml +0 -6
  326. data/app/views/locomotive/shared/header/_account_menu.html.haml +0 -5
  327. data/app/views/locomotive/shared/header/_brand.html.haml +0 -4
  328. data/app/views/locomotive/shared/rte/_toolbar.html.haml +0 -62
  329. data/app/views/locomotive/shared/sidebar/_content_types.html.haml +0 -15
  330. data/app/views/locomotive/shared/sidebar/_link.html.haml +0 -10
  331. data/app/views/locomotive/shared/sidebar/_page.html.haml +0 -33
  332. data/app/views/locomotive/shared/sidebar/_pages.html.haml +0 -11
  333. data/app/views/locomotive/translations/_form.html.haml +0 -12
  334. data/app/views/locomotive/translations/edit.html.haml +0 -15
  335. data/app/views/locomotive/translations/index.html.haml +0 -30
  336. data/app/views/locomotive/translations/new.html.haml +0 -12
  337. data/config/initializers/haml.rb +0 -2
  338. data/config/initializers/locomotive_loaded_first.rb +0 -19
  339. data/config/locales/formtastic.bg.yml +0 -113
  340. data/config/locales/formtastic.cs.yml +0 -125
  341. data/config/locales/formtastic.de.yml +0 -106
  342. data/config/locales/formtastic.es.yml +0 -84
  343. data/config/locales/formtastic.et.yml +0 -103
  344. data/config/locales/formtastic.fr.yml +0 -109
  345. data/config/locales/formtastic.it.yml +0 -99
  346. data/config/locales/formtastic.ja.yml +0 -103
  347. data/config/locales/formtastic.nb.yml +0 -103
  348. data/config/locales/formtastic.nl.yml +0 -85
  349. data/config/locales/formtastic.pl.yml +0 -105
  350. data/config/locales/formtastic.pt-BR.yml +0 -70
  351. data/config/locales/formtastic.pt.yml +0 -70
  352. data/config/locales/formtastic.ru.yml +0 -106
  353. data/config/locales/formtastic.sk.yml +0 -125
  354. data/config/locales/formtastic.sr.yml +0 -112
  355. data/config/locales/formtastic.zh-CN.yml +0 -112
  356. data/lib/locomotive/haml.rb +0 -1
  357. data/lib/locomotive/middlewares/page_editing.rb +0 -41
  358. data/spec/dummy/app/views/foo/index.html.haml +0 -1
  359. data/spec/dummy/config/initializers/haml.rb +0 -2
  360. data/spec/support/asset_host_stubs.rb +0 -17
  361. data/spec/support/controller.rb +0 -32
@@ -37,8 +37,10 @@ class Locomotive.Views.ContentAssets.EditImageView extends Backbone.View
37
37
  @$content.find('.apply-resizing-btn').on 'click', @apply_resizing
38
38
  @$content.find('.cancel-resizing-btn').on 'click', @cancel_resizing
39
39
 
40
+ container = if $('.drawer').size() > 0 then '.drawer' else '.main'
41
+
40
42
  @$link.popover
41
- container: '.main'
43
+ container: container
42
44
  placement: 'left'
43
45
  content: @$content
44
46
  html: true
@@ -2,4 +2,36 @@ Locomotive.Views.Dashboard ||= {}
2
2
 
3
3
  class Locomotive.Views.Dashboard.ShowView extends Backbone.View
4
4
 
5
- el: '#content'
5
+ el: '.main'
6
+
7
+ infinite_activity_button: 'a[data-behavior~=load-more]'
8
+
9
+ events:
10
+ 'ajax:beforeSend a[data-behavior~=load-more]': 'loading_activity_feed'
11
+ 'ajax:success a[data-behavior~=load-more]': 'refresh_activity_feed'
12
+
13
+ render: ->
14
+ super
15
+
16
+ # replace the img by the name of the file
17
+ @$('.assets img').error ->
18
+ $(this).parent().html($(this).attr('alt'))
19
+
20
+ loading_activity_feed: (event) -> $(event.target).button('loading')
21
+
22
+ refresh_activity_feed: (event, data, status, xhr) ->
23
+ $btn = $(event.target).button('reset')
24
+ $last = @$('.activity-feed > li:last-child')
25
+ $response = $(data)
26
+
27
+ # add new activity items
28
+ $response.find('.activity-feed > li').appendTo(@$('.activity-feed'))
29
+
30
+ # display or not the load more button
31
+ if ($new_btn = $response.find(@infinite_activity_button)).size() > 0
32
+ $btn.replaceWith($new_btn)
33
+ else
34
+ @$(@infinite_activity_button).hide()
35
+
36
+ # scroll to see the new items
37
+ $(@el).parent().animate scrollTop: $last.offset().top + 'px', 2000
@@ -0,0 +1,9 @@
1
+ Locomotive.Views.DevelopersDocumentation ||= {}
2
+
3
+ class Locomotive.Views.DevelopersDocumentation.ShowView extends Backbone.View
4
+
5
+ el: '.main'
6
+
7
+ render: ->
8
+ super()
9
+ hljs.initHighlightingOnLoad()
@@ -27,7 +27,9 @@ class Locomotive.Views.EditableElements.EditView extends Locomotive.Views.Shared
27
27
  dom_id = $(view.el).attr('id')
28
28
  $new_el = $html.find("##{dom_id}")
29
29
 
30
- view.replace $new_el if $new_el.size() > 0
30
+ view.replace $new_el
31
+
32
+ view
31
33
 
32
34
  filter_elements_by: (block) ->
33
35
  @$('.editable-elements .form-group.input').each ->
@@ -19,6 +19,7 @@ class Locomotive.Views.EditableElements.IndexView extends Backbone.View
19
19
 
20
20
  view_options = if $('body').hasClass('live-editing') then {} else { el: '.main' }
21
21
 
22
+ @startup = true
22
23
  @edit_view = new Locomotive.Views.EditableElements.EditView(view_options)
23
24
  @pubsub_text_token = PubSub.subscribe('inputs.text_changed', @refresh_text)
24
25
 
@@ -33,19 +34,18 @@ class Locomotive.Views.EditableElements.IndexView extends Backbone.View
33
34
 
34
35
  refresh_elements: (type, view, callback) ->
35
36
  $parent_view = $(view.el).parent()
36
- element_id = $parent_view.find('input[name*="[humanized_id]"]').val().replace(/_/g, '-')
37
- dom_id = "locomotive-editable-#{type}-#{element_id}"
37
+ element_id = $parent_view.find('input[name*="[id]"]').val()
38
38
 
39
39
  $iframe_document = $($('iframe')[0].contentWindow.document)
40
40
 
41
- callback($iframe_document.find("##{dom_id}"), dom_id, $iframe_document)
41
+ callback($iframe_document.find("*[data-element-id=#{element_id}]"), element_id, $iframe_document)
42
42
 
43
43
  refresh_image_on_remove: (msg, data) ->
44
44
  data.url = $(data.view.el).parent().find('input[name*="[default_source_url]"]').val()
45
45
  @refresh_image(msg, data)
46
46
 
47
47
  refresh_image: (msg, data) ->
48
- @refresh_elements 'image', data.view, ($elements, dom_id, $iframe_document) ->
48
+ @refresh_elements 'image', data.view, ($elements, element_id, $iframe_document) ->
49
49
  current_image_url = data.view.$('input[name*="[content]"]').val()
50
50
  image_url = data.url || current_image_url
51
51
 
@@ -57,11 +57,11 @@ class Locomotive.Views.EditableElements.IndexView extends Backbone.View
57
57
  $(this).css("background-image", "url('" + image_url + "')")
58
58
  else
59
59
  # looking for DIVs with background-url property matching the previous image url
60
- $el = $iframe_document.find("*[style*='#{current_image_url}']").attr('id', dom_id)
60
+ $el = $iframe_document.find("*[style*='#{current_image_url}']").attr('data-element-id', element_id)
61
61
  $el.css("background-image", "url('" + image_url + "')")
62
62
 
63
63
  # looking for IMGs with src attribute matching the previous image url
64
- $el = $iframe_document.find("img[src*='#{current_image_url}']").attr('id', dom_id)
64
+ $el = $iframe_document.find("img[src*='#{current_image_url}']").attr('data-element-id', element_id)
65
65
  $el.attr('src', image_url)
66
66
 
67
67
  refresh_text: (msg, data) ->
@@ -86,11 +86,11 @@ class Locomotive.Views.EditableElements.IndexView extends Backbone.View
86
86
  # store the url
87
87
  @preview_url = $('.preview iframe')[0].contentWindow.document.location.href
88
88
 
89
- if editable_elements_path?
90
- unless editable_elements_path == (window.location.pathname + window.location.search)
91
- History.replaceState({ live_editing: true, url: @preview_url }, '', editable_elements_path)
92
-
93
- @replace_edit_view(editable_elements_path)
89
+ if editable_elements_path? && @startup == false
90
+ History.replaceState({ live_editing: true, url: @preview_url }, '', editable_elements_path)
91
+ @replace_edit_view(editable_elements_path)
92
+ else
93
+ @startup = false
94
94
 
95
95
  replace_edit_view: (url) ->
96
96
  $(@edit_view.el).load url, =>
@@ -0,0 +1,16 @@
1
+ Locomotive.Views.Inputs ||= {}
2
+
3
+ class Locomotive.Views.Inputs.TextView extends Backbone.View
4
+
5
+ events:
6
+ 'change input[type=text]': 'content_change'
7
+ 'paste input[type=text]': 'content_change'
8
+ 'keyup input[type=text]': 'content_change'
9
+ 'change textarea': 'content_change'
10
+ 'paste textarea': 'content_change'
11
+ 'keyup textarea': 'content_change'
12
+
13
+ content_change: (event) ->
14
+ PubSub.publish 'inputs.text_changed',
15
+ view: @
16
+ content: $(event.target).val()
@@ -13,161 +13,3 @@ class Locomotive.Views.Pages.FormView extends Locomotive.Views.Shared.FormView
13
13
  @$('#page_redirect').on 'switchChange.bootstrapSwitch', (event, state) ->
14
14
  $inputs = $('.locomotive_page_redirect_url, .locomotive_page_redirect_type')
15
15
  $inputs.toggleClass('hide')
16
-
17
-
18
-
19
- # events:
20
- # 'change #page_parent_id': 'change_page_url'
21
- # 'click a#image-picker-link': 'open_image_picker'
22
- # 'click a#copy-template-link': 'replace_template'
23
- # 'submit': 'save'
24
-
25
- # initialize: ->
26
- # _.bindAll(@, 'insert_image')
27
-
28
- # @model = new Locomotive.Models.Page(@options.page)
29
-
30
- # @touched_url = false
31
-
32
- # @image_picker_view = new Locomotive.Views.ThemeAssets.ImagePickerView
33
- # collection: new Locomotive.Models.ThemeAssetsCollection()
34
- # on_select: @insert_image
35
-
36
- # @image_picker_view.render()
37
-
38
- # Backbone.ModelBinding.bind @
39
-
40
- # @editable_elements_view = new Locomotive.Views.EditableElements.EditAllView(collection: @model.get('editable_elements'))
41
-
42
- # render: ->
43
- # super()
44
-
45
- # # slugify the slug field from title
46
- # @slugify_title()
47
-
48
- # # the url gets modified by different ways so reflect the changes in the UI
49
- # @listen_for_url_changes()
50
-
51
- # # enable response type to be changed (xml, json, ...etc)
52
- # @enable_response_type_select()
53
-
54
- # # enable check boxes
55
- # @enable_templatized_checkbox()
56
-
57
- # @enable_redirect_checkbox()
58
-
59
- # @enable_other_checkboxes()
60
-
61
- # # liquid code textarea
62
- # @enable_liquid_editing()
63
-
64
- # # editable elements
65
- # @render_editable_elements()
66
-
67
- # return @
68
-
69
- # open_image_picker: (event) ->
70
- # event.stopPropagation() & event.preventDefault()
71
- # @image_picker_view.editor = @editor
72
- # @image_picker_view.fetch_assets()
73
-
74
- # insert_image: (path) ->
75
- # text = "{{ '#{path}' | theme_image_url }}"
76
- # @editor.replaceSelection(text)
77
- # @image_picker_view.close()
78
-
79
- # replace_template: (event) ->
80
- # event.stopPropagation() & event.preventDefault()
81
-
82
- # link = $(event.target).closest('a')
83
-
84
- # $.rails.ajax
85
- # url: link.attr('href')
86
- # type: 'get'
87
- # dataType: 'json'
88
- # success: (data) =>
89
- # @editor.setValue(data.raw_template)
90
-
91
- # enable_liquid_editing: ->
92
- # input = @$('#page_raw_template')
93
-
94
- # if input.size() > 0
95
- # @editor = CodeMirror.fromTextArea input.get()[0],
96
- # mode: 'liquid'
97
- # autoMatchParens: false
98
- # lineNumbers: true
99
- # passDelay: 50
100
- # tabMode: 'shift'
101
- # theme: 'default'
102
-
103
- # @editor.on 'change', (editor, change) => @model.set(raw_template: editor.getValue())
104
-
105
- # after_inputs_fold: ->
106
- # @editor.refresh() if @editor?
107
-
108
- # render_editable_elements: ->
109
- # @$('.formtastic fieldset.inputs:first').before(@editable_elements_view.render().el)
110
- # @editable_elements_view.after_render()
111
-
112
- # # Remove the editable elements and rebuild them
113
- # reset_editable_elements: ->
114
- # @editable_elements_view.remove()
115
- # @editable_elements_view.collection = @model.get('editable_elements')
116
- # @render_editable_elements()
117
-
118
- # # Just re-connect the model and the views (+ redraw the file fields)
119
- # refresh_editable_elements: ->
120
- # @editable_elements_view.unbind_model()
121
- # @editable_elements_view.collection = @model.get('editable_elements')
122
- # @editable_elements_view.refresh()
123
-
124
- # slugify_title: ->
125
- # @$('#page_title').slugify(target: @$('#page_slug'), url: window.permalink_service_url)
126
- # @$('#page_slug').bind 'change', ((event) => @touched_url = true)
127
-
128
- # listen_for_url_changes: ->
129
- # setInterval (=> (@change_page_url() & @touched_url = false) if @touched_url), 1200
130
-
131
- # change_page_url: ->
132
- # $.rails.ajax
133
- # url: @$('#page_slug').data('url')
134
- # type: 'get'
135
- # dataType: 'json'
136
- # data: { parent_id: @$('#page_parent_id').val(), slug: @$('#page_slug').val() }
137
- # success: (data) =>
138
- # @$('#page_slug_input .inline-hints').html(data.url).effect('highlight')
139
- # if data.templatized_parent
140
- # @$('li#page_slug_input').show()
141
- # @$('li#page_templatized_input, li#page_target_klass_name_input').hide()
142
- # else
143
- # @$('li#page_templatized_input').show() unless @model.get('redirect')
144
-
145
- # enable_response_type_select: ->
146
- # @$('li#page_response_type_input').change (event) =>
147
- # if $(event.target).val() == 'text/html'
148
- # @$('li#page_redirect_input, li#page_redirect_url_input, li#page_redirect_type_input').show()
149
- # else
150
- # @model.set redirect: false
151
- # @$('li#page_redirect_input, li#page_redirect_url_input, li#page_redirect_type_input').hide()
152
-
153
- # enable_templatized_checkbox: ->
154
- # @_enable_checkbox 'templatized',
155
- # features: ['slug', 'redirect', 'listed']
156
- # on_callback: =>
157
- # @$('li#page_target_klass_name_input').show()
158
- # off_callback: =>
159
- # @$('li#page_target_klass_name_input').hide()
160
-
161
- # @$('li#page_templatized_input').hide() if @model.get('templatized_from_parent') == true
162
-
163
- # enable_redirect_checkbox: ->
164
- # @_enable_checkbox 'redirect',
165
- # features: ['templatized', 'cache_strategy']
166
- # on_callback: =>
167
- # @$('li#page_redirect_url_input, li#page_redirect_type_input').show()
168
- # off_callback: =>
169
- # @$('li#page_redirect_url_input, li#page_redirect_type_input').hide()
170
-
171
- # enable_other_checkboxes: ->
172
- # @$('li.toggle input[type=checkbox].simple-toggle').checkToggle()
173
- # @$('li.toggle.simple-toggle input[type=checkbox]').checkToggle()
@@ -5,44 +5,3 @@ Locomotive.Views.Pages ||= {}
5
5
  class Locomotive.Views.Pages.EditView extends Locomotive.Views.Pages.FormView
6
6
 
7
7
  el: '.main'
8
-
9
- # Locomotive.Views.Pages ||= {}
10
-
11
- # class Locomotive.Views.Pages.EditView extends Locomotive.Views.Pages.FormView
12
-
13
- # save: (event) ->
14
- # event.stopPropagation() & event.preventDefault()
15
-
16
- # @trigger_change_event_on_focused_inputs()
17
-
18
- # form = $(event.target).trigger('ajax:beforeSend')
19
-
20
- # @clear_errors()
21
-
22
- # # store the previous editable elements in case we
23
- # # need to use the content of these elements for
24
- # # the new ones (same block and slug).
25
- # editable_elements = _.clone @model.get('editable_elements')
26
-
27
- # @model.save {},
28
- # success: (model, response) =>
29
- # form.trigger('ajax:complete')
30
-
31
- # model._normalize()
32
-
33
- # if model.get('template_changed') == true
34
- # model.get('editable_elements').update_content_from(editable_elements)
35
- # @reset_editable_elements()
36
- # else
37
- # @refresh_editable_elements()
38
-
39
- # # refresh the show link
40
- # fullpath = @model.get('localized_fullpaths')[window.content_locale]
41
- # @$('#local-actions-bar > a.show').attr('href', "/#{fullpath}")
42
-
43
- # error: (model, xhr) =>
44
- # form.trigger('ajax:complete')
45
-
46
- # errors = JSON.parse(xhr.responseText)
47
-
48
- # @show_errors errors
@@ -0,0 +1,7 @@
1
+ #= require ../shared/form_view
2
+
3
+ Locomotive.Views.PublicSubmissionAccounts ||= {}
4
+
5
+ class Locomotive.Views.PublicSubmissionAccounts.EditView extends Locomotive.Views.Shared.FormView
6
+
7
+ el: '.main'
@@ -6,12 +6,12 @@ class Locomotive.Views.Shared.FormView extends Backbone.View
6
6
 
7
7
  namespace: null
8
8
 
9
- inputs: []
10
-
11
9
  events:
12
10
  'submit form': 'save'
13
11
 
14
12
  render: ->
13
+ @inputs = []
14
+
15
15
  @display_active_nav()
16
16
 
17
17
  @enable_hover()
@@ -21,6 +21,7 @@ class Locomotive.Views.Shared.FormView extends Backbone.View
21
21
  @enable_toggle_inputs()
22
22
  @enable_date_inputs()
23
23
  @enable_datetime_inputs()
24
+ @enable_text_inputs()
24
25
  @enable_rte_inputs()
25
26
  @enable_tags_inputs()
26
27
  @enable_document_picker_inputs()
@@ -95,6 +96,13 @@ class Locomotive.Views.Shared.FormView extends Backbone.View
95
96
  useseconds: false
96
97
  format: $(@).data('format')
97
98
 
99
+ enable_text_inputs: ->
100
+ self = @
101
+ @$('.input.text').each ->
102
+ view = new Locomotive.Views.Inputs.TextView(el: $(@))
103
+ view.render()
104
+ self.inputs.push(view)
105
+
98
106
  enable_rte_inputs: ->
99
107
  self = @
100
108
  @$('.input.rte').each ->
@@ -116,7 +124,7 @@ class Locomotive.Views.Shared.FormView extends Backbone.View
116
124
  self.inputs.push(view)
117
125
 
118
126
  remove: ->
119
- _.each @inputs.each, (view) -> view.remove()
127
+ _.each @inputs, (view) -> view.remove()
120
128
  @$('.input.tags input[type=text]').tagsinput('destroy')
121
129
  @$('.input.select select').select2('destroy')
122
130
 
@@ -34,7 +34,9 @@ class Locomotive.Views.Shared.ListView extends Backbone.View
34
34
  error: @.on_failed_sort
35
35
 
36
36
  on_successful_sort: (data, status, xhr) ->
37
- # $.growl('success', decodeURIComponent $.parseJSON xhr.getResponseHeader('X-Message'))
37
+ message = xhr.getResponseHeader('X-Message')
38
+ Locomotive.notify decodeURIComponent($.parseJSON(message)), 'success'
38
39
 
39
40
  on_failed_sort: (data, status, xhr) ->
40
- # $.growl('error', decodeURIComponent $.parseJSON xhr.getResponseHeader('X-Message'))
41
+ message = if _.isObject(xhr) then $.parseJSON(xhr.getResponseHeader('X-Message')) else xhr
42
+ Locomotive.notify decodeURIComponent(message), 'danger'
@@ -0,0 +1,5 @@
1
+ Locomotive.Views.Translations ||= {}
2
+
3
+ class Locomotive.Views.Translations.IndexView extends Backbone.View
4
+
5
+ el: '.main'
@@ -4,6 +4,7 @@
4
4
  //= require locomotive/bootstrap-switch
5
5
  //= require locomotive/bootstrap-datetimepicker
6
6
  //= require locomotive/bootstrap-tagsinput
7
+ //= require locomotive/highlightjs/github
7
8
 
8
9
  @import "font-awesome-sprockets";
9
10
  @import "font-awesome";
@@ -30,6 +31,9 @@
30
31
  @import "components/main";
31
32
  @import "components/list";
32
33
  @import "components/content_assets";
34
+ @import "components/translations";
33
35
  @import "components/live_editing";
36
+ @import "components/activity_feed";
37
+ @import "components/developers";
34
38
 
35
39
  @import "components/sites";