trusty-cms 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (380) hide show
  1. data/.gitignore +4 -1
  2. data/CHANGELOG.md +1 -1
  3. data/Gemfile +12 -8
  4. data/Gemfile.lock +141 -82
  5. data/LICENSE.md +1 -1
  6. data/README.md +48 -5
  7. data/Vagrantfile +122 -0
  8. data/{public → app/assets}/images/admin/add_tab.png +0 -0
  9. data/app/assets/images/admin/animated-overlay.gif +0 -0
  10. data/{public → app/assets}/images/admin/avatar_32x32.png +0 -0
  11. data/{public → app/assets}/images/admin/avatar_64x64.png +0 -0
  12. data/{public → app/assets}/images/admin/avatar_96x96.png +0 -0
  13. data/{public → app/assets}/images/admin/brown_bottom_line.gif +0 -0
  14. data/{public → app/assets}/images/admin/calendar_down.gif +0 -0
  15. data/{public → app/assets}/images/admin/collapse.png +0 -0
  16. data/{public/images/admin/expand.png → app/assets/images/admin/collapsed.png} +0 -0
  17. data/{public → app/assets}/images/admin/draft_page.png +0 -0
  18. data/{public → app/assets}/images/admin/image.png +0 -0
  19. data/{public → app/assets}/images/admin/javascript.png +0 -0
  20. data/{public → app/assets}/images/admin/layout.png +0 -0
  21. data/{public → app/assets}/images/admin/metadata_toggle.png +0 -0
  22. data/{public → app/assets}/images/admin/minus.png +0 -0
  23. data/{public → app/assets}/images/admin/minus_disabled.png +0 -0
  24. data/{public → app/assets}/images/admin/minus_grey.png +0 -0
  25. data/{public → app/assets}/images/admin/navigation_secondary_separator.gif +0 -0
  26. data/{public → app/assets}/images/admin/page.png +0 -0
  27. data/{public → app/assets}/images/admin/plus.png +0 -0
  28. data/{public → app/assets}/images/admin/plus_disabled.png +0 -0
  29. data/{public → app/assets}/images/admin/plus_grey.png +0 -0
  30. data/{public → app/assets}/images/admin/popup_border_background.png +0 -0
  31. data/{public → app/assets}/images/admin/popup_border_bottom_left.png +0 -0
  32. data/{public → app/assets}/images/admin/popup_border_bottom_right.png +0 -0
  33. data/{public → app/assets}/images/admin/popup_border_top_left.png +0 -0
  34. data/{public → app/assets}/images/admin/popup_border_top_right.png +0 -0
  35. data/{public → app/assets}/images/admin/search.png +0 -0
  36. data/{public → app/assets}/images/admin/single_form_shadow.png +0 -0
  37. data/{public → app/assets}/images/admin/snippet.png +0 -0
  38. data/{public → app/assets}/images/admin/spinner.gif +0 -0
  39. data/{public → app/assets}/images/admin/status_background.png +0 -0
  40. data/{public → app/assets}/images/admin/status_bottom_left.png +0 -0
  41. data/{public → app/assets}/images/admin/status_bottom_right.png +0 -0
  42. data/{public → app/assets}/images/admin/status_spinner.gif +0 -0
  43. data/{public → app/assets}/images/admin/status_top_left.png +0 -0
  44. data/{public → app/assets}/images/admin/status_top_right.png +0 -0
  45. data/{public → app/assets}/images/admin/stylesheet.png +0 -0
  46. data/{public → app/assets}/images/admin/tab_close.png +0 -0
  47. data/app/assets/images/admin/ui-bg_flat_75_ffffff_40x100.png +0 -0
  48. data/app/assets/images/admin/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  49. data/app/assets/images/admin/ui-bg_glass_65_ffffff_1x400.png +0 -0
  50. data/app/assets/images/admin/ui-bg_glass_75_dadada_1x400.png +0 -0
  51. data/app/assets/images/admin/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  52. data/app/assets/images/admin/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  53. data/app/assets/images/admin/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  54. data/app/assets/images/admin/ui-icons_222222_256x240.png +0 -0
  55. data/app/assets/images/admin/ui-icons_2e83ff_256x240.png +0 -0
  56. data/app/assets/images/admin/ui-icons_454545_256x240.png +0 -0
  57. data/app/assets/images/admin/ui-icons_888888_256x240.png +0 -0
  58. data/app/assets/images/admin/ui-icons_cd0a0a_256x240.png +0 -0
  59. data/{public → app/assets}/images/admin/upload.png +0 -0
  60. data/{public → app/assets}/images/admin/virtual_page.png +0 -0
  61. data/{public → app/assets}/images/radiant/radiant-badge-color.png +0 -0
  62. data/app/assets/javascripts/admin.js +35 -0
  63. data/app/assets/javascripts/admin/autopopulate-breadcrumb.js +35 -0
  64. data/{public → app/assets}/javascripts/admin/cookie.js +13 -13
  65. data/app/assets/javascripts/admin/datecheck.js +7 -0
  66. data/app/assets/javascripts/admin/dropdown.js +26 -0
  67. data/app/assets/javascripts/admin/jquery-ui.js +2371 -0
  68. data/app/assets/javascripts/admin/jquery.treetable.js +629 -0
  69. data/app/assets/javascripts/admin/jquery.validate.min.js +4 -0
  70. data/app/assets/javascripts/admin/modernizr.js +409 -0
  71. data/app/assets/javascripts/admin/more-or-less.js +38 -0
  72. data/app/assets/javascripts/admin/page-edit.js +51 -0
  73. data/app/assets/javascripts/admin/pagefield.js +35 -0
  74. data/app/assets/javascripts/admin/persist.min.js +31 -0
  75. data/app/assets/javascripts/admin/popup.js +40 -0
  76. data/app/assets/javascripts/admin/preview.js +40 -0
  77. data/app/assets/javascripts/admin/tabcontrol.js.erb +81 -0
  78. data/app/assets/javascripts/admin/tags.js +41 -0
  79. data/app/assets/javascripts/admin/treetable.js +50 -0
  80. data/app/assets/javascripts/admin/utilities.js +5 -0
  81. data/app/assets/javascripts/admin/validation.js +7 -0
  82. data/app/assets/javascripts/admin/validations/user_validations.js +21 -0
  83. data/app/assets/javascripts/ckeditor/config.js +10 -0
  84. data/{config/initializers/configuration_extensions.rb → app/assets/javascripts/ckeditor/contents.css} +0 -0
  85. data/app/assets/javascripts/notes.md +40 -0
  86. data/app/assets/stylesheets/admin/_base.scss +17 -0
  87. data/app/assets/stylesheets/admin/main.scss +34 -0
  88. data/app/assets/stylesheets/admin/modules/_boxes.scss +7 -0
  89. data/app/assets/stylesheets/admin/modules/_gradients.scss +5 -0
  90. data/app/assets/stylesheets/admin/modules/_links.scss +24 -0
  91. data/app/assets/stylesheets/admin/partials/_actions.scss +118 -0
  92. data/app/assets/stylesheets/admin/partials/_avatars.scss +12 -0
  93. data/app/assets/stylesheets/admin/partials/_content.scss +74 -0
  94. data/app/assets/stylesheets/admin/partials/_dateinput.scss +71 -0
  95. data/app/assets/stylesheets/admin/partials/_deprecated.scss +65 -0
  96. data/app/assets/stylesheets/admin/partials/_dropdown.scss +34 -0
  97. data/app/assets/stylesheets/admin/partials/_footer.scss +14 -0
  98. data/app/assets/stylesheets/admin/partials/_forms.scss +419 -0
  99. data/app/assets/stylesheets/admin/partials/_header.scss +135 -0
  100. data/app/assets/stylesheets/admin/partials/_index.scss +198 -0
  101. data/app/assets/stylesheets/admin/partials/_jquery-ui-structure.scss +258 -0
  102. data/app/assets/stylesheets/admin/partials/_jquery-ui-theme.scss +410 -0
  103. data/app/assets/stylesheets/admin/partials/_jquery-ui.scss +650 -0
  104. data/app/assets/stylesheets/admin/partials/_layout.scss +14 -0
  105. data/app/assets/stylesheets/admin/partials/_messages.scss +13 -0
  106. data/app/assets/stylesheets/admin/partials/_popup.scss +263 -0
  107. data/app/assets/stylesheets/admin/partials/_tabcontrol.scss +94 -0
  108. data/app/assets/stylesheets/admin/partials/_toolbar.scss +40 -0
  109. data/app/assets/stylesheets/admin/partials/_treetable.scss +120 -0
  110. data/app/assets/stylesheets/admin/partials/_typography.scss +77 -0
  111. data/app/assets/stylesheets/admin/partials/_validations.scss +22 -0
  112. data/app/controllers/admin/configuration_controller.rb +9 -9
  113. data/app/controllers/admin/extensions_controller.rb +1 -1
  114. data/app/controllers/admin/page_parts_controller.rb +1 -1
  115. data/app/controllers/admin/pages_controller.rb +8 -5
  116. data/app/controllers/admin/preferences_controller.rb +8 -25
  117. data/app/controllers/admin/resource_controller.rb +19 -20
  118. data/app/controllers/admin/users_controller.rb +7 -7
  119. data/app/controllers/admin/welcome_controller.rb +9 -9
  120. data/app/controllers/application_controller.rb +13 -24
  121. data/app/controllers/site_controller.rb +2 -1
  122. data/app/helpers/admin/configuration_helper.rb +20 -19
  123. data/app/helpers/admin/extensions_helper.rb +1 -1
  124. data/app/helpers/admin/layouts_helper.rb +1 -19
  125. data/app/helpers/admin/node_helper.rb +21 -7
  126. data/app/helpers/admin/pages_helper.rb +4 -92
  127. data/app/helpers/admin/preferences_helper.rb +1 -1
  128. data/app/helpers/admin/regions_helper.rb +5 -4
  129. data/app/helpers/application_helper.rb +62 -64
  130. data/app/models/deprecated_tags.rb +1 -21
  131. data/app/models/file_not_found_page.rb +8 -8
  132. data/app/models/layout.rb +3 -2
  133. data/app/models/menu_renderer.rb +7 -7
  134. data/app/models/page.rb +8 -7
  135. data/app/models/page_context.rb +10 -10
  136. data/app/models/page_field.rb +1 -0
  137. data/app/models/page_part.rb +5 -5
  138. data/app/models/standard_tags.rb +95 -75
  139. data/app/models/status.rb +8 -8
  140. data/app/models/text_filter.rb +5 -5
  141. data/app/models/trusty_cms/config.rb +36 -42
  142. data/app/models/trusty_cms/page_response_cache_director.rb +2 -1
  143. data/app/models/user.rb +1 -10
  144. data/app/models/user_action_observer.rb +5 -5
  145. data/app/views/admin/configuration/edit.html.haml +5 -5
  146. data/app/views/admin/configuration/show.html.haml +11 -11
  147. data/app/views/admin/extensions/index.html.haml +4 -4
  148. data/app/views/admin/layouts/_form.html.haml +6 -7
  149. data/app/views/admin/layouts/_popups.html.haml +4 -0
  150. data/app/views/admin/layouts/edit.html.haml +4 -2
  151. data/app/views/admin/layouts/new.html.haml +1 -1
  152. data/app/views/admin/layouts/remove.html.haml +3 -3
  153. data/app/views/admin/page_fields/_page_field.html.haml +3 -2
  154. data/app/views/admin/page_parts/_page_part.html.haml +4 -5
  155. data/app/views/admin/pages/_fields.html.haml +2 -3
  156. data/app/views/admin/pages/_meta_row.html.haml +2 -2
  157. data/app/views/admin/pages/_node.html.haml +4 -9
  158. data/app/views/admin/pages/_popups.html.haml +9 -5
  159. data/app/views/admin/pages/children.html.haml +5 -1
  160. data/app/views/admin/pages/edit.html.haml +1 -3
  161. data/app/views/admin/pages/index.html.haml +2 -2
  162. data/app/views/admin/pages/new.html.haml +2 -4
  163. data/app/views/admin/pages/remove.html.haml +8 -7
  164. data/app/views/admin/preferences/edit.html.haml +14 -14
  165. data/app/views/admin/references/_tag_reference.haml +1 -1
  166. data/app/views/admin/references/filters.haml +1 -1
  167. data/app/views/admin/references/tags.haml +9 -27
  168. data/app/views/admin/users/_avatar.html.haml +2 -2
  169. data/app/views/admin/users/_form.html.haml +16 -16
  170. data/app/views/admin/users/_password_fields.html.haml +3 -3
  171. data/app/views/admin/users/edit.html.haml +1 -1
  172. data/app/views/admin/users/new.html.haml +2 -2
  173. data/app/views/admin/users/remove.html.haml +4 -4
  174. data/app/views/admin/welcome/login.html.haml +6 -6
  175. data/app/views/layouts/application.html.haml +22 -11
  176. data/app/views/site/not_found.html.haml +1 -1
  177. data/app/views/site/show_page.html.haml +1 -0
  178. data/bin/ci/before_script +0 -5
  179. data/config.ru +4 -0
  180. data/config/application.rb +118 -108
  181. data/config/boot.rb +1 -1
  182. data/config/database.mysql.yml +3 -6
  183. data/config/environments/development.rb +17 -5
  184. data/config/environments/production.rb +20 -3
  185. data/config/environments/test.rb +17 -0
  186. data/config/initializers/active_record_extensions.rb +1 -1
  187. data/config/initializers/haml.rb +1 -1
  188. data/config/initializers/rails_patch.rb +1 -1
  189. data/config/initializers/secret_token.rb +7 -0
  190. data/config/initializers/string_extensions.rb +1 -1
  191. data/config/initializers/symbol_extensions.rb +1 -1
  192. data/config/initializers/{radiant_config.rb → trusty_cms_config.rb} +2 -2
  193. data/config/locales/en.yml +33 -33
  194. data/config/locales/en_available_tags.yml +62 -62
  195. data/config/routes.rb +18 -10
  196. data/db/migrate/001_create_radiant_tables.rb +3 -3
  197. data/db/migrate/002_insert_initial_data.rb +2 -2
  198. data/db/migrate/005_add_virtual_column_to_page.rb +1 -1
  199. data/db/migrate/006_integer_columns_to_boolean.rb +9 -9
  200. data/db/migrate/007_remove_virtual_column_from_page.rb +1 -1
  201. data/db/migrate/008_add_virtual_column_to_page_again.rb +1 -1
  202. data/db/migrate/010_merge_behaviors_and_pages.rb +6 -6
  203. data/db/migrate/014_rename_config_default_parts_key.rb +3 -3
  204. data/db/migrate/015_add_optimistic_locking.rb +2 -2
  205. data/db/migrate/020_add_session_info_to_users.rb +1 -1
  206. data/db/migrate/20081203140407_add_indexes.rb +2 -2
  207. data/db/migrate/20090226140109_add_user_language.rb +2 -2
  208. data/db/migrate/20100805155020_convert_page_metas.rb +1 -1
  209. data/db/migrate/20110902203823_add_allowed_children_cache_to_pages.rb +1 -1
  210. data/db/migrate/20111016150725_extend_page_part_content_limit.rb +1 -1
  211. data/db/migrate/20120209231801_change_pages_allowed_children_cache_to_text.rb +3 -4
  212. data/db/schema.rb +0 -6
  213. data/lib/active_record_extensions/active_record_extensions.rb +3 -3
  214. data/lib/annotatable.rb +3 -3
  215. data/lib/configuration_extensions/configuration_extensions.rb +7 -42
  216. data/lib/generators/extension/extension_generator.rb +11 -11
  217. data/lib/generators/extension/templates/README.md +1 -1
  218. data/lib/generators/extension/templates/cucumber.yml +1 -1
  219. data/lib/generators/extension/templates/cucumber_env.rb +2 -2
  220. data/lib/generators/extension/templates/cucumber_paths.rb +7 -7
  221. data/lib/generators/extension/templates/en.yml +1 -1
  222. data/lib/generators/extension/templates/functional_test.rb +3 -3
  223. data/lib/generators/extension/templates/migration.rb +4 -4
  224. data/lib/generators/extension/templates/routes.rb +1 -1
  225. data/lib/generators/extension/templates/spec_helper.rb +1 -1
  226. data/lib/generators/extension/templates/tasks.rake +5 -5
  227. data/lib/generators/extension/templates/test_helper.rb +5 -5
  228. data/lib/generators/extension_controller/extension_controller_generator.rb +11 -11
  229. data/lib/generators/extension_controller/templates/helper.rb +1 -1
  230. data/lib/generators/extension_controller/templates/helper_spec.rb +2 -2
  231. data/lib/generators/extension_controller/templates/view.html.erb +1 -1
  232. data/lib/generators/extension_controller/templates/view_spec.rb +1 -1
  233. data/lib/generators/extension_mailer/extension_mailer_generator.rb +10 -10
  234. data/lib/generators/extension_mailer/templates/mailer.rb +2 -2
  235. data/lib/generators/extension_migration/extension_migration_generator.rb +5 -5
  236. data/lib/generators/extension_model/extension_model_generator.rb +10 -10
  237. data/lib/generators/generator_base_extension.rb +1 -1
  238. data/lib/generators/instance/instance_generator.rb +14 -14
  239. data/lib/generators/instance/templates/databases/db2.yml +3 -3
  240. data/lib/generators/instance/templates/databases/mysql.yml +2 -2
  241. data/lib/generators/instance/templates/instance_boot.rb +4 -4
  242. data/lib/generators/instance/templates/instance_environment.rb +13 -3
  243. data/lib/generators/instance/templates/instance_radiant_config.rb +2 -2
  244. data/lib/generators/language_extension/language_extension_generator.rb +14 -14
  245. data/lib/generators/language_extension/templates/available_tags.yml +91 -91
  246. data/lib/generators/language_extension/templates/cucumber.yml +1 -1
  247. data/lib/generators/language_extension/templates/cucumber_env.rb +3 -3
  248. data/lib/generators/language_extension/templates/cucumber_paths.rb +4 -4
  249. data/lib/generators/language_extension/templates/extension.rb +1 -1
  250. data/lib/generators/language_extension/templates/functional_test.rb +3 -3
  251. data/lib/generators/language_extension/templates/lang.yml +39 -39
  252. data/lib/generators/language_extension/templates/spec_helper.rb +1 -1
  253. data/lib/generators/language_extension/templates/tasks.rake +3 -3
  254. data/lib/generators/language_extension/templates/test_helper.rb +5 -5
  255. data/lib/inheritable_class_attributes.rb +11 -11
  256. data/lib/local_time.rb +2 -2
  257. data/lib/login_system.rb +5 -6
  258. data/lib/method_observer.rb +9 -9
  259. data/lib/simpleton.rb +7 -7
  260. data/lib/string_extensions/string_extensions.rb +5 -5
  261. data/lib/symbol_extensions/symbol_extensions.rb +1 -1
  262. data/lib/tasks/database.rake +17 -20
  263. data/lib/tasks/extensions.rake +2 -2
  264. data/lib/tasks/framework.rake +13 -13
  265. data/lib/tasks/instance.rake +1 -1
  266. data/lib/tasks/radiant_config.rake +3 -3
  267. data/lib/tasks/translate.rake +10 -10
  268. data/lib/tasks/undefine.rake +1 -5
  269. data/lib/translation_support.rb +7 -7
  270. data/lib/trusty_cms.rb +1 -1
  271. data/lib/trusty_cms/admin_ui.rb +34 -34
  272. data/lib/trusty_cms/admin_ui/region_partials.rb +3 -3
  273. data/lib/trusty_cms/admin_ui/region_set.rb +5 -5
  274. data/lib/trusty_cms/available_locales.rb +1 -1
  275. data/lib/trusty_cms/config/definition.rb +21 -21
  276. data/lib/trusty_cms/engine.rb +4 -7
  277. data/lib/trusty_cms/extension.rb +15 -15
  278. data/lib/trusty_cms/extension/script.rb +7 -7
  279. data/lib/trusty_cms/extension_loader.rb +23 -11
  280. data/lib/trusty_cms/extension_migrator.rb +9 -9
  281. data/lib/trusty_cms/extension_path.rb +23 -23
  282. data/lib/trusty_cms/initializer.rb +33 -15
  283. data/lib/trusty_cms/pagination/link_renderer.rb +3 -3
  284. data/lib/trusty_cms/resource_responses.rb +15 -15
  285. data/lib/trusty_cms/setup.rb +35 -33
  286. data/lib/trusty_cms/taggable.rb +18 -18
  287. data/public/404.html +1 -1
  288. data/public/500.html +1 -1
  289. data/public/loading-iframe.html +1 -1
  290. data/public/robots.txt +1 -1
  291. data/script/rails +0 -0
  292. data/spec/features/admin_login_spec.rb +92 -0
  293. data/spec/features/config_spec.rb +34 -0
  294. data/spec/features/javascript_smoke_spec.rb +59 -0
  295. data/spec/features/layouts_spec.rb +49 -0
  296. data/spec/features/pages_spec.rb +55 -0
  297. data/spec/fixtures/users.yml +16 -0
  298. data/spec/helpers/regions_helper_spec.rb +16 -0
  299. data/spec/rails_helper.rb +74 -0
  300. data/spec/spec_helper.rb +78 -0
  301. data/spec/support/custom_actions.rb +9 -0
  302. data/trusty_cms.gemspec +22 -25
  303. metadata +393 -242
  304. checksums.yaml +0 -15
  305. data/config/compass.config +0 -15
  306. data/config/database.db2.yml +0 -20
  307. data/config/database.postgresql.yml +0 -25
  308. data/config/database.sqlite.yml +0 -16
  309. data/config/database.sqlserver.yml +0 -20
  310. data/config/initializers/object_extensions.rb +0 -1
  311. data/config/preinitializer.rb +0 -18
  312. data/lib/object_extensions/object_extensions.rb +0 -5
  313. data/lib/tasks/prototype.rake +0 -31
  314. data/lib/tasks/release.rake +0 -131
  315. data/lib/trusty_cms/cache.rb +0 -100
  316. data/public/javascripts/admin/application.js +0 -94
  317. data/public/javascripts/admin/codearea.js +0 -165
  318. data/public/javascripts/admin/controls.js +0 -965
  319. data/public/javascripts/admin/dateinput.js +0 -402
  320. data/public/javascripts/admin/dragdrop.js +0 -974
  321. data/public/javascripts/admin/dropdown.js +0 -216
  322. data/public/javascripts/admin/effects.js +0 -1122
  323. data/public/javascripts/admin/lowpro.js +0 -340
  324. data/public/javascripts/admin/overrides.js +0 -1
  325. data/public/javascripts/admin/page_preview.js +0 -41
  326. data/public/javascripts/admin/pagefield.js +0 -54
  327. data/public/javascripts/admin/pagestatus.js +0 -17
  328. data/public/javascripts/admin/popup.js +0 -339
  329. data/public/javascripts/admin/prototype.js +0 -4874
  330. data/public/javascripts/admin/ruledtable.js +0 -13
  331. data/public/javascripts/admin/shortcuts.js +0 -33
  332. data/public/javascripts/admin/sitemap.js +0 -149
  333. data/public/javascripts/admin/status.js +0 -233
  334. data/public/javascripts/admin/tabcontrol.js +0 -123
  335. data/public/javascripts/admin/toggle.js +0 -430
  336. data/public/javascripts/admin/utility.js +0 -53
  337. data/public/javascripts/admin/validationerror.js +0 -18
  338. data/public/stylesheets/sass/admin/_base.sass +0 -18
  339. data/public/stylesheets/sass/admin/main.sass +0 -27
  340. data/public/stylesheets/sass/admin/modules/_boxes.sass +0 -6
  341. data/public/stylesheets/sass/admin/modules/_gradients.sass +0 -4
  342. data/public/stylesheets/sass/admin/modules/_links.sass +0 -18
  343. data/public/stylesheets/sass/admin/overrides.sass +0 -2
  344. data/public/stylesheets/sass/admin/partials/_actions.sass +0 -96
  345. data/public/stylesheets/sass/admin/partials/_avatars.sass +0 -10
  346. data/public/stylesheets/sass/admin/partials/_content.sass +0 -58
  347. data/public/stylesheets/sass/admin/partials/_dateinput.sass +0 -62
  348. data/public/stylesheets/sass/admin/partials/_deprecated.sass +0 -55
  349. data/public/stylesheets/sass/admin/partials/_dropdown.sass +0 -28
  350. data/public/stylesheets/sass/admin/partials/_footer.sass +0 -12
  351. data/public/stylesheets/sass/admin/partials/_forms.sass +0 -322
  352. data/public/stylesheets/sass/admin/partials/_header.sass +0 -114
  353. data/public/stylesheets/sass/admin/partials/_index.sass +0 -147
  354. data/public/stylesheets/sass/admin/partials/_layout.sass +0 -10
  355. data/public/stylesheets/sass/admin/partials/_messages.sass +0 -10
  356. data/public/stylesheets/sass/admin/partials/_popup.sass +0 -213
  357. data/public/stylesheets/sass/admin/partials/_tabcontrol.sass +0 -72
  358. data/public/stylesheets/sass/admin/partials/_toolbar.sass +0 -31
  359. data/public/stylesheets/sass/admin/partials/_typography.sass +0 -60
  360. data/public/stylesheets/sass/admin/partials/_validations.sass +0 -19
  361. data/rails/init.rb +0 -1
  362. data/script/about +0 -4
  363. data/script/breakpointer +0 -3
  364. data/script/console +0 -3
  365. data/script/dbconsole +0 -3
  366. data/script/destroy +0 -3
  367. data/script/generate +0 -3
  368. data/script/performance/benchmarker +0 -3
  369. data/script/performance/profiler +0 -3
  370. data/script/performance/request +0 -3
  371. data/script/plugin +0 -3
  372. data/script/process/inspector +0 -3
  373. data/script/process/reaper +0 -3
  374. data/script/process/spawner +0 -3
  375. data/script/process/spinner +0 -3
  376. data/script/runner +0 -3
  377. data/script/server +0 -3
  378. data/script/version +0 -5
  379. data/spec/ci/database.postgresql.yml +0 -4
  380. data/spec/ci/database.sqlite.yml +0 -3
