brilliant_cms 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (138) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.rdoc +3 -0
  4. data/Rakefile +37 -0
  5. data/app/assets/images/brilliant_cms/bootstrap-colorpicker/alpha-horizontal.png +0 -0
  6. data/app/assets/images/brilliant_cms/bootstrap-colorpicker/alpha.png +0 -0
  7. data/app/assets/images/brilliant_cms/bootstrap-colorpicker/hue-horizontal.png +0 -0
  8. data/app/assets/images/brilliant_cms/bootstrap-colorpicker/hue.png +0 -0
  9. data/app/assets/images/brilliant_cms/bootstrap-colorpicker/saturation.png +0 -0
  10. data/app/assets/images/brilliant_cms/light-bulb.svg +38 -0
  11. data/app/assets/images/brilliant_cms/user.png +0 -0
  12. data/app/assets/javascripts/brilliant_cms/application.js +6 -0
  13. data/app/assets/javascripts/brilliant_cms/dashboard.js +2 -0
  14. data/app/assets/javascripts/brilliant_cms/data/flot.js +58 -0
  15. data/app/assets/javascripts/brilliant_cms/data/gauge.js +21 -0
  16. data/app/assets/javascripts/brilliant_cms/data/linegraphs.coffee +23 -0
  17. data/app/assets/javascripts/brilliant_cms/data/load.js +1 -0
  18. data/app/assets/javascripts/brilliant_cms/data/map.coffee +17 -0
  19. data/app/assets/javascripts/brilliant_cms/datepicker.coffee +107 -0
  20. data/app/assets/javascripts/brilliant_cms/entries.js +2 -0
  21. data/app/assets/javascripts/brilliant_cms/skycons.coffee +18 -0
  22. data/app/assets/javascripts/brilliant_cms/vendor/bootstrap-progressbar.min.js +2 -0
  23. data/app/assets/javascripts/brilliant_cms/vendor/chart.min.js +11 -0
  24. data/app/assets/javascripts/brilliant_cms/vendor/daterangepicker.js +1 -0
  25. data/app/assets/javascripts/brilliant_cms/vendor/flot/a.jquery.flot.js +2 -0
  26. data/app/assets/javascripts/brilliant_cms/vendor/flot/b.jquery.flot.pie.js +820 -0
  27. data/app/assets/javascripts/brilliant_cms/vendor/flot/c.jquery.flot.orderBars.js +187 -0
  28. data/app/assets/javascripts/brilliant_cms/vendor/flot/d.jquery.flot.time.min.js +1 -0
  29. data/app/assets/javascripts/brilliant_cms/vendor/flot/e.date.js +104 -0
  30. data/app/assets/javascripts/brilliant_cms/vendor/flot/f.jquery.flot.spline.js +212 -0
  31. data/app/assets/javascripts/brilliant_cms/vendor/flot/g.jquery.flot.stack.js +188 -0
  32. data/app/assets/javascripts/brilliant_cms/vendor/flot/h.curvedLines.js +483 -0
  33. data/app/assets/javascripts/brilliant_cms/vendor/flot/i.jquery.flot.resize.js +57 -0
  34. data/app/assets/javascripts/brilliant_cms/vendor/flot/jquery.flot.tooltip.min.js +12 -0
  35. data/app/assets/javascripts/brilliant_cms/vendor/gauge.min.js +61 -0
  36. data/app/assets/javascripts/brilliant_cms/vendor/jquery.nicescroll.min.js +111 -0
  37. data/app/assets/javascripts/brilliant_cms/vendor/load.js +11 -0
  38. data/app/assets/javascripts/brilliant_cms/vendor/maps/jquery-jvectormap.js +2 -0
  39. data/app/assets/javascripts/brilliant_cms/vendor/maps/jvectormap-us-aea-en.js +1 -0
  40. data/app/assets/javascripts/brilliant_cms/vendor/maps/jvectormap-world-mill-en.js +1 -0
  41. data/app/assets/javascripts/brilliant_cms/vendor/maps/z.gdp-data.js +185 -0
  42. data/app/assets/javascripts/brilliant_cms/vendor/moment.js +3606 -0
  43. data/app/assets/javascripts/brilliant_cms/vendor/nprogress.js +491 -0
  44. data/app/assets/javascripts/brilliant_cms/vendor/skycons.js +730 -0
  45. data/app/assets/javascripts/brilliant_cms/vendor/template.js +317 -0
  46. data/app/assets/stylesheets/brilliant_cms/application.css +6 -0
  47. data/app/assets/stylesheets/brilliant_cms/dashboard.css +4 -0
  48. data/app/assets/stylesheets/brilliant_cms/entries.css +4 -0
  49. data/app/assets/stylesheets/brilliant_cms/layout.scss +6389 -0
  50. data/app/assets/stylesheets/brilliant_cms/vendor/animate.min.css +11 -0
  51. data/app/assets/stylesheets/brilliant_cms/vendor/maps/jquery-jvectormap-2.0.1.css +129 -0
  52. data/app/controllers/brilliant_cms/application_controller.rb +35 -0
  53. data/app/controllers/brilliant_cms/dashboard_controller.rb +12 -0
  54. data/app/controllers/brilliant_cms/entries_controller.rb +87 -0
  55. data/app/controllers/brilliant_cms/registrations_controller.rb +19 -0
  56. data/app/helpers/brilliant_cms/application_helper.rb +9 -0
  57. data/app/helpers/brilliant_cms/dashboard_helper.rb +4 -0
  58. data/app/helpers/brilliant_cms/entries_helper.rb +4 -0
  59. data/app/models/brilliant_cms/article.rb +9 -0
  60. data/app/models/brilliant_cms/blog_link.rb +10 -0
  61. data/app/models/brilliant_cms/blog_post.rb +9 -0
  62. data/app/models/brilliant_cms/concerns/searchable.rb +37 -0
  63. data/app/models/brilliant_cms/entry.rb +25 -0
  64. data/app/models/brilliant_cms/entry_search_data.rb +19 -0
  65. data/app/models/brilliant_cms/user.rb +8 -0
  66. data/app/views/brilliant_cms/dashboard/index.html.erb +0 -0
  67. data/app/views/brilliant_cms/entries/_form.html.erb +21 -0
  68. data/app/views/brilliant_cms/entries/edit.html.erb +6 -0
  69. data/app/views/brilliant_cms/entries/index.html.erb +38 -0
  70. data/app/views/brilliant_cms/entries/new.html.erb +3 -0
  71. data/app/views/brilliant_cms/entries/show.html.erb +28 -0
  72. data/app/views/layouts/brilliant_cms/_footer.html.erb +10 -0
  73. data/app/views/layouts/brilliant_cms/_notifications.html.erb +6 -0
  74. data/app/views/layouts/brilliant_cms/_sidemenu.html.erb +87 -0
  75. data/app/views/layouts/brilliant_cms/_topbar.html.erb +31 -0
  76. data/app/views/layouts/brilliant_cms/application.html.erb +40 -0
  77. data/config/initializers/assets.rb +1 -0
  78. data/config/initializers/devise.rb +267 -0
  79. data/config/initializers/simple_form.rb +165 -0
  80. data/config/initializers/simple_form_bootstrap.rb +149 -0
  81. data/config/locales/devise.en.yml +62 -0
  82. data/config/locales/simple_form.en.yml +31 -0
  83. data/config/routes.rb +27 -0
  84. data/db/migrate/20160218214729_create_brilliant_cms_entries.rb +15 -0
  85. data/db/migrate/20160219045419_create_brilliant_cms_entry_search_data.rb +14 -0
  86. data/db/migrate/20160219065450_devise_create_brilliant_cms_users.rb +42 -0
  87. data/lib/brilliant_cms.rb +6 -0
  88. data/lib/brilliant_cms/configuration.rb +17 -0
  89. data/lib/brilliant_cms/engine.rb +11 -0
  90. data/lib/brilliant_cms/version.rb +3 -0
  91. data/lib/tasks/brilliant_cms_tasks.rake +4 -0
  92. data/lib/templates/erb/scaffold/_form.html.erb +13 -0
  93. data/test/brilliant_cms_test.rb +7 -0
  94. data/test/controllers/brilliant_cms/dashboard_controller_test.rb +13 -0
  95. data/test/controllers/brilliant_cms/entries_controller_test.rb +13 -0
  96. data/test/dummy/README.rdoc +28 -0
  97. data/test/dummy/Rakefile +6 -0
  98. data/test/dummy/app/assets/javascripts/application.js +13 -0
  99. data/test/dummy/app/assets/stylesheets/application.css +15 -0
  100. data/test/dummy/app/controllers/application_controller.rb +5 -0
  101. data/test/dummy/app/helpers/application_helper.rb +2 -0
  102. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  103. data/test/dummy/bin/bundle +3 -0
  104. data/test/dummy/bin/rails +4 -0
  105. data/test/dummy/bin/rake +4 -0
  106. data/test/dummy/bin/setup +29 -0
  107. data/test/dummy/config.ru +4 -0
  108. data/test/dummy/config/application.rb +26 -0
  109. data/test/dummy/config/boot.rb +5 -0
  110. data/test/dummy/config/database.yml +85 -0
  111. data/test/dummy/config/environment.rb +5 -0
  112. data/test/dummy/config/environments/development.rb +41 -0
  113. data/test/dummy/config/environments/production.rb +79 -0
  114. data/test/dummy/config/environments/test.rb +42 -0
  115. data/test/dummy/config/initializers/assets.rb +11 -0
  116. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  117. data/test/dummy/config/initializers/cookies_serializer.rb +3 -0
  118. data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  119. data/test/dummy/config/initializers/inflections.rb +16 -0
  120. data/test/dummy/config/initializers/mime_types.rb +4 -0
  121. data/test/dummy/config/initializers/session_store.rb +3 -0
  122. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  123. data/test/dummy/config/locales/en.yml +23 -0
  124. data/test/dummy/config/routes.rb +4 -0
  125. data/test/dummy/config/secrets.yml +22 -0
  126. data/test/dummy/public/404.html +67 -0
  127. data/test/dummy/public/422.html +67 -0
  128. data/test/dummy/public/500.html +66 -0
  129. data/test/dummy/public/favicon.ico +0 -0
  130. data/test/fixtures/brilliant_cms/entries.yml +11 -0
  131. data/test/fixtures/brilliant_cms/entry_search_data.yml +13 -0
  132. data/test/fixtures/brilliant_cms/users.yml +11 -0
  133. data/test/integration/navigation_test.rb +8 -0
  134. data/test/models/brilliant_cms/entry_search_data_test.rb +9 -0
  135. data/test/models/brilliant_cms/entry_test.rb +9 -0
  136. data/test/models/brilliant_cms/user_test.rb +9 -0
  137. data/test/test_helper.rb +21 -0
  138. metadata +407 -0
