locomotive_cms 2.0.3 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (378) hide show
  1. checksums.yaml +15 -0
  2. data/Gemfile +3 -3
  3. data/README.textile +7 -7
  4. data/app/assets/images/locomotive/icons/flags/ja.png +0 -0
  5. data/app/assets/javascripts/locomotive/aloha.js.coffee +3 -0
  6. data/app/assets/javascripts/locomotive/models/page.js.coffee +1 -1
  7. data/app/assets/javascripts/locomotive/models/site.js.coffee +16 -6
  8. data/app/assets/javascripts/locomotive/utils/aloha_settings.js.coffee +1 -1
  9. data/app/assets/javascripts/locomotive/views/content_entries/_form_view.js.coffee +5 -0
  10. data/app/assets/javascripts/locomotive/views/my_account/edit_view.js.coffee +14 -0
  11. data/app/assets/javascripts/locomotive/views/pages/_form_view.js.coffee +1 -1
  12. data/app/assets/javascripts/locomotive/views/pages/edit_view.js.coffee +2 -1
  13. data/app/assets/javascripts/tinymce/plugins/locomotive_media/langs/de.js +1 -0
  14. data/app/assets/stylesheets/locomotive.css +1 -0
  15. data/app/assets/stylesheets/locomotive/backoffice/formtastic_changes.css.scss +18 -3
  16. data/app/assets/stylesheets/locomotive/backoffice/layout.css.scss +1 -1
  17. data/app/assets/stylesheets/locomotive/backoffice/menu/main.css.scss +7 -3
  18. data/app/assets/stylesheets/locomotive/backoffice/pagination.css.scss +37 -0
  19. data/app/assets/stylesheets/locomotive/backoffice/tagit_changes.css.scss +49 -0
  20. data/app/cells/locomotive/content_locale_picker/show.html.haml +1 -1
  21. data/app/cells/locomotive/global_actions_cell.rb +8 -8
  22. data/app/cells/locomotive/main_menu/show.html.haml +2 -2
  23. data/app/cells/locomotive/main_menu_cell.rb +2 -2
  24. data/app/cells/locomotive/menu_cell.rb +6 -6
  25. data/app/cells/locomotive/partials_cell.rb +21 -0
  26. data/app/cells/locomotive/settings_menu_cell.rb +4 -4
  27. data/app/cells/locomotive/sub_menu/show.html.haml +2 -2
  28. data/app/cells/locomotive/sub_menu_cell.rb +1 -1
  29. data/app/controllers/locomotive/accounts_controller.rb +4 -4
  30. data/app/controllers/locomotive/api/accounts_controller.rb +1 -0
  31. data/app/controllers/locomotive/api/content_assets_controller.rb +1 -1
  32. data/app/controllers/locomotive/api/content_entries_controller.rb +1 -1
  33. data/app/controllers/locomotive/api/content_types_controller.rb +2 -2
  34. data/app/controllers/locomotive/api/pages_controller.rb +1 -1
  35. data/app/controllers/locomotive/api/snippets_controller.rb +1 -1
  36. data/app/controllers/locomotive/api/theme_assets_controller.rb +47 -0
  37. data/app/controllers/locomotive/api/tokens_controller.rb +2 -2
  38. data/app/controllers/locomotive/base_controller.rb +5 -2
  39. data/app/controllers/locomotive/content_assets_controller.rb +1 -1
  40. data/app/controllers/locomotive/content_entries_controller.rb +22 -9
  41. data/app/controllers/locomotive/content_types_controller.rb +6 -6
  42. data/app/controllers/locomotive/current_site_controller.rb +6 -6
  43. data/app/controllers/locomotive/installation_controller.rb +11 -3
  44. data/app/controllers/locomotive/memberships_controller.rb +6 -6
  45. data/app/controllers/locomotive/my_account_controller.rb +9 -3
  46. data/app/controllers/locomotive/pages_controller.rb +10 -6
  47. data/app/controllers/locomotive/passwords_controller.rb +1 -1
  48. data/app/controllers/locomotive/public/content_entries_controller.rb +1 -1
  49. data/app/controllers/locomotive/public/pages_controller.rb +5 -5
  50. data/app/controllers/locomotive/public/robots_controller.rb +1 -1
  51. data/app/controllers/locomotive/public/sitemaps_controller.rb +1 -1
  52. data/app/controllers/locomotive/sessions_controller.rb +1 -1
  53. data/app/controllers/locomotive/sites_controller.rb +5 -5
  54. data/app/controllers/locomotive/snippets_controller.rb +6 -6
  55. data/app/controllers/locomotive/theme_assets_controller.rb +6 -6
  56. data/app/controllers/locomotive/translations_controller.rb +1 -1
  57. data/app/helpers/locomotive/accounts_helper.rb +1 -1
  58. data/app/helpers/locomotive/base_helper.rb +13 -21
  59. data/app/helpers/locomotive/content_types_helper.rb +3 -3
  60. data/app/helpers/locomotive/custom_fields_helper.rb +5 -5
  61. data/app/helpers/locomotive/installation_helper.rb +1 -1
  62. data/app/helpers/locomotive/pages_helper.rb +5 -5
  63. data/app/helpers/locomotive/snippets_helper.rb +1 -1
  64. data/app/helpers/locomotive/theme_assets_helper.rb +1 -1
  65. data/app/helpers/locomotive/translations_helper.rb +2 -2
  66. data/app/inputs/locomotive/api_key_input.rb +40 -0
  67. data/app/inputs/locomotive/code_input.rb +5 -5
  68. data/app/inputs/locomotive/file_input.rb +6 -6
  69. data/app/inputs/locomotive/locale_input.rb +5 -5
  70. data/app/inputs/locomotive/locales_input.rb +4 -4
  71. data/app/inputs/locomotive/rte_input.rb +1 -1
  72. data/app/inputs/locomotive/small_code_input.rb +1 -1
  73. data/app/inputs/locomotive/subdomain_input.rb +1 -1
  74. data/app/mailers/locomotive/devise_mailer.rb +1 -1
  75. data/app/mailers/locomotive/notifications.rb +3 -3
  76. data/app/models/locomotive/ability.rb +10 -11
  77. data/app/models/locomotive/account.rb +61 -26
  78. data/app/models/locomotive/content_asset.rb +8 -8
  79. data/app/models/locomotive/content_entry.rb +8 -7
  80. data/app/models/locomotive/content_type.rb +12 -7
  81. data/app/models/locomotive/editable_control.rb +2 -2
  82. data/app/models/locomotive/editable_element.rb +13 -8
  83. data/app/models/locomotive/editable_file.rb +5 -3
  84. data/app/models/locomotive/editable_short_text.rb +3 -3
  85. data/app/models/locomotive/extensions/asset/types.rb +2 -2
  86. data/app/models/locomotive/extensions/content_entry/csv.rb +78 -0
  87. data/app/models/locomotive/extensions/content_type/item_template.rb +3 -3
  88. data/app/models/locomotive/extensions/content_type/sync.rb +4 -4
  89. data/app/models/locomotive/extensions/page/editable_elements.rb +1 -1
  90. data/app/models/locomotive/extensions/page/parse.rb +2 -2
  91. data/app/models/locomotive/extensions/page/render.rb +7 -1
  92. data/app/models/locomotive/extensions/page/templatized.rb +20 -15
  93. data/app/models/locomotive/extensions/page/tree.rb +4 -4
  94. data/app/models/locomotive/extensions/shared/seo.rb +3 -3
  95. data/app/models/locomotive/extensions/site/first_installation.rb +5 -2
  96. data/app/models/locomotive/extensions/site/locales.rb +9 -6
  97. data/app/models/locomotive/extensions/site/subdomain_domains.rb +8 -8
  98. data/app/models/locomotive/membership.rb +6 -6
  99. data/app/models/locomotive/page.rb +30 -23
  100. data/app/models/locomotive/site.rb +19 -15
  101. data/app/models/locomotive/snippet.rb +5 -5
  102. data/app/models/locomotive/theme_asset.rb +17 -6
  103. data/app/models/locomotive/translation.rb +21 -16
  104. data/app/presenters/locomotive/account_presenter.rb +1 -1
  105. data/app/presenters/locomotive/content_entry_presenter.rb +2 -2
  106. data/app/presenters/locomotive/content_field_presenter.rb +2 -2
  107. data/app/presenters/locomotive/content_type_presenter.rb +6 -1
  108. data/app/presenters/locomotive/theme_asset_presenter.rb +2 -2
  109. data/app/uploaders/locomotive/editable_file_uploader.rb +1 -1
  110. data/app/uploaders/locomotive/theme_asset_uploader.rb +1 -1
  111. data/app/views/locomotive/accounts/new.html.haml +6 -6
  112. data/app/views/locomotive/content_assets/_asset.html.haml +3 -3
  113. data/app/views/locomotive/content_assets/_picker.html.haml +12 -12
  114. data/app/views/locomotive/content_entries/_form.html.haml +9 -8
  115. data/app/views/locomotive/content_entries/_list.html.haml +8 -5
  116. data/app/views/locomotive/content_entries/edit.html.haml +6 -6
  117. data/app/views/locomotive/content_entries/index.html.haml +8 -6
  118. data/app/views/locomotive/content_entries/new.html.haml +5 -5
  119. data/app/views/locomotive/content_types/_form.html.haml +16 -16
  120. data/app/views/locomotive/content_types/edit.html.haml +5 -5
  121. data/app/views/locomotive/content_types/new.html.haml +3 -3
  122. data/app/views/locomotive/current_site/_form.html.haml +12 -12
  123. data/app/views/locomotive/current_site/edit.html.haml +5 -5
  124. data/app/views/locomotive/custom_fields/_form.html.haml +23 -19
  125. data/app/views/locomotive/custom_fields/_select_templates.html.haml +5 -5
  126. data/app/views/locomotive/custom_fields/types/_belongs_to.html.haml +4 -4
  127. data/app/views/locomotive/custom_fields/types/_boolean.html.haml +3 -3
  128. data/app/views/locomotive/custom_fields/types/_date.html.haml +4 -4
  129. data/app/views/locomotive/custom_fields/types/_email.html.haml +4 -0
  130. data/app/views/locomotive/custom_fields/types/_file.html.haml +3 -3
  131. data/app/views/locomotive/custom_fields/types/_float.html.haml +6 -0
  132. data/app/views/locomotive/custom_fields/types/_has_many.html.haml +10 -10
  133. data/app/views/locomotive/custom_fields/types/_integer.html.haml +5 -0
  134. data/app/views/locomotive/custom_fields/types/_many_to_many.html.haml +10 -10
  135. data/app/views/locomotive/custom_fields/types/_select.html.haml +10 -10
  136. data/app/views/locomotive/custom_fields/types/_string.html.haml +3 -3
  137. data/app/views/locomotive/custom_fields/types/_tags.html.haml +4 -0
  138. data/app/views/locomotive/custom_fields/types/_text.html.haml +4 -4
  139. data/app/views/locomotive/devise_mailer/reset_password_instructions.html.haml +1 -1
  140. data/app/views/locomotive/installation/step_1.html.haml +5 -5
  141. data/app/views/locomotive/installation/step_2.html.haml +6 -6
  142. data/app/views/locomotive/kaminari/_first_page.html.haml +2 -0
  143. data/app/views/locomotive/kaminari/_gap.html.haml +2 -0
  144. data/app/views/locomotive/kaminari/_last_page.html.haml +2 -0
  145. data/app/views/locomotive/kaminari/_next_page.html.haml +2 -0
  146. data/app/views/locomotive/kaminari/_page.html.haml +2 -0
  147. data/app/views/locomotive/kaminari/_paginator.html.haml +11 -0
  148. data/app/views/locomotive/kaminari/_prev_page.html.haml +2 -0
  149. data/app/views/locomotive/layouts/application.html.haml +2 -2
  150. data/app/views/locomotive/layouts/not_logged_in.html.haml +3 -3
  151. data/app/views/locomotive/memberships/new.html.haml +4 -4
  152. data/app/views/locomotive/my_account/edit.html.haml +14 -13
  153. data/app/views/locomotive/notifications/new_content_entry.html.haml +2 -2
  154. data/app/views/locomotive/pages/_editable_elements.html.haml +20 -20
  155. data/app/views/locomotive/pages/_form.html.haml +23 -27
  156. data/app/views/locomotive/pages/_page.html.haml +6 -6
  157. data/app/views/locomotive/pages/edit.html.haml +5 -5
  158. data/app/views/locomotive/pages/index.html.haml +2 -2
  159. data/app/views/locomotive/pages/new.html.haml +4 -4
  160. data/app/views/locomotive/passwords/edit.html.haml +3 -3
  161. data/app/views/locomotive/passwords/new.html.haml +2 -2
  162. data/app/views/locomotive/public/pages/show_toolbar.html.haml +15 -15
  163. data/app/views/locomotive/sessions/new.html.haml +4 -4
  164. data/app/views/locomotive/shared/_footer.html.haml +1 -1
  165. data/app/views/locomotive/shared/_head.html.haml +7 -7
  166. data/app/views/locomotive/shared/_header.html.haml +2 -2
  167. data/app/views/locomotive/shared/_locale_picker_link.html.haml +1 -1
  168. data/app/views/locomotive/shared/_site_picker.html.haml +2 -2
  169. data/app/views/locomotive/shared/actions/_contents.html.haml +1 -1
  170. data/app/views/locomotive/shared/menu/_contents.html.haml +5 -5
  171. data/app/views/locomotive/sites/_domains.html.haml +7 -7
  172. data/app/views/locomotive/sites/_form.html.haml +6 -1
  173. data/app/views/locomotive/sites/_memberships.html.haml +3 -3
  174. data/app/views/locomotive/sites/new.html.haml +3 -3
  175. data/app/views/locomotive/snippets/_form.html.haml +6 -6
  176. data/app/views/locomotive/snippets/_snippet.html.haml +2 -2
  177. data/app/views/locomotive/snippets/edit.html.haml +5 -5
  178. data/app/views/locomotive/snippets/new.html.haml +3 -3
  179. data/app/views/locomotive/theme_assets/_asset.html.haml +2 -2
  180. data/app/views/locomotive/theme_assets/_form.html.haml +10 -10
  181. data/app/views/locomotive/theme_assets/_list.html.haml +3 -3
  182. data/app/views/locomotive/theme_assets/_picker.html.haml +8 -8
  183. data/app/views/locomotive/theme_assets/edit.html.haml +7 -7
  184. data/app/views/locomotive/theme_assets/index.html.haml +6 -6
  185. data/app/views/locomotive/theme_assets/new.html.haml +3 -3
  186. data/app/views/locomotive/translations/_form.html.haml +3 -3
  187. data/app/views/locomotive/translations/edit.html.haml +6 -6
  188. data/app/views/locomotive/translations/index.html.haml +2 -0
  189. data/app/views/locomotive/translations/new.html.haml +2 -2
  190. data/config/initializers/csv_renderer.rb +10 -0
  191. data/config/locales/admin_ui.de.yml +1 -0
  192. data/config/locales/admin_ui.en.yml +12 -0
  193. data/config/locales/admin_ui.es.yml +1 -0
  194. data/config/locales/admin_ui.et.yml +1 -0
  195. data/config/locales/admin_ui.fr.yml +12 -0
  196. data/config/locales/admin_ui.it.yml +1 -0
  197. data/config/locales/admin_ui.ja.yml +335 -0
  198. data/config/locales/admin_ui.nb.yml +1 -0
  199. data/config/locales/admin_ui.nl.yml +1 -0
  200. data/config/locales/admin_ui.pl.yml +1 -0
  201. data/config/locales/admin_ui.pt-BR.yml +8 -0
  202. data/config/locales/admin_ui.ru.yml +1 -0
  203. data/config/locales/carrierwave.ja.yml +4 -0
  204. data/config/locales/default.de.yml +1 -1
  205. data/config/locales/default.en.yml +1 -1
  206. data/config/locales/default.es.yml +3 -0
  207. data/config/locales/default.et.yml +2 -2
  208. data/config/locales/default.fr.yml +1 -1
  209. data/config/locales/default.it.yml +3 -0
  210. data/config/locales/default.ja.yml +94 -0
  211. data/config/locales/default.nb.yml +1 -1
  212. data/config/locales/default.nl.yml +5 -0
  213. data/config/locales/default.pl.yml +2 -2
  214. data/config/locales/default.pt-BR.yml +3 -2
  215. data/config/locales/default.ru.yml +19 -16
  216. data/config/locales/devise.ja.yml +63 -0
  217. data/config/locales/flash.ja.yml +115 -0
  218. data/config/locales/formtastic.en.yml +7 -0
  219. data/config/locales/formtastic.fr.yml +9 -0
  220. data/config/locales/formtastic.ja.yml +103 -0
  221. data/config/locales/formtastic.pt-BR.yml +1 -1
  222. data/config/routes.rb +5 -2
  223. data/features/api/authentication.feature +24 -2
  224. data/features/api/authorization/pages.feature +3 -1
  225. data/features/api/entries_custom_fields.feature +2 -2
  226. data/features/backoffice/authorization/pages.feature +7 -7
  227. data/features/backoffice/content_types/email.feature +26 -0
  228. data/features/backoffice/content_types/has_many.feature +20 -0
  229. data/features/backoffice/content_types/integer.feature +26 -0
  230. data/features/backoffice/content_types/many_to_many.feature +29 -1
  231. data/features/backoffice/content_types/tags.feature +22 -0
  232. data/features/backoffice/content_types/uniqueness.feature +29 -0
  233. data/features/backoffice/contents.feature +16 -0
  234. data/features/backoffice/installation.feature +33 -0
  235. data/features/backoffice/my_account.feature +21 -0
  236. data/features/backoffice/pages.feature +21 -1
  237. data/features/backoffice/site.feature +59 -40
  238. data/features/backoffice/snippets.feature +1 -1
  239. data/features/backoffice/translations.feature +7 -1
  240. data/features/public/basic.feature +1 -1
  241. data/features/public/pages.feature +92 -0
  242. data/features/public/session.feature +40 -0
  243. data/features/public/tags.feature +45 -0
  244. data/features/step_definitions/backoffice_steps.rb +4 -0
  245. data/features/step_definitions/content_types_steps.rb +16 -3
  246. data/features/step_definitions/more_web_steps.rb +35 -4
  247. data/features/step_definitions/page_steps.rb +52 -35
  248. data/features/step_definitions/pagination_steps.rb +4 -4
  249. data/features/step_definitions/site_steps.rb +22 -10
  250. data/features/step_definitions/snippet_steps.rb +1 -1
  251. data/features/step_definitions/theme_asset_steps.rb +2 -2
  252. data/features/step_definitions/translation_steps.rb +1 -1
  253. data/features/step_definitions/web_steps.rb +1 -1
  254. data/features/support/http.rb +1 -1
  255. data/features/support/locales.rb +5 -0
  256. data/lib/generators/locomotive/install/install_generator.rb +1 -6
  257. data/lib/generators/locomotive/install/templates/carrierwave.rb +4 -4
  258. data/lib/generators/locomotive/install/templates/locomotive.rb +12 -7
  259. data/lib/locomotive.rb +4 -4
  260. data/lib/locomotive/action_controller.rb +1 -0
  261. data/lib/locomotive/action_controller/responder.rb +9 -10
  262. data/lib/locomotive/action_controller/section_helpers.rb +1 -1
  263. data/lib/locomotive/action_controller/ssl.rb +11 -0
  264. data/lib/locomotive/action_controller/url_helpers.rb +9 -5
  265. data/lib/locomotive/carrierwave/asset.rb +6 -6
  266. data/lib/locomotive/configuration.rb +28 -26
  267. data/lib/locomotive/core_ext.rb +1 -2
  268. data/lib/locomotive/custom_fields.rb +12 -6
  269. data/lib/locomotive/dependencies.rb +1 -0
  270. data/lib/locomotive/dragonfly.rb +1 -1
  271. data/lib/locomotive/engine.rb +3 -3
  272. data/lib/locomotive/formtastic.rb +1 -1
  273. data/lib/locomotive/httparty/webservice.rb +1 -1
  274. data/lib/locomotive/kaminari.rb +28 -13
  275. data/lib/locomotive/liquid.rb +1 -0
  276. data/lib/locomotive/liquid/drops/content_entry.rb +1 -1
  277. data/lib/locomotive/liquid/drops/content_types.rb +27 -2
  278. data/lib/locomotive/liquid/drops/page.rb +14 -2
  279. data/lib/locomotive/liquid/drops/proxy_collection.rb +4 -0
  280. data/lib/locomotive/liquid/drops/session_proxy.rb +16 -0
  281. data/lib/locomotive/liquid/drops/site.rb +11 -3
  282. data/lib/locomotive/liquid/drops/uploader.rb +1 -1
  283. data/lib/locomotive/liquid/filters/base.rb +1 -1
  284. data/lib/locomotive/liquid/filters/date.rb +2 -2
  285. data/lib/locomotive/liquid/filters/html.rb +12 -12
  286. data/lib/locomotive/liquid/filters/translate.rb +21 -3
  287. data/lib/locomotive/liquid/tags/consume.rb +50 -19
  288. data/lib/locomotive/liquid/tags/editable/base.rb +9 -9
  289. data/lib/locomotive/liquid/tags/editable/control.rb +1 -1
  290. data/lib/locomotive/liquid/tags/editable/file.rb +1 -1
  291. data/lib/locomotive/liquid/tags/editable/short_text.rb +1 -1
  292. data/lib/locomotive/liquid/tags/fetch_page.rb +28 -0
  293. data/lib/locomotive/liquid/tags/hybrid.rb +25 -0
  294. data/lib/locomotive/liquid/tags/inherited_block.rb +2 -2
  295. data/lib/locomotive/liquid/tags/inline_editor.rb +4 -4
  296. data/lib/locomotive/liquid/tags/javascript.rb +16 -0
  297. data/lib/locomotive/liquid/tags/link_to.rb +42 -0
  298. data/lib/locomotive/liquid/tags/locale_switcher.rb +1 -1
  299. data/lib/locomotive/liquid/tags/nav.rb +2 -2
  300. data/lib/locomotive/liquid/tags/paginate.rb +2 -2
  301. data/lib/locomotive/liquid/tags/session_assign.rb +39 -0
  302. data/lib/locomotive/liquid/tags/snippet.rb +1 -1
  303. data/lib/locomotive/liquid/tags/with_scope.rb +6 -2
  304. data/lib/locomotive/logger.rb +1 -1
  305. data/lib/locomotive/middlewares/cache.rb +1 -1
  306. data/lib/locomotive/middlewares/fonts.rb +1 -1
  307. data/lib/locomotive/middlewares/inline_editor.rb +1 -1
  308. data/lib/locomotive/middlewares/permalink.rb +1 -1
  309. data/lib/locomotive/middlewares/seo_trailing_slash.rb +1 -1
  310. data/lib/locomotive/mongoid/patches.rb +21 -21
  311. data/lib/locomotive/rails/action_view.rb +20 -4
  312. data/lib/locomotive/regexps.rb +1 -1
  313. data/lib/locomotive/render.rb +4 -2
  314. data/lib/locomotive/routing/default_constraint.rb +1 -1
  315. data/lib/locomotive/routing/site_dispatcher.rb +1 -1
  316. data/lib/locomotive/session_store.rb +7 -7
  317. data/lib/locomotive/version.rb +1 -1
  318. data/lib/tasks/development.rake +11 -9
  319. data/lib/tasks/locomotive.rake +11 -11
  320. data/mongodb/migrate/20130204072721_make_editable_elements_consistent.rb +3 -1
  321. data/mongodb/migrate/20130326201349_rename_entry_to_content_entry.rb +6 -6
  322. data/mongodb/migrate/20130511121956_generate_checksum_for_theme_assets.rb +14 -0
  323. data/mongodb/migrate/20130530162559_api_key_for_all_accounts.rb +10 -0
  324. data/spec/cells/locomotive/global_actions_spec.rb +11 -11
  325. data/spec/cells/locomotive/main_menu_cell_spec.rb +9 -9
  326. data/spec/cells/locomotive/settings_menu_cell_spec.rb +11 -11
  327. data/spec/dummy/config/environments/development.rb +1 -1
  328. data/spec/dummy/config/initializers/locomotive.rb +16 -11
  329. data/spec/dummy/config/mongoid.yml +99 -18
  330. data/spec/lib/action_view_spec.rb +19 -0
  331. data/spec/lib/core_ext_spec.rb +2 -2
  332. data/spec/lib/locomotive/configuration_spec.rb +1 -1
  333. data/spec/lib/locomotive/httparty/webservice_spec.rb +6 -6
  334. data/spec/lib/locomotive/liquid/drops/content_entry_spec.rb +1 -1
  335. data/spec/lib/locomotive/liquid/drops/current_user.rb +3 -3
  336. data/spec/lib/locomotive/liquid/drops/page_spec.rb +63 -14
  337. data/spec/lib/locomotive/liquid/drops/site_spec.rb +3 -3
  338. data/spec/lib/locomotive/liquid/filters/html_spec.rb +22 -7
  339. data/spec/lib/locomotive/liquid/filters/resize_spec.rb +3 -3
  340. data/spec/lib/locomotive/liquid/filters/translate_spec.rb +26 -12
  341. data/spec/lib/locomotive/liquid/tags/consume_spec.rb +26 -2
  342. data/spec/lib/locomotive/liquid/tags/csrf_spec.rb +3 -3
  343. data/spec/lib/locomotive/liquid/tags/editable/short_text_spec.rb +1 -1
  344. data/spec/lib/locomotive/liquid/tags/extends_spec.rb +5 -5
  345. data/spec/lib/locomotive/liquid/tags/javascript_spec.rb +18 -0
  346. data/spec/lib/locomotive/liquid/tags/locale_switcher_spec.rb +23 -13
  347. data/spec/lib/locomotive/liquid/tags/nav_spec.rb +11 -11
  348. data/spec/lib/locomotive/liquid/tags/paginate_spec.rb +13 -13
  349. data/spec/lib/locomotive/liquid/tags/seo_spec.rb +8 -8
  350. data/spec/lib/locomotive/liquid/tags/with_scope_spec.rb +8 -2
  351. data/spec/lib/locomotive/presentable_spec.rb +10 -10
  352. data/spec/lib/locomotive/render_spec.rb +14 -14
  353. data/spec/mailers/locomotive/notifications_spec.rb +3 -3
  354. data/spec/models/locomotive/ability_spec.rb +23 -9
  355. data/spec/models/locomotive/account_spec.rb +30 -8
  356. data/spec/models/locomotive/content_asset_spec.rb +1 -1
  357. data/spec/models/locomotive/content_entry_spec.rb +57 -2
  358. data/spec/models/locomotive/content_type_spec.rb +42 -41
  359. data/spec/models/locomotive/editable_control_spec.rb +5 -5
  360. data/spec/models/locomotive/editable_file_spec.rb +21 -5
  361. data/spec/models/locomotive/editable_long_text_spec.rb +3 -3
  362. data/spec/models/locomotive/editable_short_text_spec.rb +8 -8
  363. data/spec/models/locomotive/extensions/page/editable_elements_spec.rb +9 -9
  364. data/spec/models/locomotive/extensions/page/redirect_spec.rb +1 -1
  365. data/spec/models/locomotive/extensions/page/render_spec.rb +4 -8
  366. data/spec/models/locomotive/extensions/site/locales_spec.rb +2 -2
  367. data/spec/models/locomotive/membership_spec.rb +5 -5
  368. data/spec/models/locomotive/page_spec.rb +10 -1
  369. data/spec/models/locomotive/site_spec.rb +19 -19
  370. data/spec/models/locomotive/snippet_spec.rb +9 -9
  371. data/spec/models/locomotive/theme_asset_spec.rb +91 -57
  372. data/spec/requests/admin_ssl_spec.rb +25 -0
  373. data/spec/support/factories.rb +32 -27
  374. data/spec/support/locomotive.rb +2 -0
  375. data/vendor/assets/javascripts/locomotive/backbone.sync.js +1 -1
  376. data/vendor/assets/javascripts/locomotive/tag-it.min.js +16 -0
  377. data/vendor/assets/stylesheets/locomotive/jquery.tagit.css +67 -0
  378. metadata +108 -138
