active_admin_editor 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (185) hide show
  1. data/MIT-LICENSE +20 -0
  2. data/README.md +39 -0
  3. data/Rakefile +38 -0
  4. data/app/assets/images/active_admin/editor/icons.png +0 -0
  5. data/app/assets/javascripts/active_admin/editor.js +23 -0
  6. data/app/assets/javascripts/active_admin/editor/quicksave.js +36 -0
  7. data/app/assets/stylesheets/active_admin/editor.css +136 -0
  8. data/app/assets/stylesheets/active_admin/editor/wysiwyg.css +130 -0
  9. data/app/inputs/html_editor_input.rb +79 -0
  10. data/lib/active_admin/editor.rb +2 -0
  11. data/lib/active_admin/editor/rails/engine.rb +16 -0
  12. data/lib/active_admin/editor/version.rb +5 -0
  13. data/lib/active_admin_editor.rb +1 -0
  14. data/lib/tasks/active_admin_editor_tasks.rake +4 -0
  15. data/test/active_admin_editor_test.rb +7 -0
  16. data/test/dummy/README.rdoc +261 -0
  17. data/test/dummy/Rakefile +7 -0
  18. data/test/dummy/app/admin/dashboards.rb +44 -0
  19. data/test/dummy/app/admin/pages.rb +16 -0
  20. data/test/dummy/app/assets/javascripts/active_admin.js +1 -0
  21. data/test/dummy/app/assets/javascripts/application.js +15 -0
  22. data/test/dummy/app/assets/javascripts/pages.js +2 -0
  23. data/test/dummy/app/assets/stylesheets/active_admin.css.scss +6 -0
  24. data/test/dummy/app/assets/stylesheets/application.css +13 -0
  25. data/test/dummy/app/assets/stylesheets/pages.css.scss +3 -0
  26. data/test/dummy/app/assets/stylesheets/scaffolds.css.scss +56 -0
  27. data/test/dummy/app/controllers/application_controller.rb +3 -0
  28. data/test/dummy/app/controllers/pages_controller.rb +2 -0
  29. data/test/dummy/app/helpers/application_helper.rb +2 -0
  30. data/test/dummy/app/helpers/pages_helper.rb +2 -0
  31. data/test/dummy/app/models/admin_user.rb +10 -0
  32. data/test/dummy/app/models/page.rb +3 -0
  33. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  34. data/test/dummy/app/views/pages/_form.html.erb +25 -0
  35. data/test/dummy/app/views/pages/edit.html.erb +6 -0
  36. data/test/dummy/app/views/pages/index.html.erb +25 -0
  37. data/test/dummy/app/views/pages/new.html.erb +5 -0
  38. data/test/dummy/app/views/pages/show.html.erb +15 -0
  39. data/test/dummy/config.ru +4 -0
  40. data/test/dummy/config/application.rb +56 -0
  41. data/test/dummy/config/boot.rb +10 -0
  42. data/test/dummy/config/database.yml +25 -0
  43. data/test/dummy/config/environment.rb +5 -0
  44. data/test/dummy/config/environments/development.rb +37 -0
  45. data/test/dummy/config/environments/production.rb +67 -0
  46. data/test/dummy/config/environments/test.rb +37 -0
  47. data/test/dummy/config/initializers/active_admin.rb +129 -0
  48. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  49. data/test/dummy/config/initializers/devise.rb +223 -0
  50. data/test/dummy/config/initializers/inflections.rb +15 -0
  51. data/test/dummy/config/initializers/mime_types.rb +5 -0
  52. data/test/dummy/config/initializers/secret_token.rb +7 -0
  53. data/test/dummy/config/initializers/session_store.rb +8 -0
  54. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  55. data/test/dummy/config/locales/devise.en.yml +57 -0
  56. data/test/dummy/config/locales/en.yml +5 -0
  57. data/test/dummy/config/routes.rb +64 -0
  58. data/test/dummy/db/development.sqlite3 +0 -0
  59. data/test/dummy/db/migrate/20120430130552_create_admin_notes.rb +17 -0
  60. data/test/dummy/db/migrate/20120430130553_move_admin_notes_to_comments.rb +25 -0
  61. data/test/dummy/db/migrate/20120430200549_devise_create_admin_users.rb +52 -0
  62. data/test/dummy/db/migrate/20120430201522_create_pages.rb +10 -0
  63. data/test/dummy/db/schema.rb +56 -0
  64. data/test/dummy/db/test.sqlite3 +0 -0
  65. data/test/dummy/log/development.log +9246 -0
  66. data/test/dummy/public/404.html +26 -0
  67. data/test/dummy/public/422.html +26 -0
  68. data/test/dummy/public/500.html +25 -0
  69. data/test/dummy/public/favicon.ico +0 -0
  70. data/test/dummy/script/rails +6 -0
  71. data/test/dummy/test/fixtures/admin_users.yml +11 -0
  72. data/test/dummy/test/fixtures/pages.yml +9 -0
  73. data/test/dummy/test/functional/pages_controller_test.rb +49 -0
  74. data/test/dummy/test/unit/admin_user_test.rb +7 -0
  75. data/test/dummy/test/unit/helpers/pages_helper_test.rb +4 -0
  76. data/test/dummy/test/unit/page_test.rb +7 -0
  77. data/test/dummy/tmp/cache/assets/C37/920/sprockets%2F06193740ee7452897ea890866606e46c +0 -0
  78. data/test/dummy/tmp/cache/assets/C71/0E0/sprockets%2F21b76d0a722239c66071874c6c1f103d +0 -0
  79. data/test/dummy/tmp/cache/assets/C72/550/sprockets%2Fb10447885a4e045d14e632325d4167ba +0 -0
  80. data/test/dummy/tmp/cache/assets/C79/430/sprockets%2F239310c864d95b8029081a8cbb51109f +0 -0
  81. data/test/dummy/tmp/cache/assets/C7A/E90/sprockets%2F43393b12e73846b417e5187012f74cab +0 -0
  82. data/test/dummy/tmp/cache/assets/C8E/6F0/sprockets%2F17a15f67b95d85b259346b1988509d0b +0 -0
  83. data/test/dummy/tmp/cache/assets/C9C/4C0/sprockets%2F310c249165fa3e00ec5239562bc245f1 +0 -0
  84. data/test/dummy/tmp/cache/assets/CDB/040/sprockets%2Fc732474e67003a4eb840eb44c5ca9385 +0 -0
  85. data/test/dummy/tmp/cache/assets/CDD/2E0/sprockets%2F0f78bdd85b7f5fd4621224a2c0437572 +0 -0
  86. data/test/dummy/tmp/cache/assets/CE3/2D0/sprockets%2F4d4462dd9972233e700be2e38188ed1d +0 -0
  87. data/test/dummy/tmp/cache/assets/CEC/AF0/sprockets%2F7d8695745080bd838fea849c0d2d3a42 +0 -0
  88. data/test/dummy/tmp/cache/assets/D09/190/sprockets%2F45fb79553642c806213ebc0e22faed63 +0 -0
  89. data/test/dummy/tmp/cache/assets/D13/FE0/sprockets%2Ffb7916af38b70bb578a6d035d2508f18 +0 -0
  90. data/test/dummy/tmp/cache/assets/D24/8D0/sprockets%2F8f2a1bfe27153639fb959a5968b44c8d +0 -0
  91. data/test/dummy/tmp/cache/assets/D2A/F60/sprockets%2Fe73a58b43837c7ff9f6543898b362ebb +0 -0
  92. data/test/dummy/tmp/cache/assets/D2C/800/sprockets%2Fc7dacf6709ba20274c032814cd4e531b +0 -0
  93. data/test/dummy/tmp/cache/assets/D2F/AF0/sprockets%2F701a5254fb5ba1455e860e5c70d07cdb +0 -0
  94. data/test/dummy/tmp/cache/assets/D38/540/sprockets%2F86e1ad844bc9df4491a2a52b870421db +0 -0
  95. data/test/dummy/tmp/cache/assets/D3B/4F0/sprockets%2F6be6ae7be6be4167064d435a34ca1369 +0 -0
  96. data/test/dummy/tmp/cache/assets/D3E/150/sprockets%2Fec3ae7fd44729124d3e7046f33af28a4 +0 -0
  97. data/test/dummy/tmp/cache/assets/D48/640/sprockets%2F9f4f18d910b678b1d0777e04cdaf6f24 +0 -0
  98. data/test/dummy/tmp/cache/assets/D4D/D70/sprockets%2F169a66ca31e9576ce9062c9c38bf5e2e +0 -0
  99. data/test/dummy/tmp/cache/assets/D59/D70/sprockets%2Fed9f0de1b65ae8d7ef89087c83728461 +0 -0
  100. data/test/dummy/tmp/cache/assets/D64/2C0/sprockets%2Fce4f2416932b7aae7c1e2cdad1343873 +0 -0
  101. data/test/dummy/tmp/cache/assets/D6D/830/sprockets%2Fae3018f4cb13ce743eecf52ff7951532 +0 -0
  102. data/test/dummy/tmp/cache/assets/D75/FD0/sprockets%2Fc7cfc0d19e8f7f5166a4b436ba358e34 +0 -0
  103. data/test/dummy/tmp/cache/assets/D86/680/sprockets%2F16dbbba0db91ea56e2a6a5f6450c2522 +0 -0
  104. data/test/dummy/tmp/cache/assets/D91/A70/sprockets%2F4bc82aa15ade4213e6574aaac1d8387f +0 -0
  105. data/test/dummy/tmp/cache/assets/D93/4C0/sprockets%2F857ecd2092cee11f740b3cf2e373ad2a +0 -0
  106. data/test/dummy/tmp/cache/assets/DA3/140/sprockets%2Fbdcfc2e11e8ef8080de86623e8734ad2 +0 -0
  107. data/test/dummy/tmp/cache/assets/DBA/330/sprockets%2Fc80aa22f501364dfa9cbf2b4135efbc4 +0 -0
  108. data/test/dummy/tmp/cache/assets/DCE/D20/sprockets%2Fbb2839e538aadcf1cacde890159b37e2 +0 -0
  109. data/test/dummy/tmp/cache/assets/DD0/820/sprockets%2F92503cd8fdbce38ac5de45630df9d15b +0 -0
  110. data/test/dummy/tmp/cache/assets/DD2/350/sprockets%2Ffabdac3a31a0fd1f9132ff5e89f46993 +0 -0
  111. data/test/dummy/tmp/cache/assets/DD9/760/sprockets%2F96b2c42e56df91c925faff94d3dbfb32 +0 -0
  112. data/test/dummy/tmp/cache/assets/DDE/420/sprockets%2Ffb8b186d5bf0307f86f65fc787d2adeb +0 -0
  113. data/test/dummy/tmp/cache/assets/DE5/ED0/sprockets%2Fbceb64af6e2b030cc2362a481efae2d2 +0 -0
  114. data/test/dummy/tmp/cache/assets/DF5/940/sprockets%2F68a03b5cb8fac91ac7bb6f7a3703d5ae +0 -0
  115. data/test/dummy/tmp/cache/assets/DFE/710/sprockets%2Fbaba2fa1e1be8d768b866fc59c8b250c +0 -0
  116. data/test/dummy/tmp/cache/sass/11e515356bc5cb9773a810e4d1a8f0adc86f5a55/_animation.scssc +0 -0
  117. data/test/dummy/tmp/cache/sass/11e515356bc5cb9773a810e4d1a8f0adc86f5a55/_appearance.scssc +0 -0
  118. data/test/dummy/tmp/cache/sass/11e515356bc5cb9773a810e4d1a8f0adc86f5a55/_background-image.scssc +0 -0
  119. data/test/dummy/tmp/cache/sass/11e515356bc5cb9773a810e4d1a8f0adc86f5a55/_background-size.scssc +0 -0
  120. data/test/dummy/tmp/cache/sass/11e515356bc5cb9773a810e4d1a8f0adc86f5a55/_border-image.scssc +0 -0
  121. data/test/dummy/tmp/cache/sass/11e515356bc5cb9773a810e4d1a8f0adc86f5a55/_border-radius.scssc +0 -0
  122. data/test/dummy/tmp/cache/sass/11e515356bc5cb9773a810e4d1a8f0adc86f5a55/_box-shadow.scssc +0 -0
  123. data/test/dummy/tmp/cache/sass/11e515356bc5cb9773a810e4d1a8f0adc86f5a55/_box-sizing.scssc +0 -0
  124. data/test/dummy/tmp/cache/sass/11e515356bc5cb9773a810e4d1a8f0adc86f5a55/_columns.scssc +0 -0
  125. data/test/dummy/tmp/cache/sass/11e515356bc5cb9773a810e4d1a8f0adc86f5a55/_flex-box.scssc +0 -0
  126. data/test/dummy/tmp/cache/sass/11e515356bc5cb9773a810e4d1a8f0adc86f5a55/_inline-block.scssc +0 -0
  127. data/test/dummy/tmp/cache/sass/11e515356bc5cb9773a810e4d1a8f0adc86f5a55/_linear-gradient.scssc +0 -0
  128. data/test/dummy/tmp/cache/sass/11e515356bc5cb9773a810e4d1a8f0adc86f5a55/_radial-gradient.scssc +0 -0
  129. data/test/dummy/tmp/cache/sass/11e515356bc5cb9773a810e4d1a8f0adc86f5a55/_transform.scssc +0 -0
  130. data/test/dummy/tmp/cache/sass/11e515356bc5cb9773a810e4d1a8f0adc86f5a55/_transition.scssc +0 -0
  131. data/test/dummy/tmp/cache/sass/11e515356bc5cb9773a810e4d1a8f0adc86f5a55/_user-select.scssc +0 -0
  132. data/test/dummy/tmp/cache/sass/56f95d233a346715dafb1425c7f414577b3d6faa/_blank_slates.scssc +0 -0
  133. data/test/dummy/tmp/cache/sass/56f95d233a346715dafb1425c7f414577b3d6faa/_breadcrumbs.scssc +0 -0
  134. data/test/dummy/tmp/cache/sass/56f95d233a346715dafb1425c7f414577b3d6faa/_buttons.scssc +0 -0
  135. data/test/dummy/tmp/cache/sass/56f95d233a346715dafb1425c7f414577b3d6faa/_columns.scssc +0 -0
  136. data/test/dummy/tmp/cache/sass/56f95d233a346715dafb1425c7f414577b3d6faa/_comments.css.scssc +0 -0
  137. data/test/dummy/tmp/cache/sass/56f95d233a346715dafb1425c7f414577b3d6faa/_date_picker.css.scssc +0 -0
  138. data/test/dummy/tmp/cache/sass/56f95d233a346715dafb1425c7f414577b3d6faa/_flash_messages.css.scssc +0 -0
  139. data/test/dummy/tmp/cache/sass/56f95d233a346715dafb1425c7f414577b3d6faa/_grid.scssc +0 -0
  140. data/test/dummy/tmp/cache/sass/56f95d233a346715dafb1425c7f414577b3d6faa/_links.scssc +0 -0
  141. data/test/dummy/tmp/cache/sass/56f95d233a346715dafb1425c7f414577b3d6faa/_pagination.scssc +0 -0
  142. data/test/dummy/tmp/cache/sass/56f95d233a346715dafb1425c7f414577b3d6faa/_panels.scssc +0 -0
  143. data/test/dummy/tmp/cache/sass/56f95d233a346715dafb1425c7f414577b3d6faa/_scopes.scssc +0 -0
  144. data/test/dummy/tmp/cache/sass/56f95d233a346715dafb1425c7f414577b3d6faa/_status_tags.scssc +0 -0
  145. data/test/dummy/tmp/cache/sass/56f95d233a346715dafb1425c7f414577b3d6faa/_table_tools.css.scssc +0 -0
  146. data/test/dummy/tmp/cache/sass/56f95d233a346715dafb1425c7f414577b3d6faa/_tables.css.scssc +0 -0
  147. data/test/dummy/tmp/cache/sass/6013972b9ab0cd5761b527297d1ebb87580f0630/_button.scssc +0 -0
  148. data/test/dummy/tmp/cache/sass/6013972b9ab0cd5761b527297d1ebb87580f0630/_clearfix.scssc +0 -0
  149. data/test/dummy/tmp/cache/sass/6013972b9ab0cd5761b527297d1ebb87580f0630/_font-family.scssc +0 -0
  150. data/test/dummy/tmp/cache/sass/6013972b9ab0cd5761b527297d1ebb87580f0630/_html5-input-types.scssc +0 -0
  151. data/test/dummy/tmp/cache/sass/6013972b9ab0cd5761b527297d1ebb87580f0630/_position.scssc +0 -0
  152. data/test/dummy/tmp/cache/sass/6013972b9ab0cd5761b527297d1ebb87580f0630/_timing-functions.scssc +0 -0
  153. data/test/dummy/tmp/cache/sass/649eb811547a5926cdeb483c470efd70480ac80c/_dashboard.scssc +0 -0
  154. data/test/dummy/tmp/cache/sass/649eb811547a5926cdeb483c470efd70480ac80c/_logged_out.scssc +0 -0
  155. data/test/dummy/tmp/cache/sass/6918b4b0c0893eabd3eaf41fe8db1fb76432cdb7/_footer.scssc +0 -0
  156. data/test/dummy/tmp/cache/sass/6918b4b0c0893eabd3eaf41fe8db1fb76432cdb7/_main_structure.scssc +0 -0
  157. data/test/dummy/tmp/cache/sass/6918b4b0c0893eabd3eaf41fe8db1fb76432cdb7/_title_bar.scssc +0 -0
  158. data/test/dummy/tmp/cache/sass/6b007881be7ebec964704521003b1d386a87a62e/active_admin.css.scssc +0 -0
  159. data/test/dummy/tmp/cache/sass/888027b357ba8ec167989a2ba7b1e1313066ae81/_deprecated-webkit-gradient.scssc +0 -0
  160. data/test/dummy/tmp/cache/sass/888027b357ba8ec167989a2ba7b1e1313066ae81/_flex-grid.scssc +0 -0
  161. data/test/dummy/tmp/cache/sass/888027b357ba8ec167989a2ba7b1e1313066ae81/_grid-width.scssc +0 -0
  162. data/test/dummy/tmp/cache/sass/888027b357ba8ec167989a2ba7b1e1313066ae81/_linear-gradient.scssc +0 -0
  163. data/test/dummy/tmp/cache/sass/888027b357ba8ec167989a2ba7b1e1313066ae81/_modular-scale.scssc +0 -0
  164. data/test/dummy/tmp/cache/sass/888027b357ba8ec167989a2ba7b1e1313066ae81/_radial-gradient.scssc +0 -0
  165. data/test/dummy/tmp/cache/sass/888027b357ba8ec167989a2ba7b1e1313066ae81/_render-gradients.scssc +0 -0
  166. data/test/dummy/tmp/cache/sass/888027b357ba8ec167989a2ba7b1e1313066ae81/_tint-shade.scssc +0 -0
  167. data/test/dummy/tmp/cache/sass/9281732a5ed473e2068958b0e7f25e8bbdf281c1/_bourbon.scssc +0 -0
  168. data/test/dummy/tmp/cache/sass/ba7a563e935ca29470253023d07bc597fa6926a3/_all.css.scssc +0 -0
  169. data/test/dummy/tmp/cache/sass/ba7a563e935ca29470253023d07bc597fa6926a3/_buttons.css.scssc +0 -0
  170. data/test/dummy/tmp/cache/sass/ba7a563e935ca29470253023d07bc597fa6926a3/_gradients.css.scssc +0 -0
  171. data/test/dummy/tmp/cache/sass/ba7a563e935ca29470253023d07bc597fa6926a3/_icons.css.scssc +0 -0
  172. data/test/dummy/tmp/cache/sass/ba7a563e935ca29470253023d07bc597fa6926a3/_reset.css.scssc +0 -0
  173. data/test/dummy/tmp/cache/sass/ba7a563e935ca29470253023d07bc597fa6926a3/_rounded.css.scssc +0 -0
  174. data/test/dummy/tmp/cache/sass/ba7a563e935ca29470253023d07bc597fa6926a3/_sections.css.scssc +0 -0
  175. data/test/dummy/tmp/cache/sass/ba7a563e935ca29470253023d07bc597fa6926a3/_shadows.css.scssc +0 -0
  176. data/test/dummy/tmp/cache/sass/ba7a563e935ca29470253023d07bc597fa6926a3/_typography.scssc +0 -0
  177. data/test/dummy/tmp/cache/sass/ba7a563e935ca29470253023d07bc597fa6926a3/_utilities.scssc +0 -0
  178. data/test/dummy/tmp/cache/sass/ba7a563e935ca29470253023d07bc597fa6926a3/_variables.css.scssc +0 -0
  179. data/test/dummy/tmp/cache/sass/e1ee1d106b06fec6178a485c63d8daecda888171/_base.css.scssc +0 -0
  180. data/test/dummy/tmp/cache/sass/e1ee1d106b06fec6178a485c63d8daecda888171/_forms.css.scssc +0 -0
  181. data/test/dummy/tmp/cache/sass/e1ee1d106b06fec6178a485c63d8daecda888171/_header.css.scssc +0 -0
  182. data/test/dummy/tmp/cache/sass/e1ee1d106b06fec6178a485c63d8daecda888171/_mixins.css.scssc +0 -0
  183. data/test/dummy/tmp/cache/sass/e1ee1d106b06fec6178a485c63d8daecda888171/_typography.css.scssc +0 -0
  184. data/test/test_helper.rb +15 -0
  185. metadata +454 -0