@@ -4,8 +4,8 @@ require 'login_system'
4
4
  class ApplicationController < ActionController::Base
5
5
  include LoginSystem
6
6
  # TODO: Add an ActionView::PathSet.new([paths]) for all extension view paths
7
- prepend_view_path ("#{TRUSTY_CMS_ROOT}/app/views")
8
-
7
+ prepend_view_path("#{TRUSTY_CMS_ROOT}/app/views")
8
+
9
9
  protect_from_forgery
10
10
 
11
11
  before_filter :set_current_user
@@ -18,22 +18,11 @@ class ApplicationController < ActionController::Base
18
18
  attr_accessor :trusty_config, :cache
19
19
  attr_reader :pagination_parameters
20
20
  helper_method :pagination_parameters
21
-
21
+
22
22
  def initialize
23
23
  super
24
24
  @trusty_config = TrustyCms::Config
25
25
  end
26
-
27
- # helpers to include additional assets from actions or views
28
- helper_method :include_stylesheet, :include_javascript
29
-
30
- def include_stylesheet(sheet)
31
- @stylesheets << sheet
32
- end
33
-
34
- def include_javascript(script)
35
- @javascripts << script
36
- end
37
26
 
38
27
  def template_name
39
28
  case self.action_name
@@ -51,7 +40,7 @@ class ApplicationController < ActionController::Base
51
40
  self.action_name
