padrino-admin 0.18.0 → 0.18.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/padrino-admin/generators/templates/account/mongoid.rb.tt +1 -1
- data/lib/padrino-admin/generators/templates/app/controllers/sessions.rb.tt +0 -4
- data/lib/padrino-admin/generators/templates/erb/app/sessions/new.erb.tt +0 -6
- data/lib/padrino-admin/generators/templates/haml/app/sessions/new.haml.tt +0 -6
- data/lib/padrino-admin/generators/templates/slim/app/sessions/new.slim.tt +0 -6
- data/test/generators/test_admin_page_generator.rb +4 -4
- metadata +5 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 281388666c8cb872b46f3ce068940e8718006d27375c7a81b5281e09e8a250de
|
|
4
|
+
data.tar.gz: e3b4d990cc8c9d48954531eeb3234efadc0d46ab2a63fdf34cce3f1e8ce218ac
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7c2b5c039a5c8716aaeb1f4e6a1aad7bf61aeee5994cb567e425a3580050d282e473e033037a603ceb85feeef1a84fcb8d0f3d056e5916d97bd2bcec54398e79
|
|
7
|
+
data.tar.gz: e58b0d302e3d6ff10a2ae6866e55640819512d6309e06a595138a91ee61e3ff1789abd898dfe233245d97a49dcf366d6014d5d5b8f5ba9d1723c6aa0ebbebb97
|
|
@@ -27,7 +27,7 @@ class <%= @model_name %>
|
|
|
27
27
|
# This method is for authentication purpose.
|
|
28
28
|
#
|
|
29
29
|
def self.authenticate(email, password)
|
|
30
|
-
account = where(email:
|
|
30
|
+
account = where(email: /\A#{Object::Regexp.escape(email)}\z/i).first if email.present?
|
|
31
31
|
account if account&.has_password?(password)
|
|
32
32
|
end
|
|
33
33
|
|
|
@@ -7,10 +7,6 @@
|
|
|
7
7
|
if account = <%= @model_name %>.authenticate(params[:email], params[:password])
|
|
8
8
|
set_current_account(account)
|
|
9
9
|
redirect url(:base, :index)
|
|
10
|
-
elsif Padrino.env == :development && params[:bypass]
|
|
11
|
-
account = <%= @model_name %>.first
|
|
12
|
-
set_current_account(account)
|
|
13
|
-
redirect url(:base, :index)
|
|
14
10
|
else
|
|
15
11
|
params[:email] = h(params[:email])
|
|
16
12
|
flash.now[:error] = pat('login.error')
|
|
@@ -31,12 +31,6 @@
|
|
|
31
31
|
<div class="col-lg-10"><%%= password_field_tag :password, id: :password, class: 'form-control' %></div>
|
|
32
32
|
</div>
|
|
33
33
|
|
|
34
|
-
<fieldset class="login-control-group-last control-group">
|
|
35
|
-
<div class="login-controls controls">
|
|
36
|
-
<label class="login-bypass-label checkbox"><%%= check_box_tag :bypass %> <%%= pat('login.bypass') %></label>
|
|
37
|
-
</div>
|
|
38
|
-
</fieldset>
|
|
39
|
-
|
|
40
34
|
</div>
|
|
41
35
|
<div class="login-footer modal-footer"><%%= submit_tag(pat('login.sign_in'), class: 'btn btn-primary pull-right') %></div>
|
|
42
36
|
<%% end %>
|
|
@@ -26,12 +26,6 @@
|
|
|
26
26
|
%label.col-lg-2.control-label{for: :password}= pat('login.password')
|
|
27
27
|
.col-lg-10= password_field_tag :password, id: :password, class:'form-control'
|
|
28
28
|
|
|
29
|
-
%fieldset.login-control-group-last.control-group
|
|
30
|
-
.login-controls.controls
|
|
31
|
-
%label.login-bypass-label.checkbox
|
|
32
|
-
= check_box_tag :bypass
|
|
33
|
-
= pat('login.bypass')
|
|
34
|
-
|
|
35
29
|
.login-footer.modal-footer
|
|
36
30
|
= submit_tag(pat('login.sign_in'), class: 'btn btn-primary pull-right')
|
|
37
31
|
|
|
@@ -26,12 +26,6 @@ html lang="en" xmlns="http://www.w3.org/1999/xhtml"
|
|
|
26
26
|
label for="password" class='col-lg-2 control-label' = pat('login.password')
|
|
27
27
|
div class='col-lg-10' = password_field_tag :password, id: :password, class: 'form-control'
|
|
28
28
|
|
|
29
|
-
fieldset class='login-control-group-last control-group'
|
|
30
|
-
div class='login-controls controls'
|
|
31
|
-
label class="login-bypass-label checkbox"
|
|
32
|
-
= check_box_tag :bypass
|
|
33
|
-
| #{pat('login.bypass')}
|
|
34
|
-
|
|
35
29
|
div class="login-footer modal-footer"
|
|
36
30
|
= submit_tag(pat('login.sign_in'), class: 'btn btn-primary pull-right')
|
|
37
31
|
= javascript_include_tag 'jquery-3.7.1.min', (Padrino.env == :production ? 'bootstrap/bootstrap.min' : %w[bootstrap/affix bootstrap/alert bootstrap/button bootstrap/carousel bootstrap/collapse bootstrap/dropdown bootstrap/tooltip bootstrap/transition bootstrap/modal bootstrap/popover bootstrap/scrollspy bootstrap/tab]), :application
|
|
@@ -111,7 +111,7 @@ describe 'AdminPageGenerator' do
|
|
|
111
111
|
assert_file_exists "#{@apptmp}/sample_project/admin/controllers/friends.rb"
|
|
112
112
|
assert_match_in_file 'SampleProject::Admin.controllers :friends do', "#{@apptmp}/sample_project/admin/controllers/friends.rb"
|
|
113
113
|
assert_match_in_file "role.project_module :friends, '/friends'", "#{@apptmp}/sample_project/admin/app.rb"
|
|
114
|
-
|
|
114
|
+
assert_no_match_in_file(/bypass/, "#{@apptmp}/sample_project/admin/controllers/sessions.rb")
|
|
115
115
|
end
|
|
116
116
|
|
|
117
117
|
# users can override certain templates from a generators/templates folder in the destination_root
|
|
@@ -137,7 +137,7 @@ describe 'AdminPageGenerator' do
|
|
|
137
137
|
assert_match_in_file "label :#{field}", "#{@apptmp}/sample_project/admin/views/friends/_form.haml"
|
|
138
138
|
assert_match_in_file "text_field :#{field}", "#{@apptmp}/sample_project/admin/views/friends/_form.haml"
|
|
139
139
|
end
|
|
140
|
-
|
|
140
|
+
assert_no_match_in_file(/bypass/, "#{@apptmp}/sample_project/admin/views/sessions/new.haml")
|
|
141
141
|
end
|
|
142
142
|
|
|
143
143
|
it 'should correctly generate a new page with erb' do
|
|
@@ -152,7 +152,7 @@ describe 'AdminPageGenerator' do
|
|
|
152
152
|
assert_match_in_file "label :#{field}", "#{@apptmp}/sample_project/admin/views/friends/_form.erb"
|
|
153
153
|
assert_match_in_file "text_field :#{field}", "#{@apptmp}/sample_project/admin/views/friends/_form.erb"
|
|
154
154
|
end
|
|
155
|
-
|
|
155
|
+
assert_no_match_in_file(/bypass/, "#{@apptmp}/sample_project/admin/views/sessions/new.erb")
|
|
156
156
|
end
|
|
157
157
|
|
|
158
158
|
it 'should correctly generate a new page with slim' do
|
|
@@ -167,7 +167,7 @@ describe 'AdminPageGenerator' do
|
|
|
167
167
|
assert_match_in_file "label :#{field}", "#{@apptmp}/sample_project/admin/views/friends/_form.slim"
|
|
168
168
|
assert_match_in_file "text_field :#{field}", "#{@apptmp}/sample_project/admin/views/friends/_form.slim"
|
|
169
169
|
end
|
|
170
|
-
|
|
170
|
+
assert_no_match_in_file(/bypass/, "#{@apptmp}/sample_project/admin/views/sessions/new.slim")
|
|
171
171
|
end
|
|
172
172
|
end
|
|
173
173
|
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: padrino-admin
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.18.
|
|
4
|
+
version: 0.18.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Padrino Team
|
|
@@ -19,28 +19,28 @@ dependencies:
|
|
|
19
19
|
requirements:
|
|
20
20
|
- - '='
|
|
21
21
|
- !ruby/object:Gem::Version
|
|
22
|
-
version: 0.18.
|
|
22
|
+
version: 0.18.1
|
|
23
23
|
type: :runtime
|
|
24
24
|
prerelease: false
|
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
|
26
26
|
requirements:
|
|
27
27
|
- - '='
|
|
28
28
|
- !ruby/object:Gem::Version
|
|
29
|
-
version: 0.18.
|
|
29
|
+
version: 0.18.1
|
|
30
30
|
- !ruby/object:Gem::Dependency
|
|
31
31
|
name: padrino-helpers
|
|
32
32
|
requirement: !ruby/object:Gem::Requirement
|
|
33
33
|
requirements:
|
|
34
34
|
- - '='
|
|
35
35
|
- !ruby/object:Gem::Version
|
|
36
|
-
version: 0.18.
|
|
36
|
+
version: 0.18.1
|
|
37
37
|
type: :runtime
|
|
38
38
|
prerelease: false
|
|
39
39
|
version_requirements: !ruby/object:Gem::Requirement
|
|
40
40
|
requirements:
|
|
41
41
|
- - '='
|
|
42
42
|
- !ruby/object:Gem::Version
|
|
43
|
-
version: 0.18.
|
|
43
|
+
version: 0.18.1
|
|
44
44
|
description: Admin View for Padrino applications
|
|
45
45
|
email: padrinorb@gmail.com
|
|
46
46
|
executables: []
|