cardboard_cms 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (360) hide show
  1. checksums.yaml +7 -0
  2. data/.ruby-gemset +1 -0
  3. data/.ruby-version +1 -0
  4. data/Gemfile +42 -0
  5. data/Gemfile.lock +324 -0
  6. data/Guardfile +23 -0
  7. data/LICENSE.txt +677 -0
  8. data/README.md +370 -0
  9. data/Rakefile +23 -0
  10. data/app/assets/images/cardboard/.gitkeep +0 -0
  11. data/app/assets/images/cardboard/bg.png +0 -0
  12. data/app/assets/images/cardboard/calendar.png +0 -0
  13. data/app/assets/images/cardboard/lorem-ipsum-coffe-mug.jpg +0 -0
  14. data/app/assets/javascripts/cardboard.js +1 -0
  15. data/app/assets/javascripts/cardboard/admin.js +62 -0
  16. data/app/assets/javascripts/cardboard/content_sidebar.js +27 -0
  17. data/app/assets/javascripts/cardboard/datepicker.js +19 -0
  18. data/app/assets/javascripts/cardboard/main_sidebar.js +32 -0
  19. data/app/assets/javascripts/cardboard/rich_text.js +81 -0
  20. data/app/assets/javascripts/cardboard/search_filter.js +28 -0
  21. data/app/assets/stylesheets/cardboard.css.scss +2 -0
  22. data/app/assets/stylesheets/cardboard/_bootstrap-select.css.scss +183 -0
  23. data/app/assets/stylesheets/cardboard/_content.css.scss +35 -0
  24. data/app/assets/stylesheets/cardboard/_content_sidebar.css.scss +96 -0
  25. data/app/assets/stylesheets/cardboard/_framework.css.scss +129 -0
  26. data/app/assets/stylesheets/cardboard/_main_sidebar.css.scss +38 -0
  27. data/app/assets/stylesheets/cardboard/_main_topbar.css.scss +62 -0
  28. data/app/assets/stylesheets/cardboard/_resources.css.scss +28 -0
  29. data/app/assets/stylesheets/cardboard/_rich_text.css.scss +6 -0
  30. data/app/assets/stylesheets/cardboard/_variables.scss +326 -0
  31. data/app/assets/stylesheets/cardboard/admin.css.scss +63 -0
  32. data/app/controllers/cardboard/application_controller.rb +45 -0
  33. data/app/controllers/cardboard/dashboard_controller.rb +9 -0
  34. data/app/controllers/cardboard/my_account_controller.rb +27 -0
  35. data/app/controllers/cardboard/pages_controller.rb +34 -0
  36. data/app/controllers/cardboard/resource_controller.rb +61 -0
  37. data/app/controllers/cardboard/settings_controller.rb +28 -0
  38. data/app/controllers/cardboard/super_user_controller.rb +8 -0
  39. data/app/controllers/pages_controller.rb +29 -0
  40. data/app/decorators/controllers/application_controller_decorator.rb +9 -0
  41. data/app/decorators/lib/cardboard/user_class_decorator.rb +32 -0
  42. data/app/helpers/cardboard/application_helper.rb +4 -0
  43. data/app/helpers/cardboard/public_helper.rb +53 -0
  44. data/app/helpers/cardboard/resource_helper.rb +80 -0
  45. data/app/inputs/date_picker_input.rb +10 -0
  46. data/app/inputs/date_time_input.rb +7 -0
  47. data/app/inputs/image_input.rb +3 -0
  48. data/app/inputs/rich_text_input.rb +6 -0
  49. data/app/models/cardboard/field.rb +67 -0
  50. data/app/models/cardboard/field/boolean.rb +29 -0
  51. data/app/models/cardboard/field/date.rb +24 -0
  52. data/app/models/cardboard/field/decimal.rb +25 -0
  53. data/app/models/cardboard/field/external_link.rb +4 -0
  54. data/app/models/cardboard/field/file.rb +19 -0
  55. data/app/models/cardboard/field/image.rb +33 -0
  56. data/app/models/cardboard/field/integer.rb +26 -0
  57. data/app/models/cardboard/field/resource_link.rb +4 -0
  58. data/app/models/cardboard/field/rich_text.rb +21 -0
  59. data/app/models/cardboard/field/string.rb +16 -0
  60. data/app/models/cardboard/field/text.rb +15 -0
  61. data/app/models/cardboard/page.rb +253 -0
  62. data/app/models/cardboard/page_part.rb +79 -0
  63. data/app/models/cardboard/setting.rb +46 -0
  64. data/app/views/cardboard/dashboard/index.html.slim +1 -0
  65. data/app/views/cardboard/fields/_base_input.html.slim +1 -0
  66. data/app/views/cardboard/fields/_boolean.html.slim +4 -0
  67. data/app/views/cardboard/fields/_date.html.slim +1 -0
  68. data/app/views/cardboard/fields/_external_link.html.slim +2 -0
  69. data/app/views/cardboard/fields/_file.html.slim +12 -0
  70. data/app/views/cardboard/fields/_image.html.slim +11 -0
  71. data/app/views/cardboard/fields/_resource_link.html.slim +2 -0
  72. data/app/views/cardboard/fields/_rich_text.html.slim +3 -0
  73. data/app/views/cardboard/fields/_string.html.slim +1 -0
  74. data/app/views/cardboard/my_account/edit.html.slim +29 -0
  75. data/app/views/cardboard/pages/_error.html.slim +7 -0
  76. data/app/views/cardboard/pages/_seo.html.slim +6 -0
  77. data/app/views/cardboard/pages/_sidebar.html.slim +17 -0
  78. data/app/views/cardboard/pages/_subpart_fields.html.slim +20 -0
  79. data/app/views/cardboard/pages/_url_field.html.slim +20 -0
  80. data/app/views/cardboard/pages/edit.html.slim +43 -0
  81. data/app/views/cardboard/pages/index.html.slim +2 -0
  82. data/app/views/cardboard/pages/show.html.slim +9 -0
  83. data/app/views/cardboard/resources/_advanced_search.html.slim +40 -0
  84. data/app/views/cardboard/resources/_search_button.html.slim +2 -0
  85. data/app/views/cardboard/resources/_search_helper.html.slim +17 -0
  86. data/app/views/cardboard/resources/_simple_search.html.slim +6 -0
  87. data/app/views/cardboard/rich_editor/_links_modal.html.slim +39 -0
  88. data/app/views/cardboard/settings/index.html.slim +8 -0
  89. data/app/views/cardboard/super_user/index.html.slim +10 -0
  90. data/app/views/layouts/cardboard/_flash_message.html.slim +6 -0
  91. data/app/views/layouts/cardboard/_head.html.slim +16 -0
  92. data/app/views/layouts/cardboard/_main_sidebar.html.slim +12 -0
  93. data/app/views/layouts/cardboard/_main_topbar.html.slim +32 -0
  94. data/app/views/layouts/cardboard/application.html.slim +28 -0
  95. data/cardboard.gemspec +57 -0
  96. data/config/initializers/dragonfly.rb +27 -0
  97. data/config/initializers/ranker_mapper_finder_bugfix.rb +43 -0
  98. data/config/initializers/simple_form.rb +142 -0
  99. data/config/initializers/simple_form_bootstrap.rb +45 -0
  100. data/config/locales/simple_form.en.yml +26 -0
  101. data/config/routes.rb +53 -0
  102. data/doc/apple-touch-icon.png +0 -0
  103. data/doc/classes/Cardboard.html +190 -0
  104. data/doc/classes/Cardboard/AdminController.html +134 -0
  105. data/doc/classes/Cardboard/AdminHelper.html +307 -0
  106. data/doc/classes/Cardboard/ApplicationController.html +76 -0
  107. data/doc/classes/Cardboard/ApplicationHelper.html +70 -0
  108. data/doc/classes/Cardboard/DashboardController.html +131 -0
  109. data/doc/classes/Cardboard/Field.html +283 -0
  110. data/doc/classes/Cardboard/Field/Boolean.html +218 -0
  111. data/doc/classes/Cardboard/Field/Date.html +218 -0
  112. data/doc/classes/Cardboard/Field/Decimal.html +218 -0
  113. data/doc/classes/Cardboard/Field/ExternalLink.html +76 -0
  114. data/doc/classes/Cardboard/Field/File.html +131 -0
  115. data/doc/classes/Cardboard/Field/Image.html +181 -0
  116. data/doc/classes/Cardboard/Field/Integer.html +218 -0
  117. data/doc/classes/Cardboard/Field/ResourceLink.html +76 -0
  118. data/doc/classes/Cardboard/Field/RichText.html +131 -0
  119. data/doc/classes/Cardboard/Field/String.html +131 -0
  120. data/doc/classes/Cardboard/Page.html +1184 -0
  121. data/doc/classes/Cardboard/PagePart.html +304 -0
  122. data/doc/classes/Cardboard/PagesController.html +186 -0
  123. data/doc/classes/Cardboard/PublicHelper.html +252 -0
  124. data/doc/classes/Cardboard/Setting.html +240 -0
  125. data/doc/classes/Cardboard/SettingsController.html +184 -0
  126. data/doc/classes/Cardboard/SuperUserController.html +130 -0
  127. data/doc/classes/Cardboard/UsersController.html +191 -0
  128. data/doc/classes/DatePickerInput.html +132 -0
  129. data/doc/classes/ImageInput.html +76 -0
  130. data/doc/classes/Object.html +211 -0
  131. data/doc/classes/PagesController.html +145 -0
  132. data/doc/classes/RichTextInput.html +132 -0
  133. data/doc/created.rid +31 -0
  134. data/doc/css/github.css +129 -0
  135. data/doc/css/main.css +333 -0
  136. data/doc/css/panel.css +384 -0
  137. data/doc/css/reset.css +48 -0
  138. data/doc/favicon.ico +0 -0
  139. data/doc/files/app/controllers/cardboard/admin_controller_rb.html +79 -0
  140. data/doc/files/app/controllers/cardboard/application_controller_rb.html +84 -0
  141. data/doc/files/app/controllers/cardboard/dashboard_controller_rb.html +84 -0
  142. data/doc/files/app/controllers/cardboard/pages_controller_rb.html +84 -0
  143. data/doc/files/app/controllers/cardboard/settings_controller_rb.html +84 -0
  144. data/doc/files/app/controllers/cardboard/super_user_controller_rb.html +84 -0
  145. data/doc/files/app/controllers/cardboard/users_controller_rb.html +84 -0
  146. data/doc/files/app/controllers/pages_controller_rb.html +79 -0
  147. data/doc/files/app/decorators/controllers/application_controller_decorator_rb.html +68 -0
  148. data/doc/files/app/decorators/lib/cardboard/user_class_decorator_rb.html +68 -0
  149. data/doc/files/app/helpers/cardboard/admin_helper_rb.html +84 -0
  150. data/doc/files/app/helpers/cardboard/application_helper_rb.html +84 -0
  151. data/doc/files/app/helpers/cardboard/public_helper_rb.html +84 -0
  152. data/doc/files/app/inputs/date_picker_input_rb.html +79 -0
  153. data/doc/files/app/inputs/image_input_rb.html +79 -0
  154. data/doc/files/app/inputs/rich_text_input_rb.html +79 -0
  155. data/doc/files/app/models/cardboard/field/boolean_rb.html +84 -0
  156. data/doc/files/app/models/cardboard/field/date_rb.html +84 -0
  157. data/doc/files/app/models/cardboard/field/decimal_rb.html +84 -0
  158. data/doc/files/app/models/cardboard/field/external_link_rb.html +84 -0
  159. data/doc/files/app/models/cardboard/field/file_rb.html +84 -0
  160. data/doc/files/app/models/cardboard/field/image_rb.html +84 -0
  161. data/doc/files/app/models/cardboard/field/integer_rb.html +84 -0
  162. data/doc/files/app/models/cardboard/field/resource_link_rb.html +84 -0
  163. data/doc/files/app/models/cardboard/field/rich_text_rb.html +84 -0
  164. data/doc/files/app/models/cardboard/field/string_rb.html +84 -0
  165. data/doc/files/app/models/cardboard/field_rb.html +84 -0
  166. data/doc/files/app/models/cardboard/page_part_rb.html +84 -0
  167. data/doc/files/app/models/cardboard/page_rb.html +84 -0
  168. data/doc/files/app/models/cardboard/setting_rb.html +84 -0
  169. data/doc/i/arrows.png +0 -0
  170. data/doc/i/results_bg.png +0 -0
  171. data/doc/i/tree_bg.png +0 -0
  172. data/doc/index.html +13 -0
  173. data/doc/js/highlight.pack.js +1 -0
  174. data/doc/js/jquery-1.3.2.min.js +19 -0
  175. data/doc/js/jquery-effect.js +593 -0
  176. data/doc/js/main.js +24 -0
  177. data/doc/js/navigation.js +142 -0
  178. data/doc/js/search_index.js +1 -0
  179. data/doc/js/searchdoc.js +449 -0
  180. data/doc/js/searcher.js +228 -0
  181. data/doc/panel/index.html +73 -0
  182. data/doc/panel/links.html +66 -0
  183. data/doc/panel/tree.js +1 -0
  184. data/lib/cardboard/application.rb +67 -0
  185. data/lib/cardboard/engine.rb +83 -0
  186. data/lib/cardboard/helpers/seed.rb +80 -0
  187. data/lib/cardboard/helpers/settings.rb +58 -0
  188. data/lib/cardboard/version.rb +3 -0
  189. data/lib/cardboard_cms.rb +34 -0
  190. data/lib/generators/cardboard/assets/assets_generator.rb +18 -0
  191. data/lib/generators/cardboard/install/install_generator.rb +96 -0
  192. data/lib/generators/cardboard/install/templates/cardboard.rb.erb +53 -0
  193. data/lib/generators/cardboard/install/templates/cardboard.yml +29 -0
  194. data/lib/generators/cardboard/install/templates/index.html.erb +0 -0
  195. data/lib/generators/cardboard/install/templates/migrations/1_create_cardboard_fields.rb +21 -0
  196. data/lib/generators/cardboard/install/templates/migrations/2_create_cardboard_page_parts.rb +17 -0
  197. data/lib/generators/cardboard/install/templates/migrations/3_create_cardboard_pages.rb +18 -0
  198. data/lib/generators/cardboard/install/templates/migrations/4_create_cardboard_settings.rb +14 -0
  199. data/lib/generators/cardboard/resource/resource_generator.rb +52 -0
  200. data/lib/generators/cardboard/resource/templates/admin_controller.rb +9 -0
  201. data/lib/generators/cardboard/resource/templates/slim/_fields.html.slim +5 -0
  202. data/lib/generators/cardboard/resource/templates/slim/edit.html.slim +4 -0
  203. data/lib/generators/cardboard/resource/templates/slim/index.html.slim +18 -0
  204. data/lib/generators/cardboard/resource/templates/slim/new.html.slim +4 -0
  205. data/lib/tasks/cardboard_tasks.rake +22 -0
  206. data/lib/templates/erb/scaffold/_form.html.erb +13 -0
  207. data/script/rails +8 -0
  208. data/test/dummy/README.rdoc +261 -0
  209. data/test/dummy/Rakefile +7 -0
  210. data/test/dummy/app/assets/images/defaults/CrashTest.jpg +0 -0
  211. data/test/dummy/app/assets/javascripts/admins.js +2 -0
  212. data/test/dummy/app/assets/javascripts/application.js +5 -0
  213. data/test/dummy/app/assets/javascripts/beans.js +2 -0
  214. data/test/dummy/app/assets/javascripts/cardboard.js +1 -0
  215. data/test/dummy/app/assets/javascripts/icescreams.js +2 -0
  216. data/test/dummy/app/assets/javascripts/main.js +2 -0
  217. data/test/dummy/app/assets/javascripts/news_posts.js +2 -0
  218. data/test/dummy/app/assets/javascripts/pianos.js +2 -0
  219. data/test/dummy/app/assets/stylesheets/admins.css.scss +3 -0
  220. data/test/dummy/app/assets/stylesheets/application.css.scss +9 -0
  221. data/test/dummy/app/assets/stylesheets/beans.css.scss +3 -0
  222. data/test/dummy/app/assets/stylesheets/cardboard.css.scss +5 -0
  223. data/test/dummy/app/assets/stylesheets/icescreams.css.scss +3 -0
  224. data/test/dummy/app/assets/stylesheets/main.css +4 -0
  225. data/test/dummy/app/assets/stylesheets/news_posts.css.scss +3 -0
  226. data/test/dummy/app/assets/stylesheets/pianos.css.scss +3 -0
  227. data/test/dummy/app/assets/stylesheets/scaffolds.css.scss +69 -0
  228. data/test/dummy/app/controllers/application_controller.rb +3 -0
  229. data/test/dummy/app/controllers/cardboard/pianos_controller.rb +6 -0
  230. data/test/dummy/app/controllers/pianos_controller.rb +83 -0
  231. data/test/dummy/app/helpers/application_helper.rb +9 -0
  232. data/test/dummy/app/helpers/cardboard/pianos_helper.rb +7 -0
  233. data/test/dummy/app/mailers/.gitkeep +0 -0
  234. data/test/dummy/app/models/.gitkeep +0 -0
  235. data/test/dummy/app/models/admin_user.rb +28 -0
  236. data/test/dummy/app/models/piano.rb +3 -0
  237. data/test/dummy/app/views/cardboard/pianos/_fields.html.slim +5 -0
  238. data/test/dummy/app/views/cardboard/pianos/edit.html.slim +6 -0
  239. data/test/dummy/app/views/cardboard/pianos/index.html.slim +18 -0
  240. data/test/dummy/app/views/cardboard/pianos/new.html.slim +6 -0
  241. data/test/dummy/app/views/cardboard/pianos/show.html.slim +11 -0
  242. data/test/dummy/app/views/layouts/application.html.slim +24 -0
  243. data/test/dummy/app/views/main/index.html.slim +1 -0
  244. data/test/dummy/app/views/pages/about-us.html.slim +1 -0
  245. data/test/dummy/app/views/pages/home.html.slim +3 -0
  246. data/test/dummy/app/views/pianos/_form.html.erb +25 -0
  247. data/test/dummy/app/views/pianos/edit.html.erb +6 -0
  248. data/test/dummy/app/views/pianos/index.html.erb +25 -0
  249. data/test/dummy/app/views/pianos/new.html.erb +5 -0
  250. data/test/dummy/app/views/pianos/show.html.erb +15 -0
  251. data/test/dummy/config.ru +4 -0
  252. data/test/dummy/config/application.rb +50 -0
  253. data/test/dummy/config/boot.rb +10 -0
  254. data/test/dummy/config/cardboard.yml +126 -0
  255. data/test/dummy/config/database.yml +17 -0
  256. data/test/dummy/config/environment.rb +5 -0
  257. data/test/dummy/config/environments/development.rb +24 -0
  258. data/test/dummy/config/environments/production.rb +70 -0
  259. data/test/dummy/config/environments/test.rb +33 -0
  260. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  261. data/test/dummy/config/initializers/cardboard.rb +53 -0
  262. data/test/dummy/config/initializers/devise.rb +240 -0
  263. data/test/dummy/config/initializers/inflections.rb +15 -0
  264. data/test/dummy/config/initializers/mime_types.rb +5 -0
  265. data/test/dummy/config/initializers/secret_token.rb +8 -0
  266. data/test/dummy/config/initializers/session_store.rb +8 -0
  267. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  268. data/test/dummy/config/locales/devise.en.yml +59 -0
  269. data/test/dummy/config/locales/en.yml +5 -0
  270. data/test/dummy/config/routes.rb +16 -0
  271. data/test/dummy/db/migrate/20130403142235_create_pianos.rb +10 -0
  272. data/test/dummy/db/migrate/20130417134832_add_devise_to_admin_users.rb +53 -0
  273. data/test/dummy/db/migrate/20130426021522_create_news_posts.rb +10 -0
  274. data/test/dummy/db/migrate/20130501195423_create_icescreams.rb +10 -0
  275. data/test/dummy/db/migrate/20130502165540_create_beans.rb +12 -0
  276. data/test/dummy/db/migrate/20130522151358_create_cardboard_fields.rb +21 -0
  277. data/test/dummy/db/migrate/20130522151359_create_cardboard_page_parts.rb +17 -0
  278. data/test/dummy/db/migrate/20130522151400_create_cardboard_pages.rb +18 -0
  279. data/test/dummy/db/migrate/20130522151401_create_cardboard_settings.rb +14 -0
  280. data/test/dummy/db/migrate/20130607132558_create_admins.rb +9 -0
  281. data/test/dummy/db/schema.rb +129 -0
  282. data/test/dummy/db/seeds.rb +2 -0
  283. data/test/dummy/lib/assets/.gitkeep +0 -0
  284. data/test/dummy/log/.gitkeep +0 -0
  285. data/test/dummy/public/404.html +26 -0
  286. data/test/dummy/public/422.html +26 -0
  287. data/test/dummy/public/500.html +25 -0
  288. data/test/dummy/public/favicon.ico +0 -0
  289. data/test/dummy/public/system/dragonfly/development/2013/04/16/10_39_10_816_404_no_file.png +0 -0
  290. data/test/dummy/public/system/dragonfly/development/2013/04/16/10_39_10_816_404_no_file.png.meta +2 -0
  291. data/test/dummy/public/system/dragonfly/development/2013/04/16/10_39_17_87_404_no_file.png +0 -0
  292. data/test/dummy/public/system/dragonfly/development/2013/04/16/10_39_17_87_404_no_file.png.meta +2 -0
  293. data/test/dummy/public/system/dragonfly/development/2013/04/16/10_39_34_680_404_no_file.png +0 -0
  294. data/test/dummy/public/system/dragonfly/development/2013/04/16/10_39_34_680_404_no_file.png.meta +2 -0
  295. data/test/dummy/public/system/dragonfly/development/2013/04/16/10_44_00_698_404_no_file.png +0 -0
  296. data/test/dummy/public/system/dragonfly/development/2013/04/16/10_44_00_698_404_no_file.png.meta +2 -0
  297. data/test/dummy/public/system/dragonfly/development/2013/04/16/10_46_49_55_6152message_in_a_bottle.jpeg +0 -0
  298. data/test/dummy/public/system/dragonfly/development/2013/04/16/10_46_49_55_6152message_in_a_bottle.jpeg.meta +2 -0
  299. data/test/dummy/public/system/dragonfly/development/2013/04/16/14_10_30_773_404_no_file.png +0 -0
  300. data/test/dummy/public/system/dragonfly/development/2013/04/16/14_10_30_773_404_no_file.png.meta +2 -0
  301. data/test/dummy/public/system/dragonfly/development/2013/04/16/14_10_38_856_airport_shuttles_20130207_1647.csv +8 -0
  302. data/test/dummy/public/system/dragonfly/development/2013/04/16/14_10_38_856_airport_shuttles_20130207_1647.csv.meta +2 -0
  303. data/test/dummy/public/system/dragonfly/development/2013/04/16/14_12_12_144_1361696555_GMail_Android_R.png +0 -0
  304. data/test/dummy/public/system/dragonfly/development/2013/04/16/14_12_12_144_1361696555_GMail_Android_R.png.meta +2 -0
  305. data/test/dummy/public/system/dragonfly/development/2013/04/16/14_16_40_989_404_no_file.png +0 -0
  306. data/test/dummy/public/system/dragonfly/development/2013/04/16/14_16_40_989_404_no_file.png.meta +2 -0
  307. data/test/dummy/public/system/dragonfly/development/2013/04/16/14_19_19_40_6152message_in_a_bottle.jpeg +0 -0
  308. data/test/dummy/public/system/dragonfly/development/2013/04/16/14_19_19_40_6152message_in_a_bottle.jpeg.meta +2 -0
  309. data/test/dummy/public/system/dragonfly/development/2013/04/16/14_21_21_825_6152message_in_a_bottle.jpeg +0 -0
  310. data/test/dummy/public/system/dragonfly/development/2013/04/16/14_21_21_825_6152message_in_a_bottle.jpeg.meta +2 -0
  311. data/test/dummy/public/system/dragonfly/development/2013/04/16/15_46_33_341_bio.jpg +0 -0
  312. data/test/dummy/public/system/dragonfly/development/2013/04/16/15_46_33_341_bio.jpg.meta +2 -0
  313. data/test/dummy/public/system/dragonfly/development/2013/04/16/15_52_55_892_404_no_file.png +0 -0
  314. data/test/dummy/public/system/dragonfly/development/2013/04/16/15_52_55_892_404_no_file.png.meta +2 -0
  315. data/test/dummy/public/system/dragonfly/development/2013/04/16/15_52_56_30_404_no_file.png +0 -0
  316. data/test/dummy/public/system/dragonfly/development/2013/04/16/15_52_56_30_404_no_file.png.meta +2 -0
  317. data/test/dummy/public/system/dragonfly/development/2013/04/17/15_24_04_585_Sky_3920445.jpg +0 -0
  318. data/test/dummy/public/system/dragonfly/development/2013/04/17/15_24_04_585_Sky_3920445.jpg.meta +2 -0
  319. data/test/dummy/public/system/dragonfly/development/2013/04/17/15_25_41_111_Sky_3920445.jpg +0 -0
  320. data/test/dummy/public/system/dragonfly/development/2013/04/17/15_25_41_111_Sky_3920445.jpg.meta +2 -0
  321. data/test/dummy/public/system/dragonfly/development/2013/04/17/15_27_16_937_Sky_3920445.jpg +0 -0
  322. data/test/dummy/public/system/dragonfly/development/2013/04/17/15_27_16_937_Sky_3920445.jpg.meta +2 -0
  323. data/test/dummy/public/system/dragonfly/development/2013/04/17/15_27_57_585_Sky_3920445.jpg +0 -0
  324. data/test/dummy/public/system/dragonfly/development/2013/04/17/15_27_57_585_Sky_3920445.jpg.meta +2 -0
  325. data/test/dummy/public/system/dragonfly/development/2013/04/17/15_28_24_991_Sky_3920445.jpg +0 -0
  326. data/test/dummy/public/system/dragonfly/development/2013/04/17/15_28_24_991_Sky_3920445.jpg.meta +2 -0
  327. data/test/dummy/public/system/dragonfly/development/2013/04/17/15_33_30_610_Sky_3920445.jpg +0 -0
  328. data/test/dummy/public/system/dragonfly/development/2013/04/17/15_33_30_610_Sky_3920445.jpg.meta +2 -0
  329. data/test/dummy/public/system/dragonfly/development/2013/04/17/15_35_18_437_Sky_3920445.jpg +0 -0
  330. data/test/dummy/public/system/dragonfly/development/2013/04/17/15_35_18_437_Sky_3920445.jpg.meta +2 -0
  331. data/test/dummy/public/system/dragonfly/development/2013/04/17/16_45_07_162_Vehicle_Types.jpg +0 -0
  332. data/test/dummy/public/system/dragonfly/development/2013/04/17/16_45_07_162_Vehicle_Types.jpg.meta +2 -0
  333. data/test/dummy/public/system/dragonfly/development/2013/04/18/22_27_35_733_hall.jpg +0 -0
  334. data/test/dummy/public/system/dragonfly/development/2013/04/18/22_27_35_733_hall.jpg.meta +2 -0
  335. data/test/dummy/public/system/dragonfly/development/2013/04/18/22_29_15_808_fluidicon.png +0 -0
  336. data/test/dummy/public/system/dragonfly/development/2013/04/18/22_29_15_808_fluidicon.png.meta +2 -0
  337. data/test/dummy/public/system/dragonfly/development/2013/04/18/22_29_15_989_fluidicon.png +0 -0
  338. data/test/dummy/public/system/dragonfly/development/2013/04/18/22_29_15_989_fluidicon.png.meta +2 -0
  339. data/test/dummy/public/system/dragonfly/development/2013/04/19/09_54_44_881_hall3.jpg +0 -0
  340. data/test/dummy/public/system/dragonfly/development/2013/04/19/09_54_44_881_hall3.jpg.meta +2 -0
  341. data/test/dummy/public/system/dragonfly/development/2013/04/19/09_54_45_450_hall3.jpg +0 -0
  342. data/test/dummy/public/system/dragonfly/development/2013/04/19/09_54_45_450_hall3.jpg.meta +2 -0
  343. data/test/dummy/script/rails +6 -0
  344. data/test/dummy/test/fixtures/admins.yml +7 -0
  345. data/test/dummy/test/functional/admins_controller_test.rb +49 -0
  346. data/test/dummy/test/unit/admin_test.rb +7 -0
  347. data/test/dummy/test/unit/helpers/admins_helper_test.rb +4 -0
  348. data/test/factories.rb +47 -0
  349. data/test/integration/page_editing_test.rb +77 -0
  350. data/test/integration/seeding_test.rb +96 -0
  351. data/test/models/field_test.rb +102 -0
  352. data/test/models/page_test.rb +105 -0
  353. data/test/test_helper.rb +40 -0
  354. data/vendor/assets/javascripts/cardboard/bootstrap-select.js +590 -0
  355. data/vendor/assets/javascripts/cardboard/jquery.livesearch.js +48 -0
  356. data/vendor/assets/javascripts/cardboard/jquery.pjax.js +822 -0
  357. data/vendor/assets/javascripts/cardboard/jquery.wysihtml5_size_matters.js.coffee +44 -0
  358. data/vendor/assets/javascripts/cardboard/jquery.wysihtml5imgresizer.js +320 -0
  359. data/vendor/assets/javascripts/cardboard/wysihtml5-0.4.0pre.js +9579 -0
  360. metadata +1011 -0