52
41
  end
53
42
  end
54
-
43
+
55
44
  def rescue_action_in_public(exception)
56
45
  case exception
57
46
  when ActiveRecord::RecordNotFound, ActionController::UnknownController, ActionController::UnknownAction, ActionController::RoutingError
@@ -60,21 +49,21 @@ class ApplicationController < ActionController::Base
60
49
  super
61
50
  end
62
51
  end
63
-
52
+
64
53
  private
65
-
54
+
66
55
  def set_current_user
67
56
  UserActionObserver.instance.current_user = current_user
68
- end
69
-
70
- def set_user_locale
57
+ end
58
+
59
+ def set_user_locale
71
60
  I18n.locale = current_user && !current_user.locale.blank? ? current_user.locale : TrustyCms::Config['default_locale']
72
61
  end
73
62
 
74
63
  def set_timezone
75
64
  Time.zone = TrustyCms::Config['local.timezone'] != nil && TrustyCms::Config['local.timezone'].empty? ? Time.zone_default : TrustyCms::Config['local.timezone']
76
65
  end
77
-
66
+
78
67
  def set_javascripts_and_stylesheets
79
68
  @stylesheets ||= []
80
69
  @stylesheets.concat %w(admin/main)
@@ -85,7 +74,7 @@ class ApplicationController < ActionController::Base
85
74
  @body_classes ||= []