@@ -1,4 +1,4 @@
1
1
  = f.input name,
2
- :label => field.label,
3
- :hint => field.hint,
4
- :wrapper_html => { :class => "#{'highlighted' if highlighted}" }
2
+ label: field.label,
3
+ hint: field.hint,
4
+ wrapper_html: { class: "#{'highlighted' if highlighted}" }
@@ -0,0 +1,4 @@
1
+ = f.input name,
2
+ label: field.label,
3
+ hint: field.hint,
4
+ wrapper_html: { class: "tags #{'highlighted' if highlighted}" }
@@ -1,5 +1,5 @@
1
1
  = f.input field.name.to_sym,
2
- :label => field.label,
3
- :hint => field.hint,
4
- :as => field.text_formatting == 'html' ? :'Locomotive::Rte' : :text,
5
- :input_html => { :class => field.text_formatting }
2
+ label: field.label,
3
+ hint: field.hint,
4
+ as: field.text_formatting == 'html' ? :'Locomotive::Rte' : :text,
5
+ input_html: { class: field.text_formatting }
@@ -5,7 +5,7 @@
5
5
  %p
6
6
  != t('.reset_password_instruction')
7
7
  %p
8
- = link_to t('.change_my_password'), edit_locomotive_account_password_url(:reset_password_token => @resource.reset_password_token)
8
+ = link_to t('.change_my_password'), edit_locomotive_account_password_url(reset_password_token: @resource.reset_password_token)
9
9
  %p
