lotus_admin 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/app/controllers/concerns/lotus_admin/devise_controllers.rb +3 -0
- data/app/views/administrators/_links.html.haml +0 -3
- data/app/views/layouts/lotus_admin/_sidebar.html.haml +1 -1
- data/config/routes.rb +1 -3
- data/lib/lotus_admin/configuration.rb +1 -11
- data/lib/lotus_admin/router.rb +45 -0
- data/lib/lotus_admin/version.rb +1 -1
- data/lib/lotus_admin.rb +3 -2
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0c9e4993cb32ec7a89ecade49298a80692670bc6e8153621ff8b7a3cd45e0228
|
4
|
+
data.tar.gz: 7dcb22bdec0562583224701e9ec891c06da97e3f07abdc2b4200babdc371a6e7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: beb934c43516b3df224028237c5e9be65ffe0860ef29e44d401b32115cd6ba691fb23e592a04f7ad26e114a9967fbc4388c883856e1a5e757166a4134bb9548d
|
7
|
+
data.tar.gz: 38d23815c520035b15a1a87dc55447d008bcc88bf0666865846444bc366a56443bebfa5f262144030c2a9b794f4067ee9b650d9c734791ded083ece367f502c2
|
data/README.md
CHANGED
@@ -2,9 +2,6 @@
|
|
2
2
|
- if controller_name != 'sessions'
|
3
3
|
= link_to "Log in", new_session_path(resource_name)
|
4
4
|
%br/
|
5
|
-
- if devise_mapping.registerable? && controller_name != 'registrations'
|
6
|
-
= link_to "Sign up", new_registration_path(resource_name)
|
7
|
-
%br/
|
8
5
|
- if devise_mapping.recoverable? && controller_name != 'passwords' && controller_name != 'registrations'
|
9
6
|
= link_to "Forgot your password?", new_password_path(resource_name)
|
10
7
|
%br/
|
data/config/routes.rb
CHANGED
@@ -1,11 +1,9 @@
|
|
1
1
|
LotusAdmin::Engine.routes.draw do
|
2
|
-
devise_for :administrators, class_name: LotusAdmin.configuration.user_class_name
|
3
|
-
|
4
2
|
authenticate :administrator do
|
5
3
|
resources :users
|
6
4
|
resource :profile, only: [:edit, :update]
|
7
5
|
|
8
|
-
LotusAdmin.
|
6
|
+
LotusAdmin.router.resources(self)
|
9
7
|
|
10
8
|
root to: 'dashboard#show'
|
11
9
|
end
|
@@ -4,11 +4,7 @@ module LotusAdmin
|
|
4
4
|
attr_accessor :action_mailer_default_sender_address
|
5
5
|
|
6
6
|
def routes(&block)
|
7
|
-
|
8
|
-
end
|
9
|
-
|
10
|
-
def routing_options
|
11
|
-
@routing_options ||= []
|
7
|
+
LotusAdmin.router.define(&block)
|
12
8
|
end
|
13
9
|
|
14
10
|
def filter_search_btn_css_classes
|
@@ -27,11 +23,5 @@ module LotusAdmin
|
|
27
23
|
def user_class
|
28
24
|
@user_class ||= user_class_name.constantize
|
29
25
|
end
|
30
|
-
|
31
|
-
def install_routes!(router)
|
32
|
-
routing_options.each do |routes|
|
33
|
-
router.instance_eval(&routes)
|
34
|
-
end
|
35
|
-
end
|
36
26
|
end
|
37
27
|
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
module LotusAdmin
|
2
|
+
class Router
|
3
|
+
def install(router, at: 'admin')
|
4
|
+
router.devise_for :administrators, devise_config
|
5
|
+
|
6
|
+
router.mount LotusAdmin::Engine, at: at
|
7
|
+
end
|
8
|
+
|
9
|
+
def resources(router)
|
10
|
+
resource_routes.each do |routes|
|
11
|
+
router.instance_eval(&routes)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
def define(&block)
|
16
|
+
resource_routes.push(block)
|
17
|
+
end
|
18
|
+
|
19
|
+
def resource_routes
|
20
|
+
@resource_routes ||= []
|
21
|
+
end
|
22
|
+
|
23
|
+
private
|
24
|
+
|
25
|
+
def devise_config
|
26
|
+
{
|
27
|
+
class_name: user_class_name,
|
28
|
+
skip: :registrations,
|
29
|
+
controllers: devise_controllers
|
30
|
+
}
|
31
|
+
end
|
32
|
+
|
33
|
+
def devise_controllers
|
34
|
+
{
|
35
|
+
confirmations: 'lotus_admin/confirmations',
|
36
|
+
sessions: 'lotus_admin/sessions',
|
37
|
+
passwords: 'lotus_admin/passwords'
|
38
|
+
}
|
39
|
+
end
|
40
|
+
|
41
|
+
def user_class_name
|
42
|
+
LotusAdmin.configuration.user_class_name
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
data/lib/lotus_admin/version.rb
CHANGED
data/lib/lotus_admin.rb
CHANGED
@@ -19,6 +19,7 @@ require 'kaminari'
|
|
19
19
|
require 'ransack'
|
20
20
|
|
21
21
|
require 'lotus_admin/configuration'
|
22
|
+
require 'lotus_admin/router'
|
22
23
|
|
23
24
|
module LotusAdmin
|
24
25
|
module_function
|
@@ -31,7 +32,7 @@ module LotusAdmin
|
|
31
32
|
@configuration ||= Configuration.new
|
32
33
|
end
|
33
34
|
|
34
|
-
def
|
35
|
-
|
35
|
+
def router
|
36
|
+
@router ||= Router.new
|
36
37
|
end
|
37
38
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lotus_admin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Millsaps-Brewer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-03-
|
11
|
+
date: 2020-03-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -435,6 +435,7 @@ files:
|
|
435
435
|
- lib/lotus_admin.rb
|
436
436
|
- lib/lotus_admin/configuration.rb
|
437
437
|
- lib/lotus_admin/engine.rb
|
438
|
+
- lib/lotus_admin/router.rb
|
438
439
|
- lib/lotus_admin/version.rb
|
439
440
|
- lib/tasks/lotus_admin_tasks.rake
|
440
441
|
- lib/templates/erb/scaffold/_form.html.erb
|