five-two-nw-olivander 0.1.2.42 → 0.1.2.43.a

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/fonts/summernote.eot +0 -0
  3. data/app/assets/fonts/summernote.ttf +0 -0
  4. data/app/assets/fonts/summernote.woff +0 -0
  5. data/app/assets/fonts/summernote.woff2 +0 -0
  6. data/app/assets/javascripts/adminlte/plugins/select2/css/select2-bootstrap4.min.css +2 -0
  7. data/app/assets/javascripts/adminlte/plugins/select2/css/select2.css +481 -0
  8. data/app/assets/javascripts/adminlte/plugins/select2/css/select2.min.css +1 -0
  9. data/app/assets/javascripts/adminlte/plugins/select2/js/select2.full.min.js +2 -0
  10. data/app/assets/javascripts/adminlte/select2_defaults.coffee +23 -0
  11. data/app/assets/javascripts/adminlte.js +2 -0
  12. data/app/assets/javascripts/controllers/refresh_datatable_controller.js +1 -0
  13. data/app/assets/stylesheets/adminlte.css +2 -0
  14. data/app/assets/stylesheets/fa-fix.scss +12 -0
  15. data/app/components/olivander/components/portlet_component.html.haml +3 -3
  16. data/app/components/olivander/components/portlet_component.rb +11 -7
  17. data/app/components/olivander/components/table_portlet_component/table_component.html.haml +1 -1
  18. data/app/components/olivander/components/table_portlet_component.html.haml +3 -3
  19. data/app/components/olivander/components/table_portlet_component.rb +13 -8
  20. data/app/helpers/olivander/application_helper.rb +3 -1
  21. data/app/javascript/controllers/refresh_datatable_controller.js +3 -0
  22. data/app/views/application/edit.html.haml +1 -1
  23. data/lib/generators/olivander/active_record/migration/templates/create_table_migration.rb.tt +28 -0
  24. data/lib/generators/olivander/active_record/model/templates/model.rb.tt +32 -0
  25. data/lib/generators/olivander/active_record/model/templates/module.rb.tt +7 -0
  26. data/lib/generators/olivander/active_record_generator.rb +21 -0
  27. data/lib/generators/olivander/controller/templates/controller.rb.tt +8 -0
  28. data/lib/generators/olivander/controller_generator.rb +7 -0
  29. data/lib/generators/olivander/datatable/templates/datatable.rb.tt +0 -0
  30. data/lib/generators/olivander/datatable_generator.rb +13 -0
  31. data/lib/generators/olivander/install/USAGE +8 -0
  32. data/lib/generators/olivander/install/install_generator.rb +28 -0
  33. data/lib/generators/olivander/install/templates/context_builder.rb +3 -0
  34. data/lib/generators/olivander/install/templates/effective_datatables.rb +51 -0
  35. data/lib/generators/olivander/install/templates/effective_resources.rb +57 -0
  36. data/lib/generators/olivander/install/templates/favicon-dev.ico +0 -0
  37. data/lib/generators/olivander/install/templates/favicon.ico +0 -0
  38. data/lib/generators/olivander/install/templates/logo.png +0 -0
  39. data/lib/generators/olivander/install/templates/lograge.rb +32 -0
  40. data/lib/generators/olivander/install/templates/route_builder.rb +3 -0
  41. data/lib/generators/olivander/scaffold/USAGE +8 -0
  42. data/lib/generators/olivander/scaffold_generator.rb +26 -0
  43. data/lib/olivander/engine.rb +1 -1
  44. data/lib/olivander/version.rb +1 -1
  45. data/lib/olivander.rb +5 -1
  46. metadata +33 -4
