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,227 @@
1
+ # Use this hook to configure devise mailer, warden hooks and so forth.
2
+ # Many of these configuration options can be set straight in your model.
3
+ Devise.setup do |config|
4
+ # ==> Mailer Configuration
5
+ # Configure the e-mail address which will be shown in Devise::Mailer,
6
+ # note that it will be overwritten if you use your own mailer class with default "from" parameter.
7
+ config.mailer_sender = "please-change-me-at-config-initializers-devise@example.com"
8
+
9
+ # Configure the class responsible to send e-mails.
10
+ # config.mailer = "Devise::Mailer"
11
+
12
+ # Automatically apply schema changes in tableless databases
13
+ config.apply_schema = false
14
+
15
+ # ==> ORM configuration
16
+ # Load and configure the ORM. Supports :active_record (default) and
17
+ # :mongoid (bson_ext recommended) by default. Other ORMs may be
18
+ # available as additional gems.
19
+ require 'devise/orm/active_record'
20
+
21
+ # ==> Configuration for any authentication mechanism
22
+ # Configure which keys are used when authenticating a user. The default is
23
+ # just :email. You can configure it to use [:username, :subdomain], so for
24
+ # authenticating a user, both parameters are required. Remember that those
25
+ # parameters are used only when authenticating and not when retrieving from
26
+ # session. If you need permissions, you should implement that in a before filter.
27
+ # You can also supply a hash where the value is a boolean determining whether
28
+ # or not authentication should be aborted when the value is not present.
29
+ #config.authentication_keys = [ :login ]
30
+
31
+ # Configure parameters from the request object used for authentication. Each entry
32
+ # given should be a request method and it will automatically be passed to the
33
+ # find_for_authentication method and considered in your model lookup. For instance,
34
+ # if you set :request_keys to [:subdomain], :subdomain will be used on authentication.
35
+ # The same considerations mentioned for authentication_keys also apply to request_keys.
36
+ # config.request_keys = []
37
+
38
+ # Configure which authentication keys should be case-insensitive.
39
+ # These keys will be downcased upon creating or modifying a user and when used
40
+ # to authenticate or find a user. Default is :email.
41
+ config.case_insensitive_keys = [ :email ]
42
+
43
+ # Configure which authentication keys should have whitespace stripped.
44
+ # These keys will have whitespace before and after removed upon creating or
45
+ # modifying a user and when used to authenticate or find a user. Default is :email.
46
+ config.strip_whitespace_keys = [ :email ]
47
+
48
+ # Tell if authentication through request.params is enabled. True by default.
49
+ # It can be set to an array that will enable params authentication only for the
50
+ # given strategies, for example, `config.params_authenticatable = [:database]` will
51
+ # enable it only for database (email + password) authentication.
52
+ # config.params_authenticatable = true
53
+
54
+ # Tell if authentication through HTTP Basic Auth is enabled. False by default.
55
+ # It can be set to an array that will enable http authentication only for the
56
+ # given strategies, for example, `config.http_authenticatable = [:token]` will
57
+ # enable it only for token authentication.
58
+ # config.http_authenticatable = false
59
+
60
+ # If http headers should be returned for AJAX requests. True by default.
61
+ # config.http_authenticatable_on_xhr = true
62
+
63
+ # The realm used in Http Basic Authentication. "Application" by default.
64
+ # config.http_authentication_realm = "Application"
65
+
66
+ # It will change confirmation, password recovery and other workflows
67
+ # to behave the same regardless if the e-mail provided was right or wrong.
68
+ # Does not affect registerable.
69
+ # config.paranoid = true
70
+
71
+ # By default Devise will store the user in session. You can skip storage for
72
+ # :http_auth and :token_auth by adding those symbols to the array below.
73
+ # Notice that if you are skipping storage for all authentication paths, you
74
+ # may want to disable generating routes to Devise's sessions controller by
75
+ # passing :skip => :sessions to `devise_for` in your config/routes.rb
76
+ config.skip_session_storage = [:http_auth]
77
+
78
+ # ==> Configuration for :database_authenticatable
79
+ # For bcrypt, this is the cost for hashing the password and defaults to 10. If
80
+ # using other encryptors, it sets how many times you want the password re-encrypted.
81
+ #
82
+ # Limiting the stretches to just one in testing will increase the performance of
83
+ # your test suite dramatically. However, it is STRONGLY RECOMMENDED to not use
84
+ # a value less than 10 in other environments.
85
+ config.stretches = Rails.env.test? ? 1 : 10
86
+
87
+ # Setup a pepper to generate the encrypted password.
88
+ # config.pepper = "f185e35f46e2e90ed8bd369d0e04d1154ded7284f404cf26dd101bdd71db64e79a962954fc426183f9b502ec1dd34e1369fbb469f411cd427484db0ef444d32a"
89
+
90
+ # ==> Configuration for :confirmable
91
+ # A period that the user is allowed to access the website even without
92
+ # confirming his account. For instance, if set to 2.days, the user will be
93
+ # able to access the website for two days without confirming his account,
94
+ # access will be blocked just in the third day. Default is 0.days, meaning
95
+ # the user cannot access the website without confirming his account.
96
+ # config.allow_unconfirmed_access_for = 2.days
97
+
98
+ # If true, requires any email changes to be confirmed (exctly the same way as
99
+ # initial account confirmation) to be applied. Requires additional unconfirmed_email
100
+ # db field (see migrations). Until confirmed new email is stored in
101
+ # unconfirmed email column, and copied to email column on successful confirmation.
102
+ config.reconfirmable = true
103
+
104
+ # Defines which key will be used when confirming an account
105
+ # config.confirmation_keys = [ :email ]
106
+
107
+ # ==> Configuration for :rememberable
108
+ # The time the user will be remembered without asking for credentials again.
109
+ # config.remember_for = 2.weeks
110
+
111
+ # If true, extends the user's remember period when remembered via cookie.
112
+ # config.extend_remember_period = false
113
+
114
+ # If true, uses the password salt as remember token. This should be turned
115
+ # to false if you are not using database authenticatable.
116
+ config.use_salt_as_remember_token = true
117
+
118
+ # Options to be passed to the created cookie. For instance, you can set
119
+ # :secure => true in order to force SSL only cookies.
120
+ # config.cookie_options = {}
121
+
122
+ # ==> Configuration for :validatable
123
+ # Range for password length. Default is 6..128.
124
+ config.password_length = 5..28
125
+
126
+ # Email regex used to validate email formats. It simply asserts that
127
+ # an one (and only one) @ exists in the given string. This is mainly
128
+ # to give user feedback and not to assert the e-mail validity.
129
+ # config.email_regexp = /\A[^@]+@[^@]+\z/
130
+
131
+ # ==> Configuration for :timeoutable
132
+ # The time you want to timeout the user session without activity. After this
133
+ # time the user will be asked for credentials again. Default is 30 minutes.
134
+ # config.timeout_in = 30.minutes
135
+
136
+ # ==> Configuration for :lockable
137
+ # Defines which strategy will be used to lock an account.
138
+ # :failed_attempts = Locks an account after a number of failed attempts to sign in.
139
+ # :none = No lock strategy. You should handle locking by yourself.
140
+ # config.lock_strategy = :failed_attempts
141
+
142
+ # Defines which key will be used when locking and unlocking an account
143
+ # config.unlock_keys = [ :email ]
144
+
145
+ # Defines which strategy will be used to unlock an account.
146
+ # :email = Sends an unlock link to the user email
147
+ # :time = Re-enables login after a certain amount of time (see :unlock_in below)
148
+ # :both = Enables both strategies
149
+ # :none = No unlock strategy. You should handle unlocking by yourself.
150
+ # config.unlock_strategy = :both
151
+
152
+ # Number of authentication tries before locking an account if lock_strategy
153
+ # is failed attempts.
154
+ # config.maximum_attempts = 20
155
+
156
+ # Time interval to unlock the account if :time is enabled as unlock_strategy.
157
+ # config.unlock_in = 1.hour
158
+
159
+ # ==> Configuration for :recoverable
160
+ #
161
+ # Defines which key will be used when recovering the password for an account
162
+ # config.reset_password_keys = [ :email ]
163
+
164
+ # Time interval you can reset your password with a reset password key.
165
+ # Don't put a too small interval or your users won't have the time to
166
+ # change their passwords.
167
+ config.reset_password_within = 6.hours
168
+
169
+ # ==> Configuration for :encryptable
170
+ # Allow you to use another encryption algorithm besides bcrypt (default). You can use
171
+ # :sha1, :sha512 or encryptors from others authentication tools as :clearance_sha1,
172
+ # :authlogic_sha512 (then you should set stretches above to 20 for default behavior)
173
+ # and :restful_authentication_sha1 (then you should set stretches to 10, and copy
174
+ # REST_AUTH_SITE_KEY to pepper)
175
+ # config.encryptor = :sha512
176
+
177
+ # ==> Configuration for :token_authenticatable
178
+ # Defines name of the authentication token params key
179
+ # config.token_authentication_key = :auth_token
180
+
181
+ # ==> Scopes configuration
182
+ # Turn scoped views on. Before rendering "sessions/new", it will first check for
183
+ # "users/sessions/new". It's turned off by default because it's slower if you
184
+ # are using only default views.
185
+ # config.scoped_views = false
186
+
187
+ # Configure the default scope given to Warden. By default it's the first
188
+ # devise role declared in your routes (usually :user).
189
+ # config.default_scope = :user
190
+
191
+ # Configure sign_out behavior.
192
+ # Sign_out action can be scoped (i.e. /users/sign_out affects only :user scope).
193
+ # The default is true, which means any logout action will sign out all active scopes.
194
+ # config.sign_out_all_scopes = true
195
+
196
+
197
+ config.router_name = :wafflemix
198
+
199
+
200
+ # ==> Navigation configuration
201
+ # Lists the formats that should be treated as navigational. Formats like
202
+ # :html, should redirect to the sign in page when the user does not have
203
+ # access, but formats like :xml or :json, should return 401.
204
+ #
205
+ # If you have any extra navigational formats, like :iphone or :mobile, you
206
+ # should add them to the navigational formats lists.
207
+ #
208
+ # The "*/*" below is required to match Internet Explorer requests.
209
+ # config.navigational_formats = ["*/*", :html]
210
+
211
+ # The default HTTP method used to sign out a resource. Default is :delete.
212
+ config.sign_out_via = :delete
213
+
214
+ # ==> OmniAuth
215
+ # Add a new OmniAuth provider. Check the wiki for more information on setting
216
+ # up on your models and hooks.
217
+ # config.omniauth :github, 'APP_ID', 'APP_SECRET', :scope => 'user,public_repo'
218
+
219
+ # ==> Warden configuration
220
+ # If you want to use other strategies, that are not supported by Devise, or
221
+ # change the failure app, you can configure them inside the config.warden block.
222
+ #
223
+ # config.warden do |manager|
224
+ # manager.intercept_401 = false
225
+ # manager.default_strategies(:scope => :user).unshift :some_external_strategy
226
+ # end
227
+ end
@@ -0,0 +1,16 @@
1
+ require 'dragonfly'
2
+ app = Dragonfly[:waffle_assets]
3
+
4
+ app.configure_with(:imagemagick)
5
+ app.configure_with(:rails)
6
+ if ENV['S3_BUCKET']
7
+ app.configure do |c|
8
+ c.datastore = Dragonfly::DataStorage::S3DataStore.new(
9
+ :bucket_name => ENV['S3_BUCKET'],
10
+ :access_key_id => ENV['S3_KEY'],
11
+ :secret_access_key => ENV['S3_SECRET']
12
+ )
13
+ end
14
+ end
15
+
16
+ app.define_macro(ActiveRecord::Base, :image_accessor)
@@ -0,0 +1,78 @@
1
+ Formtastic::Helpers::FormHelper.builder = FormtasticBootstrap::FormBuilder
2
+
3
+ # encoding: utf-8
4
+
5
+ # Set the default text field size when input is a string. Default is nil.
6
+ # Formtastic::FormBuilder.default_text_field_size = 50
7
+
8
+ # Set the default text area height when input is a text. Default is 20.
9
+ # Formtastic::FormBuilder.default_text_area_height = 5
10
+
11
+ # Set the default text area width when input is a text. Default is nil.
12
+ # Formtastic::FormBuilder.default_text_area_width = 50
13
+
14
+ # Should all fields be considered "required" by default?
15
+ # Defaults to true.
16
+ # Formtastic::FormBuilder.all_fields_required_by_default = true
17
+
18
+ # Should select fields have a blank option/prompt by default?
19
+ # Defaults to true.
20
+ # Formtastic::FormBuilder.include_blank_for_select_by_default = true
21
+
22
+ # Set the string that will be appended to the labels/fieldsets which are required
23
+ # It accepts string or procs and the default is a localized version of
24
+ # '<abbr title="required">*</abbr>'. In other words, if you configure formtastic.required
25
+ # in your locale, it will replace the abbr title properly. But if you don't want to use
26
+ # abbr tag, you can simply give a string as below
27
+ # Formtastic::FormBuilder.required_string = "(required)"
28
+
29
+ # Set the string that will be appended to the labels/fieldsets which are optional
30
+ # Defaults to an empty string ("") and also accepts procs (see required_string above)
31
+ # Formtastic::FormBuilder.optional_string = "(optional)"
32
+
33
+ # Set the way inline errors will be displayed.
34
+ # Defaults to :sentence, valid options are :sentence, :list, :first and :none
35
+ # Formtastic::FormBuilder.inline_errors = :sentence
36
+ # Formtastic uses the following classes as default for hints, inline_errors and error list
37
+
38
+ # If you override the class here, please ensure to override it in your stylesheets as well
39
+ # Formtastic::FormBuilder.default_hint_class = "inline-hints"
40
+ # Formtastic::FormBuilder.default_inline_error_class = "inline-errors"
41
+ # Formtastic::FormBuilder.default_error_list_class = "errors"
42
+
43
+ # Set the method to call on label text to transform or format it for human-friendly
44
+ # reading when formtastic is used without object. Defaults to :humanize.
45
+ # Formtastic::FormBuilder.label_str_method = :humanize
46
+
47
+ # Set the array of methods to try calling on parent objects in :select and :radio inputs
48
+ # for the text inside each @<option>@ tag or alongside each radio @<input>@. The first method
49
+ # that is found on the object will be used.
50
+ # Defaults to ["to_label", "display_name", "full_name", "name", "title", "username", "login", "value", "to_s"]
51
+ # Formtastic::FormBuilder.collection_label_methods = [
52
+ # "to_label", "display_name", "full_name", "name", "title", "username", "login", "value", "to_s"]
53
+
54
+ # Specifies if labels/hints for input fields automatically be looked up using I18n.
55
+ # Default value: true. Overridden for specific fields by setting value to true,
56
+ # i.e. :label => true, or :hint => true (or opposite depending on initialized value)
57
+ # Formtastic::FormBuilder.i18n_lookups_by_default = false
58
+
59
+ # Specifies if I18n lookups of the default I18n Localizer should be cached to improve performance.
60
+ # Defaults to true.
61
+ # Formtastic::FormBuilder.i18n_cache_lookups = false
62
+
63
+ # Specifies the class to use for localization lookups. You can create your own
64
+ # class and use it instead by subclassing Formtastic::Localizer (which is the default).
65
+ # Formtastic::FormBuilder.i18n_localizer = MyOwnLocalizer
66
+
67
+ # You can add custom inputs or override parts of Formtastic by subclassing Formtastic::FormBuilder and
68
+ # specifying that class here. Defaults to Formtastic::FormBuilder.
69
+ # Formtastic::Helpers::FormHelper.builder = MyCustomBuilder
70
+
71
+ # You can opt-in to Formtastic's use of the HTML5 `required` attribute on `<input>`, `<select>`
72
+ # and `<textarea>` tags by setting this to false (defaults to true).
73
+ # Formtastic::FormBuilder.use_required_attribute = true
74
+
75
+ # You can opt-in to new HTML5 browser validations (for things like email and url inputs) by setting
76
+ # this to false. Doing so will add a `novalidate` attribute to the `<form>` tag.
77
+ # See http://diveintohtml5.org/forms.html#validation for more info.
78
+ # Formtastic::FormBuilder.perform_browser_validations = true
@@ -0,0 +1,4 @@
1
+ Rails.application.config.middleware.use Spamster::Rack::Middleware
2
+
3
+ Spamster.use_akismet(ENV['AKISMET_API_KEY'], ENV['AKISMET_SITE_URL'])
4
+
@@ -0,0 +1,57 @@
1
+ # Additional translations at https://github.com/plataformatec/devise/wiki/I18n
2
+
3
+ en:
4
+ errors:
5
+ messages:
6
+ expired: "has expired, please request a new one"
7
+ not_found: "not found"
8
+ already_confirmed: "was already confirmed, please try signing in"
9
+ not_locked: "was not locked"
10
+ not_saved:
11
+ one: "1 error prohibited this %{resource} from being saved:"
12
+ other: "%{count} errors prohibited this %{resource} from being saved:"
13
+
14
+ devise:
15
+ failure:
16
+ already_authenticated: 'You are already signed in.'
17
+ unauthenticated: 'You need to sign in or sign up before continuing.'
18
+ unconfirmed: 'You have to confirm your account before continuing.'
19
+ locked: 'Your account is locked.'
20
+ invalid: 'Invalid email or password.'
21
+ invalid_token: 'Invalid authentication token.'
22
+ timeout: 'Your session expired, please sign in again to continue.'
23
+ inactive: 'Your account was not activated yet.'
24
+ sessions:
25
+ signed_in: 'Signed in successfully.'
26
+ signed_out: 'Signed out successfully.'
27
+ passwords:
28
+ send_instructions: 'You will receive an email with instructions about how to reset your password in a few minutes.'
29
+ updated: 'Your password was changed successfully. You are now signed in.'
30
+ updated_not_active: 'Your password was changed successfully.'
31
+ send_paranoid_instructions: "If your e-mail exists on our database, you will receive a password recovery link on your e-mail"
32
+ confirmations:
33
+ send_instructions: 'You will receive an email with instructions about how to confirm your account in a few minutes.'
34
+ send_paranoid_instructions: 'If your e-mail exists on our database, you will receive an email with instructions about how to confirm your account in a few minutes.'
35
+ confirmed: 'Your account was successfully confirmed. You are now signed in.'
36
+ registrations:
37
+ signed_up: 'Welcome! You have signed up successfully.'
38
+ signed_up_but_unconfirmed: 'A message with a confirmation link has been sent to your email address. Please open the link to activate your account.'
39
+ signed_up_but_inactive: 'You have signed up successfully. However, we could not sign you in because your account is not yet activated.'
40
+ signed_up_but_locked: 'You have signed up successfully. However, we could not sign you in because your account is locked.'
41
+ updated: 'You updated your account successfully.'
42
+ update_needs_confirmation: "You updated your account successfully, but we need to verify your new email address. Please check your email and click on the confirm link to finalize confirming your new email address."
43
+ destroyed: 'Bye! Your account was successfully cancelled. We hope to see you again soon.'
44
+ unlocks:
45
+ send_instructions: 'You will receive an email with instructions about how to unlock your account in a few minutes.'
46
+ unlocked: 'Your account has been unlocked successfully. Please sign in to continue.'
47
+ send_paranoid_instructions: 'If your account exists, you will receive an email with instructions about how to unlock it in a few minutes.'
48
+ omniauth_callbacks:
49
+ success: 'Successfully authorized from %{kind} account.'
50
+ failure: 'Could not authorize you from %{kind} because "%{reason}".'
51
+ mailer:
52
+ confirmation_instructions:
53
+ subject: 'Confirmation instructions'
54
+ reset_password_instructions:
55
+ subject: 'Reset password instructions'
56
+ unlock_instructions:
57
+ subject: 'Unlock Instructions'
data/config/routes.rb ADDED
@@ -0,0 +1,55 @@
1
+ Wafflemix::Engine.routes.draw do
2
+ mount Mercury::Engine => '/'
3
+
4
+ resources :assets
5
+
6
+ resources :pages, :only => [:index, :show, :home] do
7
+ member { post :mercury_update }
8
+ end
9
+
10
+ resources :posts, :only => [:index, :show] do
11
+ post :mercury_update, :on => :member
12
+ get :tagged, :on => :member
13
+ end
14
+
15
+ resources :portfolios, :only => [:index, :show] do
16
+ member { post :mercury_update }
17
+ end
18
+
19
+ resources :categories
20
+ resources :contact_forms
21
+
22
+ namespace :admin do
23
+ resources :pages do
24
+ collection { post :sort }
25
+ end
26
+ resources :slides do
27
+ collection { post :sort }
28
+ end
29
+ resources :users
30
+ resources :roles
31
+ resources :assets
32
+ resources :categories
33
+ resources :content_sections
34
+ resources :posts
35
+ resources :contact_forms
36
+ resources :portfolios do
37
+ collection { post :sort }
38
+ end
39
+ resources :assets do
40
+ collection { post :add_image }
41
+ end
42
+ end
43
+
44
+ devise_for :users, {
45
+ class_name: '::Wafflemix::User',
46
+ module: :devise,
47
+ }
48
+
49
+ match "/contact-us" => "contact_forms#new"
50
+
51
+ root :to => "pages#home"
52
+
53
+ #this is our catch-all-route
54
+ match '*path' => 'pages#show'
55
+ end
@@ -0,0 +1,19 @@
1
+ class CreateWafflemixPages < ActiveRecord::Migration
2
+ def up
3
+ create_table :wafflemix_pages do |t|
4
+ t.integer :parent_id
5
+ t.integer :position
6
+ t.boolean :show_in_menu
7
+ t.string :link_url
8
+ t.boolean :deletable
9
+ t.boolean :draft
10
+ t.boolean :skip_to_first
11
+
12
+ t.timestamps
13
+ end
14
+ end
15
+
16
+ def down
17
+ drop_table :wafflemix_pages
18
+ end
19
+ end
@@ -0,0 +1,29 @@
1
+ class CreateWafflemixUsers < ActiveRecord::Migration
2
+ def change
3
+ create_table :wafflemix_users do |t|
4
+ t.string :username
5
+ t.string :email
6
+ t.string :encrypted_password, :null => false, :default => ""
7
+
8
+ ## Recoverable
9
+ t.string :reset_password_token
10
+ t.datetime :reset_password_sent_at
11
+
12
+ ## Rememberable
13
+ t.datetime :remember_created_at
14
+
15
+ ## Trackable
16
+ t.integer :sign_in_count, :default => 0
17
+ t.datetime :current_sign_in_at
18
+ t.datetime :last_sign_in_at
19
+ t.string :current_sign_in_ip
20
+ t.string :last_sign_in_ip
21
+
22
+ t.timestamps
23
+ end
24
+
25
+ add_index :wafflemix_users, :username, :unique => true
26
+ add_index :wafflemix_users, :email, :unique => true
27
+ add_index :wafflemix_users, :reset_password_token, :unique => true
28
+ end
29
+ end
@@ -0,0 +1,11 @@
1
+ class CreateWafflemixAssets < ActiveRecord::Migration
2
+ def change
3
+ create_table :wafflemix_assets do |t|
4
+ t.string :asset_uid
5
+ t.string :asset_mime_type
6
+ t.integer :asset_file_size
7
+
8
+ t.timestamps
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,9 @@
1
+ class CreateWafflemixRoles < ActiveRecord::Migration
2
+ def change
3
+ create_table :wafflemix_roles do |t|
4
+ t.string :name
5
+
6
+ t.timestamps
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,13 @@
1
+ class CreateWafflemixUserRoles < ActiveRecord::Migration
2
+ def change
3
+ create_table :wafflemix_user_roles do |t|
4
+ t.integer :user_id
5
+ t.integer :role_id
6
+
7
+ t.timestamps
8
+ end
9
+
10
+ add_index :wafflemix_user_roles, :user_id
11
+ add_index :wafflemix_user_roles, :role_id
12
+ end
13
+ end
@@ -0,0 +1,7 @@
1
+ class AddAncestryToPages < ActiveRecord::Migration
2
+ def change
3
+ add_column :wafflemix_pages, :ancestry, :string
4
+
5
+ add_index :wafflemix_pages, :ancestry
6
+ end
7
+ end
@@ -0,0 +1,15 @@
1
+ class CreateWafflemixCategories < ActiveRecord::Migration
2
+ def change
3
+ create_table :wafflemix_categories do |t|
4
+ t.integer :categorical_id
5
+ t.string :categorical_type
6
+ t.string :name
7
+ t.integer :position
8
+ t.string :ancestry
9
+
10
+ t.timestamps
11
+ end
12
+ add_index :wafflemix_categories, :categorical_id
13
+ add_index :wafflemix_categories, :categorical_type
14
+ end
15
+ end
@@ -0,0 +1,11 @@
1
+ class CreateWafflemixSlides < ActiveRecord::Migration
2
+ def change
3
+ create_table :wafflemix_slides do |t|
4
+ t.string :name
5
+ t.string :ancestry
6
+
7
+ t.timestamps
8
+ end
9
+ add_index :wafflemix_slides, :ancestry
10
+ end
11
+ end
@@ -0,0 +1,12 @@
1
+ class CreateWafflemixContentSections < ActiveRecord::Migration
2
+ def change
3
+ create_table :wafflemix_content_sections do |t|
4
+ t.integer :contentable_id
5
+ t.string :contentable_type
6
+ t.string :name
7
+ t.text :content
8
+
9
+ t.timestamps
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,5 @@
1
+ class AddPositionToSlides < ActiveRecord::Migration
2
+ def change
3
+ add_column :wafflemix_slides, :position, :integer
4
+ end
5
+ end
@@ -0,0 +1,10 @@
1
+ class UpdateAssetTable < ActiveRecord::Migration
2
+ def change
3
+ remove_column :wafflemix_assets, :asset_uid
4
+ remove_column :wafflemix_assets, :asset_file_size
5
+ remove_column :wafflemix_assets, :asset_mime_type
6
+
7
+ add_column :wafflemix_assets, :assetable_type, :string
8
+ add_column :wafflemix_assets, :assetable_id, :integer
9
+ end
10
+ end
@@ -0,0 +1,15 @@
1
+ class CreateWafflemixPosts < ActiveRecord::Migration
2
+ def up
3
+ create_table :wafflemix_posts do |t|
4
+ t.datetime :published_at
5
+ t.string :link_url
6
+ t.string :draft
7
+
8
+ t.timestamps
9
+ end
10
+ end
11
+
12
+ def down
13
+ drop_table :wafflemix_posts
14
+ end
15
+ end
@@ -0,0 +1,9 @@
1
+ class AddTranslationTableForPosts < ActiveRecord::Migration
2
+ def up
3
+ Wafflemix::Post.create_translation_table! :title => :string, :body => :text, :excerpt => :text
4
+ end
5
+
6
+ def down
7
+ Wafflemix::Post.drop_translation_table!
8
+ end
9
+ end
@@ -0,0 +1,11 @@
1
+ class UpdateDraftToBooleanOnPosts < ActiveRecord::Migration
2
+ def up
3
+ remove_column :wafflemix_posts, :draft
4
+ add_column :wafflemix_posts, :draft, :boolean, :default => false, :null => false
5
+ end
6
+
7
+ def down
8
+ remove_column :wafflemix_posts, :draft
9
+ add_column :wafflemix_posts, :draft, :boolean
10
+ end
11
+ end
@@ -0,0 +1,9 @@
1
+ class AddPageTranslations < ActiveRecord::Migration
2
+ def up
3
+ Wafflemix::Page.create_translation_table! :title => :string
4
+ end
5
+
6
+ def down
7
+ Wafflemix::Page.drop_translation_table!
8
+ end
9
+ end