lotus_admin 1.2.2 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/stylesheets/lotus_admin/components/_all.scss +1 -0
- data/app/assets/stylesheets/lotus_admin/components/_badges.scss +23 -0
- data/app/controllers/concerns/lotus_admin/decorations.rb +29 -0
- data/app/controllers/concerns/lotus_admin/filterable_controller.rb +6 -1
- data/app/controllers/lotus_admin/authenticated_controller.rb +1 -0
- data/app/decorators/lotus_admin/application_decorator.rb +11 -0
- data/app/decorators/lotus_admin/paginating_decorator.rb +3 -0
- data/lib/lotus_admin/version.rb +1 -1
- data/lib/lotus_admin.rb +1 -0
- metadata +20 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3f1b026cfd1e070c4d1a0fff64c4d0214818a713c9cfbfaed3a0a476d870321e
|
4
|
+
data.tar.gz: cbe3427768813ca6c7c7df6a97bbf6b2a599a2904e1a1c91f3c3c89781a9a56b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 644eeb24a1917d4ce1cc6ee9385151b6e059f409a0618fc751b88f5476ffd2aa7bf669c050c6abd17f946b30a53cf017d76a16b3cbb4deac3f51e404abac4522
|
7
|
+
data.tar.gz: fbb8c7db19e309b90fed1d44ebc8697cba74420a043560f7a4a2450adbb8c6108e0cea5f06aaa8e888a8836a5bc04f83383050afd7a894fc42e303ad7dbddc3b
|
@@ -0,0 +1,23 @@
|
|
1
|
+
.badge {
|
2
|
+
background-color: $app-gray;
|
3
|
+
|
4
|
+
&.badge-primary {
|
5
|
+
background-color: $brand-primary;
|
6
|
+
}
|
7
|
+
|
8
|
+
&.badge-success {
|
9
|
+
background-color: $brand-success;
|
10
|
+
}
|
11
|
+
|
12
|
+
&.badge-info {
|
13
|
+
background-color: $brand-info;
|
14
|
+
}
|
15
|
+
|
16
|
+
&.badge-warning {
|
17
|
+
background-color: $brand-warning;
|
18
|
+
}
|
19
|
+
|
20
|
+
&.badge-error {
|
21
|
+
background-color: $brand-danger;
|
22
|
+
}
|
23
|
+
}
|
@@ -0,0 +1,29 @@
|
|
1
|
+
module LotusAdmin
|
2
|
+
module Decorations
|
3
|
+
extend ActiveSupport::Concern
|
4
|
+
|
5
|
+
class_methods do
|
6
|
+
def decorates_with(decorator_class_or_name)
|
7
|
+
self._decorator_class_name = decorator_class_or_name.to_s
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
included do
|
12
|
+
class_attribute :_decorator_class_name, instance_accessor: false
|
13
|
+
|
14
|
+
let(:collection) do
|
15
|
+
if self.class._decorator_class_name.present?
|
16
|
+
self.class._decorator_class_name.constantize.decorate_collection(end_of_association_chain)
|
17
|
+
else
|
18
|
+
end_of_association_chain
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
let(:decorated_resource) do
|
23
|
+
if self.class._decorator_class_name.present?
|
24
|
+
self.class._decorator_class_name.constantize.decorate(resource)
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -18,7 +18,6 @@ module LotusAdmin
|
|
18
18
|
|
19
19
|
let(:filters_enabled?) { self.class.filters_enabled }
|
20
20
|
let(:ransack_object) { instance_exec(&self.class._beginning_of_scope_chain).ransack(params[:q]) }
|
21
|
-
let(:collection) { paginate(ransack_object.result) }
|
22
21
|
end
|
23
22
|
|
24
23
|
class_methods do
|
@@ -36,5 +35,11 @@ module LotusAdmin
|
|
36
35
|
self._beginning_of_scope_chain = block
|
37
36
|
end
|
38
37
|
end
|
38
|
+
|
39
|
+
private
|
40
|
+
|
41
|
+
def end_of_association_chain
|
42
|
+
paginate(ransack_object.result)
|
43
|
+
end
|
39
44
|
end
|
40
45
|
end
|
@@ -3,6 +3,7 @@ class LotusAdmin::AuthenticatedController < LotusAdmin::ApplicationController
|
|
3
3
|
include LotusAdmin::FilterableController
|
4
4
|
include LotusAdmin::ResourcefulController
|
5
5
|
include LotusAdmin::FileStreamer
|
6
|
+
include LotusAdmin::Decorations
|
6
7
|
|
7
8
|
before_action :authenticate_administrator!
|
8
9
|
around_action :use_user_time_zone, if: :administrator_signed_in?
|
data/lib/lotus_admin/version.rb
CHANGED
data/lib/lotus_admin.rb
CHANGED
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.
|
4
|
+
version: 1.3.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: 2020-03-
|
11
|
+
date: 2020-03-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -226,6 +226,20 @@ dependencies:
|
|
226
226
|
- - ">="
|
227
227
|
- !ruby/object:Gem::Version
|
228
228
|
version: '2.3'
|
229
|
+
- !ruby/object:Gem::Dependency
|
230
|
+
name: draper
|
231
|
+
requirement: !ruby/object:Gem::Requirement
|
232
|
+
requirements:
|
233
|
+
- - ">="
|
234
|
+
- !ruby/object:Gem::Version
|
235
|
+
version: '4.0'
|
236
|
+
type: :runtime
|
237
|
+
prerelease: false
|
238
|
+
version_requirements: !ruby/object:Gem::Requirement
|
239
|
+
requirements:
|
240
|
+
- - ">="
|
241
|
+
- !ruby/object:Gem::Version
|
242
|
+
version: '4.0'
|
229
243
|
- !ruby/object:Gem::Dependency
|
230
244
|
name: pg
|
231
245
|
requirement: !ruby/object:Gem::Requirement
|
@@ -343,11 +357,13 @@ files:
|
|
343
357
|
- app/assets/stylesheets/lotus_admin/application.css.scss
|
344
358
|
- app/assets/stylesheets/lotus_admin/components/_alerts.scss
|
345
359
|
- app/assets/stylesheets/lotus_admin/components/_all.scss
|
360
|
+
- app/assets/stylesheets/lotus_admin/components/_badges.scss
|
346
361
|
- app/assets/stylesheets/lotus_admin/components/_datepicker.scss
|
347
362
|
- app/assets/stylesheets/lotus_admin/components/_devise.scss
|
348
363
|
- app/assets/stylesheets/lotus_admin/components/_filters.scss
|
349
364
|
- app/assets/stylesheets/lotus_admin/components/_forms.scss
|
350
365
|
- app/assets/stylesheets/lotus_admin/components/_tables.scss
|
366
|
+
- app/controllers/concerns/lotus_admin/decorations.rb
|
351
367
|
- app/controllers/concerns/lotus_admin/devise_controllers.rb
|
352
368
|
- app/controllers/concerns/lotus_admin/exposure.rb
|
353
369
|
- app/controllers/concerns/lotus_admin/file_streamer.rb
|
@@ -363,6 +379,8 @@ files:
|
|
363
379
|
- app/controllers/lotus_admin/resource_controller.rb
|
364
380
|
- app/controllers/lotus_admin/sessions_controller.rb
|
365
381
|
- app/controllers/lotus_admin/users_controller.rb
|
382
|
+
- app/decorators/lotus_admin/application_decorator.rb
|
383
|
+
- app/decorators/lotus_admin/paginating_decorator.rb
|
366
384
|
- app/helpers/lotus_admin/application_helper.rb
|
367
385
|
- app/helpers/lotus_admin/filter_helpers.rb
|
368
386
|
- app/helpers/lotus_admin/form_helpers.rb
|