86
75
  @body_classes.concat(%w(reversed))
87
76
  end
88
-
77
+
89
78
  # When using TrustyCms with Ruby 1.9, the strings that come in from forms are ASCII-8BIT encoded.
90
79
  # That causes problems, especially when using special chars and with certain DBs, like DB2
91
80
  # That's why we force the encoding of the params to UTF-8
@@ -94,7 +83,7 @@ class ApplicationController < ActionController::Base
94
83
  # See http://stackoverflow.com/questions/8268778/rails-2-3-9-encoding-of-query-parameters
95
84
  # See https://rails.lighthouseapp.com/projects/8994/tickets/4807
96
85
  # See http://jasoncodes.com/posts/ruby19-rails2-encodings (thanks for the following code, Jason!)
97
- def force_utf8_params
86
+ def force_utf8_params
98
87
  traverse = lambda do |object, block|
99
88
  if object.kind_of?(Hash)
100
89
  object.each_value { |o| traverse.call(o, block) }
@@ -110,5 +99,5 @@ class ApplicationController < ActionController::Base
110
99
  end
111
100
  traverse.call(params, force_encoding)
112
101
  end
113
-
102
+
114
103
  end
@@ -24,8 +24,9 @@ class SiteController < ApplicationController
24
24
  process_page(@page)