10
10
  != t('.wrong_request_instruction')
11
11
  %p
@@ -4,13 +4,13 @@
4
4
  - title t('.title')
5
5
 
6
6
  - if @step_done.blank?
7
- = semantic_form_for(@account, :url => installation_step_url(1)) do |f|
7
+ = semantic_form_for(@account, url: installation_step_url(1)) do |f|
8
8
  .inner
9
9
  = f.inputs do
10
- = f.input :name, :label => t('.name'), :required => false
11
- = f.input :email, :label => t('.email'), :required => false
12
- = f.input :password, :label => t('.password'), :required => false
13
- = f.input :password_confirmation, :label => t('.password_confirmation'), :required => false
10
+ = f.input :name, label: t('.name'), required: false
11
+ = f.input :email, label: t('.email'), required: false
12
+ = f.input :password, label: t('.password'), required: false
13
+ = f.input :password_confirmation, label: t('.password_confirmation'), required: false
14
14
 
15
15
  .footer
16
16
  = submit_tag t('.next')
@@ -3,21 +3,21 @@
3
3
 
4
4
  - title t('.title')
5
5
 
6
- = semantic_form_for(@site, :url => installation_step_url(2), :html => { :multipart => true }) do |f|
6
+ = semantic_form_for(@site, url: installation_step_url(2), html: { multipart: true }) do |f|
7
7
  .inner