@@ -0,0 +1,28 @@
1
+ module Olivander
2
+ class InstallGenerator < Rails::Generators::Base
3
+ source_root File.expand_path('templates', __dir__)
4
+
5
+ def effective_datatables
6
+ template 'effective_datatables.rb', 'config/initializers/effective_datatables.rb'
7
+ template 'effective_resources.rb', 'config/initializers/effective_resources.rb'
8
+ end
9
+
10
+ def lograge
11
+ template 'lograge.rb', 'config/initializers/lograge.rb'
12
+ end
13
+
14
+ def olivander_base_classes
15
+ inject_into_class "app/controllers/application_controller.rb", "ApplicationController" do
16
+ " include ::Olivander::ApplicationController\n"
17
+ end
18
+ inject_into_class "app/models/application_record.rb", "ApplicationRecord" do
19
+ " include ::Olivander::ApplicationRecord\n"
20
+ end
21
+ template 'logo.png', 'public/images/logo.png'
22
+ template 'favicon.ico', 'public/images/favicon.ico'
23
+ template 'favicon-dev.ico', 'public/images/favicon-dev.ico'
24
+ template 'route_builder.rb', 'app/services/route_builder.rb'
25
+ template 'context_builder.rb', 'app_services/context_builder.rb'
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,3 @@
1
+ class ContextBuilder
2
+ include ::Olivander::ContextBuilder
3
+ end
@@ -0,0 +1,51 @@
1
+ EffectiveDatatables.setup do |config|
2
+ # Authorization Method
3
+ #
4
+ # This method is called by all controller actions with the appropriate action and resource
5
+ # If it raises an exception or returns false, an Effective::AccessDenied Error will be raised
6
+ #
7
+ # Use via Proc:
8
+ # Proc.new { |controller, action, resource| authorize!(action, resource) } # CanCan
9
+ # Proc.new { |controller, action, resource| can?(action, resource) } # CanCan with skip_authorization_check
10
+ # Proc.new { |controller, action, resource| authorize "#{action}?", resource } # Pundit
11
+ # Proc.new { |controller, action, resource| current_user.is?(:admin) } # Custom logic
12
+ #
13
+ # Use via Boolean:
14
+ # config.authorization_method = true # Always authorized
15
+ # config.authorization_method = false # Always unauthorized
16
+ #
17
+ # Use via Method (probably in your application_controller.rb):
18
+ # config.authorization_method = :my_authorization_method
19
+ # def my_authorization_method(resource, action)
20
+ # true
21
+ # end
22
+ config.authorization_method = Proc.new { |controller, action, resource|
23
+ controller.can?(action, resource)
24
+ }
25
+
26
+ # Default number of entries shown per page
27
+ # Valid options are: 5, 10, 25, 50, 100, 250, 500, :all
28
+ config.default_length = 10
29
+
30
+ # Default class used on the <table> tag
31
+ config.html_class = 'table table-hover table-striped'
32
+
33
+ # Log search/sort information to the console
34
+ config.debug = false
35
+
36
+ # Use a cookie to save and restore state from previous page visits.
37
+ config.save_state = true
38
+
39
+ # Configure the _effective_dt cookie.
40
+ config.cookie_max_size = 1500 # String size. Final byte size is about 1.5 times bigger, after rails signs it
41
+ config.cookie_domain = :all # Should usually be :all
42
+ config.cookie_tld_length = nil # Leave nil to autodetect, or set to probably 2
43
+
44
+ # Date formatting
45
+ config.format_datetime = '%F %H:%M'
46
+ config.format_date = '%m/%d/%Y'
47
+ config.format_time = '%H:%M'
48
+
49
+ # Enable the Download button which serves a CSV of your collection
50
+ config.download = false
51
+ end
@@ -0,0 +1,57 @@
1
+ EffectiveResources.setup do |config|
2
+ # Authorization Method
3
+ #
4
+ # This method is called by all controller actions with the appropriate action and resource
5
+ # If it raises an exception or returns false, an Effective::AccessDenied Error will be raised
6
+ #
7
+ # Use via Proc:
8
+ # Proc.new { |controller, action, resource| authorize!(action, resource) } # CanCan
9
+ # Proc.new { |controller, action, resource| can?(action, resource) } # CanCan with skip_authorization_check
10
+ # Proc.new { |controller, action, resource| authorize "#{action}?", resource } # Pundit
11
+ # Proc.new { |controller, action, resource| current_user.is?(:admin) } # Custom logic
12
+ #
13
+ # Use via Boolean:
14
+ # config.authorization_method = true # Always authorized
15
+ # config.authorization_method = false # Always unauthorized
16
+ #
17
+ # Use via Method (probably in your application_controller.rb):
18
+ # config.authorization_method = :my_authorization_method
19
+ # def my_authorization_method(resource, action)
20
+ # true
21
+ # end
22
+ # config.authorization_method = Proc.new { |controller, action, resource| authorize!(action, resource) }
23
+ config.authorization_method = Proc.new { |controller, action, resource|
24
+ authorize!(action, resource)
25
+ }
26
+
27
+ # Default Submits
28
+ #
29
+ # These default submit actions will be added to each controller
30
+ # and rendered when calling effective_submit(f)
31
+ # based on the controller, and its `submits` if any.
32
+ #
33
+ # Supported values: 'Save', 'Continue', and 'Add New'
34
+ config.default_submits = ['Save', 'Continue', 'Add New']
35
+
36
+ # Mailer Settings
37
+ #
38
+ # The default mailer settings for all effective gems
39
+ #
40
+ # Configure the parent class responsible to send e-mails.
41
+ # config.parent_mailer = '::ApplicationMailer'
42
+
43
+ # Default deliver method
44
+ # config.deliver_method = :deliver_later
45
+
46
+ # Default layout
47
+ # config.mailer_layout = 'effective_mailer_layout'
48
+
49
+ # Customize the Subject
50
+ # config.mailer_subject = Proc.new { |action, subject, resource, opts = {}| subject }
51
+
52
+ # Default From
53
+ config.mailer_sender = '"Info" <info@example.com>'
54
+
55
+ # Send Admin correspondence To
56
+ config.mailer_admin = '"Admin" <admin@example.com>'
57
+ end
@@ -0,0 +1,32 @@
1
+ require 'colorized_string'
2
+
3
+ class ColorKeyValue < Lograge::Formatters::KeyValue
4
+ FIELDS_COLORS = {
5
+ method: :white,
6
+ path: :white,
7
+ format: :red,
8
+ controller: :green,
9
+ action: :green,
10
+ status: :yellow,
11
+ duration: :magenta,
12
+ view: :magenta,
13
+ db: :magenta,
14
+ time: :cyan,
15
+ ip: :red,
16
+ host: :red,
17
+ params: :green,
18
+ unpermitted_params: {color: :black, background: :red},
19
+ }
20
+
21
+ def format(key, value)
22
+ line = super(key, value)
23
+
24
+ color = FIELDS_COLORS[key] || :default
25
+ ColorizedString[line].colorize(color)
26
+ end
27
+ end
28
+
29
+ Rails.application.configure do
30
+ config.lograge.enabled = true
31
+ config.lograge.formatter = ColorKeyValue.new
32
+ end
@@ -0,0 +1,3 @@
1
+ class ContextBuilder
2
+ include Olivander::Resources::RouteBuilder
3
+ end
@@ -0,0 +1,8 @@
1
+ Description:
2
+ Explain the generator
3
+
4
+ Example:
5
+ bin/rails generate scaffold Thing
6
+
7
+ This will create:
8
+ what/will/it/create
@@ -0,0 +1,26 @@
1
+ module Olivander
2
+ class ScaffoldGenerator < Rails::Generators::NamedBase
3
+ include Rails::Generators::ResourceHelpers
4
+
5
+ argument :attributes, type: :array, default: [], banner: "field[:type][:index] field[:type][:index]"
6
+
7
+ source_root File.expand_path('templates/scaffold', __dir__)
8
+
9
+ hook_for :orm, as: :model, required: true do |instance, controller|
10
+ instance.invoke controller, [ instance.name ], instance.options.merge({ test_framework: false })
11
+ end
12
+
13
+ hook_for :datatable, as: :boolean, default: true
14
+
15
+ hook_for :resource_controller do |instance, controller|
16
+ instance.invoke controller, [ instance.name.pluralize ], instance.options.merge({ helper: false, test_framework: false, assets: false })
17
+ end
18
+
19
+ def create_views
20
+ # template "views/_form.html.haml", File.join("app/views", controller_file_path, '_form.html.haml')
21
+ # template "views/_model.html.haml", File.join("app/views", controller_file_path, "_#{file_name}.html.haml")
22
+ end
23
+
24
+ hook_for :resource_route, in: :rails
25
+ end
26
+ end
@@ -3,7 +3,7 @@ module Olivander
3
3
  isolate_namespace Olivander
