five-two-nw-olivander 0.1.2.15 → 0.1.2.17
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/adminlte.css +3 -1
- data/app/controllers/concerns/olivander/resources/route_builder.rb +4 -0
- data/app/helpers/olivander/application_helper.rb +9 -1
- data/app/views/application/_form.html.haml +1 -1
- data/app/views/application/index.html.haml +2 -2
- data/app/views/layouts/olivander/adminlte/_sidebar.html.haml +1 -1
- data/app/views/layouts/olivander/adminlte/main.html.haml +1 -0
- data/lib/olivander/application_context.rb +3 -2
- data/lib/olivander/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 60ef0e4f6cf44268d5836df99ce2f7548b77f6494a1de083ec0374c58c5f823c
|
4
|
+
data.tar.gz: 56d4c32092f2fd4dbeca7f8470fb26f01a23b0a3f2f38e10a734119a745a39c3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b58d17599c9bff68932f749af403b809bd7080a7e77fb9dacb943e5f5558e26010ea0cea38e461fa11abaf4847c3bdd81de376622c96c83b32e72df2208418d2
|
7
|
+
data.tar.gz: d2345d025f1460ea4c3a2c7b806885eb514cda39e284400e773da772ac68ebc64596d11841b5a11ae393ffdd3ea5d041e5bc5d580bff50eb79ec5003118167fa
|
@@ -90,6 +90,10 @@ module Olivander
|
|
90
90
|
end
|
91
91
|
|
92
92
|
class_methods do
|
93
|
+
def resource_action(model, action)
|
94
|
+
resources[model].actions.select{ |x| x.sym == action }.first
|
95
|
+
end
|
96
|
+
|
93
97
|
def resource(model, only: DEFAULT_CRUD_ACTIONS, except: [], &block)
|
94
98
|
self.current_resource = RoutedResource.new(model, DEFAULT_CRUD_ACTIONS & (only - except))
|
95
99
|
yield if block_given?
|
@@ -32,9 +32,17 @@ module Olivander
|
|
32
32
|
def resource_form_actions(route_builder, resource, for_action: :show)
|
33
33
|
[].tap do |output|
|
34
34
|
authorized_resource_actions(route_builder, resource, for_action: for_action).select{ |x| x.show_in_form }.each do |a|
|
35
|
-
output << link_to(a.sym, {controller: a.controller, action: a.action}, method: a.verb, class: 'btn btn-
|
35
|
+
output << link_to(a.sym, {controller: a.controller, action: a.action}, method: a.verb, class: 'btn btn-tool', data: { turbo: true })
|
36
36
|
end
|
37
37
|
end.join(' ').html_safe
|
38
38
|
end
|
39
|
+
|
40
|
+
def current_user
|
41
|
+
controller.respond_to?(:current_user) ? controller.current_user : nil
|
42
|
+
end
|
43
|
+
|
44
|
+
def current_ability
|
45
|
+
controller.respond_to?(:current_ability) ? controller.current_ability : nil
|
46
|
+
end
|
39
47
|
end
|
40
48
|
end
|
@@ -24,7 +24,7 @@
|
|
24
24
|
|
25
25
|
.row
|
26
26
|
.col-12
|
27
|
-
.card
|
27
|
+
.card.card-primary
|
28
28
|
.card-header
|
29
29
|
%h3.card-title= @page_title
|
30
30
|
.card-tools
|
@@ -48,4 +48,4 @@
|
|
48
48
|
- begin
|
49
49
|
= render partial: 'index_additional'
|
50
50
|
- rescue ActionView::MissingTemplate
|
51
|
-
- Rails.logger.debug "did not find additional index partial"
|
51
|
+
- Rails.logger.debug "did not find additional index partial"
|
@@ -11,7 +11,7 @@
|
|
11
11
|
.image
|
12
12
|
%img.img-circle.elevation-2{:alt => "User Image", :src => image_path(user_image_path(nil))}/
|
13
13
|
.info
|
14
|
-
= link_to
|
14
|
+
= link_to current_user, @context.sign_out_path, method: :delete, class: 'd-block'
|
15
15
|
/ SidebarSearch Form
|
16
16
|
.form-inline
|
17
17
|
.input-group{"data-widget" => "sidebar-search"}
|
@@ -12,6 +12,7 @@
|
|
12
12
|
= render partial: 'layouts/olivander/adminlte/sidebar'
|
13
13
|
-# = render partial: 'layouts/olivander/adminlte/content'
|
14
14
|
= render partial: @content_partial || 'layouts/olivander/adminlte/content', locals: { content: yield }
|
15
|
+
= turbo_frame_tag 'modal'
|
15
16
|
= render partial: 'layouts/olivander/adminlte/flashes'
|
16
17
|
= render partial: 'layouts/olivander/adminlte/footer'
|
17
18
|
= render partial: 'layouts/olivander/adminlte/control_sidebar'
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module Olivander
|
2
2
|
class ApplicationContext
|
3
|
-
attr_accessor :name, :logo, :company, :menu_items, :route_builder
|
3
|
+
attr_accessor :name, :logo, :company, :menu_items, :route_builder, :sign_out_path
|
4
4
|
|
5
5
|
def self.default
|
6
6
|
ctx = ApplicationContext.new
|
@@ -8,10 +8,11 @@ module Olivander
|
|
8
8
|
ctx
|
9
9
|
end
|
10
10
|
|
11
|
-
def initialize(name: 'Application Name', logo: Logo.new, company: Company.new, menu_items: [])
|
11
|
+
def initialize(name: 'Application Name', logo: Logo.new, company: Company.new, sign_out_path: '/sign_out', menu_items: [])
|
12
12
|
self.name = name
|
13
13
|
self.logo = logo
|
14
14
|
self.company = company
|
15
|
+
self.sign_out_path = sign_out_path
|
15
16
|
self.menu_items = menu_items
|
16
17
|
end
|
17
18
|
|
data/lib/olivander/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: five-two-nw-olivander
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.2.
|
4
|
+
version: 0.1.2.17
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eric Dennis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-07-
|
11
|
+
date: 2023-07-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: chartkick
|