constructor-core 0.3.3 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- data/app/assets/stylesheets/constructor_core/application.css.scss +1 -56
- data/app/assets/stylesheets/constructor_core/main.css.scss +200 -0
- data/app/controllers/constructor_core/application_controller.rb +7 -0
- data/app/controllers/constructor_core/sessions_controller.rb +2 -2
- data/app/helpers/constructor_core/application_helper.rb +29 -0
- data/app/models/constructor_core/user.rb +0 -2
- data/app/views/constructor_core/sessions/new.html.haml +3 -6
- data/app/views/layouts/constructor_core/application_admin.haml +36 -19
- data/config/environments/production.rb +0 -2
- data/config/initializers/devise.rb +2 -203
- data/config/locales/en.yml +10 -0
- data/config/locales/ru.yml +11 -1
- data/config/routes.rb +10 -5
- data/constructor-core.gemspec +2 -0
- data/lib/constructor-core.rb +2 -0
- data/lib/constructor_core/version.rb +1 -1
- metadata +38 -14
- data/app/assets/fonts/FontAwesome.otf +0 -0
- data/app/assets/fonts/fontawesome-webfont.eot +0 -0
- data/app/assets/fonts/fontawesome-webfont.svg +0 -339
- data/app/assets/fonts/fontawesome-webfont.ttf +0 -0
- data/app/assets/fonts/fontawesome-webfont.woff +0 -0
- data/app/assets/stylesheets/constructor_core/bootstrap-responsive.css +0 -1109
- data/app/assets/stylesheets/constructor_core/bootstrap.css +0 -6158
- data/app/assets/stylesheets/constructor_core/font-awesome.css +0 -1268
- data/app/assets/stylesheets/constructor_core/jquery.treeview.css +0 -73
- data/app/controllers/constructor_core/admin_controller.rb +0 -6
- data/app/helpers/constructor_core/devise_helper.rb +0 -24
- data/config/environments/development.rb +0 -4
@@ -1,58 +1,3 @@
|
|
1
|
-
//= require_self
|
2
1
|
//= require ckeditor/contents
|
3
2
|
//= require ckeditor/skins/moono/editor.css
|
4
|
-
//= require
|
5
|
-
//= require constructor_core/bootstrap-responsive
|
6
|
-
//= require constructor_core/jquery.treeview
|
7
|
-
//= require constructor_core/font-awesome.css
|
8
|
-
|
9
|
-
body {
|
10
|
-
padding-top: 40px;
|
11
|
-
}
|
12
|
-
|
13
|
-
.images_controls {
|
14
|
-
float: left;
|
15
|
-
overflow: hidden;
|
16
|
-
display: inline-block;
|
17
|
-
width: 180px;
|
18
|
-
margin-bottom: 20px;
|
19
|
-
|
20
|
-
.actions {
|
21
|
-
margin-top: 5px;
|
22
|
-
margin-left: 28px;
|
23
|
-
}
|
24
|
-
}
|
25
|
-
|
26
|
-
.sizes .controls {
|
27
|
-
margin-bottom: 30px;
|
28
|
-
}
|
29
|
-
|
30
|
-
.url {
|
31
|
-
font-size: 12px;
|
32
|
-
|
33
|
-
.full_url {
|
34
|
-
margin-top: 6px;
|
35
|
-
float: left;
|
36
|
-
}
|
37
|
-
|
38
|
-
.icon-pencil {
|
39
|
-
margin-top: 5px;
|
40
|
-
margin-left: 3px;
|
41
|
-
}
|
42
|
-
|
43
|
-
.address {
|
44
|
-
font-weight: bold;
|
45
|
-
|
46
|
-
&:hover {
|
47
|
-
background-color: #ffa;
|
48
|
-
}
|
49
|
-
}
|
50
|
-
}
|
51
|
-
|
52
|
-
.url .icon-pencil {
|
53
|
-
display: none;
|
54
|
-
}
|
55
|
-
|
56
|
-
.url:hover .icon-pencil {
|
57
|
-
display: inline-block;
|
58
|
-
}
|
3
|
+
//= require ./main
|
@@ -0,0 +1,200 @@
|
|
1
|
+
@import 'bootstrap';
|
2
|
+
@import 'font-awesome';
|
3
|
+
|
4
|
+
$red: #ED2B00;
|
5
|
+
$yellow: #FFC404;
|
6
|
+
$green: #2AB500;
|
7
|
+
$violet: #8E0BD6;
|
8
|
+
$blue: #0D98FF;
|
9
|
+
|
10
|
+
$redDark: #B82100;
|
11
|
+
$yellowDark: #D9A603;
|
12
|
+
$greenDark: #218F00;
|
13
|
+
$violetDark: #6B08A1;
|
14
|
+
$blueDark: #0A7BCF;
|
15
|
+
|
16
|
+
body {
|
17
|
+
min-width: 950px;
|
18
|
+
color: $gray;
|
19
|
+
}
|
20
|
+
|
21
|
+
a {
|
22
|
+
&:link {
|
23
|
+
color: $blue;
|
24
|
+
}
|
25
|
+
|
26
|
+
&:active, &:hover, &:focus {
|
27
|
+
color: $red;
|
28
|
+
}
|
29
|
+
}
|
30
|
+
|
31
|
+
|
32
|
+
h3 {
|
33
|
+
font-weight: normal;
|
34
|
+
}
|
35
|
+
|
36
|
+
.text-right {
|
37
|
+
text-align: right;
|
38
|
+
}
|
39
|
+
|
40
|
+
.avatar {
|
41
|
+
@include border-radius(2px);
|
42
|
+
}
|
43
|
+
|
44
|
+
.form-actions {
|
45
|
+
background-color: rgba(245,245,245,0.4);
|
46
|
+
}
|
47
|
+
|
48
|
+
.navbar-constructor > .navbar-inner {
|
49
|
+
padding: 5px;
|
50
|
+
background-color: rgba(245,245,245,0.7);
|
51
|
+
background-image: none;
|
52
|
+
@include border-radius(0);
|
53
|
+
@include box-shadow(none);
|
54
|
+
border: none;
|
55
|
+
border-bottom: 1px solid #ddd;
|
56
|
+
}
|
57
|
+
|
58
|
+
.navbar .nav > li > a {
|
59
|
+
&:hover { color: $red }
|
60
|
+
}
|
61
|
+
|
62
|
+
.btn {
|
63
|
+
@include buttonBackground(#fff, #eee, $grayDark);
|
64
|
+
background-color: $grayLighter;
|
65
|
+
color: $gray;
|
66
|
+
border: 1px solid #ddd;
|
67
|
+
text-shadow: none;
|
68
|
+
font-weight: normal;
|
69
|
+
@include box-shadow(none);
|
70
|
+
|
71
|
+
&:active, &:link, &:hover, &:focus {
|
72
|
+
color: $gray;
|
73
|
+
}
|
74
|
+
|
75
|
+
&.btn-link {
|
76
|
+
background-image: none;
|
77
|
+
color: $blue;
|
78
|
+
border: none;
|
79
|
+
background-color: transparent;
|
80
|
+
|
81
|
+
&:link {
|
82
|
+
color: $blue
|
83
|
+
}
|
84
|
+
|
85
|
+
&:active, &:hover, &:focus {
|
86
|
+
color: $red;
|
87
|
+
text-decoration: none;
|
88
|
+
}
|
89
|
+
}
|
90
|
+
|
91
|
+
&.btn-danger {
|
92
|
+
background-image: none;
|
93
|
+
border: none;
|
94
|
+
color: $red;
|
95
|
+
background-color: transparent;
|
96
|
+
|
97
|
+
|
98
|
+
&:link {
|
99
|
+
color: $red;
|
100
|
+
}
|
101
|
+
|
102
|
+
&:active, &:hover, &:focus {
|
103
|
+
background-color: $red;
|
104
|
+
color: $white;
|
105
|
+
}
|
106
|
+
}
|
107
|
+
|
108
|
+
&.btn-primary {
|
109
|
+
background-image: none;
|
110
|
+
border: none;
|
111
|
+
background-color: $blueDark;
|
112
|
+
color: $white;
|
113
|
+
|
114
|
+
&:link {
|
115
|
+
color: $white;
|
116
|
+
}
|
117
|
+
|
118
|
+
&:active, &:hover, &:focus {}
|
119
|
+
}
|
120
|
+
|
121
|
+
&.btn-success {
|
122
|
+
background-image: none;
|
123
|
+
border: none;
|
124
|
+
background-color: $green;
|
125
|
+
color: $white;
|
126
|
+
|
127
|
+
&:link {
|
128
|
+
color: $white;
|
129
|
+
}
|
130
|
+
|
131
|
+
&:active, &:hover, &:focus {}
|
132
|
+
}
|
133
|
+
|
134
|
+
&.btn-large { font-size: $baseFontSize*1.5 }
|
135
|
+
}
|
136
|
+
|
137
|
+
.images_controls {
|
138
|
+
float: left;
|
139
|
+
overflow: hidden;
|
140
|
+
display: inline-block;
|
141
|
+
width: 180px;
|
142
|
+
margin-bottom: 20px;
|
143
|
+
|
144
|
+
.actions {
|
145
|
+
margin-top: 5px;
|
146
|
+
margin-left: 28px;
|
147
|
+
}
|
148
|
+
}
|
149
|
+
|
150
|
+
.sizes .controls {
|
151
|
+
margin-bottom: 30px;
|
152
|
+
}
|
153
|
+
|
154
|
+
.url {
|
155
|
+
font-size: 12px;
|
156
|
+
|
157
|
+
.full_url {
|
158
|
+
margin-top: 6px;
|
159
|
+
float: left;
|
160
|
+
}
|
161
|
+
|
162
|
+
.icon-pencil {
|
163
|
+
margin-top: 10px;
|
164
|
+
margin-left: 3px;
|
165
|
+
}
|
166
|
+
|
167
|
+
.address {
|
168
|
+
font-weight: bold;
|
169
|
+
|
170
|
+
&:hover {
|
171
|
+
background-color: #ffa;
|
172
|
+
}
|
173
|
+
}
|
174
|
+
}
|
175
|
+
|
176
|
+
.url .icon-pencil {
|
177
|
+
display: none;
|
178
|
+
}
|
179
|
+
|
180
|
+
.url:hover .icon-pencil {
|
181
|
+
display: inline-block;
|
182
|
+
}
|
183
|
+
|
184
|
+
.b-tree {
|
185
|
+
ul {
|
186
|
+
list-style: none;
|
187
|
+
margin-top: 15px;
|
188
|
+
margin-left: 60px;
|
189
|
+
|
190
|
+
&:first-child {
|
191
|
+
margin-left: 0;
|
192
|
+
padding-left: 0;
|
193
|
+
margin-top: 0;
|
194
|
+
}
|
195
|
+
|
196
|
+
li {
|
197
|
+
margin-top: 10px;
|
198
|
+
}
|
199
|
+
}
|
200
|
+
}
|
@@ -3,11 +3,11 @@
|
|
3
3
|
module ConstructorCore
|
4
4
|
class SessionsController < Devise::SessionsController
|
5
5
|
layout 'constructor_core/application_admin'
|
6
|
-
|
6
|
+
|
7
7
|
def after_sign_in_path_for(resource)
|
8
8
|
return '/admin/pages'
|
9
9
|
end
|
10
|
-
|
10
|
+
|
11
11
|
def after_sign_out_path_for(resource)
|
12
12
|
return '/'
|
13
13
|
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
module ConstructorCore
|
2
|
+
module ApplicationHelper
|
3
|
+
def authenticate_user!
|
4
|
+
warden.authenticate!
|
5
|
+
end
|
6
|
+
|
7
|
+
def user_signed_in?
|
8
|
+
!!current_user
|
9
|
+
end
|
10
|
+
|
11
|
+
def current_user
|
12
|
+
@current_user ||= warden.authenticate
|
13
|
+
end
|
14
|
+
|
15
|
+
def user_session
|
16
|
+
current_user && warden.session
|
17
|
+
end
|
18
|
+
|
19
|
+
def warden
|
20
|
+
request.env['warden']
|
21
|
+
end
|
22
|
+
|
23
|
+
def gravatar_icon(user_email = '', size = 40)
|
24
|
+
gravatar_url = 'http://www.gravatar.com/avatar/%{hash}?s=%{size}&d=mm'
|
25
|
+
user_email.strip!
|
26
|
+
sprintf gravatar_url, hash: Digest::MD5.hexdigest(user_email.downcase), size: size
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -2,9 +2,7 @@
|
|
2
2
|
|
3
3
|
module ConstructorCore
|
4
4
|
class User < ActiveRecord::Base
|
5
|
-
# Include default devise modules. Others available are:
|
6
5
|
devise :database_authenticatable, :recoverable, :rememberable, :trackable, :validatable, :token_authenticatable, :timeoutable #:confirmable, :registerable, :omniauthable, :lockable, :encryptable
|
7
|
-
# Setup accessible (or protected) attributes for your model
|
8
6
|
attr_accessible :email, :password, :password_confirmation, :remember_me
|
9
7
|
end
|
10
8
|
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
- content_for :page_title do
|
2
|
-
|
2
|
+
=t :login
|
3
3
|
|
4
4
|
= form_for(resource, :as => resource_name, :url => '/login') do |f|
|
5
5
|
.form-horizontal
|
@@ -16,9 +16,6 @@
|
|
16
16
|
.controls
|
17
17
|
%label.checkbox.inline{:for => 'remember_me'}
|
18
18
|
= f.check_box :remember_me
|
19
|
-
|
19
|
+
=t :remember_me
|
20
20
|
.controls
|
21
|
-
= f.submit
|
22
|
-
|
23
|
-
- content_for :sidebar do
|
24
|
-
//= render :partial => "devise/shared/links"
|
21
|
+
= f.submit t(:login), :class => "btn btn-primary"
|
@@ -3,42 +3,59 @@
|
|
3
3
|
%head
|
4
4
|
%meta{:charset => 'utf-8'}/
|
5
5
|
%meta{'http-equiv' => 'X-UA-Compatible', :content => 'IE=edge,chrome=1'}/
|
6
|
-
%title
|
7
|
-
|
8
|
-
%meta{:name => 'viewport', :content => 'width=device-width,initial-scale=1'}/
|
6
|
+
%title=t :dashboard
|
9
7
|
|
10
8
|
/ [if lt IE 9]
|
11
|
-
%script{:src =>
|
9
|
+
%script{:src => 'http://html5shim.googlecode.com/svn/trunk/html5.js'}
|
12
10
|
|
13
11
|
:javascript
|
14
12
|
var CKEDITOR_BASEPATH = '/assets/ckeditor/'
|
15
13
|
|
16
|
-
= stylesheet_link_tag
|
17
|
-
= javascript_include_tag
|
14
|
+
= stylesheet_link_tag 'constructor_core/application'
|
15
|
+
= javascript_include_tag 'constructor_core/application'
|
18
16
|
= csrf_meta_tag
|
19
17
|
= favicon_link_tag
|
20
18
|
|
21
|
-
%link{:rel =>
|
22
|
-
%link{:rel =>
|
23
|
-
%link{:rel =>
|
19
|
+
%link{:rel => 'apple-touch-icon', :href => 'images/apple-touch-icon.png'}
|
20
|
+
%link{:rel => 'apple-touch-icon', :sizes => '72x72', :href => 'images/apple-touch-icon-72x72.png'}
|
21
|
+
%link{:rel => 'apple-touch-icon', :sizes => '114x114', :href => 'images/apple-touch-icon-114x114.png'}
|
24
22
|
|
25
23
|
%body
|
26
|
-
.navbar.navbar-
|
24
|
+
.navbar.navbar-constructor
|
27
25
|
.navbar-inner
|
28
26
|
.container-fluid
|
29
|
-
= link_to
|
30
|
-
%a.btn.btn-navbar{'data-toggle' =>
|
27
|
+
= link_to t(:homepage), '/', :class => 'brand'
|
28
|
+
%a.btn.btn-navbar{'data-toggle' => 'collapse', 'data-target' => '.nav-collapse'}
|
31
29
|
%span.icon-bar
|
32
30
|
%span.icon-bar
|
33
31
|
%span.icon-bar
|
34
32
|
.nav-collapse
|
35
33
|
%ul.nav
|
36
|
-
%li= link_to "Структура", "/admin/pages"
|
37
|
-
%li= link_to "Шаблоны", "/admin/templates"
|
38
|
-
%ul.nav.pull-right
|
39
34
|
%li
|
40
|
-
= link_to
|
41
|
-
|
35
|
+
= link_to '/admin/pages' do
|
36
|
+
%i.icon-sitemap
|
37
|
+
=t :structure
|
38
|
+
%li
|
39
|
+
= link_to '/admin/templates' do
|
40
|
+
%i.icon-film
|
41
|
+
=t :templates
|
42
|
+
/
|
43
|
+
%li
|
44
|
+
= link_to '/admin/users' do
|
45
|
+
%i.icon-group
|
46
|
+
=t :users
|
47
|
+
|
48
|
+
- if user_signed_in?
|
49
|
+
%ul.nav.pull-right
|
50
|
+
%li
|
51
|
+
= link_to @current_user do
|
52
|
+
= image_tag gravatar_icon(current_user.email, 48), width: 24, height: 24, class: 'avatar'
|
53
|
+
%span= current_user.email
|
54
|
+
%li
|
55
|
+
= link_to @current_user, class: 'logout', method: :delete do
|
56
|
+
%i.icon-signout
|
57
|
+
=t :logout
|
58
|
+
|
42
59
|
.container-fluid
|
43
60
|
.page-header
|
44
61
|
.row-fluid
|
@@ -47,11 +64,11 @@
|
|
47
64
|
.span4
|
48
65
|
- unless notice.nil?
|
49
66
|
.alert.fade.in
|
50
|
-
= link_to
|
67
|
+
= link_to '×', '#', :class => 'close', 'data-dismiss' => 'alert'
|
51
68
|
= notice
|
52
69
|
- unless alert.nil?
|
53
70
|
.alert.alert-error.fade.in
|
54
|
-
= link_to
|
71
|
+
= link_to '×', '#', :class => 'close', 'data-dismiss' => 'alert'
|
55
72
|
= alert
|
56
73
|
|
57
74
|
= yield :actions
|
@@ -1,216 +1,15 @@
|
|
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
1
|
Devise.setup do |config|
|
4
|
-
|
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"
|
2
|
+
config.mailer_sender = 'ivanzotov@gmail.com'
|
8
3
|
|
9
|
-
|
10
|
-
# config.mailer = "Devise::Mailer"
|
4
|
+
config.parent_controller = 'ActionController::Base'
|
11
5
|
|
12
|
-
# ==> ORM configuration
|
13
|
-
# Load and configure the ORM. Supports :active_record (default) and
|
14
|
-
# :mongoid (bson_ext recommended) by default. Other ORMs may be
|
15
|
-
# available as additional gems.
|
16
6
|
require 'devise/orm/active_record'
|
17
7
|
|
18
|
-
# ==> Configuration for any authentication mechanism
|
19
|
-
# Configure which keys are used when authenticating a user. The default is
|
20
|
-
# just :email. You can configure it to use [:username, :subdomain], so for
|
21
|
-
# authenticating a user, both parameters are required. Remember that those
|
22
|
-
# parameters are used only when authenticating and not when retrieving from
|
23
|
-
# session. If you need permissions, you should implement that in a before filter.
|
24
|
-
# You can also supply a hash where the value is a boolean determining whether
|
25
|
-
# or not authentication should be aborted when the value is not present.
|
26
|
-
# config.authentication_keys = [ :email ]
|
27
|
-
|
28
|
-
# Configure parameters from the request object used for authentication. Each entry
|
29
|
-
# given should be a request method and it will automatically be passed to the
|
30
|
-
# find_for_authentication method and considered in your model lookup. For instance,
|
31
|
-
# if you set :request_keys to [:subdomain], :subdomain will be used on authentication.
|
32
|
-
# The same considerations mentioned for authentication_keys also apply to request_keys.
|
33
|
-
# config.request_keys = []
|
34
|
-
|
35
|
-
# Configure which authentication keys should be case-insensitive.
|
36
|
-
# These keys will be downcased upon creating or modifying a user and when used
|
37
|
-
# to authenticate or find a user. Default is :email.
|
38
8
|
config.case_insensitive_keys = [ :email ]
|
39
|
-
|
40
|
-
# Configure which authentication keys should have whitespace stripped.
|
41
|
-
# These keys will have whitespace before and after removed upon creating or
|
42
|
-
# modifying a user and when used to authenticate or find a user. Default is :email.
|
43
9
|
config.strip_whitespace_keys = [ :email ]
|
44
|
-
|
45
|
-
# Tell if authentication through request.params is enabled. True by default.
|
46
|
-
# It can be set to an array that will enable params authentication only for the
|
47
|
-
# given strategies, for example, `config.params_authenticatable = [:database]` will
|
48
|
-
# enable it only for database (email + password) authentication.
|
49
|
-
# config.params_authenticatable = true
|
50
|
-
|
51
|
-
# Tell if authentication through HTTP Basic Auth is enabled. False by default.
|
52
|
-
# It can be set to an array that will enable http authentication only for the
|
53
|
-
# given strategies, for example, `config.http_authenticatable = [:token]` will
|
54
|
-
# enable it only for token authentication.
|
55
|
-
# config.http_authenticatable = false
|
56
|
-
|
57
|
-
# If http headers should be returned for AJAX requests. True by default.
|
58
|
-
# config.http_authenticatable_on_xhr = true
|
59
|
-
|
60
|
-
# The realm used in Http Basic Authentication. "Application" by default.
|
61
|
-
# config.http_authentication_realm = "Application"
|
62
|
-
|
63
|
-
# It will change confirmation, password recovery and other workflows
|
64
|
-
# to behave the same regardless if the e-mail provided was right or wrong.
|
65
|
-
# Does not affect registerable.
|
66
|
-
# config.paranoid = true
|
67
|
-
|
68
|
-
# By default Devise will store the user in session. You can skip storage for
|
69
|
-
# :http_auth and :token_auth by adding those symbols to the array below.
|
70
|
-
# Notice that if you are skipping storage for all authentication paths, you
|
71
|
-
# may want to disable generating routes to Devise's sessions controller by
|
72
|
-
# passing :skip => :sessions to `devise_for` in your config/routes.rb
|
73
10
|
config.skip_session_storage = [:http_auth]
|
74
|
-
|
75
|
-
# ==> Configuration for :database_authenticatable
|
76
|
-
# For bcrypt, this is the cost for hashing the password and defaults to 10. If
|
77
|
-
# using other encryptors, it sets how many times you want the password re-encrypted.
|
78
|
-
#
|
79
|
-
# Limiting the stretches to just one in testing will increase the performance of
|
80
|
-
# your test suite dramatically. However, it is STRONGLY RECOMMENDED to not use
|
81
|
-
# a value less than 10 in other environments.
|
82
11
|
config.stretches = Rails.env.test? ? 1 : 10
|
83
|
-
|
84
|
-
# Setup a pepper to generate the encrypted password.
|
85
|
-
# config.pepper = "8101638e8d8142db6ce79325617afe094d9a69ca35fcdb1f7aacf4b0ba25bfacb0a57783d93a11829c309a3d4f05d104e22c4cd305ceec9f3f8a61d2389bb59b"
|
86
|
-
|
87
|
-
# ==> Configuration for :confirmable
|
88
|
-
# A period that the user is allowed to access the website even without
|
89
|
-
# confirming his account. For instance, if set to 2.days, the user will be
|
90
|
-
# able to access the website for two days without confirming his account,
|
91
|
-
# access will be blocked just in the third day. Default is 0.days, meaning
|
92
|
-
# the user cannot access the website without confirming his account.
|
93
|
-
# config.allow_unconfirmed_access_for = 2.days
|
94
|
-
|
95
|
-
# If true, requires any email changes to be confirmed (exctly the same way as
|
96
|
-
# initial account confirmation) to be applied. Requires additional unconfirmed_email
|
97
|
-
# db field (see migrations). Until confirmed new email is stored in
|
98
|
-
# unconfirmed email column, and copied to email column on successful confirmation.
|
99
12
|
config.reconfirmable = true
|
100
|
-
|
101
|
-
# Defines which key will be used when confirming an account
|
102
|
-
# config.confirmation_keys = [ :email ]
|
103
|
-
|
104
|
-
# ==> Configuration for :rememberable
|
105
|
-
# The time the user will be remembered without asking for credentials again.
|
106
|
-
# config.remember_for = 2.weeks
|
107
|
-
|
108
|
-
# If true, extends the user's remember period when remembered via cookie.
|
109
|
-
# config.extend_remember_period = false
|
110
|
-
|
111
|
-
# Options to be passed to the created cookie. For instance, you can set
|
112
|
-
# :secure => true in order to force SSL only cookies.
|
113
|
-
# config.cookie_options = {}
|
114
|
-
|
115
|
-
# ==> Configuration for :validatable
|
116
|
-
# Range for password length. Default is 6..128.
|
117
|
-
# config.password_length = 6..128
|
118
|
-
|
119
|
-
# Email regex used to validate email formats. It simply asserts that
|
120
|
-
# an one (and only one) @ exists in the given string. This is mainly
|
121
|
-
# to give user feedback and not to assert the e-mail validity.
|
122
|
-
# config.email_regexp = /\A[^@]+@[^@]+\z/
|
123
|
-
|
124
|
-
# ==> Configuration for :timeoutable
|
125
|
-
# The time you want to timeout the user session without activity. After this
|
126
|
-
# time the user will be asked for credentials again. Default is 30 minutes.
|
127
|
-
# config.timeout_in = 30.minutes
|
128
|
-
|
129
|
-
# ==> Configuration for :lockable
|
130
|
-
# Defines which strategy will be used to lock an account.
|
131
|
-
# :failed_attempts = Locks an account after a number of failed attempts to sign in.
|
132
|
-
# :none = No lock strategy. You should handle locking by yourself.
|
133
|
-
# config.lock_strategy = :failed_attempts
|
134
|
-
|
135
|
-
# Defines which key will be used when locking and unlocking an account
|
136
|
-
# config.unlock_keys = [ :email ]
|
137
|
-
|
138
|
-
# Defines which strategy will be used to unlock an account.
|
139
|
-
# :email = Sends an unlock link to the user email
|
140
|
-
# :time = Re-enables login after a certain amount of time (see :unlock_in below)
|
141
|
-
# :both = Enables both strategies
|
142
|
-
# :none = No unlock strategy. You should handle unlocking by yourself.
|
143
|
-
# config.unlock_strategy = :both
|
144
|
-
|
145
|
-
# Number of authentication tries before locking an account if lock_strategy
|
146
|
-
# is failed attempts.
|
147
|
-
# config.maximum_attempts = 20
|
148
|
-
|
149
|
-
# Time interval to unlock the account if :time is enabled as unlock_strategy.
|
150
|
-
# config.unlock_in = 1.hour
|
151
|
-
|
152
|
-
# ==> Configuration for :recoverable
|
153
|
-
#
|
154
|
-
# Defines which key will be used when recovering the password for an account
|
155
|
-
# config.reset_password_keys = [ :email ]
|
156
|
-
|
157
|
-
# Time interval you can reset your password with a reset password key.
|
158
|
-
# Don't put a too small interval or your users won't have the time to
|
159
|
-
# change their passwords.
|
160
13
|
config.reset_password_within = 6.hours
|
161
|
-
|
162
|
-
# ==> Configuration for :encryptable
|
163
|
-
# Allow you to use another encryption algorithm besides bcrypt (default). You can use
|
164
|
-
# :sha1, :sha512 or encryptors from others authentication tools as :clearance_sha1,
|
165
|
-
# :authlogic_sha512 (then you should set stretches above to 20 for default behavior)
|
166
|
-
# and :restful_authentication_sha1 (then you should set stretches to 10, and copy
|
167
|
-
# REST_AUTH_SITE_KEY to pepper)
|
168
|
-
# config.encryptor = :sha512
|
169
|
-
|
170
|
-
# ==> Configuration for :token_authenticatable
|
171
|
-
# Defines name of the authentication token params key
|
172
|
-
# config.token_authentication_key = :auth_token
|
173
|
-
|
174
|
-
# ==> Scopes configuration
|
175
|
-
# Turn scoped views on. Before rendering "sessions/new", it will first check for
|
176
|
-
# "users/sessions/new". It's turned off by default because it's slower if you
|
177
|
-
# are using only default views.
|
178
|
-
# config.scoped_views = false
|
179
|
-
|
180
|
-
# Configure the default scope given to Warden. By default it's the first
|
181
|
-
# devise role declared in your routes (usually :user).
|
182
|
-
# config.default_scope = :user
|
183
|
-
|
184
|
-
# Configure sign_out behavior.
|
185
|
-
# Sign_out action can be scoped (i.e. /users/sign_out affects only :user scope).
|
186
|
-
# The default is true, which means any logout action will sign out all active scopes.
|
187
|
-
# config.sign_out_all_scopes = true
|
188
|
-
|
189
|
-
# ==> Navigation configuration
|
190
|
-
# Lists the formats that should be treated as navigational. Formats like
|
191
|
-
# :html, should redirect to the sign in page when the user does not have
|
192
|
-
# access, but formats like :xml or :json, should return 401.
|
193
|
-
#
|
194
|
-
# If you have any extra navigational formats, like :iphone or :mobile, you
|
195
|
-
# should add them to the navigational formats lists.
|
196
|
-
#
|
197
|
-
# The "*/*" below is required to match Internet Explorer requests.
|
198
|
-
# config.navigational_formats = ["*/*", :html]
|
199
|
-
|
200
|
-
# The default HTTP method used to sign out a resource. Default is :delete.
|
201
14
|
config.sign_out_via = :delete
|
202
|
-
|
203
|
-
# ==> OmniAuth
|
204
|
-
# Add a new OmniAuth provider. Check the wiki for more information on setting
|
205
|
-
# up on your models and hooks.
|
206
|
-
# config.omniauth :github, 'APP_ID', 'APP_SECRET', :scope => 'user,public_repo'
|
207
|
-
|
208
|
-
# ==> Warden configuration
|
209
|
-
# If you want to use other strategies, that are not supported by Devise, or
|
210
|
-
# change the failure app, you can configure them inside the config.warden block.
|
211
|
-
#
|
212
|
-
# config.warden do |manager|
|
213
|
-
# manager.intercept_401 = false
|
214
|
-
# manager.default_strategies(:scope => :user).unshift :some_external_strategy
|
215
|
-
# end
|
216
15
|
end
|