wafflemix 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (276) hide show
  1. data/MIT-LICENSE +20 -0
  2. data/README.rdoc +96 -0
  3. data/Rakefile +40 -0
  4. data/app/assets/javascripts/mercury/page_editor.js.coffee +254 -0
  5. data/app/assets/javascripts/wafflemix/admin/admin.js.coffee +73 -0
  6. data/app/assets/javascripts/wafflemix/admin/admin_js.js +16 -0
  7. data/app/assets/javascripts/wafflemix/admin/bootstrap-datepicker.js +454 -0
  8. data/app/assets/javascripts/wafflemix/admin/jquery.nested_sortable.js +608 -0
  9. data/app/assets/javascripts/wafflemix/application.js +43 -0
  10. data/app/assets/javascripts/wafflemix/assets.js +2 -0
  11. data/app/assets/javascripts/wafflemix/contact_forms.js +2 -0
  12. data/app/assets/javascripts/wafflemix/mercury.js +469 -0
  13. data/app/assets/javascripts/wafflemix/pages.js +2 -0
  14. data/app/assets/javascripts/wafflemix/portfolios.js +2 -0
  15. data/app/assets/javascripts/wafflemix/posts.js +2 -0
  16. data/app/assets/javascripts/wafflemix/roles.js +2 -0
  17. data/app/assets/javascripts/wafflemix/users.js +2 -0
  18. data/app/assets/stylesheets/wafflemix/admin/admin.css.sass +76 -0
  19. data/app/assets/stylesheets/wafflemix/admin/bootstrap-datepicker.css +7 -0
  20. data/app/assets/stylesheets/wafflemix/application.css +15 -0
  21. data/app/assets/stylesheets/wafflemix/assets.css +4 -0
  22. data/app/assets/stylesheets/wafflemix/clearfix.css +20 -0
  23. data/app/assets/stylesheets/wafflemix/contact_forms.css +4 -0
  24. data/app/assets/stylesheets/wafflemix/main.css.sass +11 -0
  25. data/app/assets/stylesheets/wafflemix/mercury.css +23 -0
  26. data/app/assets/stylesheets/wafflemix/pages.css +4 -0
  27. data/app/assets/stylesheets/wafflemix/partials/_base.css.sass +131 -0
  28. data/app/assets/stylesheets/wafflemix/portfolios.css +4 -0
  29. data/app/assets/stylesheets/wafflemix/posts.css +4 -0
  30. data/app/assets/stylesheets/wafflemix/roles.css +4 -0
  31. data/app/assets/stylesheets/wafflemix/users.css +4 -0
  32. data/app/controllers/wafflemix/admin/assets_controller.rb +95 -0
  33. data/app/controllers/wafflemix/admin/categories_controller.rb +77 -0
  34. data/app/controllers/wafflemix/admin/contact_forms_controller.rb +77 -0
  35. data/app/controllers/wafflemix/admin/content_sections_controller.rb +85 -0
  36. data/app/controllers/wafflemix/admin/pages_controller.rb +93 -0
  37. data/app/controllers/wafflemix/admin/portfolios_controller.rb +93 -0
  38. data/app/controllers/wafflemix/admin/posts_controller.rb +82 -0
  39. data/app/controllers/wafflemix/admin/roles_controller.rb +77 -0
  40. data/app/controllers/wafflemix/admin/slides_controller.rb +88 -0
  41. data/app/controllers/wafflemix/admin/users_controller.rb +78 -0
  42. data/app/controllers/wafflemix/application_controller.rb +11 -0
  43. data/app/controllers/wafflemix/assets_controller.rb +71 -0
  44. data/app/controllers/wafflemix/categories_controller.rb +34 -0
  45. data/app/controllers/wafflemix/contact_forms_controller.rb +47 -0
  46. data/app/controllers/wafflemix/pages_controller.rb +56 -0
  47. data/app/controllers/wafflemix/portfolios_controller.rb +35 -0
  48. data/app/controllers/wafflemix/posts_controller.rb +52 -0
  49. data/app/helpers/wafflemix/admin/slides_helper.rb +11 -0
  50. data/app/helpers/wafflemix/application_helper.rb +88 -0
  51. data/app/helpers/wafflemix/assets_helper.rb +4 -0
  52. data/app/helpers/wafflemix/categories_helper.rb +4 -0
  53. data/app/helpers/wafflemix/contact_forms_helper.rb +4 -0
  54. data/app/helpers/wafflemix/content_sections_helper.rb +4 -0
  55. data/app/helpers/wafflemix/pages_helper.rb +23 -0
  56. data/app/helpers/wafflemix/portfolios_helper.rb +11 -0
  57. data/app/helpers/wafflemix/posts_helper.rb +5 -0
  58. data/app/helpers/wafflemix/roles_helper.rb +4 -0
  59. data/app/helpers/wafflemix/users_helper.rb +4 -0
  60. data/app/models/user.rb +10 -0
  61. data/app/models/wafflemix/Categorical.rb +8 -0
  62. data/app/models/wafflemix/asset.rb +22 -0
  63. data/app/models/wafflemix/category.rb +8 -0
  64. data/app/models/wafflemix/contact_form.rb +19 -0
  65. data/app/models/wafflemix/content_section.rb +21 -0
  66. data/app/models/wafflemix/image.rb +8 -0
  67. data/app/models/wafflemix/meta_content.rb +5 -0
  68. data/app/models/wafflemix/page.rb +39 -0
  69. data/app/models/wafflemix/portfolio.rb +16 -0
  70. data/app/models/wafflemix/post.rb +33 -0
  71. data/app/models/wafflemix/role.rb +10 -0
  72. data/app/models/wafflemix/slide.rb +14 -0
  73. data/app/models/wafflemix/user.rb +11 -0
  74. data/app/models/wafflemix/user_role.rb +8 -0
  75. data/app/views/devise/_links.erb +25 -0
  76. data/app/views/devise/confirmations/new.html.erb +12 -0
  77. data/app/views/devise/mailer/confirmation_instructions.html.erb +5 -0
  78. data/app/views/devise/mailer/reset_password_instructions.html.erb +8 -0
  79. data/app/views/devise/mailer/unlock_instructions.html.erb +7 -0
  80. data/app/views/devise/passwords/edit.html.erb +16 -0
  81. data/app/views/devise/passwords/new.html.erb +12 -0
  82. data/app/views/devise/registrations/edit.html.erb +25 -0
  83. data/app/views/devise/registrations/new.html.erb +18 -0
  84. data/app/views/devise/sessions/new.html.erb +17 -0
  85. data/app/views/devise/unlocks/new.html.erb +12 -0
  86. data/app/views/layouts/mercury.html.erb +24 -0
  87. data/app/views/layouts/wafflemix/admin.html.erb +19 -0
  88. data/app/views/layouts/wafflemix/example_layout.html.erb +35 -0
  89. data/app/views/wafflemix/admin/assets/_form.html.erb +22 -0
  90. data/app/views/wafflemix/admin/assets/add_image.js.erb +1 -0
  91. data/app/views/wafflemix/admin/assets/edit.html.erb +6 -0
  92. data/app/views/wafflemix/admin/assets/index.html.erb +41 -0
  93. data/app/views/wafflemix/admin/assets/new.html.erb +5 -0
  94. data/app/views/wafflemix/admin/assets/show.html.erb +20 -0
  95. data/app/views/wafflemix/admin/categories/_form.html.erb +29 -0
  96. data/app/views/wafflemix/admin/categories/edit.html.erb +6 -0
  97. data/app/views/wafflemix/admin/categories/index.html.erb +36 -0
  98. data/app/views/wafflemix/admin/categories/new.html.erb +5 -0
  99. data/app/views/wafflemix/admin/categories/show.html.erb +25 -0
  100. data/app/views/wafflemix/admin/contact_forms/_form.html.erb +15 -0
  101. data/app/views/wafflemix/admin/contact_forms/edit.html.erb +6 -0
  102. data/app/views/wafflemix/admin/contact_forms/index.html.erb +38 -0
  103. data/app/views/wafflemix/admin/contact_forms/new.html.erb +5 -0
  104. data/app/views/wafflemix/admin/contact_forms/show.html.erb +25 -0
  105. data/app/views/wafflemix/admin/content_sections/_form.html.erb +33 -0
  106. data/app/views/wafflemix/admin/content_sections/create.js.erb +3 -0
  107. data/app/views/wafflemix/admin/content_sections/destroy.js.erb +4 -0
  108. data/app/views/wafflemix/admin/content_sections/edit.html.erb +6 -0
  109. data/app/views/wafflemix/admin/content_sections/index.html.erb +29 -0
  110. data/app/views/wafflemix/admin/content_sections/new.html.erb +5 -0
  111. data/app/views/wafflemix/admin/content_sections/show.html.erb +25 -0
  112. data/app/views/wafflemix/admin/pages/_form.html.erb +47 -0
  113. data/app/views/wafflemix/admin/pages/_page.html.erb +15 -0
  114. data/app/views/wafflemix/admin/pages/edit.html.erb +3 -0
  115. data/app/views/wafflemix/admin/pages/index.html.erb +21 -0
  116. data/app/views/wafflemix/admin/pages/new.html.erb +3 -0
  117. data/app/views/wafflemix/admin/pages/show.html.erb +40 -0
  118. data/app/views/wafflemix/admin/portfolios/_form.html.erb +174 -0
  119. data/app/views/wafflemix/admin/portfolios/_portfolio.html.erb +11 -0
  120. data/app/views/wafflemix/admin/portfolios/edit.html.erb +5 -0
  121. data/app/views/wafflemix/admin/portfolios/index.html.erb +21 -0
  122. data/app/views/wafflemix/admin/portfolios/new.html.erb +5 -0
  123. data/app/views/wafflemix/admin/portfolios/show.html.erb +20 -0
  124. data/app/views/wafflemix/admin/posts/_form.html.erb +191 -0
  125. data/app/views/wafflemix/admin/posts/edit.html.erb +5 -0
  126. data/app/views/wafflemix/admin/posts/index.html.erb +38 -0
  127. data/app/views/wafflemix/admin/posts/new.html.erb +3 -0
  128. data/app/views/wafflemix/admin/posts/show.html.erb +20 -0
  129. data/app/views/wafflemix/admin/roles/_form.html.erb +21 -0
  130. data/app/views/wafflemix/admin/roles/edit.html.erb +6 -0
  131. data/app/views/wafflemix/admin/roles/index.html.erb +34 -0
  132. data/app/views/wafflemix/admin/roles/new.html.erb +5 -0
  133. data/app/views/wafflemix/admin/roles/show.html.erb +10 -0
  134. data/app/views/wafflemix/admin/slides/_form.html.erb +170 -0
  135. data/app/views/wafflemix/admin/slides/_slide.html.erb +11 -0
  136. data/app/views/wafflemix/admin/slides/edit.html.erb +5 -0
  137. data/app/views/wafflemix/admin/slides/index.html.erb +21 -0
  138. data/app/views/wafflemix/admin/slides/new.html.erb +5 -0
  139. data/app/views/wafflemix/admin/slides/show.html.erb +10 -0
  140. data/app/views/wafflemix/admin/users/_form.html.erb +29 -0
  141. data/app/views/wafflemix/admin/users/edit.html.erb +6 -0
  142. data/app/views/wafflemix/admin/users/index.html.erb +36 -0
  143. data/app/views/wafflemix/admin/users/new.html.erb +5 -0
  144. data/app/views/wafflemix/admin/users/show.html.erb +14 -0
  145. data/app/views/wafflemix/categories/index.erb +16 -0
  146. data/app/views/wafflemix/categories/show.html.erb +16 -0
  147. data/app/views/wafflemix/contact_forms/_form.html.erb +33 -0
  148. data/app/views/wafflemix/contact_forms/new.html.erb +19 -0
  149. data/app/views/wafflemix/contact_forms/show.html.erb +25 -0
  150. data/app/views/wafflemix/pages/home.html.erb +7 -0
  151. data/app/views/wafflemix/pages/index.html.erb +31 -0
  152. data/app/views/wafflemix/pages/show.html.erb +14 -0
  153. data/app/views/wafflemix/portfolios/index.html.erb +21 -0
  154. data/app/views/wafflemix/portfolios/show.html.erb +36 -0
  155. data/app/views/wafflemix/posts/_sidebar.html.erb +12 -0
  156. data/app/views/wafflemix/posts/index.html.erb +16 -0
  157. data/app/views/wafflemix/posts/show.html.erb +40 -0
  158. data/app/views/wafflemix/posts/tagged.html.erb +16 -0
  159. data/config/initializers/devise.rb +227 -0
  160. data/config/initializers/dragonfly.rb +16 -0
  161. data/config/initializers/formtastic.rb +78 -0
  162. data/config/initializers/spam_filter.rb +4 -0
  163. data/config/locales/devise.en.yml +57 -0
  164. data/config/routes.rb +55 -0
  165. data/db/migrate/20120814113226_create_wafflemix_pages.rb +19 -0
  166. data/db/migrate/20120901141321_create_wafflemix_users.rb +29 -0
  167. data/db/migrate/20120901150334_create_wafflemix_assets.rb +11 -0
  168. data/db/migrate/20120901151421_create_wafflemix_roles.rb +9 -0
  169. data/db/migrate/20120901151704_create_wafflemix_user_roles.rb +13 -0
  170. data/db/migrate/20120915124116_add_ancestry_to_pages.rb +7 -0
  171. data/db/migrate/20120918100336_create_wafflemix_categories.rb +15 -0
  172. data/db/migrate/20120923131130_create_wafflemix_slides.rb +11 -0
  173. data/db/migrate/20120923131307_create_wafflemix_content_sections.rb +12 -0
  174. data/db/migrate/20120923135949_add_position_to_slides.rb +5 -0
  175. data/db/migrate/20121005124419_update_asset_table.rb +10 -0
  176. data/db/migrate/20121113131239_create_wafflemix_posts.rb +15 -0
  177. data/db/migrate/20121113132413_add_translation_table_for_posts.rb +9 -0
  178. data/db/migrate/20121114135432_update_draft_to_boolean_on_posts.rb +11 -0
  179. data/db/migrate/20121120125114_add_page_translations.rb +9 -0
  180. data/db/migrate/20121205221122_acts_as_taggable_on_migration.rb +30 -0
  181. data/db/migrate/20121206132733_re_do_categories.rb +19 -0
  182. data/db/migrate/20121206132923_add_new_categories_table.rb +11 -0
  183. data/db/migrate/20121206133026_add_category_joins_table.rb +14 -0
  184. data/db/migrate/20121211095114_finalize_asset_table.rb +11 -0
  185. data/db/migrate/20121211095847_store_asset_url.rb +5 -0
  186. data/db/migrate/20130202161212_create_wafflemix_images.rb +11 -0
  187. data/db/migrate/20130202182435_add_extra_fields_to_slides.rb +6 -0
  188. data/db/migrate/20130204225256_create_wafflemix_portfolios.rb +11 -0
  189. data/db/migrate/20130204230818_add_ancestry_to_portfolio.rb +6 -0
  190. data/db/migrate/20130216190558_create_wafflemix_meta_contents.rb +13 -0
  191. data/db/migrate/20130219121412_create_wafflemix_contact_forms.rb +12 -0
  192. data/db/migrate/20130219130609_add_spam_to_contact_forms.rb +5 -0
  193. data/lib/tasks/wafflemix_tasks.rake +15 -0
  194. data/lib/templates/erb/scaffold/_form.html.erb +11 -0
  195. data/lib/wafflemix/engine.rb +9 -0
  196. data/lib/wafflemix/version.rb +3 -0
  197. data/lib/wafflemix.rb +17 -0
  198. data/test/dummy/README.rdoc +261 -0
  199. data/test/dummy/Rakefile +7 -0
  200. data/test/dummy/app/assets/javascripts/application.js +15 -0
  201. data/test/dummy/app/assets/stylesheets/application.css +13 -0
  202. data/test/dummy/app/controllers/application_controller.rb +3 -0
  203. data/test/dummy/app/helpers/application_helper.rb +2 -0
  204. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  205. data/test/dummy/config/application.rb +64 -0
  206. data/test/dummy/config/boot.rb +10 -0
  207. data/test/dummy/config/environment.rb +5 -0
  208. data/test/dummy/config/environments/development.rb +39 -0
  209. data/test/dummy/config/environments/production.rb +69 -0
  210. data/test/dummy/config/environments/test.rb +37 -0
  211. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  212. data/test/dummy/config/initializers/inflections.rb +15 -0
  213. data/test/dummy/config/initializers/local_s3.rb +3 -0
  214. data/test/dummy/config/initializers/mime_types.rb +5 -0
  215. data/test/dummy/config/initializers/secret_token.rb +7 -0
  216. data/test/dummy/config/initializers/session_store.rb +8 -0
  217. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  218. data/test/dummy/config/locales/en.yml +5 -0
  219. data/test/dummy/config/routes.rb +5 -0
  220. data/test/dummy/config.ru +4 -0
  221. data/test/dummy/db/schema.rb +87 -0
  222. data/test/dummy/public/404.html +26 -0
  223. data/test/dummy/public/422.html +26 -0
  224. data/test/dummy/public/500.html +25 -0
  225. data/test/dummy/public/favicon.ico +0 -0
  226. data/test/dummy/script/rails +6 -0
  227. data/test/fixtures/wafflemix/assets.yml +11 -0
  228. data/test/fixtures/wafflemix/categories.yml +13 -0
  229. data/test/fixtures/wafflemix/contact_forms.yml +13 -0
  230. data/test/fixtures/wafflemix/content_sections.yml +13 -0
  231. data/test/fixtures/wafflemix/images.yml +11 -0
  232. data/test/fixtures/wafflemix/meta_contents.yml +15 -0
  233. data/test/fixtures/wafflemix/pages.yml +19 -0
  234. data/test/fixtures/wafflemix/portfolios.yml +11 -0
  235. data/test/fixtures/wafflemix/posts.yml +11 -0
  236. data/test/fixtures/wafflemix/roles.yml +7 -0
  237. data/test/fixtures/wafflemix/slides.yml +7 -0
  238. data/test/fixtures/wafflemix/user_roles.yml +9 -0
  239. data/test/fixtures/wafflemix/users.yml +11 -0
  240. data/test/functional/wafflemix/assets_controller_test.rb +51 -0
  241. data/test/functional/wafflemix/categories_controller_test.rb +51 -0
  242. data/test/functional/wafflemix/contact_forms_controller_test.rb +51 -0
  243. data/test/functional/wafflemix/content_sections_controller_test.rb +51 -0
  244. data/test/functional/wafflemix/pages_controller_test.rb +51 -0
  245. data/test/functional/wafflemix/portfolios_controller_test.rb +51 -0
  246. data/test/functional/wafflemix/posts_controller_test.rb +51 -0
  247. data/test/functional/wafflemix/roles_controller_test.rb +51 -0
  248. data/test/functional/wafflemix/slides_controller_test.rb +51 -0
  249. data/test/functional/wafflemix/users_controller_test.rb +51 -0
  250. data/test/integration/navigation_test.rb +10 -0
  251. data/test/test_helper.rb +15 -0
  252. data/test/unit/helpers/wafflemix/assets_helper_test.rb +6 -0
  253. data/test/unit/helpers/wafflemix/categories_helper_test.rb +6 -0
  254. data/test/unit/helpers/wafflemix/contact_forms_helper_test.rb +6 -0
  255. data/test/unit/helpers/wafflemix/content_sections_helper_test.rb +6 -0
  256. data/test/unit/helpers/wafflemix/pages_helper_test.rb +6 -0
  257. data/test/unit/helpers/wafflemix/portfolios_helper_test.rb +6 -0
  258. data/test/unit/helpers/wafflemix/posts_helper_test.rb +6 -0
  259. data/test/unit/helpers/wafflemix/roles_helper_test.rb +6 -0
  260. data/test/unit/helpers/wafflemix/slides_helper_test.rb +6 -0
  261. data/test/unit/helpers/wafflemix/users_helper_test.rb +6 -0
  262. data/test/unit/wafflemix/asset_test.rb +9 -0
  263. data/test/unit/wafflemix/category_test.rb +9 -0
  264. data/test/unit/wafflemix/contact_form_test.rb +9 -0
  265. data/test/unit/wafflemix/content_section_test.rb +9 -0
  266. data/test/unit/wafflemix/image_test.rb +9 -0
  267. data/test/unit/wafflemix/meta_content_test.rb +9 -0
  268. data/test/unit/wafflemix/page_test.rb +9 -0
  269. data/test/unit/wafflemix/portfolio_test.rb +9 -0
  270. data/test/unit/wafflemix/post_test.rb +9 -0
  271. data/test/unit/wafflemix/role_test.rb +9 -0
  272. data/test/unit/wafflemix/slide_test.rb +9 -0
  273. data/test/unit/wafflemix/user_role_test.rb +9 -0
  274. data/test/unit/wafflemix/user_test.rb +9 -0
  275. data/test/wafflemix_test.rb +7 -0
  276. metadata +654 -0