25
25
  set_cache_control
26
26
  @performed_render ||= true
27
+ render layout: false
27
28
  else
28
- render :template => 'site/not_found', :status => 404
29
+ render :template => 'site/not_found', :status => 404, layout: false
29
30
  end
30
31
  rescue Page::MissingRootPageError
31
32
  redirect_to welcome_url
@@ -11,7 +11,7 @@ module Admin::ConfigurationHelper
11
11
  setting.valid?
12
12
  domkey = key.gsub(/\W/, '_')
13
13
  html = ""
14
- html << content_tag(:label, t("@trusty_config.#{key}").titlecase, :for => domkey)
14
+ html << content_tag(:label, t("trusty_config.#{key}").titlecase, :for => domkey)
15
15
  if setting.boolean?
16
16
  value = setting.checked? ? t('yes') : t('no')
17
17
  html << content_tag(:span, value, :id => domkey, :class => "#{value} #{options[:class]}")
@@ -20,17 +20,18 @@ module Admin::ConfigurationHelper
20
20
  html << content_tag(:span, value, :id => domkey, :class => options[:class])
21
21
  end
22
22
  html << content_tag(:span, " #{t("units.#{setting.units}")}", :class => 'units') if setting.units
23
- html << content_tag(:span, " #{t('warning')}: #{[setting.errors.on(:value)].flatten.first}", :class => 'warning') if setting.errors.on(:value)
24
- html
23
+ html << content_tag(:span, " #{t('warning')}: #{[setting.errors.get(:value)].flatten.first}", :class => 'warning') if setting.errors.get(:value)
24
+ Rails.logger.error(html)
25
+ html.html_safe
25
26
  end
26
-
27
+
27
28
  # Renders the setting as label and appropriate input field:
28
29
  #
29
30
  # edit_setting("admin.title")
30
31
  # => <label for="admin_title">Admin title<label><input type="text" name="config['admin.title']" id="admin_title" value="TrustyCms CMS" />
31
32
  #
32
33
  # edit_config("defaults.page.status")
33
- # =>
34
+ # =>
34
35
  # <label for="defaults_page_status">Default page status<label>
35
36
  # <select type="text" name="config['defaults.page.status']" id="defaults_page_status">
36
37
  # <option value="Draft">Draft</option>
@@ -43,38 +44,38 @@ module Admin::ConfigurationHelper
43
44
  def edit_config(key, options={})
44
45
  setting = setting_for(key)
45
46
  domkey = key.gsub(/\W/, '_')
46
- name = "@trusty_config[#{key}]"
47
- title = t("@trusty_config.#{key}").titlecase
47
+ name = "trusty_config[#{key}]"
48
+ title = t("trusty_config.#{key}").titlecase
48
49
  title << content_tag(:span, " (#{t("units.#{setting.units}")})", :class => 'units') if setting.units
49
50
  value = params[key.to_sym].nil? ? setting.value : params[key.to_sym]
50
51
  html = ""
51
52
  if setting.boolean?
52
53
  html << hidden_field_tag(name, 0)
53
54
  html << check_box_tag(name, 1, value, :class => 'setting', :id => domkey)
54
- html << content_tag(:label, title, :class => 'checkbox', :for => domkey)
55
+ html << content_tag(:label, title.html_safe, :class => 'checkbox', :for => domkey)
55
56
  elsif setting.selector?
56
- html << content_tag(:label, title, :for => domkey)
57
+ html << content_tag(:label, title.html_safe, :for => domkey)
57
58
  html << select_tag(name, options_for_select(setting.definition.selection, value), :class => 'setting', :id => domkey)
58
59
  else
59
- html << content_tag(:label, title, :for => domkey)
60
+ html << content_tag(:label, title.html_safe, :for => domkey)
60
61
  html << text_field_tag(name, value, :class => 'textbox', :id => domkey)
61
62
  end
62
- if setting.errors.on(:value)
63
- html << content_tag(:span, [setting.errors.on(:value)].flatten.first, :class => 'error')
64
- html = content_tag(:span, html, :class => "error-with-field")
63
+ if setting.errors[:value].present?
64
+ html << content_tag(:span, [setting.errors[:value]].flatten.first, :class => 'error')
65
+ html = content_tag(:span, html.html_safe, :class => "error-with-field")
65
66
  end
66
- html
67
+ html.html_safe
67
68
  end
68
-
69
+
69
70
  def setting_for(key)
70
- @config ||= {} # normally initialized in Admin::ConfigurationController
71
- @config[key] ||= TrustyCms.config.find_or_create_by_key(key)
71
+ @trusty_config ||= {} # normally initialized in Admin::ConfigurationController
72
+ @trusty_config[key] ||= TrustyCms.config.find_or_create_by_key(key)
72
73
  end
73
-
74
+
74
75
  def definition_for(key)
75
76
  if setting = setting_for(key)
76
77
  setting.definition
77
78
  end
78
79
  end
79
80
 
80
- end
81
+ end
@@ -1,2 +1,2 @@
1
1
  module Admin::ExtensionsHelper
2
- end
2
+ end
@@ -1,21 +1,3 @@
1
1
  module Admin::LayoutsHelper
2
- def layout_edit_javascripts
3
- <<-CODE
4
- var tagReferenceWindows = {};
5
- function loadTagReference() {
6
- var pageType = 'Page';
7
- if (!tagReferenceWindows[pageType])
8
- tagReferenceWindows[pageType] = new Popup.AjaxWindow("#{admin_reference_path('tags')}?class_name=" + encodeURIComponent(pageType), {reload: false});
9
- var window = tagReferenceWindows[pageType];
10
- if('Page' != pageType) {
11
- $('tag_reference_link').highlight();
12
- window.show();
13
- } else {
14
- window.toggle();
15
- }
16
- lastPageType = pageType;
17
- return false;
18
- }
19
- CODE
20
- end
2
+
21
3
  end
@@ -1,14 +1,28 @@
1
1
  module Admin::NodeHelper
2
2
 
3
- def render_node(page, locals = {})
4
- @current_node = page
3
+ def render_nodes(page, starting_index, parent_index = nil)
4
+ @rendered_html = ""
5
+ render_node page, starting_index, parent_index
6
+ @rendered_html
7
+ end
8
+
9
+ def render_node(page, index, parent_index = nil)
10
+
11
+ @current_node = prepare_page(page)
12
+
13
+ @rendered_html += (render :partial => 'admin/pages/node',
14
+ :locals => {level: index, index: index, parent_index: parent_index,
15
+ page: page, simple: false, branch: (page.children.count > 0) })
16
+ index
17
+ end
18
+
19
+ def prepare_page(page)
5
20
  page.extend MenuRenderer
6
21
  page.view = self
7
22
  if page.additional_menu_features?
8
23
  page.extend(*page.menu_renderer_modules)
9
24
  end
10
- locals.reverse_merge!(:level => 0, :simple => false).merge!(:page => page)
11
- render :partial => 'admin/pages/node', :locals => locals
25
+ page
12
26
  end
13
27
 
14
28
  def homepage
@@ -16,7 +30,7 @@ module Admin::NodeHelper
16
30
  end
17
31
 
18
32
  def show_all?
19
- @controller.action_name == 'remove'
33
+ controller.action_name == 'remove'
20
34
  end
21
35
 
22
36
  def expanded_rows
@@ -75,7 +89,7 @@ module Admin::NodeHelper
75
89
  end
76
90
 
77
91
  def node_title
78
- %{<span class="title">#{ h(@current_node.title) }</span>}
92
+ %{<span class="title">#{ h(@current_node.title) }</span>}.html_safe
79
93
  end
80
94
 
81
95
  def page_type
@@ -83,7 +97,7 @@ module Admin::NodeHelper
83
97
  if display_name == 'Page'
84
98
  ""
85
99
  else
86
- %{<span class="info">(#{ h(display_name) })</span>}
100
+ %{<span class="info">(#{ h(display_name) })</span>}.html_safe
87
101
  end
88
102
  end
89
103
 
@@ -1,15 +1,15 @@
1
1
  module Admin::PagesHelper
2
2
  include Admin::NodeHelper
3
3
  include Admin::ReferencesHelper
4
-
4
+
5
5
  def class_of_page
6
6
  @page.class
7
7
  end
8
-
8
+
9
9
  def filter
10
- @page.parts.empty? ? nil : @page.parts.first.filter
10
+ @page.parts.first.filter if @page.parts.respond_to?(:any?) && @page.parts.any?
11
11
  end
12
-
12
+
13
13
  def meta_errors?
14
14
  !!(@page.errors[:slug] or @page.errors[:breadcrumb])
15
15
  end
@@ -26,92 +26,4 @@ module Admin::PagesHelper
26
26
  def clean_page_description(page)
27
27
  page.description.to_s.strip.gsub(/\t/,'').gsub(/\s+/,' ')
28
28
  end
29
-
30
- def page_edit_javascripts
31
- <<-CODE
32
- function addPart(form) {
33
- if (validPartName()) {
34
- new Ajax.Updater(
35
- $('tab_control').down('.pages'),
36
- '#{admin_page_parts_path}',
37
- {
38
- asynchronous: true,
39
- evalScripts: true,
40
- insertion: 'bottom',
41
- onComplete: function(request){ partAdded() },
42
- onLoading: function(request){ partLoading() },
43
- parameters: Form.serialize(form)
44
- }
45
- );
46
- }
47
- }
48
- function removePart() {
49
- if(confirm('Remove the current part?')) {
50
- TabControls['tab_control'].removeSelected();
51
- }
52
- }
53
- function partAdded() {
54
- var tabControl = TabControls['tab_control'];
55
- $('add_part_busy').hide();
56
- $('add_part_button').disabled = false;
57
- $('add_part_popup').closePopup();
58
- $('part_name_field').value = '';
59
- tabControl.updateTabs();
60
- tabControl.select(tabControl.tabs.last());
61
- }
62
- function partLoading() {
63
- $('add_part_button').disabled = true;
64
- $('add_part_busy').appear();
65
- }
66
- function validPartName() {
67
- var partNameField = $('part_name_field');
68
- var name = partNameField.value.downcase();
69
- if (name.blank()) {
70
- alert('Part name cannot be empty.');
71
- return false;
72
- }
73
- if (TabControls['tab_control'].findTabByCaption(name)) {
74
- alert('Part name must be unique.');
75
- return false;
76
- }
77
- return true;
78
- }
79
-
80
- var lastPageType = '#{@page.class.name}';
81
- var tagReferenceWindows = {};
82
- function loadTagReference(part) {
83
- var pageType = $F('page_class_name');
84
- if (!tagReferenceWindows[pageType])
85
- tagReferenceWindows[pageType] = new Popup.AjaxWindow("#{admin_reference_path('tags')}?class_name=" + encodeURIComponent(pageType), {reload: false});
86
- var window = tagReferenceWindows[pageType];
87
- if(lastPageType != pageType) {
88
- $('tag_reference_link_' + part).highlight();
89
- window.show();
90
- } else {
91
- window.toggle();
92
- }
93
- lastPageType = pageType;
94
- return false;
95
- }
96
-
97
- var lastFilter = '#{default_filter_name}';
98
- var filterWindows = {};
99
- function loadFilterReference(part) {
100
- var filter = $F("part_" + part + "_filter_id");
101
- if (filter != "") {
102
- if (!filterWindows[filter]) filterWindows[filter] = new Popup.AjaxWindow("#{admin_reference_path('filters')}?filter_name="+encodeURIComponent(filter), {reload: false});
103
- var window = filterWindows[filter];
104
- if(lastFilter != filter) {
105
- window.show();
106
- } else {
107
- window.toggle();
108
- }
109
- lastFilter = filter;
110
- } else {
111
- alert('No documentation for filter.');
112
- }
113
- return false;
114
- }
115
- CODE
116
- end
117
29
  end
@@ -1,3 +1,3 @@
1
1
  module Admin::PreferencesHelper
2
2
 
3
- end
3
+ end
@@ -14,15 +14,16 @@ module Admin::RegionsHelper
14
14
  rescue ::ActionView::TemplateError => e # error in template
15
15
  raise e
16
16
  end
17
- end.join
17
+ end.join.html_safe
18
+ Rails.logger.error(output)
18
19
  block_given? ? concat(output) : output
19
20
  end
20
21
 
21
22
  def lazy_initialize_region_set
22
23
  unless @region_set
23
- @controller_name ||= @controller.controller_name
24
- @template_name ||= @controller.template_name
24
+ @controller_name ||= @_controller.controller_name
25
+ @template_name ||= @_controller.template_name
25
26
  @region_set = admin.send(@controller_name).send(@template_name)
26
27
  end
27
28
  end
28
- end
29
+ end
@@ -1,30 +1,30 @@
1
1
  module ApplicationHelper
2
2
  include Admin::RegionsHelper
3
-
4
- #def config
5
- # TrustyCms::Config
6
- #end
7
-
3
+
4
+ def trusty_config
5
+ TrustyCms::Config
6
+ end
7
+
8
8
  def default_page_title
9
9
  title + ' - ' + subtitle
10
10
  end
11
-
11
+
12
12
  def title
13
- @trusty_config['admin.title'] || 'TrustyCms CMS'
13
+ trusty_config['admin.title'] || 'Trusty CMS'
14
14
  end
15
-
15
+
16
16
  def subtitle
17
- @trusty_config['admin.subtitle'] || 'Publishing for Small Teams'
17
+ trusty_config['admin.subtitle'] || 'Publishing for Small Teams'
18
18
  end
19
-
19
+
20
20
  def logged_in?
21
21
  !current_user.nil?
22
22
  end
23
-
23
+
24
24
  def onsubmit_status(model)
25
25
  model.new_record? ? t('creating_status', :model => t(model.class.name.downcase)) : "#{I18n.t('saving_changes')}&#8230;"
26
26
  end
27
-
27
+
28
28
  def save_model_button(model, options = {})
29
29
  model_name = model.class.name.underscore
30
30
  human_model_name = model_name.humanize.titlecase
@@ -35,11 +35,11 @@ module ApplicationHelper
35
35
  options[:accesskey] ||= 'S'
36
36
  submit_tag options.delete(:label), options
37
37
  end
38
-
38
+
39
39
  def save_model_and_continue_editing_button(model)
40
40
  submit_tag t('buttons.save_and_continue'), :name => 'continue', :class => 'button', :accesskey => "s"
41
41
  end
42
-
42
+
43
43
  def current_item?(item)
44
44
  if item.tab && item.tab.many? {|i| current_url?(i.relative_url) }
45
45
  # Accept only stricter URL matches if more than one matches
@@ -48,27 +48,28 @@ module ApplicationHelper
48
48
  current_url?(item.relative_url)
49
49
  end
50
50
  end
51
-
51
+
52
52
  def current_tab?(tab)
53
53
  @current_tab ||= tab if tab.any? {|item| current_url?(item.relative_url) }
54
54
  @current_tab == tab
55
55
  end
56
-
56
+
57
57
  def current_url?(options)
58
58
  url = case options
59
- when Hash
60
- url_for options
61
- else
62
- options.to_s
63
- end
64
- request.request_uri =~ Regexp.new('^' + Regexp.quote(clean(url)))
59
+ when Hash
60
+ url_for options
61
+ else
62
+ options.to_s
63
+ end
64
+ #TODO: look for other instances of request_uri
65
+ request.original_fullpath =~ Regexp.new('^' + Regexp.quote(clean(url)))
65
66
  end
66
-
67
+
67
68
  def clean(url)
68
69
  uri = URI.parse(url)
69
70
  uri.path.gsub(%r{/+}, '/').gsub(%r{/$}, '')
70
71
  end
71
-
72
+
72
73
  def nav_link_to(name, options)
73
74
  if current_url?(options)
74
75
  %{<strong>#{ link_to translate_with_default(name), options }</strong>}
@@ -76,39 +77,35 @@ module ApplicationHelper
76
77
  link_to translate_with_default(name), options
77
78
  end
78
79
  end
79
-
80
+
80
81
  def admin?
81
82
  current_user and current_user.admin?
82
83
  end
83
-
84
+
84
85
  def designer?
85
86
  current_user and (current_user.designer? or current_user.admin?)
86
87
  end
87
-
88
- def focus(field_name)
89
- javascript_tag "Field.activate('#{field_name}');"
90
- end
91
-
88
+
92
89
  def updated_stamp(model)
93
90
  unless model.new_record?
94
91
  updated_by = (model.updated_by || model.created_by)
95
92
  name = updated_by ? updated_by.name : nil
96
93
  time = (model.updated_at || model.created_at)
97
94
  if name or time
98
- html = %{<p class="updated_line">#{t('timestamp.last_updated')} }
95
+ html = %{<p class="updated_line">#{t('timestamp.last_updated')} }
99
96
  html << %{#{t('timestamp.by')} <strong>#{name}</strong> } if name
100
97
  html << %{#{t('timestamp.at')} #{timestamp(time)}} if time
101
98
  html << %{</p>}
102
- html
99
+ html.html_safe
103
100
  end
104
101
  end
105
102
  end
106
-
103
+
107
104
  def timestamp(time)
108
105
  # time.strftime("%I:%M %p on %B %e, %Y").sub("AM", 'am').sub("PM", 'pm')
109
- I18n.localize(time, :format => :timestamp)
110
- end
111
-
106
+ I18n.localize(time, :format => :timestamp)
107
+ end
108
+
112
109
  def meta_visible(symbol)
113
110
  v = case symbol
114
111
  when :meta_more
@@ -118,62 +115,63 @@ module ApplicationHelper
118
115
  end
119
116
  v ? {} : {:style => "display: none"}
120
117
  end
121
-
118
+
122
119
  def meta_errors?
123
120
  false
124
121
  end
125
-
122
+
126
123
  def meta_label
127
124
  meta_errors? ? 'Less' : 'More'
128
125
  end
129
-
130
- def toggle_javascript_for(id)
131
- "Element.toggle('#{id}'); Element.toggle('more-#{id}'); Element.toggle('less-#{id}'); return false;"
132
- end
133
-
126
+
134
127
  def image(name, options = {})
135
128
  image_tag(append_image_extension("admin/#{name}"), options)
136
129
  end
137
-
130
+
138
131
  def image_submit(name, options = {})
139
132
  image_submit_tag(append_image_extension("admin/#{name}"), options)
140
133
  end
141
-
134
+
142
135
  def admin
143
136
  TrustyCms::AdminUI.instance
144
137
  end
145
-
138
+
146
139
  def filter_options_for_select(selected=nil)
147
140
  options_for_select([[t('select.none'), '']] + TextFilter.descendants_names, selected)
148
141
  end
149
-
142
+
150
143
  def body_classes
151
144
  @body_classes ||= []
152
145
  end
153
-
146
+
154
147
  def nav_tabs
155
148
  admin.nav
156
149
  end
157
-
150
+
158
151
  def translate_with_default(name)
159
152
  t(name.underscore.downcase, :default => name)
160
153
  end
161
-
154
+
162
155
  def available_locales_select
163
156
  [[t('select.default'),'']] + TrustyCms::AvailableLocales.locales
164
157
  end
165
-
166
- def stylesheet_and_javascript_overrides
167
- overrides = ''
158
+
159
+ def stylesheet_overrides
160
+ overrides = []
168
161
  if File.exist?("#{Rails.root}/public/stylesheets/admin/overrides.css") || File.exist?("#{Rails.root}/public/stylesheets/sass/admin/overrides.sass")
169
- overrides << stylesheet_link_tag('admin/overrides')
162
+ overrides << 'admin/overrides'
170
163
  end
164
+ overrides
165
+ end
166
+
167
+ def javascript_overrides
168
+ overrides = []
171
169
  if File.exist?("#{Rails.root}/public/javascripts/admin/overrides.js")
172
- overrides << javascript_include_tag('admin/overrides')
170
+ overrides << 'admin/overrides'
173
171
  end
174
172
  overrides
175
173
  end
176
-
174
+
177
175
  # Returns a Gravatar URL associated with the email parameter.
178
176
  # See: http://douglasfshearer.com/blog/gravatar-for-ruby-and-ruby-on-rails
179
177
  def gravatar_url(email, options={})
@@ -190,8 +188,8 @@ module ApplicationHelper
190
188
  options[:default] ||= default_avatar_url
191
189
 
192
190
  unless email.blank?
193
- # Build the Gravatar url.
194
- url = '//gravatar.com/avatar/'
191
+ # Build the Gravatar url.
192
+ url = '//gravatar.com/avatar/'
195
193
  url << "#{Digest::MD5.new.update(email)}?"
196
194
  url << "rating=#{options[:rating]}" if options[:rating]
197
195
  url << "&size=#{options[:size]}" if options[:size]
@@ -206,9 +204,9 @@ module ApplicationHelper
206
204
  local_avatar_url
207
205
  end
208
206
  end
209
-
207
+
210
208
  # returns the usual set of pagination links.
211
- # options are passed through to will_paginate
209
+ # options are passed through to will_paginate
212
210
  # and a 'show all' depagination link is added if relevant.
213
211
  def pagination_for(list, options={})
214
212
  if list.respond_to? :total_pages
@@ -227,9 +225,9 @@ module ApplicationHelper
227
225
  html
228
226
  end
229
227
  end
230
-
228
+
231
229
  private
232
-
230
+
233
231
  def append_image_extension(name)
234
232
  unless name =~ /\.(.*?)$/
235
233
  name + '.png'
@@ -237,5 +235,5 @@ module ApplicationHelper
237
235
  name
238
236
  end
239
237
  end
240
-
238
+
241
239
  end