8
8
 
9
9
  %p.explanations
10
10
  != t('.explanations')
11
11
 
12
12
  = f.inputs do
13
- = f.input :name, :required => true
13
+ = f.input :name, required: true
14
14
 
15
15
  - if multi_sites?
16
- = f.input :subdomain, :required => true
16
+ = f.input :subdomain, required: true
17
17
 
18
- %li{ :class => 'select optional', :id => 'default_site_locale' }
19
- %label{ :for => 'default_site_locale_input' }= t('.default_site_locale')
20
- = select_tag 'site[locales][]', options_for_select(options_for_site_locales, @site.default_locale), :id => 'default_site_locale_input'
18
+ %li{ class: 'select optional', id: 'default_site_locale' }
19
+ %label{ for: 'default_site_locale_input' }= t('.default_site_locale')
20
+ = select_tag 'site[locales][]', options_for_select(options_for_site_locales, @site.default_locale), id: 'default_site_locale_input'
21
21
  %p.inline-hints!= t('.default_site_locales_hints')
22
22
 
23
23
  .footer
@@ -0,0 +1,2 @@
1
+ %span.first
2
+ = link_to_unless current_page.first?, raw(t 'locomotive.pagination.first'), url, remote: remote
@@ -0,0 +1,2 @@
1
+ %span.page.gap
2
+ = raw(t 'locomotive.pagination.truncate')
@@ -0,0 +1,2 @@
1
+ %span.last
2
+ = link_to_unless current_page.last?, raw(t 'locomotive.pagination.last'), url, { remote: remote }
@@ -0,0 +1,2 @@
1
+ %span.next
2
+ = link_to_unless current_page.last?, raw(t 'locomotive.pagination.next'), url, rel: 'next', remote: remote
@@ -0,0 +1,2 @@
1
+ %span{class: "page#{' current' if page.current?}"}
2
+ = link_to_unless page.current?, page, url, { remote: remote, rel: page.next? ? 'next' : page.prev? ? 'prev' : nil }
@@ -0,0 +1,11 @@
1
+ = paginator.render do
2
+ %nav.pagination
3
+ = first_page_tag unless current_page.first?
4
+ = prev_page_tag unless current_page.first?
5
+ - each_page do |page|
6
+ - if page.left_outer? || page.right_outer? || page.inside_window?
7
+ = page_tag page
8
+ - elsif !page.was_truncated?
9
+ = gap_tag
10
+ = next_page_tag unless current_page.last?
11
+ = last_page_tag unless current_page.last?
@@ -0,0 +1,2 @@
1
+ %span.prev
2
+ = link_to_unless current_page.first?, raw(t 'locomotive.pagination.previous'), url, rel: 'prev', remote: remote
@@ -1,9 +1,9 @@
1
1
  !!! XML