@@ -0,0 +1,21 @@
1
+ <div class="col-6">
2
+ <%= simple_form_for(@entry, as: :entry, url: @entry.persisted? ? content_entry_path(@entry) : entries_path) do |f| %>
3
+ <%= f.hidden_field :type, value: @entry.type %>
4
+
5
+ <%= f.input :title %>
6
+
7
+ <% @entry.class.content_attributes.each do |attr_name, attr_type| %>
8
+ <%= f.input attr_name, as: attr_type %>
9
+ <% end %>
10
+
11
+ <%= f.input :slug %>
12
+ <%= f.input :author_name %>
13
+ <%= f.input :published_at %>
14
+
15
+ <%= f.submit "Save", class: "btn btn-primary" %>
16
+ <% end %>
17
+ </div>
18
+
19
+ <div class="col-6">
20
+
21
+ </div>
@@ -0,0 +1,6 @@
1
+ <h1>Editing <%= content_class.titleize %></h1>
2
+
3
+ <%= render 'form' %>
4
+
5
+ <%= link_to 'Show', content_entry_path(@entry) %> |
6
+ <%= link_to 'Back', content_entries_path %>
@@ -0,0 +1,38 @@
1
+ <h1><%= blog? ? 'Blog Posts' : content_class.tableize.titleize %></h1>
2
+
3
+ <div class="col-xs-6 no-pad">
4
+ <% if blog? %>
5
+ <%= link_to 'New Post', new_entry_path(content_class: 'blog_post'), class: 'btn btn-primary space-2' %>
6
+ <%= link_to 'New Link', new_entry_path(content_class: 'blog_link'), class: 'btn btn-primary space-2' %>
7
+ <% else %>
8
+ <%= link_to "New #{content_class.titleize}", new_content_entry_path, class: 'btn btn-primary space-2' %>
9
+ <% end %>
10
+ </div>
11
+ <div class="col-xs-6 no-pad">
12
+ <%= form_tag(search_path, method: :get) do %>
13
+ <%= text_field_tag 'query', '', placeholder: 'Search', class: 'form-control' %>
14
+ <% end %>
15
+ </div>
16
+
17
+ <table class="table space-4">
18
+ <thead>
19
+ <tr>
20
+ <th>Title</th>
21
+ <th>Created</th>
22
+ <th>Published</th>
23
+ <th colspan="2"></th>
24
+ </tr>
25
+ </thead>
26
+
27
+ <tbody>
28
+ <% @entries.each do |entry| %>
29
+ <tr>
30
+ <td><%= link_to entry.title, content_entry_path(entry) %></td>
31
+ <td><%= time_ago_in_words entry.created_at %> ago</td>
32
+ <td><%= entry.published_at.strftime('%b %e, %Y at %l:%M%P') %></td>
33
+ <td><%= link_to fa_icon('edit', text: 'Edit'), edit_content_entry_path(entry) %></td>
34
+ <td><%= link_to fa_icon('trash', text: 'Delete'), content_entry_path(entry), method: :delete, data: { confirm: 'Are you sure you want to delete this?' } %></td>
35
+ </tr>
36
+ <% end %>
37
+ </tbody>
38
+ </table>
@@ -0,0 +1,3 @@
1
+ <h1>New <%= content_class.titleize %></h1>
2
+
3
+ <%= render 'form' %>
@@ -0,0 +1,28 @@
1
+ <p>
2
+ <strong>Content type:</strong>
3
+ <%= tableize_type(@entry.type) %>
4
+ </p>
5
+
6
+ <p>
7
+ <strong>Title:</strong>
8
+ <%= @entry.title %>
9
+ </p>
10
+
11
+ <p>
12
+ <strong>Slug:</strong>
13
+ <%= @entry.slug %>
14
+ </p>
15
+
16
+ <% @entry.class.content_attributes.each do |attr_name, attr_type| %>
17
+ <p>
18
+ <strong><%= attr_name %>:</strong>
19
+ <%= @entry.send(attr_name.to_sym) %>
20
+ </p>
21
+ <% end %>
22
+
23
+ <p>
24
+ <strong>Author name:</strong>
25
+ <%= @entry.author_name %>
26
+ </p>
27
+
28
+ <%= link_to 'Edit', edit_content_entry_path(@entry) %>
@@ -0,0 +1,10 @@
1
+ <!-- footer content -->
2
+ <footer>
3
+ <div class="">
4
+ <p class="pull-right">Ruby Gem created by <strong><%= link_to 'Brilliant Developing', 'http://brilliantdeveloping.com' %></strong>&nbsp;&nbsp;
5
+ <span class="lead">|&nbsp;&nbsp;BrilliantCMS</span>
6
+ </p>
7
+ </div>
8
+ <div class="clearfix"></div>
9
+ </footer>
10
+ <!-- /footer content -->
@@ -0,0 +1,6 @@
1
+ <div id="custom_notifications" class="custom-notifications dsp_none">
2
+ <ul class="list-unstyled notifications clearfix" data-tabbed_notifications="notif-group">
3
+ </ul>
4
+ <div class="clearfix"></div>
5
+ <div id="notif-group" class="tabbed_notifications"></div>
6
+ </div>
@@ -0,0 +1,87 @@
1
+ <div class="left_col scroll-view">
2
+ <div class="navbar nav_title" style="border: 0;">
3
+ <%= link_to brilliant_cms.root_path, class: 'site_title' do %>
4
+ <%= image_tag 'brilliant_cms/light-bulb.svg' %><span>BrilliantCMS</span>
5
+ <% end %>
6
+ </div>
7
+ <div class="clearfix"></div>
8
+ <!-- menu prile quick info -->
9
+ <div class="profile">
10
+ <div class="profile_pic">
11
+ <%= image_tag 'brilliant_cms/user.png', class: 'img-circle profile_img' %>
12
+ </div>
13
+ <div class="profile_info">
14
+ <span>You're logged in as</span>
15
+ <h2><%= current_user.email %></h2>
16
+ </div>
17
+ </div>
18
+ <!-- /menu prile quick info -->
19
+ <br />
20
+ <!-- sidebar menu -->
21
+ <div id="sidebar-menu" class="main_menu_side hidden-print main_menu">
22
+ <div class="menu_section">
23
+ <br><br>
24
+ <ul class="nav side-menu">
25
+ <li>
26
+ <%= link_to fa_icon('dashboard', text: 'Dashboard'), root_path %>
27
+ </li>
28
+ <li>
29
+ <a><%= fa_icon('rss-square', text: chevron('Blog')) %></a>
30
+ <ul class="nav child_menu" style="display: none">
31
+ <li>
32
+ <%= link_to 'Blog Posts', entries_path(content_class: 'blog') %>
33
+ </li>
34
+ <li>
35
+ <%= link_to 'New Blog Post', new_entry_path(content_class: 'blog_post') %>
36
+ </li>
37
+ <li>
38
+ <%= link_to 'New Blog Link', new_entry_path(content_class: 'blog_link') %>
39
+ </li>
40
+ </ul>
41
+ </li>
42
+ <li>
43
+ <a><%= fa_icon('list-alt', text: chevron('Articles')) %></a>
44
+ <ul class="nav child_menu" style="display: none">
45
+ <li>
46
+ <%= link_to 'View Articles', entries_path(content_class: 'article') %>
47
+ </li>
48
+ <li>
49
+ <%= link_to 'New Article', new_entry_path(content_class: 'article') %>
50
+ </li>
51
+ </ul>
52
+ </li>
53
+ </ul>
54
+ </div>
55
+ <div class="menu_section">
56
+ <ul class="nav side-menu">
57
+ <li>
58
+ <%= link_to fa_icon('laptop',
59
+ text: 'Landing Pages <span class="label label-success pull-right">Coming Soon</span>'.html_safe
60
+ ), '#' %>
61
+ </li>
62
+ <li>
63
+ <%= link_to fa_icon('paint-brush',
64
+ text: 'Style Switcher <span class="label label-success pull-right">Coming Soon</span>'.html_safe
65
+ ), '#' %>
66
+ </li>
67
+ </ul>
68
+ </div>
69
+ </div>
70
+ <!-- /sidebar menu -->
71
+ <!-- /menu footer buttons -->
72
+ <!-- <div class="sidebar-footer hidden-small">
73
+ <a data-toggle="tooltip" data-placement="top" title="Settings">
74
+ <span class="glyphicon glyphicon-cog" aria-hidden="true"></span>
75
+ </a>
76
+ <a data-toggle="tooltip" data-placement="top" title="FullScreen">
77
+ <span class="glyphicon glyphicon-fullscreen" aria-hidden="true"></span>
78
+ </a>
79
+ <a data-toggle="tooltip" data-placement="top" title="Lock">
80
+ <span class="glyphicon glyphicon-eye-close" aria-hidden="true"></span>
81
+ </a>
82
+ <%#= link_to destroy_user_session_path, method: :delete, data: {toggle: 'tooltip', placement: 'top'}, title: 'Logout' do %>
83
+ <span class="glyphicon glyphicon-off" aria-hidden="true"></span>
84
+ <%# end %>
85
+ </div> -->
86
+ <!-- /menu footer buttons -->
87
+ </div>
@@ -0,0 +1,31 @@
1
+ <!-- top navigation -->
2
+ <div class="top_nav">
3
+ <div class="nav_menu">
4
+ <nav class="" role="navigation">
5
+ <div class="nav toggle">
6
+ <a id="menu_toggle"><i class="fa fa-bars"></i></a>
7
+ </div>
8
+ <ul class="nav navbar-nav navbar-right">
9
+ <li class="">
10
+ <a href="javascript:;" class="user-profile dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
11
+ <%= image_tag 'brilliant_cms/user.png' %><%= current_user.email %>
12
+ <span class=" fa fa-angle-down"></span>
13
+ </a>
14
+ <ul class="dropdown-menu dropdown-usermenu animated fadeInDown pull-right">
15
+ <li>
16
+ <%= link_to edit_user_registration_path do %>
17
+ Settings <%= fa_icon 'cog', class: 'pull-right' %>
18
+ <% end %>
19
+ </li>
20
+ <li>
21
+ <%= link_to destroy_user_session_path, method: :delete do %>
22
+ Log Out <%= fa_icon 'sign-out', class: 'pull-right' %>
23
+ <% end %>
24
+ </li>
25
+ </ul>
26
+ </li>
27
+ </ul>
28
+ </nav>
29
+ </div>
30
+ </div>
31
+ <!-- /top navigation -->
@@ -0,0 +1,40 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5
+ <meta charset="utf-8">
6
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
7
+ <meta name="viewport" content="width=device-width, initial-scale=1">
8
+ <title>BrilliantCms</title>
9
+ <%= stylesheet_link_tag "brilliant_cms/application", media: "all" %>
10
+ <%= javascript_include_tag "brilliant_cms/application" %>
11
+ <%= csrf_meta_tags %>
12
+ <!--[if lt IE 9]>
13
+ <script src="../assets/js/ie8-responsive-file-warning.js"></script>
14
+ <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
15
+ <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
16
+ <![endif]-->
17
+ <script>NProgress.start();</script>
18
+ </head>
19
+ <body class="nav-md">
20
+ <% if user_signed_in? %>
21
+ <div class="container body">
22
+ <div class="main_container">
23
+ <div class="col-md-3 left_col">
24
+ <%= render 'layouts/brilliant_cms/sidemenu' %>
25
+ </div>
26
+ <%= render 'layouts/brilliant_cms/topbar' %>
27
+ <div class="right_col" role="main">
28
+ <%= yield %>
29
+ <%= render 'layouts/brilliant_cms/footer' %>
30
+ </div>
31
+ <%= render 'layouts/brilliant_cms/notifications' %>
32
+ </div>
33
+ </div>
34
+ <%= javascript_include_tag "brilliant_cms/data/load" %>
35
+ <% else %>
36
+ <%= yield %>
37
+ <% end %>
38
+ <script>NProgress.done();</script>
39
+ </body>
40
+ </html>
@@ -0,0 +1 @@
1
+ Rails.application.config.assets.precompile += %w( brilliant_cms/* )
@@ -0,0 +1,267 @@
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
+ # The secret key used by Devise. Devise uses this key to generate
5
+ # random tokens. Changing this key will render invalid all existing
6
+ # confirmation, reset password and unlock tokens in the database.
7
+ # Devise will use the `secret_key_base` on Rails 4+ applications as its `secret_key`
8
+ # by default. You can change it below and use your own secret key.
9
+ # config.secret_key = '624a4ffc683cef25b72c6122d8ea6ead9c5a4ed565b9cdf849e03bc85e08ea662c0edd659ba6f94dec1da1e363bde9105185e5ca8c693cefae65fe1936ff4a4c'
10
+
11
+ # ==> Mailer Configuration
12
+ # Configure the e-mail address which will be shown in Devise::Mailer,
13
+ # note that it will be overwritten if you use your own mailer class
14
+ # with default "from" parameter.
15
+ config.mailer_sender = 'please-change-me-at-config-initializers-devise@example.com'
16
+
17
+ # Configure the class responsible to send e-mails.
18
+ # config.mailer = 'Devise::Mailer'
19
+
20
+ # ==> ORM configuration
21
+ # Load and configure the ORM. Supports :active_record (default) and
22
+ # :mongoid (bson_ext recommended) by default. Other ORMs may be
23
+ # available as additional gems.
24
+ require 'devise/orm/active_record'
25
+
26
+ # ==> Configuration for any authentication mechanism
27
+ # Configure which keys are used when authenticating a user. The default is
28
+ # just :email. You can configure it to use [:username, :subdomain], so for
29
+ # authenticating a user, both parameters are required. Remember that those
30
+ # parameters are used only when authenticating and not when retrieving from
31
+ # session. If you need permissions, you should implement that in a before filter.
32
+ # You can also supply a hash where the value is a boolean determining whether
33
+ # or not authentication should be aborted when the value is not present.
34
+ # config.authentication_keys = [:email]
35
+
36
+ # Configure parameters from the request object used for authentication. Each entry
37
+ # given should be a request method and it will automatically be passed to the
38
+ # find_for_authentication method and considered in your model lookup. For instance,
39
+ # if you set :request_keys to [:subdomain], :subdomain will be used on authentication.
40
+ # The same considerations mentioned for authentication_keys also apply to request_keys.
41
+ # config.request_keys = []
42
+
43
+ # Configure which authentication keys should be case-insensitive.
44
+ # These keys will be downcased upon creating or modifying a user and when used
45
+ # to authenticate or find a user. Default is :email.
46
+ config.case_insensitive_keys = [:email]
47
+
48
+ # Configure which authentication keys should have whitespace stripped.
49
+ # These keys will have whitespace before and after removed upon creating or
50
+ # modifying a user and when used to authenticate or find a user. Default is :email.
51
+ config.strip_whitespace_keys = [:email]
52
+
53
+ # Tell if authentication through request.params is enabled. True by default.
54
+ # It can be set to an array that will enable params authentication only for the
55
+ # given strategies, for example, `config.params_authenticatable = [:database]` will
56
+ # enable it only for database (email + password) authentication.
57
+ # config.params_authenticatable = true
58
+
59
+ # Tell if authentication through HTTP Auth is enabled. False by default.
60
+ # It can be set to an array that will enable http authentication only for the
61
+ # given strategies, for example, `config.http_authenticatable = [:database]` will
62
+ # enable it only for database authentication. The supported strategies are:
63
+ # :database = Support basic authentication with authentication key + password
64
+ # config.http_authenticatable = false
65
+
66
+ # If 401 status code should be returned for AJAX requests. True by default.
67
+ # config.http_authenticatable_on_xhr = true
68
+
69
+ # The realm used in Http Basic Authentication. 'Application' by default.
70
+ # config.http_authentication_realm = 'Application'
71
+
72
+ # It will change confirmation, password recovery and other workflows
73
+ # to behave the same regardless if the e-mail provided was right or wrong.
74
+ # Does not affect registerable.
75
+ # config.paranoid = true
76
+
77
+ # By default Devise will store the user in session. You can skip storage for
78
+ # particular strategies by setting this option.
79
+ # Notice that if you are skipping storage for all authentication paths, you
80
+ # may want to disable generating routes to Devise's sessions controller by
81
+ # passing skip: :sessions to `devise_for` in your config/routes.rb
82
+ config.skip_session_storage = [:http_auth]
83
+
84
+ # By default, Devise cleans up the CSRF token on authentication to
85
+ # avoid CSRF token fixation attacks. This means that, when using AJAX
86
+ # requests for sign in and sign up, you need to get a new CSRF token
87
+ # from the server. You can disable this option at your own risk.
88
+ # config.clean_up_csrf_token_on_authentication = true
89
+
90
+ # ==> Configuration for :database_authenticatable
91
+ # For bcrypt, this is the cost for hashing the password and defaults to 10. If
92
+ # using other encryptors, it sets how many times you want the password re-encrypted.
93
+ #
94
+ # Limiting the stretches to just one in testing will increase the performance of
95
+ # your test suite dramatically. However, it is STRONGLY RECOMMENDED to not use
96
+ # a value less than 10 in other environments. Note that, for bcrypt (the default
97
+ # encryptor), the cost increases exponentially with the number of stretches (e.g.
98
+ # a value of 20 is already extremely slow: approx. 60 seconds for 1 calculation).
99
+ config.stretches = Rails.env.test? ? 1 : 10
100
+
101
+ # Setup a pepper to generate the encrypted password.
102
+ # config.pepper = '9a24f80e19a898ab8a7ad2cbbd21fc95feb50c72f39406e44b0ab83832f739c2590edb2bd297dece646694b96ffe23773194a94906a1c4d5228bf407383dacdc'
103
+
104
+ # Send a notification email when the user's password is changed
105
+ # config.send_password_change_notification = false
106
+
107
+ # ==> Configuration for :confirmable
108
+ # A period that the user is allowed to access the website even without
109
+ # confirming their account. For instance, if set to 2.days, the user will be
110
+ # able to access the website for two days without confirming their account,
111
+ # access will be blocked just in the third day. Default is 0.days, meaning
112
+ # the user cannot access the website without confirming their account.
113
+ # config.allow_unconfirmed_access_for = 2.days
114
+
115
+ # A period that the user is allowed to confirm their account before their
116
+ # token becomes invalid. For example, if set to 3.days, the user can confirm
117
+ # their account within 3 days after the mail was sent, but on the fourth day
118
+ # their account can't be confirmed with the token any more.
119
+ # Default is nil, meaning there is no restriction on how long a user can take
120
+ # before confirming their account.
121
+ # config.confirm_within = 3.days
122
+
123
+ # If true, requires any email changes to be confirmed (exactly the same way as
124
+ # initial account confirmation) to be applied. Requires additional unconfirmed_email
125
+ # db field (see migrations). Until confirmed, new email is stored in
126
+ # unconfirmed_email column, and copied to email column on successful confirmation.
127
+ config.reconfirmable = true
128
+
129
+ # Defines which key will be used when confirming an account
130
+ # config.confirmation_keys = [:email]
131
+
132
+ # ==> Configuration for :rememberable
133
+ # The time the user will be remembered without asking for credentials again.
134
+ # config.remember_for = 2.weeks
135
+
136
+ # Invalidates all the remember me tokens when the user signs out.
137
+ config.expire_all_remember_me_on_sign_out = true
138
+
139
+ # If true, extends the user's remember period when remembered via cookie.
140
+ # config.extend_remember_period = false
141
+
142
+ # Options to be passed to the created cookie. For instance, you can set
143
+ # secure: true in order to force SSL only cookies.
144
+ # config.rememberable_options = {}
145
+
146
+ # ==> Configuration for :validatable
147
+ # Range for password length.
148
+ config.password_length = 8..72
149
+
150
+ # Email regex used to validate email formats. It simply asserts that
151
+ # one (and only one) @ exists in the given string. This is mainly
152
+ # to give user feedback and not to assert the e-mail validity.
153
+ # config.email_regexp = /\A[^@]+@[^@]+\z/
154
+
155
+ # ==> Configuration for :timeoutable
156
+ # The time you want to timeout the user session without activity. After this
157
+ # time the user will be asked for credentials again. Default is 30 minutes.
158
+ # config.timeout_in = 30.minutes
159
+
160
+ # ==> Configuration for :lockable
161
+ # Defines which strategy will be used to lock an account.
162
+ # :failed_attempts = Locks an account after a number of failed attempts to sign in.
163
+ # :none = No lock strategy. You should handle locking by yourself.
164
+ # config.lock_strategy = :failed_attempts
165
+
166
+ # Defines which key will be used when locking and unlocking an account
167
+ # config.unlock_keys = [:email]
168
+
169
+ # Defines which strategy will be used to unlock an account.
170
+ # :email = Sends an unlock link to the user email
171
+ # :time = Re-enables login after a certain amount of time (see :unlock_in below)
172
+ # :both = Enables both strategies
173
+ # :none = No unlock strategy. You should handle unlocking by yourself.
174
+ # config.unlock_strategy = :both
175
+
176
+ # Number of authentication tries before locking an account if lock_strategy
177
+ # is failed attempts.
178
+ # config.maximum_attempts = 20
179
+
180
+ # Time interval to unlock the account if :time is enabled as unlock_strategy.
181
+ # config.unlock_in = 1.hour
182
+
183
+ # Warn on the last attempt before the account is locked.
184
+ # config.last_attempt_warning = true
185
+
186
+ # ==> Configuration for :recoverable
187
+ #
188
+ # Defines which key will be used when recovering the password for an account
189
+ # config.reset_password_keys = [:email]
190
+
191
+ # Time interval you can reset your password with a reset password key.
192
+ # Don't put a too small interval or your users won't have the time to
193
+ # change their passwords.
194
+ config.reset_password_within = 6.hours
195
+
196
+ # When set to false, does not sign a user in automatically after their password is
197
+ # reset. Defaults to true, so a user is signed in automatically after a reset.
198
+ # config.sign_in_after_reset_password = true
199
+
200
+ # ==> Configuration for :encryptable
201
+ # Allow you to use another encryption algorithm besides bcrypt (default). You can use
202
+ # :sha1, :sha512 or encryptors from others authentication tools as :clearance_sha1,
203
+ # :authlogic_sha512 (then you should set stretches above to 20 for default behavior)
204
+ # and :restful_authentication_sha1 (then you should set stretches to 10, and copy
205
+ # REST_AUTH_SITE_KEY to pepper).
206
+ #
207
+ # Require the `devise-encryptable` gem when using anything other than bcrypt
208
+ # config.encryptor = :sha512
209
+
210
+ # ==> Scopes configuration
211
+ # Turn scoped views on. Before rendering "sessions/new", it will first check for
212
+ # "users/sessions/new". It's turned off by default because it's slower if you
213
+ # are using only default views.
214
+ # config.scoped_views = false
215
+
216
+ # Configure the default scope given to Warden. By default it's the first
217
+ # devise role declared in your routes (usually :user).
218
+ # config.default_scope = :user
219
+
220
+ # Set this configuration to false if you want /users/sign_out to sign out
221
+ # only the current scope. By default, Devise signs out all scopes.
222
+ # config.sign_out_all_scopes = true
223
+
224
+ # ==> Navigation configuration
225
+ # Lists the formats that should be treated as navigational. Formats like
226
+ # :html, should redirect to the sign in page when the user does not have
227
+ # access, but formats like :xml or :json, should return 401.
228
+ #
229
+ # If you have any extra navigational formats, like :iphone or :mobile, you
230
+ # should add them to the navigational formats lists.
231
+ #
232
+ # The "*/*" below is required to match Internet Explorer requests.
233
+ # config.navigational_formats = ['*/*', :html]
234
+
235
+ # The default HTTP method used to sign out a resource. Default is :delete.
236
+ config.sign_out_via = :delete
237
+
238
+ # ==> OmniAuth
239
+ # Add a new OmniAuth provider. Check the wiki for more information on setting
240
+ # up on your models and hooks.
241
+ # config.omniauth :github, 'APP_ID', 'APP_SECRET', scope: 'user,public_repo'
242
+
243
+ # ==> Warden configuration
244
+ # If you want to use other strategies, that are not supported by Devise, or
245
+ # change the failure app, you can configure them inside the config.warden block.
246
+ #
247
+ # config.warden do |manager|
248
+ # manager.intercept_401 = false
249
+ # manager.default_strategies(scope: :user).unshift :some_external_strategy
250
+ # end
251
+
252
+ # ==> Mountable engine configurations
253
+ # When using Devise inside an engine, let's call it `MyEngine`, and this engine
254
+ # is mountable, there are some extra configurations to be taken into account.
255
+ # The following options are available, assuming the engine is mounted as:
256
+ #
257
+ # mount MyEngine, at: '/my_engine'
258
+ #
259
+ # The router that invoked `devise_for`, in the example above, would be:
260
+ config.router_name = :brilliant_cms
261
+
262
+ config.parent_controller = 'BrilliantCms::ApplicationController'
263
+
264
+ # When using OmniAuth, Devise cannot automatically set OmniAuth path,
265
+ # so you need to do it manually. For the users scope, it would be:
266
+ # config.omniauth_path_prefix = '/my_engine/users/auth'
267
+ end