@@ -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,223 @@
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 = [ :email ]
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 = "062fa607f66e7ad720eddbd52f8e5fe82519d08f0d1fa2912bf4be88d6a8cff991fc1f07f2d3f04e5f4d8b86ea0d63fbb6921583ede07db04af0e21d4d62bff8"
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 = 6..128
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
+ # ==> Navigation configuration
197
+ # Lists the formats that should be treated as navigational. Formats like
198
+ # :html, should redirect to the sign in page when the user does not have
199
+ # access, but formats like :xml or :json, should return 401.
200
+ #
201
+ # If you have any extra navigational formats, like :iphone or :mobile, you
202
+ # should add them to the navigational formats lists.
203
+ #
204
+ # The "*/*" below is required to match Internet Explorer requests.
205
+ # config.navigational_formats = ["*/*", :html]
206
+
207
+ # The default HTTP method used to sign out a resource. Default is :delete.
208
+ config.sign_out_via = :delete
209
+
210
+ # ==> OmniAuth
211
+ # Add a new OmniAuth provider. Check the wiki for more information on setting
212
+ # up on your models and hooks.
213
+ # config.omniauth :github, 'APP_ID', 'APP_SECRET', :scope => 'user,public_repo'
214
+
215
+ # ==> Warden configuration
216
+ # If you want to use other strategies, that are not supported by Devise, or
217
+ # change the failure app, you can configure them inside the config.warden block.
218
+ #
219
+ # config.warden do |manager|
220
+ # manager.intercept_401 = false
221
+ # manager.default_strategies(:scope => :user).unshift :some_external_strategy
222
+ # end
223
+ end
@@ -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,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 = '90e5aef7fae060e0d62765724a7947ceb8dcfaa77a1d561e7baeabf706290454660237c947cd99565c4a5e2aafed8f066147f8f7f14c6b9caed3a468ccc8fc52'
@@ -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,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'
@@ -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,64 @@
1
+ Dummy::Application.routes.draw do
2
+ resources :pages
3
+
4
+ ActiveAdmin.routes(self)
5
+
6
+ devise_for :admin_users, ActiveAdmin::Devise.config
7
+
8
+ # The priority is based upon order of creation:
9
+ # first created -> highest priority.
10
+
11
+ # Sample of regular route:
12
+ # match 'products/:id' => 'catalog#view'
13
+ # Keep in mind you can assign values other than :controller and :action
14
+
15
+ # Sample of named route:
16
+ # match 'products/:id/purchase' => 'catalog#purchase', :as => :purchase
17
+ # This route can be invoked with purchase_url(:id => product.id)
18
+
19
+ # Sample resource route (maps HTTP verbs to controller actions automatically):
20
+ # resources :products
21
+
22
+ # Sample resource route with options:
23
+ # resources :products do
24
+ # member do
25
+ # get 'short'
26
+ # post 'toggle'
27
+ # end
28
+ #
29
+ # collection do
30
+ # get 'sold'
31
+ # end
32
+ # end
33
+
34
+ # Sample resource route with sub-resources:
35
+ # resources :products do
36
+ # resources :comments, :sales
37
+ # resource :seller
38
+ # end
39
+
40
+ # Sample resource route with more complex sub-resources
41
+ # resources :products do
42
+ # resources :comments
43
+ # resources :sales do
44
+ # get 'recent', :on => :collection
45
+ # end
46
+ # end
47
+
48
+ # Sample resource route within a namespace:
49
+ # namespace :admin do
50
+ # # Directs /admin/products/* to Admin::ProductsController
51
+ # # (app/controllers/admin/products_controller.rb)
52
+ # resources :products
53
+ # end
54
+
55
+ # You can have the root of your site routed with "root"
56
+ # just remember to delete public/index.html.
57
+ # root :to => 'welcome#index'
58
+
59
+ # See how all your routes lay out with "rake routes"
60
+
61
+ # This is a legacy wild controller route that's not recommended for RESTful applications.
62
+ # Note: This route will make all actions in every controller accessible via GET requests.
63
+ # match ':controller(/:action(/:id))(.:format)'
64
+ end
Binary file
@@ -0,0 +1,17 @@
1
+ class CreateAdminNotes < ActiveRecord::Migration
2
+ def self.up
3
+ create_table :admin_notes do |t|
4
+ t.string :resource_id, :null => false
5
+ t.string :resource_type, :null => false
6
+ t.references :admin_user, :polymorphic => true
7
+ t.text :body
8
+ t.timestamps
9
+ end
10
+ add_index :admin_notes, [:resource_type, :resource_id]
11
+ add_index :admin_notes, [:admin_user_type, :admin_user_id]
12
+ end
13
+
14
+ def self.down
15
+ drop_table :admin_notes
16
+ end
17
+ end
@@ -0,0 +1,25 @@
1
+ class MoveAdminNotesToComments < ActiveRecord::Migration
2
+ def self.up
3
+ remove_index :admin_notes, [:admin_user_type, :admin_user_id]
4
+ rename_table :admin_notes, :active_admin_comments
5
+ rename_column :active_admin_comments, :admin_user_type, :author_type
6
+ rename_column :active_admin_comments, :admin_user_id, :author_id
7
+ add_column :active_admin_comments, :namespace, :string
8
+ add_index :active_admin_comments, [:namespace]
9
+ add_index :active_admin_comments, [:author_type, :author_id]
10
+
11
+ # Update all the existing comments to the default namespace
12
+ say "Updating any existing comments to the #{ActiveAdmin.application.default_namespace} namespace."
13
+ execute "UPDATE active_admin_comments SET namespace='#{ActiveAdmin.application.default_namespace}'"
14
+ end
15
+
16
+ def self.down
17
+ remove_index :active_admin_comments, :column => [:author_type, :author_id]
18
+ remove_index :active_admin_comments, :column => [:namespace]
19
+ remove_column :active_admin_comments, :namespace
20
+ rename_column :active_admin_comments, :author_id, :admin_user_id
21
+ rename_column :active_admin_comments, :author_type, :admin_user_type
22
+ rename_table :active_admin_comments, :admin_notes
23
+ add_index :admin_notes, [:admin_user_type, :admin_user_id]
24
+ end
25
+ end