2
2
  !!!
3
- %html{ :xmlns => 'http://www.w3.org/1999/xhtml' }
3
+ %html{ xmlns: 'http://www.w3.org/1999/xhtml' }
4
4
  %head
5
5
  = render 'locomotive/shared/head'
6
- %body{ :class => sections }
6
+ %body{ class: sections }
7
7
  #wrapper
8
8
  .container
9
9
  #header
@@ -1,15 +1,15 @@
1
1
  !!! XML
2
2
  !!!
3
- %html{ :xmlns => 'http://www.w3.org/1999/xhtml' }
3
+ %html{ xmlns: 'http://www.w3.org/1999/xhtml' }
4
4
  %head
5
5
  %title= escape_once(title || "#{Locomotive.config.name} — #{current_site.name}")
6
6
 
7
7
  = javascript_include_tag 'locomotive/not_logged_in'
8
- = stylesheet_link_tag 'locomotive/not_logged_in', :media => 'screen'
8
+ = stylesheet_link_tag 'locomotive/not_logged_in', media: 'screen'
9
9
 
10
10
  = yield :head
11
11
 
12
- %body{ :class => controller.controller_name }
12
+ %body{ class: controller.controller_name }
13
13
  #wrapper
14
14
  #light
15
15
  #panel.container
@@ -5,10 +5,10 @@
5
5
 