4
4
 
5
5
  initializer "olivander.assets.precompile" do |app|
6
- app.config.assets.precompile += %w( adminlte.js adminlte.css avatar0.png avatar1.png avatar2.png avatar3.png avatar4.png)
6
+ app.config.assets.precompile += %w[adminlte.js adminlte.css avatar0.png avatar1.png avatar2.png avatar3.png avatar4.png]
7
7
  end
8
8
 
9
9
  initializer "olivander.action_controller" do |app|
@@ -1,3 +1,3 @@
1
1
  module Olivander
2
- VERSION = '0.1.2.42'.freeze
2
+ VERSION = '0.1.2.43.a'.freeze
3
3
  end
data/lib/olivander.rb CHANGED
@@ -2,7 +2,11 @@ require 'olivander/version'
2
2
  require 'olivander/engine'
3
3
  require 'olivander/application_context'
4
4
  require 'olivander/menus'
5
+ require 'pathname'
5
6
 
6
7
  module Olivander
7
- # Your code goes here...
8
+ # Root pathname to get the path of Olivander files like templates or dictionaries
9
+ def self.root
10
+ @root ||= Pathname.new(__dir__).freeze
11
+ end
8
12
  end
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.42
4
+ version: 0.1.2.43.a
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-09-22 00:00:00.000000000 Z
11
+ date: 2023-11-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: chartkick
@@ -149,6 +149,10 @@ files:
149
149
  - app/assets/fonts/fa-solid-900.ttf
