flms 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (184) hide show
  1. data/MIT-LICENSE +20 -0
  2. data/README.md +3 -0
  3. data/Rakefile +33 -0
  4. data/app/assets/images/img/glyphicons-halflings-white.png +0 -0
  5. data/app/assets/images/img/glyphicons-halflings.png +0 -0
  6. data/app/assets/javascripts/flms/blocks/index.coffee +6 -0
  7. data/app/assets/javascripts/flms/bootstrap.js +6 -0
  8. data/app/assets/javascripts/flms/flms.js +17 -0
  9. data/app/assets/javascripts/flms/layout.coffee +8 -0
  10. data/app/assets/stylesheets/flms/blocks/index.sass +28 -0
  11. data/app/assets/stylesheets/flms/bootstrap.css +6159 -0
  12. data/app/assets/stylesheets/flms/flms.css +7 -0
  13. data/app/assets/stylesheets/flms/home.sass +30 -0
  14. data/app/assets/stylesheets/flms/layout.sass +19 -0
  15. data/app/assets/stylesheets/flms/login.sass +32 -0
  16. data/app/controllers/flms/admin_controller.rb +11 -0
  17. data/app/controllers/flms/application_controller.rb +4 -0
  18. data/app/controllers/flms/blocks_controller.rb +55 -0
  19. data/app/controllers/flms/dashboard_controller.rb +13 -0
  20. data/app/controllers/flms/pages_controller.rb +47 -0
  21. data/app/controllers/flms/sessions_controller.rb +16 -0
  22. data/app/controllers/flms/users_controller.rb +31 -0
  23. data/app/helpers/flms/application_helper.rb +4 -0
  24. data/app/models/flms/block.rb +10 -0
  25. data/app/models/flms/blocks_page.rb +8 -0
  26. data/app/models/flms/page.rb +14 -0
  27. data/app/models/flms/user.rb +10 -0
  28. data/app/views/flms/blocks/_form.html.haml +25 -0
  29. data/app/views/flms/blocks/edit.html.haml +3 -0
  30. data/app/views/flms/blocks/index.html.haml +41 -0
  31. data/app/views/flms/blocks/new.html.haml +2 -0
  32. data/app/views/flms/blocks/show.html.haml +1 -0
  33. data/app/views/flms/dashboard/index.html.haml +5 -0
  34. data/app/views/flms/pages/_form.html.haml +30 -0
  35. data/app/views/flms/pages/edit.html.haml +3 -0
  36. data/app/views/flms/pages/index.html.haml +21 -0
  37. data/app/views/flms/pages/new.html.haml +2 -0
  38. data/app/views/flms/pages/show.html.haml +8 -0
  39. data/app/views/flms/sessions/new.html.haml +21 -0
  40. data/app/views/flms/users/_form.html.haml +28 -0
  41. data/app/views/flms/users/index.html.haml +22 -0
  42. data/app/views/flms/users/new.html.haml +3 -0
  43. data/app/views/layouts/flms/admin.html.haml +40 -0
  44. data/app/views/layouts/flms/admin_login.html.haml +18 -0
  45. data/app/views/layouts/flms/application.html.erb +14 -0
  46. data/config/initializers/devise.rb +243 -0
  47. data/config/locales/devise.en.yml +59 -0
  48. data/config/routes.rb +23 -0
  49. data/db/migrate/20130208224914_flms_devise_create_users.rb +47 -0
  50. data/db/migrate/20130216032241_flms_create_pages.rb +12 -0
  51. data/db/migrate/20130302011705_create_flms_blocks.rb +10 -0
  52. data/db/migrate/20130302015459_create_flms_blocks_pages.rb +12 -0
  53. data/lib/flms.rb +7 -0
  54. data/lib/flms/engine.rb +5 -0
  55. data/lib/flms/version.rb +3 -0
  56. data/lib/tasks/flms_tasks.rake +26 -0
  57. data/spec/controllers/blocks_controller_spec.rb +61 -0
  58. data/spec/controllers/dashboard_controller_spec.rb +12 -0
  59. data/spec/controllers/pages_controller_spec.rb +60 -0
  60. data/spec/controllers/users_controller_spec.rb +37 -0
  61. data/spec/dummy/Rakefile +7 -0
  62. data/spec/dummy/app/assets/javascripts/application.js +15 -0
  63. data/spec/dummy/app/assets/stylesheets/application.css +13 -0
  64. data/spec/dummy/app/controllers/application_controller.rb +12 -0
  65. data/spec/dummy/app/controllers/home_controller.rb +4 -0
  66. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  67. data/spec/dummy/app/models/user.rb +8 -0
  68. data/spec/dummy/app/views/home/index.html.haml +10 -0
  69. data/spec/dummy/app/views/layouts/application.html.haml +10 -0
  70. data/spec/dummy/config.ru +4 -0
  71. data/spec/dummy/config/application.rb +69 -0
  72. data/spec/dummy/config/boot.rb +10 -0
  73. data/spec/dummy/config/database.yml +52 -0
  74. data/spec/dummy/config/environment.rb +5 -0
  75. data/spec/dummy/config/environments/development.rb +37 -0
  76. data/spec/dummy/config/environments/production.rb +67 -0
  77. data/spec/dummy/config/environments/test.rb +37 -0
  78. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  79. data/spec/dummy/config/initializers/devise.rb +244 -0
  80. data/spec/dummy/config/initializers/flms.rb +1 -0
  81. data/spec/dummy/config/initializers/inflections.rb +15 -0
  82. data/spec/dummy/config/initializers/mime_types.rb +5 -0
  83. data/spec/dummy/config/initializers/secret_token.rb +7 -0
  84. data/spec/dummy/config/initializers/session_store.rb +8 -0
  85. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  86. data/spec/dummy/config/locales/en.yml +5 -0
  87. data/spec/dummy/config/routes.rb +4 -0
  88. data/spec/dummy/db/schema.rb +60 -0
  89. data/spec/dummy/log/development.log +39893 -0
  90. data/spec/dummy/log/test.log +42855 -0
  91. data/spec/dummy/public/404.html +26 -0
  92. data/spec/dummy/public/422.html +26 -0
  93. data/spec/dummy/public/500.html +25 -0
  94. data/spec/dummy/public/favicon.ico +0 -0
  95. data/spec/dummy/script/rails +6 -0
  96. data/spec/dummy/tmp/cache/assets/C9D/180/sprockets%2Fad74b633d2447502477133032afac84b +0 -0
  97. data/spec/dummy/tmp/cache/assets/CAB/C80/sprockets%2Fc4e739111d82c7189113aeb228816ba8 +0 -0
  98. data/spec/dummy/tmp/cache/assets/CB9/E30/sprockets%2F588cf5763c29e490d026f24e8aa90343 +0 -0
  99. data/spec/dummy/tmp/cache/assets/CCF/210/sprockets%2F43b5c2ffc8a62726b4ed6234001571a4 +0 -0
  100. data/spec/dummy/tmp/cache/assets/CDB/510/sprockets%2Fd61745a24c4636f8813fa14038bac69a +0 -0
  101. data/spec/dummy/tmp/cache/assets/CDE/D90/sprockets%2Fcc733e310d9646637216c4ffe109ea35 +0 -0
  102. data/spec/dummy/tmp/cache/assets/CE4/6B0/sprockets%2F6e38aec803936176be248f507eb3432d +0 -0
  103. data/spec/dummy/tmp/cache/assets/CED/6A0/sprockets%2Fcc221f5201d658cf456836f8b5547f9d +0 -0
  104. data/spec/dummy/tmp/cache/assets/CF6/740/sprockets%2F0cb88349ae46593e396c4bd68854ed08 +0 -0
  105. data/spec/dummy/tmp/cache/assets/D01/E80/sprockets%2Fc1a3694915166d6a041afa4bb062fd84 +0 -0
  106. data/spec/dummy/tmp/cache/assets/D06/AF0/sprockets%2F02a9a4f214368781ba86ed42d5bef203 +0 -0
  107. data/spec/dummy/tmp/cache/assets/D07/250/sprockets%2Fa8bf27de087b582dc454910a060e0b84 +0 -0
  108. data/spec/dummy/tmp/cache/assets/D09/5C0/sprockets%2F7cd3521c63623eb6f02dbb514991a6f6 +0 -0
  109. data/spec/dummy/tmp/cache/assets/D0C/570/sprockets%2F7e3d63e1412ae56b44b23d95547f0cc7 +0 -0
  110. data/spec/dummy/tmp/cache/assets/D0D/510/sprockets%2Fa189f1a8718ff11152feb3c43c75b841 +0 -0
  111. data/spec/dummy/tmp/cache/assets/D1A/3F0/sprockets%2F84181c4b293f3a1c4efe9226652f9e6e +0 -0
  112. data/spec/dummy/tmp/cache/assets/D1E/1D0/sprockets%2Ffeec495723d877b92c74db2055516bc9 +0 -0
  113. data/spec/dummy/tmp/cache/assets/D2E/F10/sprockets%2F156bfd6b405a129f5f003243cf60aea9 +0 -0
  114. data/spec/dummy/tmp/cache/assets/D35/470/sprockets%2F2c0a647ea89470a8285b9acb2006dbd5 +0 -0
  115. data/spec/dummy/tmp/cache/assets/D3B/440/sprockets%2Fabe31f236167ba051f6ff849d0a7282f +0 -0
  116. data/spec/dummy/tmp/cache/assets/D3B/550/sprockets%2Fb61caf9834ac8c31691851ac024f26ef +0 -0
  117. data/spec/dummy/tmp/cache/assets/D44/A50/sprockets%2F7602cd388554ba54eb914c1b2d7ff68c +0 -0
  118. data/spec/dummy/tmp/cache/assets/D46/210/sprockets%2F45a8d49c8edbaf91f38ab1495430384c +0 -0
  119. data/spec/dummy/tmp/cache/assets/D4A/B40/sprockets%2F509d2dc1350975d781c50dffc58ef53f +0 -0
  120. data/spec/dummy/tmp/cache/assets/D54/DE0/sprockets%2F77af3e306bb966f71f83e90e2a8868db +0 -0
  121. data/spec/dummy/tmp/cache/assets/D5B/1F0/sprockets%2F4d98e747aa4bb9fc8859f49a45159e1c +0 -0
  122. data/spec/dummy/tmp/cache/assets/D65/690/sprockets%2F511f71e32f87da06df67250bb39abdc2 +0 -0
  123. data/spec/dummy/tmp/cache/assets/D6E/870/sprockets%2F3f77e0b5396013fd145a6fdd21bc9b7f +0 -0
  124. data/spec/dummy/tmp/cache/assets/D74/EA0/sprockets%2Fccfc557971c4d47336cab75db207b89a +0 -0
  125. data/spec/dummy/tmp/cache/assets/D77/D80/sprockets%2F7ad794c63274a9812dfbabc1dae69692 +0 -0
  126. data/spec/dummy/tmp/cache/assets/D79/DE0/sprockets%2F9e7131d002f39be972e9918bdfbbcc66 +0 -0
  127. data/spec/dummy/tmp/cache/assets/D7C/3A0/sprockets%2Fec63717067efd6b2daf3423edf70f689 +0 -0
  128. data/spec/dummy/tmp/cache/assets/D81/300/sprockets%2F9543b0420abb11b0a126a8384edddafe +0 -0
  129. data/spec/dummy/tmp/cache/assets/D81/400/sprockets%2F566656e2cc9e698b1dbbd56d6e2e6b36 +0 -0
  130. data/spec/dummy/tmp/cache/assets/D93/0C0/sprockets%2Fab900c084c9c51c312ee3457cee8cdc2 +0 -0
  131. data/spec/dummy/tmp/cache/assets/D98/FD0/sprockets%2F6f253bd2bf824ac38c69bfe1418a04be +0 -0
  132. data/spec/dummy/tmp/cache/assets/D9E/220/sprockets%2Fd129fcf804e89814c2f4abbe0336cba9 +0 -0
  133. data/spec/dummy/tmp/cache/assets/DA0/9F0/sprockets%2Fd7c0d94bf0df6b0e03f83dcaf8873631 +0 -0
  134. data/spec/dummy/tmp/cache/assets/DA3/920/sprockets%2F6c45b9f8e0152c78b3c9be1c2e8be53c +0 -0
  135. data/spec/dummy/tmp/cache/assets/DA5/BC0/sprockets%2F5b86068a872e5bd841750d6cbd2dfdbf +0 -0
  136. data/spec/dummy/tmp/cache/assets/DA8/4A0/sprockets%2Ff8ba39d58ace11df624bf7e24c7b5882 +0 -0
  137. data/spec/dummy/tmp/cache/assets/DA8/C30/sprockets%2Fb7d14d588a70a56d7ddac542eef557d6 +0 -0
  138. data/spec/dummy/tmp/cache/assets/DA9/370/sprockets%2Fdf257d496b11ea9c1bb7ee139d68c83e +0 -0
  139. data/spec/dummy/tmp/cache/assets/DAC/D80/sprockets%2Fb8ca14c15e0301b935aaaef327bdc40a +0 -0
  140. data/spec/dummy/tmp/cache/assets/DAE/F10/sprockets%2F46950fdbeed95ba83ca8e7215194ddf8 +0 -0
  141. data/spec/dummy/tmp/cache/assets/DB2/1F0/sprockets%2F9fe57997f92efbee3b03df4510a2df57 +0 -0
  142. data/spec/dummy/tmp/cache/assets/DB8/C30/sprockets%2Fca860af2d10e0c745b6e38b12dabe05f +0 -0
  143. data/spec/dummy/tmp/cache/assets/DC1/530/sprockets%2F4db0b289eee7dad03453a5924c20dcfa +0 -0
  144. data/spec/dummy/tmp/cache/assets/DC6/7D0/sprockets%2Ff7689ac5fafbf683c537892e6ff7f8c3 +0 -0
  145. data/spec/dummy/tmp/cache/assets/DCC/B80/sprockets%2Fb7ae6e7bfa8984c54a4dfaf0011617cd +0 -0
  146. data/spec/dummy/tmp/cache/assets/DCE/790/sprockets%2Fff77d67febbb3af024f721c0bb4c4749 +0 -0
  147. data/spec/dummy/tmp/cache/assets/DCF/0B0/sprockets%2F23db7ab96a5549546bbdd0bc2e6ea86f +0 -0
  148. data/spec/dummy/tmp/cache/assets/DD5/440/sprockets%2F9b3488ba6d62c3dcc809f8cd3dc2d1f5 +0 -0
  149. data/spec/dummy/tmp/cache/assets/DE6/B10/sprockets%2Fa0adf3fb2b0054d04dd44c08aff1d6c8 +0 -0
  150. data/spec/dummy/tmp/cache/assets/DF1/A10/sprockets%2Fa925a815ca0bff4d6f42fbdf0d323a4f +0 -0
  151. data/spec/dummy/tmp/cache/assets/DFA/FF0/sprockets%2F75699fed9ddaecd89464492eeeef90d8 +0 -0
  152. data/spec/dummy/tmp/cache/assets/DFD/540/sprockets%2F181ef7a7c275dd2872aa1ed1fcfab75f +0 -0
  153. data/spec/dummy/tmp/cache/assets/E0E/B50/sprockets%2Fe78fa5fc4cfb0979876d23ae1b1f3ffd +0 -0
  154. data/spec/dummy/tmp/cache/assets/E3A/110/sprockets%2Fb6d5158ff7ac6d2ca99bfe56a7ddd2e3 +0 -0
  155. data/spec/dummy/tmp/cache/assets/E6D/8B0/sprockets%2F9edfdf7e85cdd1a69b0eb14c6ce8ed19 +0 -0
  156. data/spec/factories/blocks.rb +6 -0
  157. data/spec/factories/pages.rb +6 -0
  158. data/spec/factories/users.rb +7 -0
  159. data/spec/features/blocks/create_spec.rb +19 -0
  160. data/spec/features/blocks/delete_spec.rb +17 -0
  161. data/spec/features/blocks/edit_spec.rb +20 -0
  162. data/spec/features/blocks/show_spec.rb +14 -0
  163. data/spec/features/dashboard_spec.rb +11 -0
  164. data/spec/features/login_spec.rb +50 -0
  165. data/spec/features/pages/create_spec.rb +18 -0
  166. data/spec/features/pages/delete_spec.rb +14 -0
  167. data/spec/features/pages/index_spec.rb +14 -0
  168. data/spec/features/pages/update_spec.rb +17 -0
  169. data/spec/features/users/create_spec.rb +20 -0
  170. data/spec/features/users/delete_spec.rb +13 -0
  171. data/spec/features/users/index_spec.rb +16 -0
  172. data/spec/flms_spec.rb +7 -0
  173. data/spec/models/block_spec.rb +14 -0
  174. data/spec/models/page_spec.rb +15 -0
  175. data/spec/models/user_spec.rb +5 -0
  176. data/spec/spec_helper.rb +53 -0
  177. data/spec/support/access_control.rb +87 -0
  178. data/spec/support/capybara_helpers.rb +7 -0
  179. data/spec/support/lets.rb +8 -0
  180. data/vendor/assets/javascripts/bootstrapSwitch.js +238 -0
  181. data/vendor/assets/javascripts/jquery-ui.js +2221 -0
  182. data/vendor/assets/stylesheets/bootstrapSwitch.css +210 -0
  183. data/vendor/assets/stylesheets/jquery-ui.css +88 -0
  184. metadata +607 -0