@@ -0,0 +1,39 @@
1
+ Dummy::Application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb
3
+
4
+ # In the development environment your application's code is reloaded on
5
+ # every request. This slows down response time but is perfect for development
6
+ # since you don't have to restart the web server when you make code changes.
7
+ config.cache_classes = false
8
+
9
+ # Log error messages when you accidentally call methods on nil.
10
+ config.whiny_nils = true
11
+
12
+ # Show full error reports and disable caching
13
+ config.consider_all_requests_local = true
14
+ config.action_controller.perform_caching = false
15
+
16
+ # Don't care if the mailer can't send
17
+ config.action_mailer.raise_delivery_errors = false
18
+
19
+ # Print deprecation notices to the Rails logger
20
+ config.active_support.deprecation = :log
21
+
22
+ # Only use best-standards-support built into browsers
23
+ config.action_dispatch.best_standards_support = :builtin
24
+
25
+ # Raise exception on mass assignment protection for Active Record models
26
+ config.active_record.mass_assignment_sanitizer = :strict
27
+
28
+ # Log the query plan for queries taking more than this (works
29
+ # with SQLite, MySQL, and PostgreSQL)
30
+ config.active_record.auto_explain_threshold_in_seconds = 0.5
31
+
32
+ # Do not compress assets
33
+ config.assets.compress = false
34
+
35
+ # Expands the lines which load the assets
36
+ config.assets.debug = true
37
+
38
+ config.action_mailer.default_url_options = { :host => 'localhost:3000' }
39
+ end
@@ -0,0 +1,69 @@
1
+ Dummy::Application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb
3
+
4
+ # Code is not reloaded between requests
5
+ config.cache_classes = true
6
+
7
+ # Full error reports are disabled and caching is turned on
8
+ config.consider_all_requests_local = false
9
+ config.action_controller.perform_caching = true
10
+
11
+ # Disable Rails's static asset server (Apache or nginx will already do this)
12
+ config.serve_static_assets = false
13
+
14
+ # Compress JavaScripts and CSS
15
+ config.assets.compress = true
16
+
17
+ # Don't fallback to assets pipeline if a precompiled asset is missed
18
+ config.assets.compile = false
19
+
20
+ # Generate digests for assets URLs
21
+ config.assets.digest = true
22
+
23
+ # Defaults to nil and saved in location specified by config.assets.prefix
24
+ # config.assets.manifest = YOUR_PATH
25
+
26
+ # Specifies the header that your server uses for sending files
27
+ # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
28
+ # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
29
+
30
+ # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
31
+ # config.force_ssl = true
32
+
33
+ # See everything in the log (default is :info)
34
+ # config.log_level = :debug
35
+
36
+ # Prepend all log lines with the following tags
37
+ # config.log_tags = [ :subdomain, :uuid ]
38
+
39
+ # Use a different logger for distributed setups
40
+ # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
41
+
42
+ # Use a different cache store in production
43
+ # config.cache_store = :mem_cache_store
44
+
45
+ # Enable serving of images, stylesheets, and JavaScripts from an asset server
46
+ # config.action_controller.asset_host = "http://assets.example.com"
47
+
48
+ # Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
49
+ # config.assets.precompile += %w( search.js )
50
+
51
+ # Disable delivery errors, bad email addresses will be ignored
52
+ # config.action_mailer.raise_delivery_errors = false
53
+
54
+ # Enable threaded mode
55
+ # config.threadsafe!
56
+
57
+ # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
58
+ # the I18n.default_locale when a translation can not be found)
59
+ config.i18n.fallbacks = true
60
+
61
+ # Send deprecation notices to registered listeners
62
+ config.active_support.deprecation = :notify
63
+
64
+ # Log the query plan for queries taking more than this (works
65
+ # with SQLite, MySQL, and PostgreSQL)
66
+ # config.active_record.auto_explain_threshold_in_seconds = 0.5
67
+
68
+ config.action_mailer.default_url_options = { :host => 'productionapp.com' }
69
+ end
@@ -0,0 +1,37 @@
1
+ Dummy::Application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb
3
+
4
+ # The test environment is used exclusively to run your application's
5
+ # test suite. You never need to work with it otherwise. Remember that
6
+ # your test database is "scratch space" for the test suite and is wiped
7
+ # and recreated between test runs. Don't rely on the data there!
8
+ config.cache_classes = true
9
+
10
+ # Configure static asset server for tests with Cache-Control for performance
11
+ config.serve_static_assets = true
12
+ config.static_cache_control = "public, max-age=3600"
13
+
14
+ # Log error messages when you accidentally call methods on nil
15
+ config.whiny_nils = true
16
+
17
+ # Show full error reports and disable caching
18
+ config.consider_all_requests_local = true
19
+ config.action_controller.perform_caching = false
20
+
21
+ # Raise exceptions instead of rendering exception templates
22
+ config.action_dispatch.show_exceptions = false
23
+
24
+ # Disable request forgery protection in test environment
25
+ config.action_controller.allow_forgery_protection = false
26
+
27
+ # Tell Action Mailer not to deliver emails to the real world.
28
+ # The :test delivery method accumulates sent emails in the
29
+ # ActionMailer::Base.deliveries array.
30
+ config.action_mailer.delivery_method = :test
31
+
32
+ # Raise exception on mass assignment protection for Active Record models
33
+ config.active_record.mass_assignment_sanitizer = :strict
34
+
35
+ # Print deprecation notices to the stderr
36
+ config.active_support.deprecation = :stderr
37
+ end
@@ -0,0 +1,7 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
4
+ # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
5
+
6
+ # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
7
+ # Rails.backtrace_cleaner.remove_silencers!
@@ -0,0 +1,15 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new inflection rules using the following format
4
+ # (all these examples are active by default):
5
+ # ActiveSupport::Inflector.inflections do |inflect|
6
+ # inflect.plural /^(ox)$/i, '\1en'
7
+ # inflect.singular /^(ox)en/i, '\1'
8
+ # inflect.irregular 'person', 'people'
9
+ # inflect.uncountable %w( fish sheep )
10
+ # end
11
+ #
12
+ # These inflection rules are supported but not enabled by default:
13
+ # ActiveSupport::Inflector.inflections do |inflect|
14
+ # inflect.acronym 'RESTful'
15
+ # end
@@ -0,0 +1,3 @@
1
+ ENV['S3_BUCKET'] = 'your-bucket'
2
+ ENV['S3_KEY'] = 'your-key'
3
+ ENV['S3_SECRET'] = 'your-secret'
@@ -0,0 +1,5 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new mime types for use in respond_to blocks:
4
+ # Mime::Type.register "text/richtext", :rtf
5
+ # Mime::Type.register_alias "text/html", :iphone
@@ -0,0 +1,7 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Your secret key for verifying the integrity of signed cookies.
4
+ # If you change this key, all old signed cookies will become invalid!
5
+ # Make sure the secret is at least 30 characters and all random,
6
+ # no regular words or you'll be exposed to dictionary attacks.
7
+ Dummy::Application.config.secret_token = 'f629d321af339d45012e122c0b66f7037bcae73da72eb21394839b3f7de132ec090ce335a70c21004aec9b8b1eeece10d3985d25383f12976c5943d70a5aaa8b'
@@ -0,0 +1,8 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ Dummy::Application.config.session_store :cookie_store, key: '_dummy_session'
4
+
5
+ # Use the database for sessions instead of the cookie-based default,
6
+ # which shouldn't be used to store highly confidential information
7
+ # (create the session table with "rails generate session_migration")
8
+ # Dummy::Application.config.session_store :active_record_store
@@ -0,0 +1,14 @@
1
+ # Be sure to restart your server when you modify this file.
2
+ #
3
+ # This file contains settings for ActionController::ParamsWrapper which
4
+ # is enabled by default.
5
+
6
+ # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
7
+ ActiveSupport.on_load(:action_controller) do
8
+ wrap_parameters format: [:json]
9
+ end
10
+
11
+ # Disable root element in JSON by default.
12
+ ActiveSupport.on_load(:active_record) do
13
+ self.include_root_in_json = false
14
+ end
@@ -0,0 +1,5 @@
1
+ # Sample localization file for English. Add more files in this directory for other locales.
2
+ # See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
3
+
4
+ en:
5
+ hello: "Hello world"
@@ -0,0 +1,5 @@
1
+ Rails.application.routes.draw do
2
+ mount Mercury::Engine => '/'
3
+ mount Wafflemix::Engine => "/"
4
+ devise_for :user
5
+ end
@@ -0,0 +1,4 @@
1
+ # This file is used by Rack-based servers to start the application.
2
+
3
+ require ::File.expand_path('../config/environment', __FILE__)
4
+ run Dummy::Application
@@ -0,0 +1,87 @@
1
+ # encoding: UTF-8
2
+ # This file is auto-generated from the current state of the database. Instead
3
+ # of editing this file, please use the migrations feature of Active Record to
4
+ # incrementally modify your database, and then regenerate this schema definition.
5
+ #
6
+ # Note that this schema.rb definition is the authoritative source for your
7
+ # database schema. If you need to create the application database on another
8
+ # system, you should be using db:schema:load, not running all the migrations
9
+ # from scratch. The latter is a flawed and unsustainable approach (the more migrations
10
+ # you'll amass, the slower it'll run and the greater likelihood for issues).
11
+ #
12
+ # It's strongly recommended to check this file into your version control system.
13
+
14
+ ActiveRecord::Schema.define(:version => 20120915192514) do
15
+
16
+ create_table "wafflemix_assets", :force => true do |t|
17
+ t.string "asset_uid"
18
+ t.string "asset_mime_type"
19
+ t.integer "asset_file_size"
20
+ t.datetime "created_at", :null => false
21
+ t.datetime "updated_at", :null => false
22
+ end
23
+
24
+ create_table "wafflemix_page_translations", :force => true do |t|
25
+ t.integer "wafflemix_page_id"
26
+ t.string "locale"
27
+ t.string "title"
28
+ t.text "body"
29
+ t.datetime "created_at", :null => false
30
+ t.datetime "updated_at", :null => false
31
+ end
32
+
33
+ add_index "wafflemix_page_translations", ["locale"], :name => "index_wafflemix_page_translations_on_locale"
34
+ add_index "wafflemix_page_translations", ["wafflemix_page_id"], :name => "index_d726c55d32afe225f4f593cd5049b918f4a395ff"
35
+
36
+ create_table "wafflemix_pages", :force => true do |t|
37
+ t.integer "parent_id"
38
+ t.integer "position"
39
+ t.boolean "show_in_menu"
40
+ t.string "link_url"
41
+ t.boolean "deletable"
42
+ t.boolean "draft"
43
+ t.boolean "skip_to_first"
44
+ t.datetime "created_at", :null => false
45
+ t.datetime "updated_at", :null => false
46
+ t.string "ancestry"
47
+ end
48
+
49
+ add_index "wafflemix_pages", ["ancestry"], :name => "index_wafflemix_pages_on_ancestry"
50
+
51
+ create_table "wafflemix_roles", :force => true do |t|
52
+ t.string "name"
53
+ t.datetime "created_at", :null => false
54
+ t.datetime "updated_at", :null => false
55
+ end
56
+
57
+ create_table "wafflemix_user_roles", :force => true do |t|
58
+ t.integer "user_id"
59
+ t.integer "role_id"
60
+ t.datetime "created_at", :null => false
61
+ t.datetime "updated_at", :null => false
62
+ end
63
+
64
+ add_index "wafflemix_user_roles", ["role_id"], :name => "index_wafflemix_user_roles_on_role_id"
65
+ add_index "wafflemix_user_roles", ["user_id"], :name => "index_wafflemix_user_roles_on_user_id"
66
+
67
+ create_table "wafflemix_users", :force => true do |t|
68
+ t.string "username"
69
+ t.string "email"
70
+ t.string "encrypted_password", :default => "", :null => false
71
+ t.string "reset_password_token"
72
+ t.datetime "reset_password_sent_at"
73
+ t.datetime "remember_created_at"
74
+ t.integer "sign_in_count", :default => 0
75
+ t.datetime "current_sign_in_at"
76
+ t.datetime "last_sign_in_at"
77
+ t.string "current_sign_in_ip"
78
+ t.string "last_sign_in_ip"
79
+ t.datetime "created_at", :null => false
80
+ t.datetime "updated_at", :null => false
81
+ end
82
+
83
+ add_index "wafflemix_users", ["email"], :name => "index_wafflemix_users_on_email", :unique => true
84
+ add_index "wafflemix_users", ["reset_password_token"], :name => "index_wafflemix_users_on_reset_password_token", :unique => true
85
+ add_index "wafflemix_users", ["username"], :name => "index_wafflemix_users_on_username", :unique => true
86
+
87
+ end
@@ -0,0 +1,26 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The page you were looking for doesn't exist (404)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/404.html -->
21
+ <div class="dialog">
22
+ <h1>The page you were looking for doesn't exist.</h1>
23
+ <p>You may have mistyped the address or the page may have moved.</p>
24
+ </div>
25
+ </body>
26
+ </html>
@@ -0,0 +1,26 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The change you wanted was rejected (422)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/422.html -->
21
+ <div class="dialog">
22
+ <h1>The change you wanted was rejected.</h1>
23
+ <p>Maybe you tried to change something you didn't have access to.</p>
24
+ </div>
25
+ </body>
26
+ </html>
@@ -0,0 +1,25 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>We're sorry, but something went wrong (500)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/500.html -->
21
+ <div class="dialog">
22
+ <h1>We're sorry, but something went wrong.</h1>
23
+ </div>
24
+ </body>
25
+ </html>
File without changes
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+ # This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
3
+
4
+ APP_PATH = File.expand_path('../../config/application', __FILE__)
5
+ require File.expand_path('../../config/boot', __FILE__)
6
+ require 'rails/commands'
@@ -0,0 +1,11 @@
1
+ # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html
2
+
3
+ one:
4
+ asset_uid: MyString
5
+ asset_mime_type: MyString
6
+ asset_file_size: 1
7
+
8
+ two:
9
+ asset_uid: MyString
10
+ asset_mime_type: MyString
11
+ asset_file_size: 1
@@ -0,0 +1,13 @@
1
+ # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html
2
+
3
+ one:
4
+ categorical:
5
+ name: MyString
6
+ position: 1
7
+ ancestry: MyString
8
+
9
+ two:
10
+ categorical:
11
+ name: MyString
12
+ position: 1
13
+ ancestry: MyString
@@ -0,0 +1,13 @@
1
+ # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html
2
+
3
+ one:
4
+ name: MyString
5
+ email: MyString
6
+ subject: MyString
7
+ message: MyText
8
+
9
+ two:
10
+ name: MyString
11
+ email: MyString
12
+ subject: MyString
13
+ message: MyText
@@ -0,0 +1,13 @@
1
+ # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html
2
+
3
+ one:
4
+ contentable_id: 1
5
+ contentable_type: MyString
6
+ name: MyString
7
+ content: MyText
8
+
9
+ two:
10
+ contentable_id: 1
11
+ contentable_type: MyString
12
+ name: MyString
13
+ content: MyText
@@ -0,0 +1,11 @@
1
+ # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html
2
+
3
+ one:
4
+ asset_id: 1
5
+ imageable_type: MyString
6
+ imageable_id: MyString
7
+
8
+ two:
9
+ asset_id: 1
10
+ imageable_type: MyString
11
+ imageable_id: MyString
@@ -0,0 +1,15 @@
1
+ # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html
2
+
3
+ one:
4
+ metable_id: 1
5
+ metable_type: MyString
6
+ meta_title: MyString
7
+ meta_keywords: MyString
8
+ meta_description: MyString
9
+
10
+ two:
11
+ metable_id: 1
12
+ metable_type: MyString
13
+ meta_title: MyString
14
+ meta_keywords: MyString
15
+ meta_description: MyString
@@ -0,0 +1,19 @@
1
+ # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html
2
+
3
+ one:
4
+ parent_id: 1
5
+ position: 1
6
+ show_in_menu: false
7
+ link_url: MyString
8
+ deletable: false
9
+ draft: false
10
+ skip_to_first: false
11
+
12
+ two:
13
+ parent_id: 1
14
+ position: 1
15
+ show_in_menu: false
16
+ link_url: MyString
17
+ deletable: false
18
+ draft: false
19
+ skip_to_first: false
@@ -0,0 +1,11 @@
1
+ # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html
2
+
3
+ one:
4
+ title: MyString
5
+ intro: MyText
6
+ content: MyText
7
+
8
+ two:
9
+ title: MyString
10
+ intro: MyText
11
+ content: MyText
@@ -0,0 +1,11 @@
1
+ # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html
2
+
3
+ one:
4
+ published_at: 2012-11-13 08:12:39
5
+ link_url: MyString
6
+ draft: MyString
7
+
8
+ two:
9
+ published_at: 2012-11-13 08:12:39
10
+ link_url: MyString
11
+ draft: MyString
@@ -0,0 +1,7 @@
1
+ # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html
2
+
3
+ one:
4
+ name: MyString
5
+
6
+ two:
7
+ name: MyString
@@ -0,0 +1,7 @@
1
+ # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html
2
+
3
+ one:
4
+ name: MyString
5
+
6
+ two:
7
+ name: MyString
@@ -0,0 +1,9 @@
1
+ # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html
2
+
3
+ one:
4
+ user_id: 1
5
+ role_id: 1
6
+
7
+ two:
8
+ user_id: 1
9
+ role_id: 1
@@ -0,0 +1,11 @@
1
+ # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html
2
+
3
+ one:
4
+ username: MyString
5
+ email: MyString
6
+ password: MyString
7
+
8
+ two:
9
+ username: MyString
10
+ email: MyString
11
+ password: MyString
@@ -0,0 +1,51 @@
1
+ require 'test_helper'
2
+
3
+ module Wafflemix
4
+ class AssetsControllerTest < ActionController::TestCase
5
+ setup do
6
+ @asset = assets(:one)
7
+ end
8
+
9
+ test "should get index" do
10
+ get :index
11
+ assert_response :success
12
+ assert_not_nil assigns(:assets)
13
+ end
14
+
15
+ test "should get new" do
16
+ get :new
17
+ assert_response :success
18
+ end
19
+
20
+ test "should create asset" do
21
+ assert_difference('Asset.count') do
22
+ post :create, asset: { asset_file_size: @asset.asset_file_size, asset_mime_type: @asset.asset_mime_type, asset_uid: @asset.asset_uid }
23
+ end
24
+
25
+ assert_redirected_to asset_path(assigns(:asset))
26
+ end
27
+
28
+ test "should show asset" do
29
+ get :show, id: @asset
30
+ assert_response :success
31
+ end
32
+
33
+ test "should get edit" do
34
+ get :edit, id: @asset
35
+ assert_response :success
36
+ end
37
+
38
+ test "should update asset" do
39
+ put :update, id: @asset, asset: { asset_file_size: @asset.asset_file_size, asset_mime_type: @asset.asset_mime_type, asset_uid: @asset.asset_uid }
40
+ assert_redirected_to asset_path(assigns(:asset))
41
+ end
42
+
43
+ test "should destroy asset" do
44
+ assert_difference('Asset.count', -1) do
45
+ delete :destroy, id: @asset
46
+ end
47
+
48
+ assert_redirected_to assets_path
49
+ end
50
+ end
51
+ end