lotus_admin 0.5.1 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/README.md +11 -10
- data/app/controllers/lotus_admin/profiles_controller.rb +1 -1
- data/app/controllers/lotus_admin/users_controller.rb +1 -1
- data/app/mailers/lotus_admin/application_mailer.rb +1 -1
- data/app/views/layouts/lotus_admin/_sidebar_items.html.haml +2 -2
- data/config/initializers/devise.rb +2 -2
- data/config/routes.rb +1 -1
- data/lib/lotus_admin/configuration.rb +20 -0
- data/lib/lotus_admin/version.rb +1 -1
- data/lib/lotus_admin.rb +1 -3
- data/lib/tasks/lotus_admin_tasks.rake +1 -1
- data/spec/factories/users.rb +1 -1
- data/vendor/assets/stylesheets/lotus_admin/theme/inc/mixin.scss +2 -2
- metadata +43 -38
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: ca7667ec6d3d57d5e7656adbf615844998d4e1e452242bab411d91f3fa67bcca
|
4
|
+
data.tar.gz: ed86a00d57f807c58e02033ccf13f40de08f0a908c4f205bc964fe2ed5bb8e82
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 890614c3de41babfa7341d1bdffa368949eff041e4ae24ccb67d0f7c5add598d096aab409abd58a3b2d4e62bc79d7472472fcedb8249536103524172829b01c4
|
7
|
+
data.tar.gz: 564b94f2a43f90332b2e4dda37aee8fe1443d066d41831bca6ba5ec4a315b183560c76ddbcd7042e662ed6bf6c99ee48714badeda6b6d7d63758d7f33a0a883e
|
data/README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# Lotus Admin
|
2
2
|
Provides a simple, Bootstrap 3 Material Design UI to administer your web app.
|
3
3
|
|
4
|
-
[
|
4
|
+
[![Codeship Status for madebylotus/lotus-admin](https://app.codeship.com/projects/04334aa0-4c21-0138-9bf4-724cafe37732/status?branch=master)](https://app.codeship.com/projects/389417)
|
5
5
|
|
6
6
|
## Usage
|
7
7
|
Install and subclass any controllers, models, or views as needed.
|
@@ -10,13 +10,8 @@ Install and subclass any controllers, models, or views as needed.
|
|
10
10
|
Add this line to your application's Gemfile and then mount the engine in your application.
|
11
11
|
|
12
12
|
### Requirements
|
13
|
-
* Ruby 2.
|
14
|
-
* Rails
|
15
|
-
|
16
|
-
### Required Secrets
|
17
|
-
You will need to define these secrets.
|
18
|
-
|
19
|
-
* `action_mailer_default_sender_address`
|
13
|
+
* Ruby 2.6
|
14
|
+
* Rails 6
|
20
15
|
|
21
16
|
### Setup
|
22
17
|
|
@@ -31,7 +26,7 @@ require 'rails/all'
|
|
31
26
|
|
32
27
|
```ruby
|
33
28
|
# Gemfile
|
34
|
-
gem 'lotus_admin', '~>
|
29
|
+
gem 'lotus_admin', '~> 1.0'
|
35
30
|
```
|
36
31
|
|
37
32
|
And then execute:
|
@@ -59,12 +54,18 @@ There are many partials and SCSS variables that can be overwritten to customize
|
|
59
54
|
To get started, provide any SCSS variables in a file at `app/assets/stylesheets/lotus_admin/_variables.scss`.
|
60
55
|
|
61
56
|
## Configuration
|
62
|
-
You may configure the engine by providing an
|
57
|
+
You may configure the engine by providing an initializer:
|
63
58
|
|
64
59
|
```ruby
|
65
60
|
# conifg/initializers/lotus_admin.rb
|
66
61
|
LotusAdmin.configure do |config|
|
67
62
|
|
63
|
+
# set the default sender address for the included mailer
|
64
|
+
config.action_mailer_default_sender_address = "<value from wherever, credentials, secrets, etc>"
|
65
|
+
|
66
|
+
# use a custom user class, ideally subclassing from LotusAdmin::User, even if using a different table
|
67
|
+
config.user_class_name = "MyUser"
|
68
|
+
|
68
69
|
# perhaps add more custom resources
|
69
70
|
config.routes do
|
70
71
|
resources :cats, only: :show
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module LotusAdmin
|
2
2
|
class ProfilesController < LotusAdmin::AuthenticatedController
|
3
|
-
let(:resource_class) { LotusAdmin
|
3
|
+
let(:resource_class) { LotusAdmin.configuration.user_class }
|
4
4
|
|
5
5
|
permit_params do |params|
|
6
6
|
params.permit(:first_name, :last_name, :email, :time_zone, :password, :password_confirmation).delete_if do |k,v|
|
@@ -4,6 +4,6 @@
|
|
4
4
|
Dashboard
|
5
5
|
|
6
6
|
= sidebar_item(:users_index) do
|
7
|
-
= link_to lotus_admin.polymorphic_path([ LotusAdmin
|
7
|
+
= link_to lotus_admin.polymorphic_path([ LotusAdmin.configuration.user_class ]) do
|
8
8
|
%i.zmdi.zmdi-accounts
|
9
|
-
= LotusAdmin
|
9
|
+
= LotusAdmin.configuration.user_class.model_name.human(count: 2)
|
@@ -14,13 +14,13 @@ Devise.setup do |config|
|
|
14
14
|
# Configure the e-mail address which will be shown in Devise::Mailer,
|
15
15
|
# note that it will be overwritten if you use your own mailer class
|
16
16
|
# with default "from" parameter.
|
17
|
-
config.mailer_sender =
|
17
|
+
# config.mailer_sender = LotusAdmin.configuration.action_mailer_default_sender_address
|
18
18
|
|
19
19
|
# Configure the class responsible to send e-mails.
|
20
20
|
# config.mailer = 'Devise::Mailer'
|
21
21
|
|
22
22
|
# Configure the parent class responsible to send e-mails.
|
23
|
-
|
23
|
+
config.parent_mailer = 'LotusAdmin::ApplicationMailer'
|
24
24
|
|
25
25
|
# ==> ORM configuration
|
26
26
|
# Load and configure the ORM. Supports :active_record (default) and
|
data/config/routes.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
module LotusAdmin
|
2
2
|
class Configuration
|
3
3
|
attr_accessor :filter_search_btn_css_classes
|
4
|
+
attr_accessor :action_mailer_default_sender_address
|
4
5
|
|
5
6
|
def routes(&block)
|
6
7
|
routing_options.push(block)
|
@@ -13,5 +14,24 @@ module LotusAdmin
|
|
13
14
|
def filter_search_btn_css_classes
|
14
15
|
@filter_search_btn_css_classes ||= %w(filter-toggle-btn btn-js)
|
15
16
|
end
|
17
|
+
|
18
|
+
def user_class_name
|
19
|
+
@user_class_name ||= 'LotusAdmin::User'
|
20
|
+
end
|
21
|
+
|
22
|
+
def user_class_name=(value)
|
23
|
+
@user_class_name = value
|
24
|
+
@user_class = nil
|
25
|
+
end
|
26
|
+
|
27
|
+
def user_class
|
28
|
+
@user_class ||= user_class_name.constantize
|
29
|
+
end
|
30
|
+
|
31
|
+
def install_routes!(router)
|
32
|
+
routing_options.each do |routes|
|
33
|
+
router.instance_eval(&routes)
|
34
|
+
end
|
35
|
+
end
|
16
36
|
end
|
17
37
|
end
|
data/lib/lotus_admin/version.rb
CHANGED
data/lib/lotus_admin.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
namespace :lotus_admin do
|
2
2
|
desc 'Seed with First Administrator'
|
3
3
|
task seed: :environment do
|
4
|
-
LotusAdmin
|
4
|
+
LotusAdmin.configuration.user_class.create!(first_name: 'Johnny', last_name: 'Appleseed', email: 'admin@example.com', password: 'password')
|
5
5
|
end
|
6
6
|
end
|
data/spec/factories/users.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
FactoryBot.define do
|
2
|
-
factory :administrator, class:
|
2
|
+
factory :administrator, class: LotusAdmin.configuration.user_class_name do
|
3
3
|
first_name { 'Johnny' }
|
4
4
|
sequence(:last_name) { |n| "Appleseed #{ n }" }
|
5
5
|
sequence(:email) { |n| "user+#{ n }@gmail.com" }
|
@@ -89,7 +89,7 @@
|
|
89
89
|
&:focus,
|
90
90
|
&.focus,
|
91
91
|
&:active,
|
92
|
-
.open > .dropdown-toggle
|
92
|
+
.open > .dropdown-toggle {
|
93
93
|
color: $color;
|
94
94
|
background-color: $background;
|
95
95
|
border-color: transparent;
|
@@ -104,7 +104,7 @@
|
|
104
104
|
}
|
105
105
|
&:active,
|
106
106
|
&.active,
|
107
|
-
.open > .dropdown-toggle
|
107
|
+
.open > .dropdown-toggle {
|
108
108
|
background-image: none;
|
109
109
|
}
|
110
110
|
&.disabled,
|
metadata
CHANGED
@@ -1,29 +1,35 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lotus_admin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
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:
|
11
|
+
date: 2020-03-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 6.0.2
|
20
|
+
- - "<"
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: '6.1'
|
20
23
|
type: :runtime
|
21
24
|
prerelease: false
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
23
26
|
requirements:
|
24
|
-
- - "
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 6.0.2
|
30
|
+
- - "<"
|
25
31
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
32
|
+
version: '6.1'
|
27
33
|
- !ruby/object:Gem::Dependency
|
28
34
|
name: devise
|
29
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -72,14 +78,14 @@ dependencies:
|
|
72
78
|
requirements:
|
73
79
|
- - "~>"
|
74
80
|
- !ruby/object:Gem::Version
|
75
|
-
version: '
|
81
|
+
version: '6.0'
|
76
82
|
type: :runtime
|
77
83
|
prerelease: false
|
78
84
|
version_requirements: !ruby/object:Gem::Requirement
|
79
85
|
requirements:
|
80
86
|
- - "~>"
|
81
87
|
- !ruby/object:Gem::Version
|
82
|
-
version: '
|
88
|
+
version: '6.0'
|
83
89
|
- !ruby/object:Gem::Dependency
|
84
90
|
name: uglifier
|
85
91
|
requirement: !ruby/object:Gem::Requirement
|
@@ -114,28 +120,28 @@ dependencies:
|
|
114
120
|
requirements:
|
115
121
|
- - "~>"
|
116
122
|
- !ruby/object:Gem::Version
|
117
|
-
version: 3.
|
123
|
+
version: '3.4'
|
118
124
|
type: :runtime
|
119
125
|
prerelease: false
|
120
126
|
version_requirements: !ruby/object:Gem::Requirement
|
121
127
|
requirements:
|
122
128
|
- - "~>"
|
123
129
|
- !ruby/object:Gem::Version
|
124
|
-
version: 3.
|
130
|
+
version: '3.4'
|
125
131
|
- !ruby/object:Gem::Dependency
|
126
132
|
name: coffee-rails
|
127
133
|
requirement: !ruby/object:Gem::Requirement
|
128
134
|
requirements:
|
129
135
|
- - "~>"
|
130
136
|
- !ruby/object:Gem::Version
|
131
|
-
version: '
|
137
|
+
version: '5.0'
|
132
138
|
type: :runtime
|
133
139
|
prerelease: false
|
134
140
|
version_requirements: !ruby/object:Gem::Requirement
|
135
141
|
requirements:
|
136
142
|
- - "~>"
|
137
143
|
- !ruby/object:Gem::Version
|
138
|
-
version: '
|
144
|
+
version: '5.0'
|
139
145
|
- !ruby/object:Gem::Dependency
|
140
146
|
name: font-awesome-rails
|
141
147
|
requirement: !ruby/object:Gem::Requirement
|
@@ -156,14 +162,14 @@ dependencies:
|
|
156
162
|
requirements:
|
157
163
|
- - "~>"
|
158
164
|
- !ruby/object:Gem::Version
|
159
|
-
version: 2.
|
165
|
+
version: '2.20'
|
160
166
|
type: :runtime
|
161
167
|
prerelease: false
|
162
168
|
version_requirements: !ruby/object:Gem::Requirement
|
163
169
|
requirements:
|
164
170
|
- - "~>"
|
165
171
|
- !ruby/object:Gem::Version
|
166
|
-
version: 2.
|
172
|
+
version: '2.20'
|
167
173
|
- !ruby/object:Gem::Dependency
|
168
174
|
name: bootstrap3-datetimepicker-rails
|
169
175
|
requirement: !ruby/object:Gem::Requirement
|
@@ -184,84 +190,84 @@ dependencies:
|
|
184
190
|
requirements:
|
185
191
|
- - "~>"
|
186
192
|
- !ruby/object:Gem::Version
|
187
|
-
version: '
|
193
|
+
version: '4.0'
|
188
194
|
type: :runtime
|
189
195
|
prerelease: false
|
190
196
|
version_requirements: !ruby/object:Gem::Requirement
|
191
197
|
requirements:
|
192
198
|
- - "~>"
|
193
199
|
- !ruby/object:Gem::Version
|
194
|
-
version: '
|
200
|
+
version: '4.0'
|
195
201
|
- !ruby/object:Gem::Dependency
|
196
202
|
name: kaminari
|
197
203
|
requirement: !ruby/object:Gem::Requirement
|
198
204
|
requirements:
|
199
205
|
- - "~>"
|
200
206
|
- !ruby/object:Gem::Version
|
201
|
-
version: '1.
|
207
|
+
version: '1.2'
|
202
208
|
type: :runtime
|
203
209
|
prerelease: false
|
204
210
|
version_requirements: !ruby/object:Gem::Requirement
|
205
211
|
requirements:
|
206
212
|
- - "~>"
|
207
213
|
- !ruby/object:Gem::Version
|
208
|
-
version: '1.
|
214
|
+
version: '1.2'
|
209
215
|
- !ruby/object:Gem::Dependency
|
210
216
|
name: ransack
|
211
217
|
requirement: !ruby/object:Gem::Requirement
|
212
218
|
requirements:
|
213
219
|
- - ">="
|
214
220
|
- !ruby/object:Gem::Version
|
215
|
-
version: '
|
221
|
+
version: '2.3'
|
216
222
|
type: :runtime
|
217
223
|
prerelease: false
|
218
224
|
version_requirements: !ruby/object:Gem::Requirement
|
219
225
|
requirements:
|
220
226
|
- - ">="
|
221
227
|
- !ruby/object:Gem::Version
|
222
|
-
version: '
|
228
|
+
version: '2.3'
|
223
229
|
- !ruby/object:Gem::Dependency
|
224
230
|
name: pg
|
225
231
|
requirement: !ruby/object:Gem::Requirement
|
226
232
|
requirements:
|
227
|
-
- - "
|
233
|
+
- - ">="
|
228
234
|
- !ruby/object:Gem::Version
|
229
|
-
version: '0
|
235
|
+
version: '1.0'
|
230
236
|
type: :development
|
231
237
|
prerelease: false
|
232
238
|
version_requirements: !ruby/object:Gem::Requirement
|
233
239
|
requirements:
|
234
|
-
- - "
|
240
|
+
- - ">="
|
235
241
|
- !ruby/object:Gem::Version
|
236
|
-
version: '0
|
242
|
+
version: '1.0'
|
237
243
|
- !ruby/object:Gem::Dependency
|
238
244
|
name: byebug
|
239
245
|
requirement: !ruby/object:Gem::Requirement
|
240
246
|
requirements:
|
241
|
-
- - "
|
247
|
+
- - ">="
|
242
248
|
- !ruby/object:Gem::Version
|
243
|
-
version: '
|
249
|
+
version: '11.0'
|
244
250
|
type: :development
|
245
251
|
prerelease: false
|
246
252
|
version_requirements: !ruby/object:Gem::Requirement
|
247
253
|
requirements:
|
248
|
-
- - "
|
254
|
+
- - ">="
|
249
255
|
- !ruby/object:Gem::Version
|
250
|
-
version: '
|
256
|
+
version: '11.0'
|
251
257
|
- !ruby/object:Gem::Dependency
|
252
258
|
name: rspec-rails
|
253
259
|
requirement: !ruby/object:Gem::Requirement
|
254
260
|
requirements:
|
255
|
-
- - "
|
261
|
+
- - ">="
|
256
262
|
- !ruby/object:Gem::Version
|
257
|
-
version: '3.
|
263
|
+
version: '3.8'
|
258
264
|
type: :development
|
259
265
|
prerelease: false
|
260
266
|
version_requirements: !ruby/object:Gem::Requirement
|
261
267
|
requirements:
|
262
|
-
- - "
|
268
|
+
- - ">="
|
263
269
|
- !ruby/object:Gem::Version
|
264
|
-
version: '3.
|
270
|
+
version: '3.8'
|
265
271
|
- !ruby/object:Gem::Dependency
|
266
272
|
name: factory_bot_rails
|
267
273
|
requirement: !ruby/object:Gem::Requirement
|
@@ -282,28 +288,28 @@ dependencies:
|
|
282
288
|
requirements:
|
283
289
|
- - "~>"
|
284
290
|
- !ruby/object:Gem::Version
|
285
|
-
version: '3
|
291
|
+
version: '4.3'
|
286
292
|
type: :development
|
287
293
|
prerelease: false
|
288
294
|
version_requirements: !ruby/object:Gem::Requirement
|
289
295
|
requirements:
|
290
296
|
- - "~>"
|
291
297
|
- !ruby/object:Gem::Version
|
292
|
-
version: '3
|
298
|
+
version: '4.3'
|
293
299
|
- !ruby/object:Gem::Dependency
|
294
300
|
name: letter_opener
|
295
301
|
requirement: !ruby/object:Gem::Requirement
|
296
302
|
requirements:
|
297
303
|
- - "~>"
|
298
304
|
- !ruby/object:Gem::Version
|
299
|
-
version: '1.
|
305
|
+
version: '1.7'
|
300
306
|
type: :development
|
301
307
|
prerelease: false
|
302
308
|
version_requirements: !ruby/object:Gem::Requirement
|
303
309
|
requirements:
|
304
310
|
- - "~>"
|
305
311
|
- !ruby/object:Gem::Version
|
306
|
-
version: '1.
|
312
|
+
version: '1.7'
|
307
313
|
- !ruby/object:Gem::Dependency
|
308
314
|
name: capybara
|
309
315
|
requirement: !ruby/object:Gem::Requirement
|
@@ -472,8 +478,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
472
478
|
- !ruby/object:Gem::Version
|
473
479
|
version: '0'
|
474
480
|
requirements: []
|
475
|
-
|
476
|
-
rubygems_version: 2.6.13
|
481
|
+
rubygems_version: 3.0.3
|
477
482
|
signing_key:
|
478
483
|
specification_version: 4
|
479
484
|
summary: Bootstrap 3 Material Design Simple Admin Interface.
|