6
6
  %p!= t('.help')
7
7
 
8
- = semantic_form_for @membership, :url => memberships_url do |f|
8
+ = semantic_form_for @membership, url: memberships_url do |f|
9
9
 
10
- = f.inputs :name => :membership_email, :class => 'inputs email' do
10
+ = f.inputs name: :membership_email, class: 'inputs email' do
11
11
 
12
- = f.input :email, :label => false, :wrapper_html => { :class => 'no-label' }
12
+ = f.input :email, label: false, wrapper_html: { class: 'no-label' }
13
13
 
14
- = render 'locomotive/shared/form_actions', :back_url => edit_current_site_url, :button_label => :create
14
+ = render 'locomotive/shared/form_actions', back_url: edit_current_site_url, button_label: :create
@@ -1,31 +1,32 @@
1
- - title link_to(@account.name.blank? ? @account.name_was : @account.name, '#', :rel => 'account_name', :title => t('.ask_for_name'), :class => 'editable')
1
+ - title link_to(@account.name.blank? ? @account.name_was : @account.name, '#', rel: 'account_name', title: t('.ask_for_name'), class: 'editable')
2
2
 
3
3
  - content_for :backbone_view_data do
4
4
  :plain
5
- account: #{j @account.to_json.html_safe}
5
+ account: #{escape_json @account.to_json.html_safe}
6
6
 
7
7
  - content_for :submenu do
8
8
  = render_cell 'locomotive/settings_menu', :show
9
9
 
10
10
  - if multi_sites?
11
11
  - content_for :buttons do
12
- = local_action_button t('.new_site'), new_site_url, :icon => 'icon-plus' if can?(:create, Locomotive::Site)
12
+ = local_action_button t('.new_site'), new_site_url, icon: 'icon-plus' if can?(:create, Locomotive::Site)
13
13
 
14
14
  %p= t('.help')
15
15
 
16
- = semantic_form_for @account, :url => my_account_url do |f|
16
+ = semantic_form_for @account, url: my_account_url do |f|
17
17
 
18
- = f.inputs :name => :information do
18
+ = f.inputs name: :information do
19
19
  = f.input :name
20
- = f.input :locale, :as => '::Locomotive::Locale'
20
+ = f.input :locale, as: '::Locomotive::Locale'
21
21
 
22
- = f.inputs :name => :credentials, :class => "inputs foldable folded" do
22
+ = f.inputs name: :credentials, class: "inputs foldable folded" do
23
23
  = f.input :email
24
- = f.input :password, :input_html => { :autocomplete => 'off' }
25
- = f.input :password_confirmation, :input_html => { :autocomplete => 'off' }
24
+ = f.input :password, input_html: { autocomplete: 'off' }
25
+ = f.input :password_confirmation, input_html: { autocomplete: 'off' }
26
+ = f.input :api_key, as: '::Locomotive::ApiKey', url: regenerate_api_key_my_account_url
26
27
 
27
28
  - if multi_sites?
28
- = f.inputs :name => :sites, :class => "sites inputs foldable" do
29
+ = f.inputs name: :sites, class: "sites inputs foldable" do
29
30
  %li#account_sites_input.input.empty.no-label.last
30
31
  .list
31
32
  - @account.sites.each do |site|
@@ -34,7 +35,7 @@
34
35
  %em= site.domains.join(', ')
35
36
 
36
37
  - if admin_on?(site) && site != current_site
37
- %span{ :class => 'actions' }
38
- = link_to_icon :trash, site_url(site), :class => 'remove', :data => { :confirm => t('locomotive.messages.confirm') }, :method => :delete
38
+ %span{ class: 'actions' }
39
+ = link_to_icon :trash, site_url(site), class: 'remove', data: { confirm: t('locomotive.messages.confirm') }, method: :delete
39
40
 
40
- = render 'locomotive/shared/form_actions', :button_label => :update
41
+ = render 'locomotive/shared/form_actions', button_label: :update
@@ -1,7 +1,7 @@
1
- %p= t('.title', :name => @account.name, :domain => @domain, :date => I18n.l(Time.now), :locale => @account.locale).html_safe
1
+ %p= t('.title', name: @account.name, domain: @domain, date: I18n.l(Time.now), locale: @account.locale).html_safe
2
2
 
3
3
  %p
4
- %b= t('.type', :type => @type.name, :locale => @account.locale)
4
+ %b= t('.type', type: @type.name, locale: @account.locale)
5
5
  %br
6
6
  %i= @type.description
7
7
 
@@ -1,64 +1,64 @@
1
- %script{ :type => 'text/html', :id => 'editable_elements_edit' }
1
+ %script{ type: 'text/html', id: 'editable_elements_edit' }
2
2
 
3
3
  .nav