@@ -0,0 +1,3 @@
1
+ .login.container
2
+ = render partial: 'form', locals: { caption: "Editing '#{@page.title}'" }
3
+
@@ -0,0 +1,21 @@
1
+ %br
2
+ %h4 All pages
3
+
4
+ %table.table.table-striped.table-hover
5
+ %thead
6
+ %tr
7
+ %th Title
8
+ %th
9
+
10
+ %tbody
11
+ - @pages.each do |page|
12
+ %tr
13
+ %td= link_to page.title, page_blocks_path(page)
14
+ %td
15
+ = link_to 'edit', edit_page_path(page), class: 'btn'
16
+ = link_to 'delete', page_path(page), method: :delete, data: { confirm: 'Are you sure?' }, class: 'btn'
17
+
18
+ %br
19
+
20
+ = link_to 'New Page', new_page_path, class: 'btn btn-success'
21
+
@@ -0,0 +1,2 @@
1
+ .login.container
2
+ = render partial: 'form', locals: {caption: 'Create a new page'}
@@ -0,0 +1,8 @@
1
+ %p
2
+ %b Title:
3
+ = @page.title
4
+
5
+ = link_to 'Edit', edit_admin_page_path(@page)
6
+ \|
7
+ = link_to 'Back', admin_pages_path
8
+
@@ -0,0 +1,21 @@
1
+ = form_for resource, as: resource_name, url: '', html: {class: 'form-signin'} do |f|
2
+ %h2.form-signin-heading Please sign in
3
+ %br
4
+
5
+ = f.email_field :email, { autofocus: true,
6
+ class: 'input-block-level',
7
+ placeholder: 'Email' }
8
+
9
+ = f.password_field :password, { placeholder: 'Password', class: 'input-block-level' }
10
+
11
+ - if devise_mapping.rememberable?
12
+ %label.checkbox
13
+ = f.check_box :remember_me
14
+ Remember me
15
+
16
+ %br
17
+ = f.submit "Sign in", class: 'btn btn-large btn-primary'
18
+
19
+      
20
+ = link_to 'Forgot password', '/users/password/new'
21
+
@@ -0,0 +1,28 @@
1
+ = form_for @user, html: {class: 'form-horizontal'} do |f|
2
+ %fieldset
3
+ %legend= caption
4
+
5
+ - if @user.errors.any?
6
+ #error_explanation
7
+ %h2= "#{pluralize(@user.errors.count, "error")} prohibited this user from being saved:"
8
+ %ul
9
+ - @user.errors.full_messages.each do |msg|
10
+ %li= msg
11
+
12
+ .control-group
13
+ = f.label :email, class: 'control-label'
14
+ .controls
15
+ = f.email_field :email, autofocus: true
16
+
17
+ .control-group
18
+ = f.label :password, class: 'control-label'
19
+ .controls
20
+ = f.password_field :password
21
+
22
+ .control-group
23
+ .controls
24
+ .actions
25
+ = f.submit class: 'btn btn-primary'
26
+      
27
+ = link_to 'Back', users_path
28
+
@@ -0,0 +1,22 @@
1
+ %br
2
+ %h4 All users
3
+
4
+ %table.table.table-striped.table-hover
5
+ %thead
6
+ %tr
7
+ %th Email
8
+ %th
9
+
10
+ %tbody
11
+ - @users.each do |user|
12
+ %tr
13
+ %td= user.email
14
+ %td= link_to 'delete', user_path(user), method: :delete, data: { confirm: 'Are you sure?' }
15
+
16
+ %br
17
+
18
+ = link_to new_user_path, class: 'btn btn-success' do
19
+ %i.icon-plus.icon-white
20
+ New User
21
+
22
+
@@ -0,0 +1,3 @@
1
+ .login.container
2
+ = render partial: 'form', locals: { caption: "New User" }
3
+
@@ -0,0 +1,40 @@
1
+ !!! 5
2
+ %html{lang: 'en'}
3
+ %head
4
+ %title #{Flms.application_name} administration
5
+ %meta{name:"viewport", content:"width=device-width, initial-scale=1.0"}
6
+ = stylesheet_link_tag 'flms/flms', media: 'all'
7
+ = csrf_meta_tags
8
+
9
+ %body{class: "#{params[:controller].sub('/', ' ')} #{params[:action]}"}
10
+ - unless notice.blank?
11
+ %p.flash.notice= notice
12
+ - unless alert.blank?
13
+ %p.flash.alert= alert
14
+
15
+ .container-narrow
16
+
17
+ .masthead
18
+ %ul.nav.nav-pills.pull-right
19
+ - clazz = params[:controller] == 'flms/dashboard' ? 'active' : ''
20
+ %li{class: clazz}
21
+ %a{href: "/flms"}
22
+ %d.icon-home
23
+ Home
24
+ - clazz = ['flms/pages', 'flms/blocks'].include?(params[:controller]) ? 'active' : ''
25
+ %li{class: clazz}
26
+ %a{href: "/flms/pages"}
27
+ %i.icon-book
28
+ Pages
29
+ - clazz = params[:controller] == 'flms/users' ? 'active' : ''
30
+ %li{class: clazz}
31
+ %a{href: "/flms/users"}
32
+ %i.icon-user
33
+ Users
34
+ %h3.muted #{Flms.application_name} administration
35
+ -#%hr
36
+
37
+ = yield
38
+
39
+ = javascript_include_tag 'flms/flms'
40
+ = yield :js
@@ -0,0 +1,18 @@
1
+ !!! 5
2
+ %html{lang: 'en'}
3
+ %head
4
+ %title #{Flms.application_name} administration
5
+ %meta{name:"viewport", content:"width=device-width, initial-scale=1.0"}
6
+ = stylesheet_link_tag 'flms/flms', media: 'all'
7
+ = javascript_include_tag 'flms/flms'
8
+ = csrf_meta_tags
9
+
10
+ %body{class: "#{params[:controller].sub('/', ' ')} #{params[:action]}"}
11
+ - unless notice.blank?
12
+ %p.notice= notice
13
+ - unless alert.blank?
14
+ %p.alert= alert
15
+
16
+ .login.container
17
+ = yield
18
+
@@ -0,0 +1,14 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Flms</title>
5
+ <%= stylesheet_link_tag "flms/application", :media => "all" %>
6
+ <%= javascript_include_tag "flms/application" %>
7
+ <%= csrf_meta_tags %>
8
+ </head>
9
+ <body>
10
+
11
+ <%= yield %>
12
+
13
+ </body>
14
+ </html>
@@ -0,0 +1,243 @@
1
+ require 'devise'
2
+
3
+
4
+ # Use this hook to configure devise mailer, warden hooks and so forth.
5
+ # Many of these configuration options can be set straight in your model.
6
+ Devise.setup do |config|
7
+ # ==> Mailer Configuration
8
+ # Configure the e-mail address which will be shown in Devise::Mailer,
9
+ # note that it will be overwritten if you use your own mailer class with default "from" parameter.
10
+ config.mailer_sender = "please-change-me-at-config-initializers-devise@example.com"
11
+
12
+ # Configure the class responsible to send e-mails.
13
+ # config.mailer = "Devise::Mailer"
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 = "d99127c75a1c933b461f969deb57296006a8221abdbe7259def77fc5bcd7556951cbeea20f30a7010b138d10e7286b57c28d1a19623b6012d90293de5ef84d91"
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
+ # A period that the user is allowed to confirm their account before their
99
+ # token becomes invalid. For example, if set to 3.days, the user can confirm
100
+ # their account within 3 days after the mail was sent, but on the fourth day
101
+ # their account can't be confirmed with the token any more.
102
+ # Default is nil, meaning there is no restriction on how long a user can take
103
+ # before confirming their account.
104
+ # config.confirm_within = 3.days
105
+
106
+ # If true, requires any email changes to be confirmed (exactly the same way as
107
+ # initial account confirmation) to be applied. Requires additional unconfirmed_email
108
+ # db field (see migrations). Until confirmed new email is stored in
109
+ # unconfirmed email column, and copied to email column on successful confirmation.
110
+ config.reconfirmable = false
111
+
112
+ # Defines which key will be used when confirming an account
113
+ # config.confirmation_keys = [ :email ]
114
+
115
+ # ==> Configuration for :rememberable
116
+ # The time the user will be remembered without asking for credentials again.
117
+ # config.remember_for = 2.weeks
118
+
119
+ # If true, extends the user's remember period when remembered via cookie.
120
+ # config.extend_remember_period = false
121
+
122
+ # Options to be passed to the created cookie. For instance, you can set
123
+ # :secure => true in order to force SSL only cookies.
124
+ # config.rememberable_options = {}
125
+
126
+ # ==> Configuration for :validatable
127
+ # Range for password length. Default is 8..128.
128
+ config.password_length = 8..128
129
+
130
+ # Email regex used to validate email formats. It simply asserts that
131
+ # an one (and only one) @ exists in the given string. This is mainly
132
+ # to give user feedback and not to assert the e-mail validity.
133
+ # config.email_regexp = /\A[^@]+@[^@]+\z/
134
+
135
+ # ==> Configuration for :timeoutable
136
+ # The time you want to timeout the user session without activity. After this
137
+ # time the user will be asked for credentials again. Default is 30 minutes.
138
+ # config.timeout_in = 30.minutes
139
+
140
+ # If true, expires auth token on session timeout.
141
+ # config.expire_auth_token_on_timeout = false
142
+
143
+ # ==> Configuration for :lockable
144
+ # Defines which strategy will be used to lock an account.
145
+ # :failed_attempts = Locks an account after a number of failed attempts to sign in.
146
+ # :none = No lock strategy. You should handle locking by yourself.
147
+ # config.lock_strategy = :failed_attempts
148
+
149
+ # Defines which key will be used when locking and unlocking an account
150
+ # config.unlock_keys = [ :email ]
151
+
152
+ # Defines which strategy will be used to unlock an account.
153
+ # :email = Sends an unlock link to the user email
154
+ # :time = Re-enables login after a certain amount of time (see :unlock_in below)
155
+ # :both = Enables both strategies
156
+ # :none = No unlock strategy. You should handle unlocking by yourself.
157
+ # config.unlock_strategy = :both
158
+
159
+ # Number of authentication tries before locking an account if lock_strategy
160
+ # is failed attempts.
161
+ # config.maximum_attempts = 20
162
+
163
+ # Time interval to unlock the account if :time is enabled as unlock_strategy.
164
+ # config.unlock_in = 1.hour
165
+
166
+ # ==> Configuration for :recoverable
167
+ #
168
+ # Defines which key will be used when recovering the password for an account
169
+ # config.reset_password_keys = [ :email ]
170
+
171
+ # Time interval you can reset your password with a reset password key.
172
+ # Don't put a too small interval or your users won't have the time to
173
+ # change their passwords.
174
+ config.reset_password_within = 6.hours
175
+
176
+ # ==> Configuration for :encryptable
177
+ # Allow you to use another encryption algorithm besides bcrypt (default). You can use
178
+ # :sha1, :sha512 or encryptors from others authentication tools as :clearance_sha1,
179
+ # :authlogic_sha512 (then you should set stretches above to 20 for default behavior)
180
+ # and :restful_authentication_sha1 (then you should set stretches to 10, and copy
181
+ # REST_AUTH_SITE_KEY to pepper)
182
+ # config.encryptor = :sha512
183
+
184
+ # ==> Configuration for :token_authenticatable
185
+ # Defines name of the authentication token params key
186
+ # config.token_authentication_key = :auth_token
187
+
188
+ # ==> Scopes configuration
189
+ # Turn scoped views on. Before rendering "sessions/new", it will first check for
190
+ # "users/sessions/new". It's turned off by default because it's slower if you
191
+ # are using only default views.
192
+ # config.scoped_views = false
193
+
194
+ # Configure the default scope given to Warden. By default it's the first
195
+ # devise role declared in your routes (usually :user).
196
+ # config.default_scope = :user
197
+
198
+ # Set this configuration to false if you want /users/sign_out to sign out
199
+ # only the current scope. By default, Devise signs out all scopes.
200
+ # config.sign_out_all_scopes = true
201
+
202
+ # ==> Navigation configuration
203
+ # Lists the formats that should be treated as navigational. Formats like
204
+ # :html, should redirect to the sign in page when the user does not have
205
+ # access, but formats like :xml or :json, should return 401.
206
+ #
207
+ # If you have any extra navigational formats, like :iphone or :mobile, you
208
+ # should add them to the navigational formats lists.
209
+ #
210
+ # The "*/*" below is required to match Internet Explorer requests.
211
+ # config.navigational_formats = ["*/*", :html]
212
+
213
+ # The default HTTP method used to sign out a resource. Default is :delete.
214
+ config.sign_out_via = :get
215
+
216
+ # ==> OmniAuth
217
+ # Add a new OmniAuth provider. Check the wiki for more information on setting
218
+ # up on your models and hooks.
219
+ # config.omniauth :github, 'APP_ID', 'APP_SECRET', :scope => 'user,public_repo'
220
+
221
+ # ==> Warden configuration
222
+ # If you want to use other strategies, that are not supported by Devise, or
223
+ # change the failure app, you can configure them inside the config.warden block.
224
+ #
225
+ # config.warden do |manager|
226
+ # manager.intercept_401 = false
227
+ # manager.default_strategies(:scope => :user).unshift :some_external_strategy
228
+ # end
229
+
230
+ # ==> Mountable engine configurations
231
+ # When using Devise inside an engine, let's call it `MyEngine`, and this engine
232
+ # is mountable, there are some extra configurations to be taken into account.
233
+ # The following options are available, assuming the engine is mounted as:
234
+ #
235
+ # mount MyEngine, at: "/my_engine"
236
+ #
237
+ # The router that invoked `devise_for`, in the example above, would be:
238
+ # config.router_name = :my_engine
239
+ #
240
+ # When using omniauth, Devise cannot automatically set Omniauth path,
241
+ # so you need to do it manually. For the users scope, it would be:
242
+ # config.omniauth_path_prefix = "/my_engine/users/auth"
243
+ end
@@ -0,0 +1,59 @@
1
+ # Additional translations at https://github.com/plataformatec/devise/wiki/I18n
2
+
3
+ en:
4
+ devise:
5
+ confirmations:
6
+ confirmed: "Your account was successfully confirmed. You are now signed in."
7
+ send_instructions: "You will receive an email with instructions about how to confirm your account in a few minutes."
8
+ send_paranoid_instructions: "If your email address exists in our database, you will receive an email with instructions about how to confirm your account in a few minutes."
9
+ failure:
10
+ already_authenticated: "You are already signed in."
11
+ inactive: "Your account was not activated yet."
12
+ invalid: "Invalid email or password."
13
+ invalid_token: "Invalid authentication token."
14
+ locked: "Your account is locked."
15
+ not_found_in_database: "Invalid email or password."
16
+ timeout: "Your session expired, please sign in again to continue."
17
+ unauthenticated: "You need to sign in or sign up before continuing."
18
+ unconfirmed: "You have to confirm your account before continuing."
19
+ mailer:
20
+ confirmation_instructions:
21
+ subject: "Confirmation instructions"
22
+ reset_password_instructions:
23
+ subject: "Reset password instructions"
24
+ unlock_instructions:
25
+ subject: "Unlock Instructions"
26
+ omniauth_callbacks:
27
+ failure: "Could not authenticate you from %{kind} because \"%{reason}\"."
28
+ success: "Successfully authenticated from %{kind} account."
29
+ passwords:
30
+ no_token: "You can't access this page without coming from a password reset email. If you do come from a password reset email, please make sure you used the full URL provided."
31
+ send_instructions: "You will receive an email with instructions about how to reset your password in a few minutes."
32
+ send_paranoid_instructions: "If your email address exists in our database, you will receive a password recovery link at your email address in a few minutes."
33
+ updated: "Your password was changed successfully. You are now signed in."
34
+ updated_not_active: "Your password was changed successfully."
35
+ registrations:
36
+ destroyed: "Bye! Your account was successfully cancelled. We hope to see you again soon."
37
+ signed_up: "Welcome! You have signed up successfully."
38
+ signed_up_but_inactive: "You have signed up successfully. However, we could not sign you in because your account is not yet activated."
39
+ signed_up_but_locked: "You have signed up successfully. However, we could not sign you in because your account is locked."
40
+ 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."
41
+ 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."
42
+ updated: "You updated your account successfully."
43
+ sessions:
44
+ signed_in: "Signed in successfully."
45
+ signed_out: "Signed out successfully."
46
+ unlocks:
47
+ send_instructions: "You will receive an email with instructions about how to unlock your account in a few minutes."
48
+ send_paranoid_instructions: "If your account exists, you will receive an email with instructions about how to unlock it in a few minutes."
49
+ unlocked: "Your account has been unlocked successfully. Please sign in to continue."
50
+ errors:
51
+ messages:
52
+ already_confirmed: "was already confirmed, please try signing in"
53
+ confirmation_period_expired: "needs to be confirmed within %{period}, please request a new one"
54
+ expired: "has expired, please request a new one"
55
+ not_found: "not found"
56
+ not_locked: "was not locked"
57
+ not_saved:
58
+ one: "1 error prohibited this %{resource} from being saved:"
59
+ other: "%{count} errors prohibited this %{resource} from being saved:"