@@ -0,0 +1,76 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
3
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
4
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5
+ <head>
6
+ <title>Cardboard::Field::ResourceLink</title>
7
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
8
+ <link rel="stylesheet" href="../../../css/reset.css" type="text/css" media="screen" />
9
+ <link rel="stylesheet" href="../../../css/main.css" type="text/css" media="screen" />
10
+ <link rel="stylesheet" href="../../../css/github.css" type="text/css" media="screen" />
11
+ <script src="../../../js/jquery-1.3.2.min.js" type="text/javascript" charset="utf-8"></script>
12
+ <script src="../../../js/jquery-effect.js" type="text/javascript" charset="utf-8"></script>
13
+ <script src="../../../js/main.js" type="text/javascript" charset="utf-8"></script>
14
+ <script src="../../../js/highlight.pack.js" type="text/javascript" charset="utf-8"></script>
15
+
16
+ </head>
17
+
18
+ <body>
19
+ <div class="banner">
20
+
21
+ <h1>
22
+ <span class="type">Class</span>
23
+ Cardboard::Field::ResourceLink
24
+
25
+ <span class="parent">&lt;
26
+
27
+ <a href="../Field.html">Cardboard::Field</a>
28
+
29
+ </span>
30
+
31
+ </h1>
32
+ <ul class="files">
33
+
34
+ <li><a href="../../../files/app/models/cardboard/field/resource_link_rb.html">app/models/cardboard/field/resource_link.rb</a></li>
35
+
36
+ </ul>
37
+ </div>
38
+ <div id="bodyContent">
39
+ <div id="content">
40
+
41
+
42
+
43
+
44
+
45
+
46
+
47
+
48
+
49
+
50
+
51
+
52
+
53
+
54
+
55
+
56
+
57
+
58
+
59
+
60
+
61
+
62
+
63
+
64
+
65
+
66
+
67
+
68
+
69
+
70
+
71
+ <!-- Methods -->
72
+ </div>
73
+
74
+ </div>
75
+ </body>
76
+ </html>
@@ -0,0 +1,131 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
3
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
4
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5
+ <head>
6
+ <title>Cardboard::Field::RichText</title>
7
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
8
+ <link rel="stylesheet" href="../../../css/reset.css" type="text/css" media="screen" />
9
+ <link rel="stylesheet" href="../../../css/main.css" type="text/css" media="screen" />
10
+ <link rel="stylesheet" href="../../../css/github.css" type="text/css" media="screen" />
11
+ <script src="../../../js/jquery-1.3.2.min.js" type="text/javascript" charset="utf-8"></script>
12
+ <script src="../../../js/jquery-effect.js" type="text/javascript" charset="utf-8"></script>
13
+ <script src="../../../js/main.js" type="text/javascript" charset="utf-8"></script>
14
+ <script src="../../../js/highlight.pack.js" type="text/javascript" charset="utf-8"></script>
15
+
16
+ </head>
17
+
18
+ <body>
19
+ <div class="banner">
20
+
21
+ <h1>
22
+ <span class="type">Class</span>
23
+ Cardboard::Field::RichText
24
+
25
+ <span class="parent">&lt;
26
+
27
+ <a href="../Field.html">Cardboard::Field</a>
28
+
29
+ </span>
30
+
31
+ </h1>
32
+ <ul class="files">
33
+
34
+ <li><a href="../../../files/app/models/cardboard/field/rich_text_rb.html">app/models/cardboard/field/rich_text.rb</a></li>
35
+
36
+ </ul>
37
+ </div>
38
+ <div id="bodyContent">
39
+ <div id="content">
40
+
41
+
42
+
43
+
44
+
45
+
46
+
47
+
48
+
49
+
50
+
51
+
52
+
53
+
54
+ <!-- Method ref -->
55
+ <div class="sectiontitle">Methods</div>
56
+ <dl class="methods">
57
+
58
+ <dt>D</dt>
59
+ <dd>
60
+ <ul>
61
+
62
+
63
+ <li>
64
+ <a href="#method-i-default">default</a>
65
+ </li>
66
+
67
+ </ul>
68
+ </dd>
69
+
70
+ </dl>
71
+
72
+
73
+
74
+
75
+
76
+
77
+
78
+
79
+
80
+
81
+
82
+
83
+
84
+
85
+
86
+
87
+
88
+
89
+ <!-- Methods -->
90
+
91
+ <div class="sectiontitle">Instance Public methods</div>
92
+
93
+ <div class="method">
94
+ <div class="title method-title" id="method-i-default">
95
+
96
+ <b>default</b>()
97
+
98
+ <a href="../../../classes/Cardboard/Field/RichText.html#method-i-default" name="method-i-default" class="permalink">Link</a>
99
+ </div>
100
+
101
+
102
+ <div class="description">
103
+
104
+ </div>
105
+
106
+
107
+
108
+
109
+
110
+
111
+ <div class="sourcecode">
112
+
113
+ <p class="source-link">
114
+ Source:
115
+ <a href="javascript:toggleSource('method-i-default_source')" id="l_method-i-default_source">show</a>
116
+
117
+ </p>
118
+ <div id="method-i-default_source" class="dyn-source">
119
+ <pre><span class="ruby-comment"># File app/models/cardboard/field/rich_text.rb, line 8</span>
120
+ <span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">default</span>
121
+ <span class="ruby-string">&quot;&lt;div&gt;&lt;h2&gt;&lt;span&gt;What is Lorem Ipsum?&lt;/span&gt;&lt;/h2&gt;&lt;p&gt;&lt;strong&gt;Lorem Ipsum&lt;/strong&gt; is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.&lt;/p&gt;&lt;/div&gt;&quot;</span>
122
+ <span class="ruby-keyword">end</span></pre>
123
+ </div>
124
+ </div>
125
+
126
+ </div>
127
+ </div>
128
+
129
+ </div>
130
+ </body>
131
+ </html>
@@ -0,0 +1,131 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
3
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
4
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5
+ <head>
6
+ <title>Cardboard::Field::String</title>
7
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
8
+ <link rel="stylesheet" href="../../../css/reset.css" type="text/css" media="screen" />
9
+ <link rel="stylesheet" href="../../../css/main.css" type="text/css" media="screen" />
10
+ <link rel="stylesheet" href="../../../css/github.css" type="text/css" media="screen" />
11
+ <script src="../../../js/jquery-1.3.2.min.js" type="text/javascript" charset="utf-8"></script>
12
+ <script src="../../../js/jquery-effect.js" type="text/javascript" charset="utf-8"></script>
13
+ <script src="../../../js/main.js" type="text/javascript" charset="utf-8"></script>
14
+ <script src="../../../js/highlight.pack.js" type="text/javascript" charset="utf-8"></script>
15
+
16
+ </head>
17
+
18
+ <body>
19
+ <div class="banner">
20
+
21
+ <h1>
22
+ <span class="type">Class</span>
23
+ Cardboard::Field::String
24
+
25
+ <span class="parent">&lt;
26
+
27
+ <a href="../Field.html">Cardboard::Field</a>
28
+
29
+ </span>
30
+
31
+ </h1>
32
+ <ul class="files">
33
+
34
+ <li><a href="../../../files/app/models/cardboard/field/string_rb.html">app/models/cardboard/field/string.rb</a></li>
35
+
36
+ </ul>
37
+ </div>
38
+ <div id="bodyContent">
39
+ <div id="content">
40
+
41
+
42
+
43
+
44
+
45
+
46
+
47
+
48
+
49
+
50
+
51
+
52
+
53
+
54
+ <!-- Method ref -->
55
+ <div class="sectiontitle">Methods</div>
56
+ <dl class="methods">
57
+
58
+ <dt>D</dt>
59
+ <dd>
60
+ <ul>
61
+
62
+
63
+ <li>
64
+ <a href="#method-i-default">default</a>
65
+ </li>
66
+
67
+ </ul>
68
+ </dd>
69
+
70
+ </dl>
71
+
72
+
73
+
74
+
75
+
76
+
77
+
78
+
79
+
80
+
81
+
82
+
83
+
84
+
85
+
86
+
87
+
88
+
89
+ <!-- Methods -->
90
+
91
+ <div class="sectiontitle">Instance Public methods</div>
92
+
93
+ <div class="method">
94
+ <div class="title method-title" id="method-i-default">
95
+
96
+ <b>default</b>()
97
+
98
+ <a href="../../../classes/Cardboard/Field/String.html#method-i-default" name="method-i-default" class="permalink">Link</a>
99
+ </div>
100
+
101
+
102
+ <div class="description">
103
+
104
+ </div>
105
+
106
+
107
+
108
+
109
+
110
+
111
+ <div class="sourcecode">
112
+
113
+ <p class="source-link">
114
+ Source:
115
+ <a href="javascript:toggleSource('method-i-default_source')" id="l_method-i-default_source">show</a>
116
+
117
+ </p>
118
+ <div id="method-i-default_source" class="dyn-source">
119
+ <pre><span class="ruby-comment"># File app/models/cardboard/field/string.rb, line 6</span>
120
+ <span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">default</span>
121
+ <span class="ruby-string">&quot;Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur&quot;</span>
122
+ <span class="ruby-keyword">end</span></pre>
123
+ </div>
124
+ </div>
125
+
126
+ </div>
127
+ </div>
128
+
129
+ </div>
130
+ </body>
131
+ </html>
@@ -0,0 +1,1184 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
3
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
4
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5
+ <head>
6
+ <title>Cardboard::Page</title>
7
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
8
+ <link rel="stylesheet" href="../../css/reset.css" type="text/css" media="screen" />
9
+ <link rel="stylesheet" href="../../css/main.css" type="text/css" media="screen" />
10
+ <link rel="stylesheet" href="../../css/github.css" type="text/css" media="screen" />
11
+ <script src="../../js/jquery-1.3.2.min.js" type="text/javascript" charset="utf-8"></script>
12
+ <script src="../../js/jquery-effect.js" type="text/javascript" charset="utf-8"></script>
13
+ <script src="../../js/main.js" type="text/javascript" charset="utf-8"></script>
14
+ <script src="../../js/highlight.pack.js" type="text/javascript" charset="utf-8"></script>
15
+
16
+ </head>
17
+
18
+ <body>
19
+ <div class="banner">
20
+
21
+ <h1>
22
+ <span class="type">Class</span>
23
+ Cardboard::Page
24
+
25
+ <span class="parent">&lt;
26
+
27
+ ActiveRecord::Base
28
+
29
+ </span>
30
+
31
+ </h1>
32
+ <ul class="files">
33
+
34
+ <li><a href="../../files/app/models/cardboard/page_rb.html">app/models/cardboard/page.rb</a></li>
35
+
36
+ </ul>
37
+ </div>
38
+ <div id="bodyContent">
39
+ <div id="content">
40
+
41
+
42
+
43
+
44
+
45
+
46
+
47
+
48
+
49
+
50
+
51
+
52
+
53
+
54
+ <!-- Method ref -->
55
+ <div class="sectiontitle">Methods</div>
56
+ <dl class="methods">
57
+
58
+ <dt>A</dt>
59
+ <dd>
60
+ <ul>
61
+
62
+
63
+ <li>
64
+ <a href="#method-c-arrange">arrange</a>
65
+ </li>
66
+
67
+ </ul>
68
+ </dd>
69
+
70
+ <dt>C</dt>
71
+ <dd>
72
+ <ul>
73
+
74
+
75
+ <li>
76
+ <a href="#method-i-children">children</a>,
77
+ </li>
78
+
79
+
80
+ <li>
81
+ <a href="#method-c-clear_arranged_pages">clear_arranged_pages</a>
82
+ </li>
83
+
84
+ </ul>
85
+ </dd>
86
+
87
+ <dt>D</dt>
88
+ <dd>
89
+ <ul>
90
+
91
+
92
+ <li>
93
+ <a href="#method-i-depth">depth</a>
94
+ </li>
95
+
96
+ </ul>
97
+ </dd>
98
+
99
+ <dt>F</dt>
100
+ <dd>
101
+ <ul>
102
+
103
+
104
+ <li>
105
+ <a href="#method-c-find_by_url">find_by_url</a>
106
+ </li>
107
+
108
+ </ul>
109
+ </dd>
110
+
111
+ <dt>G</dt>
112
+ <dd>
113
+ <ul>
114
+
115
+
116
+ <li>
117
+ <a href="#method-i-get">get</a>
118
+ </li>
119
+
120
+ </ul>
121
+ </dd>
122
+
123
+ <dt>H</dt>
124
+ <dd>
125
+ <ul>
126
+
127
+
128
+ <li>
129
+ <a href="#method-c-homepage">homepage</a>
130
+ </li>
131
+
132
+ </ul>
133
+ </dd>
134
+
135
+ <dt>I</dt>
136
+ <dd>
137
+ <ul>
138
+
139
+
140
+ <li>
141
+ <a href="#method-i-is_root-3D">is_root=</a>
142
+ </li>
143
+
144
+ </ul>
145
+ </dd>
146
+
147
+ <dt>P</dt>
148
+ <dd>
149
+ <ul>
150
+
151
+
152
+ <li>
153
+ <a href="#method-i-parent">parent</a>,
154
+ </li>
155
+
156
+
157
+ <li>
158
+ <a href="#method-i-parent-3D">parent=</a>,
159
+ </li>
160
+
161
+
162
+ <li>
163
+ <a href="#method-i-parent_id-3D">parent_id=</a>,
164
+ </li>
165
+
166
+
167
+ <li>
168
+ <a href="#method-i-parent_url-3D">parent_url=</a>,
169
+ </li>
170
+
171
+
172
+ <li>
173
+ <a href="#method-i-parent_url_options">parent_url_options</a>
174
+ </li>
175
+
176
+ </ul>
177
+ </dd>
178
+
179
+ <dt>R</dt>
180
+ <dd>
181
+ <ul>
182
+
183
+
184
+ <li>
185
+ <a href="#method-c-root">root</a>,
186
+ </li>
187
+
188
+
189
+ <li>
190
+ <a href="#method-i-root-3F">root?</a>
191
+ </li>
192
+
193
+ </ul>
194
+ </dd>
195
+
196
+ <dt>S</dt>
197
+ <dd>
198
+ <ul>
199
+
200
+
201
+ <li>
202
+ <a href="#method-i-seo">seo</a>,
203
+ </li>
204
+
205
+
206
+ <li>
207
+ <a href="#method-i-seo-3D">seo=</a>,
208
+ </li>
209
+
210
+
211
+ <li>
212
+ <a href="#method-i-siblings">siblings</a>,
213
+ </li>
214
+
215
+
216
+ <li>
217
+ <a href="#method-i-slug-3D">slug=</a>,
218
+ </li>
219
+
220
+
221
+ <li>
222
+ <a href="#method-i-split_path">split_path</a>
223
+ </li>
224
+
225
+ </ul>
226
+ </dd>
227
+
228
+ <dt>U</dt>
229
+ <dd>
230
+ <ul>
231
+
232
+
233
+ <li>
234
+ <a href="#method-i-url">url</a>,
235
+ </li>
236
+
237
+
238
+ <li>
239
+ <a href="#method-i-using_slug_backup-3D">using_slug_backup=</a>,
240
+ </li>
241
+
242
+
243
+ <li>
244
+ <a href="#method-i-using_slug_backup-3F">using_slug_backup?</a>
245
+ </li>
246
+
247
+ </ul>
248
+ </dd>
249
+
250
+ </dl>
251
+
252
+
253
+
254
+ <!-- Includes -->
255
+ <div class="sectiontitle">Included Modules</div>
256
+ <ul>
257
+
258
+ <li>
259
+
260
+ RankedModel
261
+
262
+ </li>
263
+
264
+ </ul>
265
+
266
+
267
+
268
+
269
+
270
+
271
+
272
+
273
+
274
+
275
+
276
+
277
+
278
+
279
+ <!-- Section attributes -->
280
+ <div class="sectiontitle">Attributes</div>
281
+ <table border='0' cellpadding='5'>
282
+
283
+ <tr valign='top'>
284
+ <td class='attr-rw'>
285
+ [RW]
286
+ </td>
287
+ <td class='attr-name'>is_root</td>
288
+ <td class='attr-desc'></td>
289
+ </tr>
290
+
291
+ <tr valign='top'>
292
+ <td class='attr-rw'>
293
+ [RW]
294
+ </td>
295
+ <td class='attr-name'>parent_url</td>
296
+ <td class='attr-desc'></td>
297
+ </tr>
298
+
299
+ </table>
300
+
301
+
302
+
303
+ <!-- Methods -->
304
+
305
+ <div class="sectiontitle">Class Public methods</div>
306
+
307
+ <div class="method">
308
+ <div class="title method-title" id="method-c-arrange">
309
+
310
+ <b>arrange</b>(root_page = nil)
311
+
312
+ <a href="../../classes/Cardboard/Page.html#method-c-arrange" name="method-c-arrange" class="permalink">Link</a>
313
+ </div>
314
+
315
+
316
+ <div class="description">
317
+ <p>Arrange array of nodes into a nested hash of the form {node =&gt;
318
+ children}, where children = {} if the node has no children</p>
319
+
320
+ <p>Example: {#&lt;<a href="Page.html">Cardboard::Page</a> =&gt; {</p>
321
+
322
+ <pre class="ruby"><span class="ruby-comment">#&lt;Cardboard::Page =&gt; {}</span>
323
+ <span class="ruby-comment">#&lt;Cardboard::Page =&gt; {}</span>
324
+ <span class="ruby-comment">#&lt;Cardboard::Page =&gt; {#&lt;Cardboard::Page =&gt; {}}</span>
325
+ </pre>
326
+
327
+ <p>}}</p>
328
+ </div>
329
+
330
+
331
+
332
+
333
+
334
+
335
+ <div class="sourcecode">
336
+
337
+ <p class="source-link">
338
+ Source:
339
+ <a href="javascript:toggleSource('method-c-arrange_source')" id="l_method-c-arrange_source">show</a>
340
+
341
+ </p>
342
+ <div id="method-c-arrange_source" class="dyn-source">
343
+ <pre><span class="ruby-comment"># File app/models/cardboard/page.rb, line 186</span>
344
+ <span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">self</span>.<span class="ruby-identifier">arrange</span>(<span class="ruby-identifier">root_page</span> = <span class="ruby-keyword">nil</span>)
345
+ <span class="ruby-identifier">root_page</span> = <span class="ruby-keyword">self</span>.<span class="ruby-identifier">root</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">root_page</span>.<span class="ruby-identifier">nil?</span>
346
+
347
+ <span class="ruby-ivar">@lock</span>.<span class="ruby-identifier">synchronize</span> <span class="ruby-keyword">do</span>
348
+ <span class="ruby-ivar">@_arranged_pages</span> <span class="ruby-operator">||=</span> {}
349
+ <span class="ruby-ivar">@_arranged_pages</span>[<span class="ruby-identifier">root_page</span>.<span class="ruby-identifier">id</span>.<span class="ruby-identifier">to_s</span>] <span class="ruby-operator">||=</span> <span class="ruby-keyword">begin</span>
350
+ <span class="ruby-identifier">pages</span> = <span class="ruby-keyword">self</span>.<span class="ruby-identifier">preordered</span>.<span class="ruby-identifier">all</span>
351
+
352
+ <span class="ruby-identifier">pages</span>.<span class="ruby-identifier">inject</span>(<span class="ruby-constant">ActiveSupport</span><span class="ruby-operator">::</span><span class="ruby-constant">OrderedHash</span>.<span class="ruby-identifier">new</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">ordered_hash</span>, <span class="ruby-identifier">page</span><span class="ruby-operator">|</span>
353
+ ([<span class="ruby-string">&quot;/&quot;</span>] <span class="ruby-operator">+</span> <span class="ruby-identifier">page</span>.<span class="ruby-identifier">split_path</span>).<span class="ruby-identifier">inject</span>(<span class="ruby-identifier">ordered_hash</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">insertion_hash</span>, <span class="ruby-identifier">subpath</span><span class="ruby-operator">|</span>
354
+
355
+ <span class="ruby-identifier">insertion_hash</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">parent</span>, <span class="ruby-identifier">children</span><span class="ruby-operator">|</span>
356
+ <span class="ruby-identifier">insertion_hash</span> = <span class="ruby-identifier">children</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">subpath</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">parent</span>.<span class="ruby-identifier">slug</span>
357
+ <span class="ruby-keyword">end</span>
358
+ <span class="ruby-identifier">insertion_hash</span>
359
+ <span class="ruby-keyword">end</span>[<span class="ruby-identifier">page</span>] = <span class="ruby-constant">ActiveSupport</span><span class="ruby-operator">::</span><span class="ruby-constant">OrderedHash</span>.<span class="ruby-identifier">new</span>
360
+ <span class="ruby-identifier">ordered_hash</span>
361
+ <span class="ruby-keyword">end</span>
362
+ <span class="ruby-keyword">end</span>
363
+ <span class="ruby-keyword">end</span>
364
+ <span class="ruby-keyword">end</span></pre>
365
+ </div>
366
+ </div>
367
+
368
+ </div>
369
+
370
+ <div class="method">
371
+ <div class="title method-title" id="method-c-clear_arranged_pages">
372
+
373
+ <b>clear_arranged_pages</b>()
374
+
375
+ <a href="../../classes/Cardboard/Page.html#method-c-clear_arranged_pages" name="method-c-clear_arranged_pages" class="permalink">Link</a>
376
+ </div>
377
+
378
+
379
+ <div class="description">
380
+
381
+ </div>
382
+
383
+
384
+
385
+
386
+
387
+
388
+ <div class="sourcecode">
389
+
390
+ <p class="source-link">
391
+ Source:
392
+ <a href="javascript:toggleSource('method-c-clear_arranged_pages_source')" id="l_method-c-clear_arranged_pages_source">show</a>
393
+
394
+ </p>
395
+ <div id="method-c-clear_arranged_pages_source" class="dyn-source">
396
+ <pre><span class="ruby-comment"># File app/models/cardboard/page.rb, line 207</span>
397
+ <span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">self</span>.<span class="ruby-identifier">clear_arranged_pages</span>
398
+ <span class="ruby-comment"># clear cache when a page change</span>
399
+ <span class="ruby-ivar">@lock</span>.<span class="ruby-identifier">synchronize</span> <span class="ruby-keyword">do</span>
400
+ <span class="ruby-ivar">@_arranged_pages</span> = <span class="ruby-keyword">nil</span>
401
+ <span class="ruby-keyword">end</span>
402
+ <span class="ruby-keyword">end</span></pre>
403
+ </div>
404
+ </div>
405
+
406
+ </div>
407
+
408
+ <div class="method">
409
+ <div class="title method-title" id="method-c-find_by_url">
410
+
411
+ <b>find_by_url</b>(full_url)
412
+
413
+ <a href="../../classes/Cardboard/Page.html#method-c-find_by_url" name="method-c-find_by_url" class="permalink">Link</a>
414
+ </div>
415
+
416
+
417
+ <div class="description">
418
+ <p>class methods</p>
419
+ </div>
420
+
421
+
422
+
423
+
424
+
425
+
426
+ <div class="sourcecode">
427
+
428
+ <p class="source-link">
429
+ Source:
430
+ <a href="javascript:toggleSource('method-c-find_by_url_source')" id="l_method-c-find_by_url_source">show</a>
431
+
432
+ </p>
433
+ <div id="method-c-find_by_url_source" class="dyn-source">
434
+ <pre><span class="ruby-comment"># File app/models/cardboard/page.rb, line 58</span>
435
+ <span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">self</span>.<span class="ruby-identifier">find_by_url</span>(<span class="ruby-identifier">full_url</span>)
436
+ <span class="ruby-identifier">path</span>, <span class="ruby-identifier">slug</span> = <span class="ruby-keyword">self</span>.<span class="ruby-identifier">path_and_slug</span>(<span class="ruby-identifier">full_url</span>)
437
+ <span class="ruby-identifier">page</span> = <span class="ruby-keyword">self</span>.<span class="ruby-identifier">where</span>(<span class="ruby-identifier">path</span><span class="ruby-operator">:</span> <span class="ruby-identifier">path</span>, <span class="ruby-identifier">slug</span><span class="ruby-operator">:</span> <span class="ruby-identifier">slug</span>).<span class="ruby-identifier">first</span>
438
+
439
+ <span class="ruby-keyword">if</span> <span class="ruby-identifier">slug</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">page</span>.<span class="ruby-identifier">nil?</span>
440
+ <span class="ruby-comment">#use arel instead of LIKE/ILIKE</span>
441
+ <span class="ruby-identifier">page</span> = <span class="ruby-keyword">self</span>.<span class="ruby-identifier">where</span>(<span class="ruby-identifier">path</span><span class="ruby-operator">:</span> <span class="ruby-identifier">path</span>).<span class="ruby-identifier">where</span>(<span class="ruby-keyword">self</span>.<span class="ruby-identifier">arel_table</span>[<span class="ruby-value">:slugs_backup</span>].<span class="ruby-identifier">matches</span>(<span class="ruby-node">&quot;% #{slug}\n%&quot;</span>)).<span class="ruby-identifier">first</span>
442
+ <span class="ruby-identifier">page</span>.<span class="ruby-identifier">using_slug_backup</span> = <span class="ruby-keyword">true</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">page</span>
443
+ <span class="ruby-keyword">end</span>
444
+
445
+ <span class="ruby-identifier">page</span>
446
+ <span class="ruby-keyword">end</span></pre>
447
+ </div>
448
+ </div>
449
+
450
+ </div>
451
+
452
+ <div class="method">
453
+ <div class="title method-title" id="method-c-homepage">
454
+
455
+ <b>homepage</b>()
456
+
457
+ <a href="../../classes/Cardboard/Page.html#method-c-homepage" name="method-c-homepage" class="permalink">Link</a>
458
+ </div>
459
+
460
+
461
+ <div class="description">
462
+
463
+ </div>
464
+
465
+
466
+
467
+
468
+
469
+
470
+ <div class="sourcecode">
471
+
472
+ <p class="source-link">
473
+ Source:
474
+ <a href="javascript:toggleSource('method-c-homepage_source')" id="l_method-c-homepage_source">show</a>
475
+
476
+ </p>
477
+ <div id="method-c-homepage_source" class="dyn-source">
478
+ <pre><span class="ruby-comment"># File app/models/cardboard/page.rb, line 75</span>
479
+ <span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">self</span>.<span class="ruby-identifier">homepage</span>; <span class="ruby-keyword">self</span>.<span class="ruby-identifier">root</span>; <span class="ruby-keyword">end</span></pre>
480
+ </div>
481
+ </div>
482
+
483
+ </div>
484
+
485
+ <div class="method">
486
+ <div class="title method-title" id="method-c-root">
487
+
488
+ <b>root</b>()
489
+
490
+ <a href="../../classes/Cardboard/Page.html#method-c-root" name="method-c-root" class="permalink">Link</a>
491
+ </div>
492
+
493
+
494
+ <div class="description">
495
+
496
+ </div>
497
+
498
+
499
+
500
+
501
+
502
+
503
+ <div class="sourcecode">
504
+
505
+ <p class="source-link">
506
+ Source:
507
+ <a href="javascript:toggleSource('method-c-root_source')" id="l_method-c-root_source">show</a>
508
+
509
+ </p>
510
+ <div id="method-c-root_source" class="dyn-source">
511
+ <pre><span class="ruby-comment"># File app/models/cardboard/page.rb, line 71</span>
512
+ <span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">self</span>.<span class="ruby-identifier">root</span>
513
+ <span class="ruby-comment"># Homepage is the highest position in the root path</span>
514
+ <span class="ruby-identifier">where</span>(<span class="ruby-identifier">path</span><span class="ruby-operator">:</span> <span class="ruby-string">&quot;/&quot;</span>).<span class="ruby-identifier">rank</span>(<span class="ruby-value">:position</span>).<span class="ruby-identifier">first</span>
515
+ <span class="ruby-keyword">end</span></pre>
516
+ </div>
517
+ </div>
518
+
519
+ </div>
520
+
521
+ <div class="sectiontitle">Instance Public methods</div>
522
+
523
+ <div class="method">
524
+ <div class="title method-title" id="method-i-children">
525
+
526
+ <b>children</b>()
527
+
528
+ <a href="../../classes/Cardboard/Page.html#method-i-children" name="method-i-children" class="permalink">Link</a>
529
+ </div>
530
+
531
+
532
+ <div class="description">
533
+
534
+ </div>
535
+
536
+
537
+
538
+
539
+
540
+
541
+ <div class="sourcecode">
542
+
543
+ <p class="source-link">
544
+ Source:
545
+ <a href="javascript:toggleSource('method-i-children_source')" id="l_method-i-children_source">show</a>
546
+
547
+ </p>
548
+ <div id="method-i-children_source" class="dyn-source">
549
+ <pre><span class="ruby-comment"># File app/models/cardboard/page.rb, line 164</span>
550
+ <span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">children</span>
551
+ <span class="ruby-constant">Cardboard</span><span class="ruby-operator">::</span><span class="ruby-constant">Page</span>.<span class="ruby-identifier">where</span>(<span class="ruby-identifier">path</span><span class="ruby-operator">:</span> <span class="ruby-identifier">url</span>)
552
+ <span class="ruby-keyword">end</span></pre>
553
+ </div>
554
+ </div>
555
+
556
+ </div>
557
+
558
+ <div class="method">
559
+ <div class="title method-title" id="method-i-depth">
560
+
561
+ <b>depth</b>()
562
+
563
+ <a href="../../classes/Cardboard/Page.html#method-i-depth" name="method-i-depth" class="permalink">Link</a>
564
+ </div>
565
+
566
+
567
+ <div class="description">
568
+
569
+ </div>
570
+
571
+
572
+
573
+
574
+
575
+
576
+ <div class="sourcecode">
577
+
578
+ <p class="source-link">
579
+ Source:
580
+ <a href="javascript:toggleSource('method-i-depth_source')" id="l_method-i-depth_source">show</a>
581
+
582
+ </p>
583
+ <div id="method-i-depth_source" class="dyn-source">
584
+ <pre><span class="ruby-comment"># File app/models/cardboard/page.rb, line 172</span>
585
+ <span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">depth</span>
586
+ <span class="ruby-comment"># root is depth 0</span>
587
+ <span class="ruby-identifier">split_path</span>.<span class="ruby-identifier">size</span>
588
+ <span class="ruby-keyword">end</span></pre>
589
+ </div>
590
+ </div>
591
+
592
+ </div>
593
+
594
+ <div class="method">
595
+ <div class="title method-title" id="method-i-get">
596
+
597
+ <b>get</b>(field)
598
+
599
+ <a href="../../classes/Cardboard/Page.html#method-i-get" name="method-i-get" class="permalink">Link</a>
600
+ </div>
601
+
602
+
603
+ <div class="description">
604
+ <p>slideshow = @page.get(“slideshow”) slideshow.field(“image1”)
605
+ slideshow.each{|p| p.field(“image”)} slideshow.get(“slide1”)</p>
606
+ </div>
607
+
608
+
609
+
610
+
611
+
612
+
613
+ <div class="sourcecode">
614
+
615
+ <p class="source-link">
616
+ Source:
617
+ <a href="javascript:toggleSource('method-i-get_source')" id="l_method-i-get_source">show</a>
618
+
619
+ </p>
620
+ <div id="method-i-get_source" class="dyn-source">
621
+ <pre><span class="ruby-comment"># File app/models/cardboard/page.rb, line 92</span>
622
+ <span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">get</span>(<span class="ruby-identifier">field</span>)
623
+ <span class="ruby-identifier">f</span> = <span class="ruby-identifier">field</span>.<span class="ruby-identifier">split</span>(<span class="ruby-string">&quot;.&quot;</span>)
624
+ <span class="ruby-identifier">parent_part</span> = <span class="ruby-keyword">self</span>.<span class="ruby-identifier">parts</span>.<span class="ruby-identifier">where</span>(<span class="ruby-identifier">identifier</span><span class="ruby-operator">:</span> <span class="ruby-identifier">f</span>.<span class="ruby-identifier">first</span>).<span class="ruby-identifier">first</span>
625
+ <span class="ruby-identifier">part</span> = <span class="ruby-identifier">parent_part</span>.<span class="ruby-identifier">try</span>(<span class="ruby-value">:subparts</span>)
626
+ <span class="ruby-keyword">return</span> <span class="ruby-keyword">nil</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">part</span>
627
+ <span class="ruby-keyword">if</span> <span class="ruby-identifier">parent_part</span>.<span class="ruby-identifier">repeatable?</span>
628
+ <span class="ruby-identifier">raise</span> <span class="ruby-string">&quot;Part is repeatable, expected each loop&quot;</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">f</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">==</span> <span class="ruby-number">1</span>
629
+ <span class="ruby-identifier">part</span>
630
+ <span class="ruby-keyword">else</span>
631
+ <span class="ruby-identifier">f</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">==</span> <span class="ruby-number">1</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">part</span>.<span class="ruby-identifier">first</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">part</span>.<span class="ruby-identifier">first</span>.<span class="ruby-identifier">attr</span>(<span class="ruby-identifier">f</span>.<span class="ruby-identifier">last</span>)
632
+ <span class="ruby-keyword">end</span>
633
+ <span class="ruby-keyword">end</span></pre>
634
+ </div>
635
+ </div>
636
+
637
+ </div>
638
+
639
+ <div class="method">
640
+ <div class="title method-title" id="method-i-is_root-3D">
641
+
642
+ <b>is_root=</b>(val)
643
+
644
+ <a href="../../classes/Cardboard/Page.html#method-i-is_root-3D" name="method-i-is_root-3D" class="permalink">Link</a>
645
+ </div>
646
+
647
+
648
+ <div class="description">
649
+
650
+ </div>
651
+
652
+
653
+
654
+
655
+
656
+
657
+ <div class="sourcecode">
658
+
659
+ <p class="source-link">
660
+ Source:
661
+ <a href="javascript:toggleSource('method-i-is_root-3D_source')" id="l_method-i-is_root-3D_source">show</a>
662
+
663
+ </p>
664
+ <div id="method-i-is_root-3D_source" class="dyn-source">
665
+ <pre><span class="ruby-comment"># File app/models/cardboard/page.rb, line 45</span>
666
+ <span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">is_root=</span>(<span class="ruby-identifier">val</span>)
667
+ <span class="ruby-keyword">self</span>.<span class="ruby-identifier">position_position</span> = <span class="ruby-value">:first</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">val</span>
668
+ <span class="ruby-keyword">end</span></pre>
669
+ </div>
670
+ </div>
671
+
672
+ </div>
673
+
674
+ <div class="method">
675
+ <div class="title method-title" id="method-i-parent">
676
+
677
+ <b>parent</b>()
678
+
679
+ <a href="../../classes/Cardboard/Page.html#method-i-parent" name="method-i-parent" class="permalink">Link</a>
680
+ </div>
681
+
682
+
683
+ <div class="description">
684
+
685
+ </div>
686
+
687
+
688
+
689
+
690
+
691
+
692
+ <div class="sourcecode">
693
+
694
+ <p class="source-link">
695
+ Source:
696
+ <a href="javascript:toggleSource('method-i-parent_source')" id="l_method-i-parent_source">show</a>
697
+
698
+ </p>
699
+ <div id="method-i-parent_source" class="dyn-source">
700
+ <pre><span class="ruby-comment"># File app/models/cardboard/page.rb, line 132</span>
701
+ <span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">parent</span>
702
+ <span class="ruby-ivar">@parent</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">Cardboard</span><span class="ruby-operator">::</span><span class="ruby-constant">Page</span>.<span class="ruby-identifier">find_by_url</span>(<span class="ruby-identifier">path</span>)
703
+ <span class="ruby-keyword">end</span></pre>
704
+ </div>
705
+ </div>
706
+
707
+ </div>
708
+
709
+ <div class="method">
710
+ <div class="title method-title" id="method-i-parent-3D">
711
+
712
+ <b>parent=</b>(new_parent)
713
+
714
+ <a href="../../classes/Cardboard/Page.html#method-i-parent-3D" name="method-i-parent-3D" class="permalink">Link</a>
715
+ </div>
716
+
717
+
718
+ <div class="description">
719
+
720
+ </div>
721
+
722
+
723
+
724
+
725
+
726
+
727
+ <div class="sourcecode">
728
+
729
+ <p class="source-link">
730
+ Source:
731
+ <a href="javascript:toggleSource('method-i-parent-3D_source')" id="l_method-i-parent-3D_source">show</a>
732
+
733
+ </p>
734
+ <div id="method-i-parent-3D_source" class="dyn-source">
735
+ <pre><span class="ruby-comment"># File app/models/cardboard/page.rb, line 151</span>
736
+ <span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">parent=</span>(<span class="ruby-identifier">new_parent</span>)
737
+ <span class="ruby-keyword">return</span> <span class="ruby-keyword">nil</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">new_parent</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-identifier">new_parent</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Cardboard</span><span class="ruby-operator">::</span><span class="ruby-constant">Page</span>)
738
+ <span class="ruby-keyword">self</span>.<span class="ruby-identifier">path</span> = <span class="ruby-identifier">new_parent</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">new_parent</span>.<span class="ruby-identifier">url</span> <span class="ruby-operator">:</span> <span class="ruby-string">&quot;/&quot;</span>
739
+ <span class="ruby-keyword">end</span></pre>
740
+ </div>
741
+ </div>
742
+
743
+ </div>
744
+
745
+ <div class="method">
746
+ <div class="title method-title" id="method-i-parent_id-3D">
747
+
748
+ <b>parent_id=</b>(new_parent_id)
749
+
750
+ <a href="../../classes/Cardboard/Page.html#method-i-parent_id-3D" name="method-i-parent_id-3D" class="permalink">Link</a>
751
+ </div>
752
+
753
+
754
+ <div class="description">
755
+
756
+ </div>
757
+
758
+
759
+
760
+
761
+
762
+
763
+ <div class="sourcecode">
764
+
765
+ <p class="source-link">
766
+ Source:
767
+ <a href="javascript:toggleSource('method-i-parent_id-3D_source')" id="l_method-i-parent_id-3D_source">show</a>
768
+
769
+ </p>
770
+ <div id="method-i-parent_id-3D_source" class="dyn-source">
771
+ <pre><span class="ruby-comment"># File app/models/cardboard/page.rb, line 156</span>
772
+ <span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">parent_id=</span>(<span class="ruby-identifier">new_parent_id</span>)
773
+ <span class="ruby-keyword">self</span>.<span class="ruby-identifier">parent</span> = <span class="ruby-constant">Cardboard</span><span class="ruby-operator">::</span><span class="ruby-constant">Page</span>.<span class="ruby-identifier">where</span>(<span class="ruby-identifier">identifier</span><span class="ruby-operator">:</span> <span class="ruby-identifier">new_parent_id</span>).<span class="ruby-identifier">first</span>
774
+ <span class="ruby-keyword">end</span></pre>
775
+ </div>
776
+ </div>
777
+
778
+ </div>
779
+
780
+ <div class="method">
781
+ <div class="title method-title" id="method-i-parent_url-3D">
782
+
783
+ <b>parent_url=</b>(new_parent_url)
784
+
785
+ <a href="../../classes/Cardboard/Page.html#method-i-parent_url-3D" name="method-i-parent_url-3D" class="permalink">Link</a>
786
+ </div>
787
+
788
+
789
+ <div class="description">
790
+
791
+ </div>
792
+
793
+
794
+
795
+
796
+
797
+
798
+ <div class="sourcecode">
799
+
800
+ <p class="source-link">
801
+ Source:
802
+ <a href="javascript:toggleSource('method-i-parent_url-3D_source')" id="l_method-i-parent_url-3D_source">show</a>
803
+
804
+ </p>
805
+ <div id="method-i-parent_url-3D_source" class="dyn-source">
806
+ <pre><span class="ruby-comment"># File app/models/cardboard/page.rb, line 160</span>
807
+ <span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">parent_url=</span>(<span class="ruby-identifier">new_parent_url</span>)
808
+ <span class="ruby-keyword">self</span>.<span class="ruby-identifier">parent</span> = <span class="ruby-constant">Cardboard</span><span class="ruby-operator">::</span><span class="ruby-constant">Page</span>.<span class="ruby-identifier">find_by_url</span>(<span class="ruby-identifier">new_parent_url</span>)
809
+ <span class="ruby-keyword">end</span></pre>
810
+ </div>
811
+ </div>
812
+
813
+ </div>
814
+
815
+ <div class="method">
816
+ <div class="title method-title" id="method-i-parent_url_options">
817
+
818
+ <b>parent_url_options</b>()
819
+
820
+ <a href="../../classes/Cardboard/Page.html#method-i-parent_url_options" name="method-i-parent_url_options" class="permalink">Link</a>
821
+ </div>
822
+
823
+
824
+ <div class="description">
825
+ <p>Get all other pages</p>
826
+ </div>
827
+
828
+
829
+
830
+
831
+
832
+
833
+ <div class="sourcecode">
834
+
835
+ <p class="source-link">
836
+ Source:
837
+ <a href="javascript:toggleSource('method-i-parent_url_options_source')" id="l_method-i-parent_url_options_source">show</a>
838
+
839
+ </p>
840
+ <div id="method-i-parent_url_options_source" class="dyn-source">
841
+ <pre><span class="ruby-comment"># File app/models/cardboard/page.rb, line 137</span>
842
+ <span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">parent_url_options</span>
843
+ <span class="ruby-comment"># @parent_url_options ||= begin</span>
844
+ <span class="ruby-constant">Cardboard</span><span class="ruby-operator">::</span><span class="ruby-constant">Page</span>.<span class="ruby-identifier">all</span>.<span class="ruby-identifier">inject</span>([<span class="ruby-string">&quot;/&quot;</span>]) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">result</span>, <span class="ruby-identifier">elm</span><span class="ruby-operator">|</span>
845
+ <span class="ruby-identifier">result</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">elm</span>.<span class="ruby-identifier">url</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">elm</span>.<span class="ruby-identifier">id</span> <span class="ruby-operator">==</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">id</span>
846
+ <span class="ruby-identifier">result</span>
847
+ <span class="ruby-keyword">end</span>.<span class="ruby-identifier">sort</span>
848
+ <span class="ruby-comment"># end</span>
849
+ <span class="ruby-keyword">end</span></pre>
850
+ </div>
851
+ </div>
852
+
853
+ </div>
854
+
855
+ <div class="method">
856
+ <div class="title method-title" id="method-i-root-3F">
857
+
858
+ <b>root?</b>()
859
+
860
+ <a href="../../classes/Cardboard/Page.html#method-i-root-3F" name="method-i-root-3F" class="permalink">Link</a>
861
+ </div>
862
+
863
+
864
+ <div class="description">
865
+
866
+ </div>
867
+
868
+
869
+
870
+
871
+
872
+
873
+ <div class="sourcecode">
874
+
875
+ <p class="source-link">
876
+ Source:
877
+ <a href="javascript:toggleSource('method-i-root-3F_source')" id="l_method-i-root-3F_source">show</a>
878
+
879
+ </p>
880
+ <div id="method-i-root-3F_source" class="dyn-source">
881
+ <pre><span class="ruby-comment"># File app/models/cardboard/page.rb, line 77</span>
882
+ <span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">root?</span>
883
+ <span class="ruby-ivar">@root_id</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">Page</span>.<span class="ruby-identifier">root</span>.<span class="ruby-identifier">id</span>
884
+ <span class="ruby-ivar">@root_id</span> <span class="ruby-operator">==</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">id</span>
885
+ <span class="ruby-keyword">end</span></pre>
886
+ </div>
887
+ </div>
888
+
889
+ </div>
890
+
891
+ <div class="method">
892
+ <div class="title method-title" id="method-i-seo">
893
+
894
+ <b>seo</b>()
895
+
896
+ <a href="../../classes/Cardboard/Page.html#method-i-seo" name="method-i-seo" class="permalink">Link</a>
897
+ </div>
898
+
899
+
900
+ <div class="description">
901
+ <p>SEO children inherit their parent’s SEO settings (these can be overwritten)</p>
902
+ </div>
903
+
904
+
905
+
906
+
907
+
908
+
909
+ <div class="sourcecode">
910
+
911
+ <p class="source-link">
912
+ Source:
913
+ <a href="javascript:toggleSource('method-i-seo_source')" id="l_method-i-seo_source">show</a>
914
+
915
+ </p>
916
+ <div id="method-i-seo_source" class="dyn-source">
917
+ <pre><span class="ruby-comment"># File app/models/cardboard/page.rb, line 107</span>
918
+ <span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">seo</span>
919
+ <span class="ruby-ivar">@_seo</span> <span class="ruby-operator">||=</span> <span class="ruby-keyword">begin</span>
920
+ <span class="ruby-identifier">seo</span> = <span class="ruby-keyword">self</span>.<span class="ruby-identifier">meta_seo</span>
921
+ <span class="ruby-identifier">seo</span> = <span class="ruby-keyword">self</span>.<span class="ruby-identifier">parent</span>.<span class="ruby-identifier">seo</span>.<span class="ruby-identifier">merge</span>(<span class="ruby-identifier">seo</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">parent</span>
922
+ <span class="ruby-identifier">seo</span> = <span class="ruby-constant">Page</span>.<span class="ruby-identifier">root</span>.<span class="ruby-identifier">seo</span>.<span class="ruby-identifier">merge</span>(<span class="ruby-identifier">seo</span>) <span class="ruby-keyword">unless</span> <span class="ruby-identifier">root?</span>
923
+ <span class="ruby-identifier">seo</span>
924
+ <span class="ruby-keyword">end</span>
925
+ <span class="ruby-keyword">end</span></pre>
926
+ </div>
927
+ </div>
928
+
929
+ </div>
930
+
931
+ <div class="method">
932
+ <div class="title method-title" id="method-i-seo-3D">
933
+
934
+ <b>seo=</b>(hash)
935
+
936
+ <a href="../../classes/Cardboard/Page.html#method-i-seo-3D" name="method-i-seo-3D" class="permalink">Link</a>
937
+ </div>
938
+
939
+
940
+ <div class="description">
941
+
942
+ </div>
943
+
944
+
945
+
946
+
947
+
948
+
949
+ <div class="sourcecode">
950
+
951
+ <p class="source-link">
952
+ Source:
953
+ <a href="javascript:toggleSource('method-i-seo-3D_source')" id="l_method-i-seo-3D_source">show</a>
954
+
955
+ </p>
956
+ <div id="method-i-seo-3D_source" class="dyn-source">
957
+ <pre><span class="ruby-comment"># File app/models/cardboard/page.rb, line 116</span>
958
+ <span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">seo=</span>(<span class="ruby-identifier">hash</span>)
959
+ <span class="ruby-comment"># to hash is important here for strong parameters</span>
960
+ <span class="ruby-keyword">self</span>.<span class="ruby-identifier">meta_seo</span> = <span class="ruby-identifier">hash</span>.<span class="ruby-identifier">to_hash</span>
961
+ <span class="ruby-ivar">@_seo</span> = <span class="ruby-keyword">nil</span>
962
+ <span class="ruby-keyword">end</span></pre>
963
+ </div>
964
+ </div>
965
+
966
+ </div>
967
+
968
+ <div class="method">
969
+ <div class="title method-title" id="method-i-siblings">
970
+
971
+ <b>siblings</b>()
972
+
973
+ <a href="../../classes/Cardboard/Page.html#method-i-siblings" name="method-i-siblings" class="permalink">Link</a>
974
+ </div>
975
+
976
+
977
+ <div class="description">
978
+
979
+ </div>
980
+
981
+
982
+
983
+
984
+
985
+
986
+ <div class="sourcecode">
987
+
988
+ <p class="source-link">
989
+ Source:
990
+ <a href="javascript:toggleSource('method-i-siblings_source')" id="l_method-i-siblings_source">show</a>
991
+
992
+ </p>
993
+ <div id="method-i-siblings_source" class="dyn-source">
994
+ <pre><span class="ruby-comment"># File app/models/cardboard/page.rb, line 168</span>
995
+ <span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">siblings</span>
996
+ <span class="ruby-constant">Cardboard</span><span class="ruby-operator">::</span><span class="ruby-constant">Page</span>.<span class="ruby-identifier">where</span>(<span class="ruby-string">&quot;path = ? AND id != ?&quot;</span>, <span class="ruby-identifier">path</span>, <span class="ruby-identifier">id</span>)
997
+ <span class="ruby-keyword">end</span></pre>
998
+ </div>
999
+ </div>
1000
+
1001
+ </div>
1002
+
1003
+ <div class="method">
1004
+ <div class="title method-title" id="method-i-slug-3D">
1005
+
1006
+ <b>slug=</b>(value)
1007
+
1008
+ <a href="../../classes/Cardboard/Page.html#method-i-slug-3D" name="method-i-slug-3D" class="permalink">Link</a>
1009
+ </div>
1010
+
1011
+
1012
+ <div class="description">
1013
+ <p>overwritten setters/getters</p>
1014
+ </div>
1015
+
1016
+
1017
+
1018
+
1019
+
1020
+
1021
+ <div class="sourcecode">
1022
+
1023
+ <p class="source-link">
1024
+ Source:
1025
+ <a href="javascript:toggleSource('method-i-slug-3D_source')" id="l_method-i-slug-3D_source">show</a>
1026
+
1027
+ </p>
1028
+ <div id="method-i-slug-3D_source" class="dyn-source">
1029
+ <pre><span class="ruby-comment"># File app/models/cardboard/page.rb, line 40</span>
1030
+ <span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">slug=</span>(<span class="ruby-identifier">value</span>)
1031
+ <span class="ruby-comment"># the user can overwrite the auto generated slug</span>
1032
+ <span class="ruby-keyword">self</span>[<span class="ruby-value">:slug</span>] = <span class="ruby-identifier">value</span>.<span class="ruby-identifier">present?</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">value</span>.<span class="ruby-identifier">to_url</span> <span class="ruby-operator">:</span> <span class="ruby-keyword">nil</span>
1033
+ <span class="ruby-keyword">end</span></pre>
1034
+ </div>
1035
+ </div>
1036
+
1037
+ </div>
1038
+
1039
+ <div class="method">
1040
+ <div class="title method-title" id="method-i-split_path">
1041
+
1042
+ <b>split_path</b>()
1043
+
1044
+ <a href="../../classes/Cardboard/Page.html#method-i-split_path" name="method-i-split_path" class="permalink">Link</a>
1045
+ </div>
1046
+
1047
+
1048
+ <div class="description">
1049
+
1050
+ </div>
1051
+
1052
+
1053
+
1054
+
1055
+
1056
+
1057
+ <div class="sourcecode">
1058
+
1059
+ <p class="source-link">
1060
+ Source:
1061
+ <a href="javascript:toggleSource('method-i-split_path_source')" id="l_method-i-split_path_source">show</a>
1062
+
1063
+ </p>
1064
+ <div id="method-i-split_path_source" class="dyn-source">
1065
+ <pre><span class="ruby-comment"># File app/models/cardboard/page.rb, line 127</span>
1066
+ <span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">split_path</span>
1067
+ <span class="ruby-comment"># path.sub(/^\//,'').split(&quot;/&quot;) # &quot;/path/&quot; =&gt; [&quot;path&quot;]</span>
1068
+ <span class="ruby-identifier">path</span>[<span class="ruby-number">1</span><span class="ruby-operator">..</span><span class="ruby-number">-1</span>].<span class="ruby-identifier">split</span>(<span class="ruby-string">&quot;/&quot;</span>)
1069
+ <span class="ruby-keyword">end</span></pre>
1070
+ </div>
1071
+ </div>
1072
+
1073
+ </div>
1074
+
1075
+ <div class="method">
1076
+ <div class="title method-title" id="method-i-url">
1077
+
1078
+ <b>url</b>()
1079
+
1080
+ <a href="../../classes/Cardboard/Page.html#method-i-url" name="method-i-url" class="permalink">Link</a>
1081
+ </div>
1082
+
1083
+
1084
+ <div class="description">
1085
+
1086
+ </div>
1087
+
1088
+
1089
+
1090
+
1091
+
1092
+
1093
+ <div class="sourcecode">
1094
+
1095
+ <p class="source-link">
1096
+ Source:
1097
+ <a href="javascript:toggleSource('method-i-url_source')" id="l_method-i-url_source">show</a>
1098
+
1099
+ </p>
1100
+ <div id="method-i-url_source" class="dyn-source">
1101
+ <pre><span class="ruby-comment"># File app/models/cardboard/page.rb, line 122</span>
1102
+ <span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">url</span>
1103
+ <span class="ruby-keyword">return</span> <span class="ruby-string">&quot;/&quot;</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">slug</span>.<span class="ruby-identifier">blank?</span> <span class="ruby-comment">#|| self.root?</span>
1104
+ <span class="ruby-node">&quot;#{path}#{slug}/&quot;</span>
1105
+ <span class="ruby-keyword">end</span></pre>
1106
+ </div>
1107
+ </div>
1108
+
1109
+ </div>
1110
+
1111
+ <div class="method">
1112
+ <div class="title method-title" id="method-i-using_slug_backup-3D">
1113
+
1114
+ <b>using_slug_backup=</b>(value)
1115
+
1116
+ <a href="../../classes/Cardboard/Page.html#method-i-using_slug_backup-3D" name="method-i-using_slug_backup-3D" class="permalink">Link</a>
1117
+ </div>
1118
+
1119
+
1120
+ <div class="description">
1121
+
1122
+ </div>
1123
+
1124
+
1125
+
1126
+
1127
+
1128
+
1129
+ <div class="sourcecode">
1130
+
1131
+ <p class="source-link">
1132
+ Source:
1133
+ <a href="javascript:toggleSource('method-i-using_slug_backup-3D_source')" id="l_method-i-using_slug_backup-3D_source">show</a>
1134
+
1135
+ </p>
1136
+ <div id="method-i-using_slug_backup-3D_source" class="dyn-source">
1137
+ <pre><span class="ruby-comment"># File app/models/cardboard/page.rb, line 53</span>
1138
+ <span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">using_slug_backup=</span>(<span class="ruby-identifier">value</span>)
1139
+ <span class="ruby-ivar">@using_slug_backup</span> = <span class="ruby-identifier">value</span>
1140
+ <span class="ruby-keyword">end</span></pre>
1141
+ </div>
1142
+ </div>
1143
+
1144
+ </div>
1145
+
1146
+ <div class="method">
1147
+ <div class="title method-title" id="method-i-using_slug_backup-3F">
1148
+
1149
+ <b>using_slug_backup?</b>()
1150
+
1151
+ <a href="../../classes/Cardboard/Page.html#method-i-using_slug_backup-3F" name="method-i-using_slug_backup-3F" class="permalink">Link</a>
1152
+ </div>
1153
+
1154
+
1155
+ <div class="description">
1156
+
1157
+ </div>
1158
+
1159
+
1160
+
1161
+
1162
+
1163
+
1164
+ <div class="sourcecode">
1165
+
1166
+ <p class="source-link">
1167
+ Source:
1168
+ <a href="javascript:toggleSource('method-i-using_slug_backup-3F_source')" id="l_method-i-using_slug_backup-3F_source">show</a>
1169
+
1170
+ </p>
1171
+ <div id="method-i-using_slug_backup-3F_source" class="dyn-source">
1172
+ <pre><span class="ruby-comment"># File app/models/cardboard/page.rb, line 49</span>
1173
+ <span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">using_slug_backup?</span>
1174
+ <span class="ruby-ivar">@using_slug_backup</span> <span class="ruby-operator">||</span> <span class="ruby-keyword">false</span>
1175
+ <span class="ruby-keyword">end</span></pre>
1176
+ </div>
1177
+ </div>
1178
+
1179
+ </div>
1180
+ </div>
1181
+
1182
+ </div>
1183
+ </body>
1184
+ </html>