4
4
  {{#each blocks}}
5
- = link_to '{{name}}', '#block-{{index}}', :class => '{{#unless index}}on{{/unless}}'
5
+ = link_to '{{name}}', '#block-{{index}}', class: '{{#unless index}}on{{/unless}}'
6
6
  {{/each}}
7
7
  .clear
8
8
 
9
9
  .wrapper
10
10
  %ul
11
11
  {{#each blocks}}
12
- %li{ :id => 'block-{{index}}', :class => 'block', :style => 'display: {{#if index}}none{{else}}block{{/if}}' }
12
+ %li{ id: 'block-{{index}}', class: 'block', style: 'display: {{#if index}}none{{else}}block{{/if}}' }
13
13
  %fieldset.inputs
14
14
  %ol
15
15
  {{/each}}
16
16
 
17
- %script{ :type => 'text/html', :id => 'editable_text_input' }
17
+ %script{ type: 'text/html', id: 'editable_text_input' }
18
18
 
19
- %label{ :for => 'page_editable_elements_attributes_{{index}}_content' } {{label}}
19
+ %label{ for: 'page_editable_elements_attributes_{{index}}_content' } {{label}}
20
20
 
21
- = text_area_tag 'page[editable_elements_attributes][{{index}}][content]', '{{content}}', :id => 'page_editable_elements_attributes_{{index}}_content'
21
+ = text_area_tag 'page[editable_elements_attributes][{{index}}][content]', '{{content}}', id: 'page_editable_elements_attributes_{{index}}_content'
22
22
 
23
23
  {{#if hint}}
24
24
  %p.inline-hints {{hint}}
25
25
  {{/if}}
26
26
 
27
- = hidden_field_tag 'page[editable_elements_attributes][{{index}}][id]', '{{id}}', :id => 'page_editable_elements_attributes_{{index}}_id'
27
+ = hidden_field_tag 'page[editable_elements_attributes][{{index}}][id]', '{{id}}', id: 'page_editable_elements_attributes_{{index}}_id'
28
28
 
29
- %script{ :type => 'text/html', :id => 'editable_file_input' }
29
+ %script{ type: 'text/html', id: 'editable_file_input' }
30
30
 
31
- %label{ :for => 'page_editable_elements_attributes_{{index}}_content' } {{label}}
31
+ %label{ for: 'page_editable_elements_attributes_{{index}}_content' } {{label}}
32
32
 
33
33
  %span.file
34
34
  {{#if content}}
35
- = link_to '{{filename}}', '{{content}}', :target => '_blank'
35
+ = link_to '{{filename}}', '{{content}}', target: '_blank'
36
36
 
37
- = file_field_tag 'page[editable_elements_attributes][{{index}}][source]', :id => 'page_editable_elements_attributes_{{index}}_source', :style => 'display: none'
37
+ = file_field_tag 'page[editable_elements_attributes][{{index}}][source]', id: 'page_editable_elements_attributes_{{index}}_source', style: 'display: none'
38
38
 
39
- = link_to t('locomotive.pages.form.change_file'), '#', :class => 'change', :'data-alt-label' => t('locomotive.pages.form.cancel')
40
- = link_to t('locomotive.pages.form.delete_file'), '#', :class => 'delete', :'data-alt-label' => t('locomotive.pages.form.cancel')
39
+ = link_to t('locomotive.pages.form.change_file'), '#', class: 'change', :'data-alt-label' => t('locomotive.pages.form.cancel')
40
+ = link_to t('locomotive.pages.form.delete_file'), '#', class: 'delete', :'data-alt-label' => t('locomotive.pages.form.cancel')
41
41
 
42
- = hidden_field_tag 'page[editable_elements_attributes][{{index}}][remove_source]', '0', :class => 'remove-flag'
42
+ = hidden_field_tag 'page[editable_elements_attributes][{{index}}][remove_source]', '0', class: 'remove-flag'
43
43
 
44
44
  {{else}}
45
- = file_field_tag 'page[editable_elements_attributes][{{index}}][source]', :id => 'page_editable_elements_attributes_{{index}}_source'
45
+ = file_field_tag 'page[editable_elements_attributes][{{index}}][source]', id: 'page_editable_elements_attributes_{{index}}_source'
46
46
  {{/if}}
47
47
 
48
48
  {{#if hint}}
49
49
  %p.inline-hints {{hint}}
50
50
  {{/if}}
51
51
 
52
- = hidden_field_tag 'page[editable_elements_attributes][{{index}}][id]', '{{id}}', :id => 'page_editable_elements_attributes_{{index}}_id'
52
+ = hidden_field_tag 'page[editable_elements_attributes][{{index}}][id]', '{{id}}', id: 'page_editable_elements_attributes_{{index}}_id'
53
53
 
54
- %script{ :type => 'text/html', :id => 'editable_control_input' }
54
+ %script{ type: 'text/html', id: 'editable_control_input' }
55
55
 
56
- %label{ :for => 'page_editable_elements_attributes_{{index}}_content' } {{label}}
56
+ %label{ for: 'page_editable_elements_attributes_{{index}}_content' } {{label}}
57
57
 
58
- = select_tag 'page[editable_elements_attributes][{{index}}][content]', raw('{{#each options}}<option value="{{this.value}}" {{#if this.selected}}selected="selected"{{/if}}>{{this.text}}</option>{{/each}}'), :id => 'page_editable_elements_attributes_{{index}}_content', :class => 'content'
58
+ = select_tag 'page[editable_elements_attributes][{{index}}][content]', raw('{{#each options}}<option value="{{this.value}}" {{#if this.selected}}selected="selected"{{/if}}>{{this.text}}</option>{{/each}}'), id: 'page_editable_elements_attributes_{{index}}_content', class: 'content'
59
59
 
60
60
  {{#if hint}}
61
61
  %p.inline-hints {{hint}}
62
62
  {{/if}}
63
63
 
64
- = hidden_field_tag 'page[editable_elements_attributes][{{index}}][id]', '{{id}}', :id => 'page_editable_elements_attributes_{{index}}_id'
64
+ = hidden_field_tag 'page[editable_elements_attributes][{{index}}][id]', '{{id}}', id: 'page_editable_elements_attributes_{{index}}_id'
@@ -5,24 +5,18 @@
5
5
 
6
6
  - content_for :backbone_view_data do
7
7
  :plain
8
- page: #{j to_json(@page)}
8
+ page: #{escape_json to_json(@page)}
9
9
 
10
- - if can?(:manage, @page)
10
+ = f.inputs name: :information do
11
11
 
12
- = f.inputs :name => :information do
12
+ = f.input :title, wrapper_html: { class: 'highlighted' }
13
13
 
14
- = f.input :title, :wrapper_html => { :class => 'highlighted' }
14
+ - if not @page.index? and not @page.not_found?
15
+ = f.input :parent_id, as: :select, collection: parent_pages_options, include_blank: false
15
16
 
16
- - if not @page.index? and not @page.not_found?
17
- = f.input :parent_id, :as => :select, :collection => parent_pages_options, :include_blank => false
17
+ = f.input :slug, required: false, hint: @page.slug.blank? ? t('.empty_slug') : public_page_url(@page, locale: current_content_locale), input_html: { :'data-url' => get_path_pages_url, disabled: @page.index? || @page.not_found? }, wrapper_html: { style: "#{'display: none' if @page.templatized? && !@page.templatized_from_parent?};", class: 'em-inline-hints' }
18
18
 
19
- = f.input :slug, :required => false, :hint => @page.slug.blank? ? t('.empty_slug') : public_page_url(@page), :input_html => { :'data-url' => get_path_pages_url, :disabled => @page.index? || @page.not_found? }, :wrapper_html => { :style => "#{'display: none' if @page.templatized? && !@page.templatized_from_parent?};", :class => 'em-inline-hints' }
20
-
21
- - else
22
- = f.inputs :name => :information, :style => 'display: none' do
23
- = f.text_field :title
24
-
25
- = f.inputs :name => :seo, :class => "inputs foldable #{'folded' if inputs_folded?(@page)}" do
19
+ = f.inputs name: :seo, class: "inputs foldable #{'folded' if inputs_folded?(@page)}" do
26
20
 
27
21
  = f.input :seo_title
28
22
 
@@ -30,32 +24,34 @@
30
24
 
31
25
  = f.input :meta_description
32
26
 
33
- - if can?(:manage, @page)
34
-
35
- = f.inputs :name => :advanced_options, :id => 'advanced-options', :class => "inputs foldable #{'folded' if inputs_folded?(@page)}" do
27
+ = f.inputs name: :advanced_options, id: 'advanced-options', class: "inputs foldable #{'folded' if inputs_folded?(@page)}" do
36
28
 
29
+ - if can?(:customize, @page)
37
30
  = f.input :handle
38
31
 
39
- = f.input :response_type, :as => :select, :collection => options_for_page_response_type, :include_blank => false
32
+ = f.input :response_type, as: :select, collection: options_for_page_response_type, include_blank: false
33
+
34
+ = f.input :templatized, as: :'Locomotive::Toggle', style: "#{'display: none' if @page.redirect? || @page.templatized_from_parent?}"
40
35
 
41
- = f.input :templatized, :as => :'Locomotive::Toggle', :style => "#{'display: none' if @page.redirect? || @page.templatized_from_parent?}"
36
+ = f.input :target_klass_name, as: :select, collection: options_for_target_klass_name, include_blank: false, wrapper_html: { style: "#{'display: none' if !@page.templatized? || @page.templatized_from_parent?}" }
42
37
 
43
- = f.input :target_klass_name, :as => :select, :collection => options_for_target_klass_name, :include_blank => false, :wrapper_html => { :style => "#{'display: none' if !@page.templatized? || @page.templatized_from_parent?}" }
38
+ = f.input :published, as: :'Locomotive::Toggle'
44
39
 
45
- = f.input :published, :as => :'Locomotive::Toggle'
40
+ = f.input :listed, as: :'Locomotive::Toggle'
46
41
 
47
- = f.input :listed, :as => :'Locomotive::Toggle'
42
+ = f.input :redirect, as: :'Locomotive::Toggle', wrapper_html: { style: "#{'display: none' if @page.templatized? || !@page.default_response_type?}" }
48
43
 
49
- = f.input :redirect, :as => :'Locomotive::Toggle', :wrapper_html => { :style => "#{'display: none' if @page.templatized? || !@page.default_response_type?}" }
44
+ = f.input :redirect_url, required: true, wrapper_html: { style: "#{'display: none' unless @page.redirect?}" }
50
45
 
51
- = f.input :redirect_url, :required => true, :wrapper_html => { :style => "#{'display: none' unless @page.redirect?}" }
46
+ = f.input :redirect_type, as: :select, collection: options_for_page_redirect_type, include_blank: false, wrapper_html: { style: "#{'display: none' unless @page.redirect?}" }
52
47
 
53
- = f.input :redirect_type, :as => :select, :collection => options_for_page_redirect_type, :include_blank => false, :wrapper_html => { :style => "#{'display: none' unless @page.redirect?}" }
48
+ - if can?(:customize, @page)
54
49
 
55
- = f.input :cache_strategy, :as => :select, :collection => options_for_page_cache_strategy, :include_blank => false, :wrapper_html => { :style => "#{'display: none' if @page.redirect?}" }
50
+ = f.input :cache_strategy, as: :select, collection: options_for_page_cache_strategy, include_blank: false, wrapper_html: { style: "#{'display: none' if @page.redirect?}" }
56
51
 
57
- = f.inputs :name => :raw_template, :class => "inputs foldable #{'folded' if inputs_folded?(@page)}" do
52
+ - if can?(:customize, @page)
53
+ = f.inputs name: :raw_template, class: "inputs foldable #{'folded' if inputs_folded?(@page)}" do
58
54
 
59
- = f.input :raw_template, :as => :'Locomotive::Code', :main_locale_template_url => page_main_template_path(@page)
55
+ = f.input :raw_template, as: :'Locomotive::Code', main_locale_template_url: page_main_template_path(@page)
60
56
 
61
57
 
@@ -1,7 +1,7 @@
1
1
  - if page.not_found?
2
2
  %li.sep &nbsp;
3
3
 
4
- %li{ :id => "item-#{page.id}", :class => "page #{css_for_page(page)}" }
4
+ %li{ id: "item-#{page.id}", class: "page #{css_for_page(page)}" }
5
5
 
6
6
  - children = can?(:manage, page) ? page.children : page.children.find_all { |p| !p.templatized? }
7
7
 
@@ -15,7 +15,7 @@
15
15
  - unless page.index_or_not_found?
16
16
  %em
17
17
 
18
- = link_to truncate(page.title, :length => 80), edit_page_url(page)
18
+ = link_to truncate(page.title, length: 80), edit_page_url(page)
19
19
 
20
20
  - if page.templatized?
21
21
  %i.icon-cog
@@ -31,12 +31,12 @@
31
31
 
32
32
  .more
33
33
  %span!= t('.updated_at')
34
- = l page.updated_at, :format => :short
34
+ = l page.updated_at, format: :short
35
35
 
36
- - if !page.index_or_not_found? && can?(:manage, page)
37
- = link_to_icon :trash, page_url(page), :class => 'remove', :data => { :confirm => t('locomotive.messages.confirm') }, :method => :delete
36
+ - if !page.index_or_not_found? && can?(:destroy, page)
37
+ = link_to_icon :trash, page_url(page), class: 'remove', data: { confirm: t('locomotive.messages.confirm') }, method: :delete
38
38
 
39
39
  - if with_children
40
- %ul{ :id => "folder-#{page._id}", :class => "page folder depth-#{(page.depth || 0) + 1}", :'data-url' => sort_page_url(page), :style => "display: #{cookies["folder-#{page._id}"] || 'block'}" }
40
+ %ul{ id: "folder-#{page._id}", class: "page folder depth-#{(page.depth || 0) + 1}", :'data-url' => sort_page_url(page), style: "display: #{cookies["folder-#{page._id}"] || 'block'}" }
41
41
 
42
42
  = render children
@@ -1,4 +1,4 @@
1
- - title link_to(@page.title.blank? ? @page.title_was : @page.title, '#', :rel => 'page_title', :title => t('.ask_for_title'), :class => 'editable')
1
+ - title link_to(@page.title.blank? ? @page.title_was : @page.title, '#', rel: 'page_title', title: t('.ask_for_title'), class: 'editable')
2
2
 
3
3
  - content_for :submenu do
4
4
  = render 'locomotive/shared/menu/contents'
@@ -7,12 +7,12 @@
7
7
  = render 'locomotive/shared/actions/contents'
8
8
 
9
9
  - content_for :buttons do
10
- = local_action_button :show, "/#{current_site.localized_page_fullpath(@page, ::Mongoid::Fields::I18n.locale)}", :icon => 'icon-eye-open'
10
+ = local_action_button :show, "/#{current_site.localized_page_fullpath(@page, current_content_locale)}", class: 'show', icon: 'icon-eye-open'
11
11
 
12
12
  %p!= t('.help')
13
13
 
14
- = semantic_form_for @page, :url => page_url(@page), :html => { :multipart => true } do |form|
14
+ = semantic_form_for @page, url: page_url(@page), html: { multipart: true } do |form|
15
15
 
16
- = render 'form', :f => form
16
+ = render 'form', f: form
17
17
 
18
- = render 'locomotive/shared/form_actions', :back_url => pages_url, :button_label => :update
18
+ = render 'locomotive/shared/form_actions', back_url: pages_url, button_label: :update