five-two-nw-olivander 0.1.2 → 0.1.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/datatables/olivander/datatable.rb +18 -0
- data/app/views/application/edit.html.haml +11 -0
- data/app/views/application/index.html.haml +24 -0
- data/app/views/application/new.html.haml +11 -0
- data/app/views/application/show.html.haml +14 -0
- data/lib/olivander/version.rb +1 -1
- metadata +21 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fc230db07c2624d5ca4398239976b374c1fcdec0a4d741a27387f7ecfd3705dd
|
4
|
+
data.tar.gz: 45767c0b8bfca58e6ce48672e6c8bc310baec3bc15c2bedf8f34d95e330085a0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b96d61fa31cb64a25fd0ceb3097979d4874763f88891fc503318a7b3f30fde73f306e9973525205f3876b9ea07739f7f4c45b4fa24c814289bcf2564984d0077
|
7
|
+
data.tar.gz: 74ca5454b8081887b6c16ede1e4fa941248bc8854d41998dab7007011b07fe548efc6b970b1f5ccc6999b58d15a4a90fdb4e328e1b20992e0404c1397186a9fd
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module Olivander
|
2
|
+
class Datatable < Effective::Datatable
|
3
|
+
def link_col(field, path, path_args)
|
4
|
+
dsl_tool.col(field) do |r|
|
5
|
+
args = [].tap do |arr|
|
6
|
+
if path_args.is_a? Array
|
7
|
+
path_args.each do |arg|
|
8
|
+
arr << r.send(arg)
|
9
|
+
end
|
10
|
+
else
|
11
|
+
arr << r.send(path_args)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
link_to r.send(field), send(path, args)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
- resource = (@_effective_resource || Effective::Resource.new(controller_path))
|
2
|
+
- @resource = instance_variable_get('@' + resource.name) if resource.name
|
3
|
+
|
4
|
+
- if @resource
|
5
|
+
.row
|
6
|
+
.col-8
|
7
|
+
%h1= @page_title
|
8
|
+
.col-4.text-right
|
9
|
+
= render_resource_buttons(@resource, edit: false)
|
10
|
+
|
11
|
+
= render_resource_form(@resource)
|
@@ -0,0 +1,24 @@
|
|
1
|
+
- resource = (@_effective_resource || Effective::Resource.new(controller_path))
|
2
|
+
|
3
|
+
.row
|
4
|
+
.col-12
|
5
|
+
.card
|
6
|
+
.card-header
|
7
|
+
%h1= @page_title
|
8
|
+
.card-body
|
9
|
+
- if @datatable
|
10
|
+
= render_datatable(@datatable)
|
11
|
+
|
12
|
+
- elsif instance_variable_get('@' + resource.plural_name).respond_to?(:to_partial_path)
|
13
|
+
= render instance_variable_get('@' + resource.plural_name)
|
14
|
+
|
15
|
+
- elsif instance_variable_get('@' + resource.name).respond_to?(:to_partial_path)
|
16
|
+
= render instance_variable_get('@' + resource.name)
|
17
|
+
|
18
|
+
- elsif Rails.env.development?
|
19
|
+
%p effective_resources index view is not sure what to render.
|
20
|
+
%p Define an @datatable, @#{resource.try(:plural_name) || 'a plural'}, or @#{resource.try(:name) || 'a singular'}.
|
21
|
+
%p or include Effective::CrudController in your controller
|
22
|
+
.card-footer
|
23
|
+
= render_resource_buttons(resource.klass, (action ||= :index) => false)
|
24
|
+
|
@@ -0,0 +1,11 @@
|
|
1
|
+
- resource = (@_effective_resource || Effective::Resource.new(controller_path))
|
2
|
+
- @resource = instance_variable_get('@' + resource.name) if resource.name
|
3
|
+
|
4
|
+
- if @resource
|
5
|
+
.row
|
6
|
+
.col-8
|
7
|
+
%h1= @page_title
|
8
|
+
.col-4.text-right
|
9
|
+
= render_resource_buttons(@resource)
|
10
|
+
|
11
|
+
= render_resource_form(@resource)
|
@@ -0,0 +1,14 @@
|
|
1
|
+
- resource = (@_effective_resource || Effective::Resource.new(controller_path))
|
2
|
+
- @resource = instance_variable_get('@' + resource.name) if resource.name
|
3
|
+
|
4
|
+
- if @resource
|
5
|
+
.row
|
6
|
+
.col-8
|
7
|
+
%h1= @page_title
|
8
|
+
.col-4.text-right
|
9
|
+
= render_resource_buttons(@resource, show: false)
|
10
|
+
|
11
|
+
= render_resource_partial(@resource)
|
12
|
+
|
13
|
+
.form-actions
|
14
|
+
= link_to 'Continue', (resource.action_path(:index) || root_path), class: 'btn btn-primary'
|
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.1
|
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-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: chartkick
|
@@ -80,6 +80,20 @@ dependencies:
|
|
80
80
|
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: 3.2.0
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: simple_form
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '5.1'
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '5.1'
|
83
97
|
- !ruby/object:Gem::Dependency
|
84
98
|
name: view_component
|
85
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -162,11 +176,16 @@ files:
|
|
162
176
|
- app/controllers/olivander/resources/crud_controller.rb
|
163
177
|
- app/controllers/olivander/resources/default_crud_chain.rb
|
164
178
|
- app/controllers/olivander/test_controller.rb
|
179
|
+
- app/datatables/olivander/datatable.rb
|
165
180
|
- app/datatables/test_datatable.rb
|
166
181
|
- app/helpers/olivander/application_helper.rb
|
167
182
|
- app/jobs/olivander/application_job.rb
|
168
183
|
- app/mailers/olivander/application_mailer.rb
|
169
184
|
- app/models/olivander/application_record.rb
|
185
|
+
- app/views/application/edit.html.haml
|
186
|
+
- app/views/application/index.html.haml
|
187
|
+
- app/views/application/new.html.haml
|
188
|
+
- app/views/application/show.html.haml
|
170
189
|
- app/views/layouts/olivander/adminlte/_content.html.haml
|
171
190
|
- app/views/layouts/olivander/adminlte/_content_kanban.html.haml
|
172
191
|
- app/views/layouts/olivander/adminlte/_control_sidebar.html.haml
|