150
150
  - app/assets/fonts/fa-solid-900.woff
151
151
  - app/assets/fonts/fa-solid-900.woff2
152
+ - app/assets/fonts/summernote.eot
153
+ - app/assets/fonts/summernote.ttf
154
+ - app/assets/fonts/summernote.woff
155
+ - app/assets/fonts/summernote.woff2
152
156
  - app/assets/images/avatar0.png
153
157
  - app/assets/images/avatar1.png
154
158
  - app/assets/images/avatar2.png
@@ -174,6 +178,10 @@ files:
174
178
  - app/assets/javascripts/adminlte/plugins/moment/moment.min.js
175
179
  - app/assets/javascripts/adminlte/plugins/overlayScrollbars/css/OverlayScrollbars.min.css
176
180
  - app/assets/javascripts/adminlte/plugins/overlayScrollbars/js/jquery.overlayScrollbars.min.js
181
+ - app/assets/javascripts/adminlte/plugins/select2/css/select2-bootstrap4.min.css
182
+ - app/assets/javascripts/adminlte/plugins/select2/css/select2.css
183
+ - app/assets/javascripts/adminlte/plugins/select2/css/select2.min.css
184
+ - app/assets/javascripts/adminlte/plugins/select2/js/select2.full.min.js
177
185
  - app/assets/javascripts/adminlte/plugins/sparklines/sparkline.js
178
186
  - app/assets/javascripts/adminlte/plugins/summernote/summernote-bs4.min.css
179
187
  - app/assets/javascripts/adminlte/plugins/summernote/summernote-bs4.min.js
@@ -181,6 +189,7 @@ files:
181
189
  - app/assets/javascripts/adminlte/plugins/sweetalert2/sweetalert2.min.css
182
190
  - app/assets/javascripts/adminlte/plugins/tempusdominus-bootstrap-4/css/tempusdominus-bootstrap-4.min.css
183
191
  - app/assets/javascripts/adminlte/plugins/tempusdominus-bootstrap-4/js/tempusdominus-bootstrap-4.min.js
192
+ - app/assets/javascripts/adminlte/select2_defaults.coffee
184
193
  - app/assets/javascripts/controllers/refresh_datatable_controller.js
185
194
  - app/assets/stylesheets/adminlte.css
186
195
  - app/assets/stylesheets/fa-fix.scss
@@ -236,6 +245,26 @@ files:
236
245
  - config/locales/simple_form.en.yml
237
246
  - config/routes.rb
238
247
  - lib/five-two-nw-olivander.rb
248
+ - lib/generators/olivander/active_record/migration/templates/create_table_migration.rb.tt
249
+ - lib/generators/olivander/active_record/model/templates/model.rb.tt
250
+ - lib/generators/olivander/active_record/model/templates/module.rb.tt
251
+ - lib/generators/olivander/active_record_generator.rb
252
+ - lib/generators/olivander/controller/templates/controller.rb.tt
253
+ - lib/generators/olivander/controller_generator.rb
254
+ - lib/generators/olivander/datatable/templates/datatable.rb.tt
255
+ - lib/generators/olivander/datatable_generator.rb
256
+ - lib/generators/olivander/install/USAGE
257
+ - lib/generators/olivander/install/install_generator.rb
258
+ - lib/generators/olivander/install/templates/context_builder.rb
259
+ - lib/generators/olivander/install/templates/effective_datatables.rb
260
+ - lib/generators/olivander/install/templates/effective_resources.rb
261
+ - lib/generators/olivander/install/templates/favicon-dev.ico
262
+ - lib/generators/olivander/install/templates/favicon.ico
263
+ - lib/generators/olivander/install/templates/logo.png
264
+ - lib/generators/olivander/install/templates/lograge.rb
265
+ - lib/generators/olivander/install/templates/route_builder.rb
266
+ - lib/generators/olivander/scaffold/USAGE
267
+ - lib/generators/olivander/scaffold_generator.rb
239
268
  - lib/olivander.rb
240
269
  - lib/olivander/application_context.rb
241
270
  - lib/olivander/engine.rb
@@ -265,9 +294,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
265
294
  version: '0'
266
295
  required_rubygems_version: !ruby/object:Gem::Requirement
267
296
  requirements:
268
- - - ">="
297
+ - - ">"
269
298
  - !ruby/object:Gem::Version
270
- version: '0'
299
+ version: 1.3.1
271
300
  requirements: []
272
301
  rubygems_version: 3.1.6
273
302
  signing_key: