wallaby 6.1.6 → 7.0.0.beta1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (98) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/fonts/FontAwesome.otf +0 -0
  3. data/app/assets/fonts/fontawesome-webfont.eot +0 -0
  4. data/app/assets/fonts/fontawesome-webfont.svg +2671 -0
  5. data/app/assets/fonts/fontawesome-webfont.ttf +0 -0
  6. data/app/assets/fonts/fontawesome-webfont.woff +0 -0
  7. data/app/assets/fonts/fontawesome-webfont.woff2 +0 -0
  8. data/app/assets/fonts/summernote.eot +0 -0
  9. data/app/assets/fonts/summernote.hash +1 -0
  10. data/app/assets/fonts/summernote.ttf +0 -0
  11. data/app/assets/fonts/summernote.woff +0 -0
  12. data/app/assets/fonts/summernote.woff2 +0 -0
  13. data/app/assets/javascripts/wallaby/base.js +1 -17
  14. data/app/assets/javascripts/wallaby/core.js +46172 -0
  15. data/app/assets/javascripts/wallaby/core.js.map +7 -0
  16. data/app/assets/javascripts/wallaby/{setup.js.erb → setup.js} +17 -5
  17. data/app/assets/stylesheets/wallaby/base/_fonts.scss +22 -0
  18. data/app/assets/stylesheets/wallaby/base/_functions.scss +13 -29
  19. data/app/assets/stylesheets/wallaby/base/_mixins.scss +7 -7
  20. data/app/assets/stylesheets/wallaby/base.scss +2 -8
  21. data/app/assets/stylesheets/wallaby/core.scss +12139 -0
  22. data/app/assets/stylesheets/wallaby/pages/_index.scss +1 -1
  23. data/app/javascript/wallaby/core.js +23 -0
  24. data/app/javascript/wallaby/globals.js +9 -0
  25. data/app/stylesheets/wallaby/core.scss +15 -0
  26. data/app/views/layouts/wallaby/resources.html.erb +1 -3
  27. data/app/views/wallaby/resources/_edit_page.html.erb +20 -0
  28. data/app/views/wallaby/resources/_form.html.erb +7 -1
  29. data/app/views/wallaby/resources/_frontend.html.erb +2 -3
  30. data/app/views/wallaby/resources/_home_page.html.erb +5 -0
  31. data/app/views/wallaby/resources/_index_page.html.erb +59 -0
  32. data/app/views/wallaby/resources/_new_page.html.erb +19 -0
  33. data/app/views/wallaby/resources/_show_page.html.erb +42 -0
  34. data/app/views/wallaby/resources/edit.html.erb +1 -18
  35. data/app/views/wallaby/resources/error.json.jbuilder +1 -0
  36. data/app/views/wallaby/resources/form/_belongs_to.html.erb +1 -1
  37. data/app/views/wallaby/resources/form/_citext.html.erb +1 -1
  38. data/app/views/wallaby/resources/form/_color.html.erb +1 -1
  39. data/app/views/wallaby/resources/form/_date.html.erb +1 -1
  40. data/app/views/wallaby/resources/form/_daterange.html.erb +1 -1
  41. data/app/views/wallaby/resources/form/_datetime.html.erb +1 -1
  42. data/app/views/wallaby/resources/form/_has_and_belongs_to_many.html.erb +1 -1
  43. data/app/views/wallaby/resources/form/_has_many.html.erb +1 -1
  44. data/app/views/wallaby/resources/form/_hstore.html.erb +1 -1
  45. data/app/views/wallaby/resources/form/_json.html.erb +1 -1
  46. data/app/views/wallaby/resources/form/_jsonb.html.erb +1 -1
  47. data/app/views/wallaby/resources/form/_longtext.html.erb +1 -1
  48. data/app/views/wallaby/resources/form/_markdown.html.erb +1 -1
  49. data/app/views/wallaby/resources/form/_mediumtext.html.erb +1 -1
  50. data/app/views/wallaby/resources/form/_text.html.erb +1 -1
  51. data/app/views/wallaby/resources/form/_time.html.erb +1 -1
  52. data/app/views/wallaby/resources/form/_tinytext.html.erb +1 -1
  53. data/app/views/wallaby/resources/form/_tsrange.html.erb +1 -1
  54. data/app/views/wallaby/resources/form/_tstzrange.html.erb +1 -1
  55. data/app/views/wallaby/resources/form/_xml.html.erb +1 -1
  56. data/app/views/wallaby/resources/home.html.erb +1 -5
  57. data/app/views/wallaby/resources/index/_box.html.erb +1 -1
  58. data/app/views/wallaby/resources/index/_circle.html.erb +1 -1
  59. data/app/views/wallaby/resources/index/_citext.html.erb +1 -1
  60. data/app/views/wallaby/resources/index/_dollar.html.erb +5 -0
  61. data/app/views/wallaby/resources/index/_hstore.html.erb +1 -1
  62. data/app/views/wallaby/resources/index/_json.html.erb +1 -1
  63. data/app/views/wallaby/resources/index/_jsonb.html.erb +1 -1
  64. data/app/views/wallaby/resources/index/_line.html.erb +1 -1
  65. data/app/views/wallaby/resources/index/_longtext.html.erb +1 -1
  66. data/app/views/wallaby/resources/index/_lseg.html.erb +1 -1
  67. data/app/views/wallaby/resources/index/_ltree.html.erb +1 -1
  68. data/app/views/wallaby/resources/index/_mediumtext.html.erb +1 -1
  69. data/app/views/wallaby/resources/index/_path.html.erb +1 -1
  70. data/app/views/wallaby/resources/index/_percent.html.erb +10 -0
  71. data/app/views/wallaby/resources/index/_polygon.html.erb +1 -1
  72. data/app/views/wallaby/resources/index/_sti.html.erb +1 -1
  73. data/app/views/wallaby/resources/index/_string.html.erb +1 -1
  74. data/app/views/wallaby/resources/index/_text.html.erb +1 -1
  75. data/app/views/wallaby/resources/index/_tinytext.html.erb +1 -1
  76. data/app/views/wallaby/resources/index/_tsvector.html.erb +1 -1
  77. data/app/views/wallaby/resources/index/_uuid.html.erb +1 -1
  78. data/app/views/wallaby/resources/index/_xml.html.erb +1 -1
  79. data/app/views/wallaby/resources/index.csv.erb +7 -1
  80. data/app/views/wallaby/resources/index.html.erb +1 -54
  81. data/app/views/wallaby/resources/new.html.erb +1 -18
  82. data/app/views/wallaby/resources/show/_active_storage.html.erb +5 -0
  83. data/app/views/wallaby/resources/show.html.erb +1 -35
  84. data/lib/generators/wallaby/engine/partials/USAGE +23 -0
  85. data/lib/generators/wallaby/engine/partials/partials_generator.rb +25 -0
  86. data/lib/generators/wallaby/install/install_generator.rb +1 -54
  87. data/lib/wallaby/ui_engine.rb +3 -2
  88. data/lib/wallaby/version.rb +1 -1
  89. data/lib/wallaby/views.rb +2 -11
  90. metadata +45 -108
  91. data/app/assets/stylesheets/wallaby/summernote.scss.erb +0 -7
  92. data/lib/generators/wallaby/install/templates/application_authorizer.rb.erb +0 -40
  93. data/lib/generators/wallaby/install/templates/application_controller.rb.erb +0 -148
  94. data/lib/generators/wallaby/install/templates/application_decorator.rb.erb +0 -10
  95. data/lib/generators/wallaby/install/templates/application_paginator.rb.erb +0 -30
  96. data/lib/generators/wallaby/install/templates/application_servicer.rb.erb +0 -50
  97. data/lib/generators/wallaby/install/templates/initializer.rb.erb +0 -58
  98. /data/app/views/wallaby/resources/{_active_storage.html.erb → index/_active_storage.html.erb} +0 -0
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wallaby
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.1.6
4
+ version: 7.0.0.beta1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tianwen Chen
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-09-20 00:00:00.000000000 Z
11
+ date: 2023-09-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: wallaby-core
@@ -28,58 +28,16 @@ dependencies:
28
28
  name: wallaby-active_record
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: 0.2.7
33
+ version: 0.3.0.beta1
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - '='
39
39
  - !ruby/object:Gem::Version
40
- version: 0.2.7
41
- - !ruby/object:Gem::Dependency
42
- name: bootstrap
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - "~>"
46
- - !ruby/object:Gem::Version
47
- version: '4.6'
48
- type: :runtime
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - "~>"
53
- - !ruby/object:Gem::Version
54
- version: '4.6'
55
- - !ruby/object:Gem::Dependency
56
- name: bootstrap4-datetime-picker-rails
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - ">="
60
- - !ruby/object:Gem::Version
61
- version: '0'
62
- type: :runtime
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - ">="
67
- - !ruby/object:Gem::Version
68
- version: '0'
69
- - !ruby/object:Gem::Dependency
70
- name: font-awesome-sass
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - ">="
74
- - !ruby/object:Gem::Version
75
- version: '0'
76
- type: :runtime
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - ">="
81
- - !ruby/object:Gem::Version
82
- version: '0'
40
+ version: 0.3.0.beta1
83
41
  - !ruby/object:Gem::Dependency
84
42
  name: jbuilder
85
43
  requirement: !ruby/object:Gem::Requirement
@@ -94,48 +52,6 @@ dependencies:
94
52
  - - ">="
95
53
  - !ruby/object:Gem::Version
96
54
  version: '0'
97
- - !ruby/object:Gem::Dependency
98
- name: jquery-minicolors-rails
99
- requirement: !ruby/object:Gem::Requirement
100
- requirements:
101
- - - ">="
102
- - !ruby/object:Gem::Version
103
- version: '0'
104
- type: :runtime
105
- prerelease: false
106
- version_requirements: !ruby/object:Gem::Requirement
107
- requirements:
108
- - - ">="
109
- - !ruby/object:Gem::Version
110
- version: '0'
111
- - !ruby/object:Gem::Dependency
112
- name: jquery-rails
113
- requirement: !ruby/object:Gem::Requirement
114
- requirements:
115
- - - ">="
116
- - !ruby/object:Gem::Version
117
- version: '0'
118
- type: :runtime
119
- prerelease: false
120
- version_requirements: !ruby/object:Gem::Requirement
121
- requirements:
122
- - - ">="
123
- - !ruby/object:Gem::Version
124
- version: '0'
125
- - !ruby/object:Gem::Dependency
126
- name: momentjs-rails
127
- requirement: !ruby/object:Gem::Requirement
128
- requirements:
129
- - - ">="
130
- - !ruby/object:Gem::Version
131
- version: '0'
132
- type: :runtime
133
- prerelease: false
134
- version_requirements: !ruby/object:Gem::Requirement
135
- requirements:
136
- - - ">="
137
- - !ruby/object:Gem::Version
138
- version: '0'
139
55
  - !ruby/object:Gem::Dependency
140
56
  name: sass-rails
141
57
  requirement: !ruby/object:Gem::Requirement
@@ -151,7 +67,7 @@ dependencies:
151
67
  - !ruby/object:Gem::Version
152
68
  version: '0'
153
69
  - !ruby/object:Gem::Dependency
154
- name: summernote-rails
70
+ name: sprockets-rails
155
71
  requirement: !ruby/object:Gem::Requirement
156
72
  requirements:
157
73
  - - ">="
@@ -165,13 +81,13 @@ dependencies:
165
81
  - !ruby/object:Gem::Version
166
82
  version: '0'
167
83
  - !ruby/object:Gem::Dependency
168
- name: twitter-typeahead-rails
84
+ name: foreman
169
85
  requirement: !ruby/object:Gem::Requirement
170
86
  requirements:
171
87
  - - ">="
172
88
  - !ruby/object:Gem::Version
173
89
  version: '0'
174
- type: :runtime
90
+ type: :development
175
91
  prerelease: false
176
92
  version_requirements: !ruby/object:Gem::Requirement
177
93
  requirements:
@@ -201,6 +117,17 @@ extensions: []
201
117
  extra_rdoc_files: []
202
118
  files:
203
119
  - LICENSE
120
+ - app/assets/fonts/FontAwesome.otf
121
+ - app/assets/fonts/fontawesome-webfont.eot
122
+ - app/assets/fonts/fontawesome-webfont.svg
123
+ - app/assets/fonts/fontawesome-webfont.ttf
124
+ - app/assets/fonts/fontawesome-webfont.woff
125
+ - app/assets/fonts/fontawesome-webfont.woff2
126
+ - app/assets/fonts/summernote.eot
127
+ - app/assets/fonts/summernote.hash
128
+ - app/assets/fonts/summernote.ttf
129
+ - app/assets/fonts/summernote.woff
130
+ - app/assets/fonts/summernote.woff2
204
131
  - app/assets/images/wallaby/bad_request.png
205
132
  - app/assets/images/wallaby/forbidden.png
206
133
  - app/assets/images/wallaby/internal_server_error.png
@@ -211,9 +138,12 @@ files:
211
138
  - app/assets/javascripts/wallaby/application.js
212
139
  - app/assets/javascripts/wallaby/auto_select.js
213
140
  - app/assets/javascripts/wallaby/base.js
214
- - app/assets/javascripts/wallaby/setup.js.erb
141
+ - app/assets/javascripts/wallaby/core.js
142
+ - app/assets/javascripts/wallaby/core.js.map
143
+ - app/assets/javascripts/wallaby/setup.js
215
144
  - app/assets/stylesheets/wallaby/application.scss
216
145
  - app/assets/stylesheets/wallaby/base.scss
146
+ - app/assets/stylesheets/wallaby/base/_fonts.scss
217
147
  - app/assets/stylesheets/wallaby/base/_functions.scss
218
148
  - app/assets/stylesheets/wallaby/base/_layout.scss
219
149
  - app/assets/stylesheets/wallaby/base/_layout_desktop.scss
@@ -228,31 +158,38 @@ files:
228
158
  - app/assets/stylesheets/wallaby/components/_pagination.scss
229
159
  - app/assets/stylesheets/wallaby/components/_query.scss
230
160
  - app/assets/stylesheets/wallaby/components/_text.scss
161
+ - app/assets/stylesheets/wallaby/core.scss
231
162
  - app/assets/stylesheets/wallaby/pages/_error.scss
232
163
  - app/assets/stylesheets/wallaby/pages/_form.scss
233
164
  - app/assets/stylesheets/wallaby/pages/_index.scss
234
165
  - app/assets/stylesheets/wallaby/pages/_index_desktop.scss
235
166
  - app/assets/stylesheets/wallaby/pages/_show.scss
236
167
  - app/assets/stylesheets/wallaby/pages/_show_desktop.scss
237
- - app/assets/stylesheets/wallaby/summernote.scss.erb
168
+ - app/javascript/wallaby/core.js
169
+ - app/javascript/wallaby/globals.js
170
+ - app/stylesheets/wallaby/core.scss
238
171
  - app/views/layouts/wallaby/resources.csv.erb
239
172
  - app/views/layouts/wallaby/resources.html.erb
240
173
  - app/views/layouts/wallaby/resources.json.erb
241
- - app/views/wallaby/resources/_active_storage.html.erb
174
+ - app/views/wallaby/resources/_edit_page.html.erb
242
175
  - app/views/wallaby/resources/_flash_messages.html.erb
243
176
  - app/views/wallaby/resources/_footer.html.erb
244
177
  - app/views/wallaby/resources/_form.html.erb
245
178
  - app/views/wallaby/resources/_frontend.html.erb
246
179
  - app/views/wallaby/resources/_header.html.erb
180
+ - app/views/wallaby/resources/_home_page.html.erb
247
181
  - app/views/wallaby/resources/_imodal.html.erb
248
182
  - app/views/wallaby/resources/_index_actions.html.erb
249
183
  - app/views/wallaby/resources/_index_filters.html.erb
184
+ - app/views/wallaby/resources/_index_page.html.erb
250
185
  - app/views/wallaby/resources/_index_pagination.html.erb
251
186
  - app/views/wallaby/resources/_index_query.html.erb
252
187
  - app/views/wallaby/resources/_logo.html.erb
253
188
  - app/views/wallaby/resources/_navs.html.erb
189
+ - app/views/wallaby/resources/_new_page.html.erb
254
190
  - app/views/wallaby/resources/_resource_actions.html.erb
255
191
  - app/views/wallaby/resources/_resource_navs.html.erb
192
+ - app/views/wallaby/resources/_show_page.html.erb
256
193
  - app/views/wallaby/resources/_title.html.erb
257
194
  - app/views/wallaby/resources/_user_menu.html.erb
258
195
  - app/views/wallaby/resources/bad_request.json.jbuilder
@@ -327,6 +264,7 @@ files:
327
264
  - app/views/wallaby/resources/index.csv.erb
328
265
  - app/views/wallaby/resources/index.html.erb
329
266
  - app/views/wallaby/resources/index.json.jbuilder
267
+ - app/views/wallaby/resources/index/_active_storage.html.erb
330
268
  - app/views/wallaby/resources/index/_belongs_to.csv.erb
331
269
  - app/views/wallaby/resources/index/_belongs_to.html.erb
332
270
  - app/views/wallaby/resources/index/_bigint.csv.erb
@@ -361,6 +299,7 @@ files:
361
299
  - app/views/wallaby/resources/index/_datetime.html.erb
362
300
  - app/views/wallaby/resources/index/_decimal.csv.erb
363
301
  - app/views/wallaby/resources/index/_decimal.html.erb
302
+ - app/views/wallaby/resources/index/_dollar.html.erb
364
303
  - app/views/wallaby/resources/index/_email.csv.erb
365
304
  - app/views/wallaby/resources/index/_email.html.erb
366
305
  - app/views/wallaby/resources/index/_float.csv.erb
@@ -411,6 +350,7 @@ files:
411
350
  - app/views/wallaby/resources/index/_password.html.erb
412
351
  - app/views/wallaby/resources/index/_path.csv.erb
413
352
  - app/views/wallaby/resources/index/_path.html.erb
353
+ - app/views/wallaby/resources/index/_percent.html.erb
414
354
  - app/views/wallaby/resources/index/_point.csv.erb
415
355
  - app/views/wallaby/resources/index/_point.html.erb
416
356
  - app/views/wallaby/resources/index/_polygon.csv.erb
@@ -452,6 +392,7 @@ files:
452
392
  - app/views/wallaby/resources/new.html.erb
453
393
  - app/views/wallaby/resources/show.html.erb
454
394
  - app/views/wallaby/resources/show.json.jbuilder
395
+ - app/views/wallaby/resources/show/_active_storage.html.erb
455
396
  - app/views/wallaby/resources/show/_belongs_to.html.erb
456
397
  - app/views/wallaby/resources/show/_bigint.html.erb
457
398
  - app/views/wallaby/resources/show/_bigserial.html.erb
@@ -517,14 +458,10 @@ files:
517
458
  - config/brakeman.ignore
518
459
  - config/massa.yml
519
460
  - config/rails_best_practices.yml
461
+ - lib/generators/wallaby/engine/partials/USAGE
462
+ - lib/generators/wallaby/engine/partials/partials_generator.rb
520
463
  - lib/generators/wallaby/install/USAGE
521
464
  - lib/generators/wallaby/install/install_generator.rb
522
- - lib/generators/wallaby/install/templates/application_authorizer.rb.erb
523
- - lib/generators/wallaby/install/templates/application_controller.rb.erb
524
- - lib/generators/wallaby/install/templates/application_decorator.rb.erb
525
- - lib/generators/wallaby/install/templates/application_paginator.rb.erb
526
- - lib/generators/wallaby/install/templates/application_servicer.rb.erb
527
- - lib/generators/wallaby/install/templates/initializer.rb.erb
528
465
  - lib/wallaby.rb
529
466
  - lib/wallaby/ui_engine.rb
530
467
  - lib/wallaby/version.rb
@@ -948,7 +885,7 @@ homepage: https://github.com/wallaby-rails/wallaby
948
885
  licenses:
949
886
  - MIT
950
887
  metadata: {}
951
- post_install_message:
888
+ post_install_message:
952
889
  rdoc_options: []
953
890
  require_paths:
954
891
  - lib
@@ -959,12 +896,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
959
896
  version: '0'
960
897
  required_rubygems_version: !ruby/object:Gem::Requirement
961
898
  requirements:
962
- - - ">="
899
+ - - ">"
963
900
  - !ruby/object:Gem::Version
964
- version: '0'
901
+ version: 1.3.1
965
902
  requirements: []
966
- rubygems_version: 3.2.33
967
- signing_key:
903
+ rubygems_version: 3.3.25
904
+ signing_key:
968
905
  specification_version: 4
969
906
  summary: Autocomplete the resourceful actions and views for ORMs for admin interface
970
907
  and other purposes.
@@ -1,7 +0,0 @@
1
- <%
2
- # NOTE: we have a problem with summernote.css that
3
- # we need to dynamically convert it to a scss format
4
- # The reason is hard to explain, so let it be :P
5
- css_file = "#{ Gem.loaded_specs['summernote-rails'].full_gem_path }/vendor/assets/stylesheets/summernote.css"
6
- %>
7
- <%= File.open(css_file, "r").read %>
@@ -1,40 +0,0 @@
1
- module <%= class_name %>
2
- # @see https://github.com/wallaby-rails/wallaby/blob/master/docs/authorizer.md
3
- class ApplicationAuthorizer < Wallaby::ModelAuthorizer
4
- # # base/abstract class?
5
- # base_class!
6
-
7
- # # set namespace
8
- # self.namespace = '<%= class_name %>'
9
-
10
- # specify which provider (:cancancan, :pundit or :default) to use.
11
- # :default means no authorization will be in use.
12
- # self.provider_name = :cancancan
13
-
14
- # Check user's permission for given action on given subject.
15
- # Raise Wallaby::Forbidden if user doesn't have permission
16
- # def authorize(action, subject)
17
- # super # do something for all the subclasses
18
- # end
19
-
20
- # Check and see if user is allowed to perform an action on given subject.
21
- # def authorized?(action, subject)
22
- # super # do something for all the subclasses
23
- # end
24
-
25
- # Restrict user to access certain scope.
26
- # def accessible_for(action, scope)
27
- # super # do something for all the subclasses
28
- # end
29
-
30
- # Restrict user to assign certain values.
31
- # def attributes_for(action, subject)
32
- # super # do something for all the subclasses
33
- # end
34
-
35
- # Restrict user to permit parameters.
36
- # def permit_params(action, subject)
37
- # super # do something for all the subclasses
38
- # end
39
- end
40
- end
@@ -1,148 +0,0 @@
1
- module <%= class_name %>
2
- # @see https://github.com/wallaby-rails/wallaby/blob/master/docs/controller.md
3
- class ApplicationController < Wallaby::ResourcesController
4
- # # base/abstract class?
5
- # base_class!
6
-
7
- # # set namespace
8
- # self.namespace = '<%= class_name %>'
9
-
10
- # # configure the responder
11
- # self.responder = Wallaby::ResourcesResponder
12
-
13
- # # theming
14
- # self.theme_name = '<%= file_name %>/application'
15
-
16
- # # engine
17
- # self.engine_name = 'admin'
18
-
19
- # # specify the application/base decorator
20
- # self.application_decorator = <%= class_name %>::ApplicationDecorator
21
-
22
- # # specify the application/base servicer
23
- # self.application_servicer = <%= class_name %>::ApplicationServicer
24
-
25
- # # specify the application/base authorizer
26
- # self.application_authorizer = <%= class_name %>::ApplicationAuthorizer
27
-
28
- # # specify the application/base paginator
29
- # self.application_paginator = <%= class_name %>::ApplicationPaginator
30
-
31
- # # customize how user should be authenticated
32
- # def authenticate_user!
33
- # super # do something for all the subclasses
34
- # end
35
-
36
- # # customize how user record should be returned
37
- # def wallaby_user
38
- # super # do something for all the subclasses
39
- # end
40
-
41
- # # landing page
42
- # def home
43
- # super # do something for all the subclasses
44
- # end
45
-
46
- # # for index page
47
- # def index
48
- # # do something before the origin action
49
- # index!(
50
- # location: nil # where to redirect when successful
51
- # ) do |format| # `respond_with` block
52
- # # do something here before rendering
53
- # end
54
- # end
55
-
56
- # # for new page
57
- # def new
58
- # # do something before the origin action
59
- # new!(
60
- # location: nil # where to redirect when successful
61
- # ) do |format| # `respond_with` block
62
- # # do something here before rendering
63
- # end
64
- # end
65
-
66
- # # for create action
67
- # def create
68
- # # do something before the origin action
69
- # create!(
70
- # params: nil, # params to use for the servicer
71
- # location: nil # where to redirect when successful
72
- # ) do |format| # `respond_with` block
73
- # # do something here before rendering
74
- # end
75
- # end
76
-
77
- # # for show page
78
- # def show
79
- # # do something before the origin action
80
- # show!(
81
- # location: nil # where to redirect when successful
82
- # ) do |format| # `respond_with` block
83
- # # do something here before rendering
84
- # end
85
- # end
86
-
87
- # # for edit page
88
- # def edit
89
- # # do something before the origin action
90
- # edit!(
91
- # location: nil # where to redirect when successful
92
- # ) do |format| # `respond_with` block
93
- # # do something here before rendering
94
- # end
95
- # end
96
-
97
- # # for update action
98
- # def update
99
- # # do something before the origin action
100
- # update!(
101
- # params: nil, # params to use for the servicer
102
- # location: nil # where to redirect when successful
103
- # ) do |format| # `respond_with` block
104
- # # do something here before rendering
105
- # end
106
- # end
107
-
108
- # # for destroy action
109
- # def destroy
110
- # # do something before the origin action
111
- # destroy!(
112
- # params: nil, # params to use for the servicer
113
- # location: nil # where to redirect when successful
114
- # ) do |format| # `respond_with` block
115
- # # do something here before rendering
116
- # end
117
- # end
118
-
119
- # # customize how parameters should be white-listed for mass assignment
120
- # def resource_params
121
- # super # something for all the subclasses
122
- # end
123
-
124
- # # customize how collection should be returned
125
- # def collection
126
- # collection!(
127
- # params: nil, # params to use for the servicer
128
- # paginate: true # whether to paginate the collection
129
- # ) do |records|
130
- # # do something here after origin query is completed
131
- # # but before `@collection` instance variable is set
132
- # records
133
- # end
134
- # end
135
-
136
- # # customize how resource should be returned
137
- # def resource
138
- # resource!(
139
- # find_params: nil, # params/options for servicer's `find` action
140
- # new_params: nil # params/options for servicer's `new` action
141
- # ) do |record|
142
- # # do something here after origin query is completed
143
- # # but before `@resource` instance variable is set
144
- # record
145
- # end
146
- # end
147
- end
148
- end
@@ -1,10 +0,0 @@
1
- module <%= class_name %>
2
- # @see https://github.com/wallaby-rails/wallaby/blob/master/docs/decorator.md
3
- class ApplicationDecorator < Wallaby::ResourceDecorator
4
- # # base/abstract class?
5
- # base_class!
6
-
7
- # # set namespace
8
- # self.namespace = '<%= class_name %>'
9
- end
10
- end
@@ -1,30 +0,0 @@
1
- module <%= class_name %>
2
- # @see https://github.com/wallaby-rails/wallaby/blob/master/docs/paginator.md
3
- class ApplicationPaginator < Wallaby::ModelPaginator
4
- # # base/abstract class?
5
- # base_class!
6
-
7
- # # set namespace
8
- # self.namespace = '<%= class_name %>'
9
-
10
- # # Check if the collection can be paginated
11
- # def paginatable?
12
- # super # do something for all the subclasses
13
- # end
14
-
15
- # # Total count of the collection
16
- # def total
17
- # super # do something for all the subclasses
18
- # end
19
-
20
- # # Page size
21
- # def page_size
22
- # super # do something for all the subclasses
23
- # end
24
-
25
- # # Page number
26
- # def page_number
27
- # super # do something for all the subclasses
28
- # end
29
- end
30
- end
@@ -1,50 +0,0 @@
1
- module <%= class_name %>
2
- # @see https://github.com/wallaby-rails/wallaby/blob/master/docs/servicer.md
3
- class ApplicationServicer < Wallaby::ModelServicer
4
- # # base/abstract class?
5
- # base_class!
6
-
7
- # # set namespace
8
- # self.namespace = '<%= class_name %>'
9
-
10
- # # To whitelist parameters for mass assignment
11
- # def permit(params, action)
12
- # super # do something for all the subclasses
13
- # end
14
-
15
- # # Fetch collection by params
16
- # def collection(params)
17
- # super # do something for all the subclasses
18
- # end
19
-
20
- # # Paginate the collection
21
- # def paginate(query, params)
22
- # super # do something for all the subclasses
23
- # end
24
-
25
- # # Initialize the model class using params
26
- # def new(params)
27
- # super # do something for all the subclasses
28
- # end
29
-
30
- # # Find a resource using id
31
- # def find(id, params)
32
- # super # do something for all the subclasses
33
- # end
34
-
35
- # # Save the newly initialized resource
36
- # def create(resource, params)
37
- # super # do something for all the subclasses
38
- # end
39
-
40
- # # Update the persisted resource
41
- # def update(resource, params)
42
- # super # do something for all the subclasses
43
- # end
44
-
45
- # # Destroy the given resource
46
- # def destroy(resource, params)
47
- # super # do something for all the subclasses
48
- # end
49
- end
50
- end
@@ -1,58 +0,0 @@
1
- Wallaby.config do |config|
2
- # Configure the base controller class that Wallaby should inherit from:
3
- # config.base_controller = ::ApplicationController
4
-
5
- # To provide support for non ActiveModel like (ActiveRecord/Her) classes:
6
- # config.custom_models = [Array]
7
-
8
- # To refine what model classes Wallaby should take care:
9
- # config.models = [Product, Order]
10
-
11
- # for authentication
12
- # To configure how `current_user` should be returned
13
- # config.security.current_user do
14
- # User.find_by_email session[:user_email]
15
- # end
16
-
17
- # To configure how `current_user` should be authenticated
18
- # config.security.authenticate do
19
- # authenticate_or_request_with_http_basic do |username, password|
20
- # username == 'too_simple' && password == 'too_naive'
21
- # end
22
- # end
23
-
24
- # To specify which method to return email for user portrait display using gravatar
25
- # config.security.email_method = :email
26
-
27
- # To specify which path Wallaby can use to logout a user
28
- # config.security.logout_path = :logout_path
29
-
30
- # To specify the http verb Wallaby can use to logout a user
31
- # config.security.logout_method = :delete
32
-
33
- # To specify base application controller for Wallaby
34
- <%= commenting %>config.mapping.resources_controller = <%= class_name %>::ApplicationController
35
-
36
- # To specify base application decorator for Wallaby
37
- <%= commenting %>config.mapping.resource_decorator = <%= class_name %>::ApplicationDecorator
38
-
39
- # To specify base application servicer for Wallaby
40
- <%= commenting %>config.mapping.model_servicer = <%= class_name %>::ApplicationServicer
41
-
42
- # To specify base application authorizer for Wallaby
43
- # config.mapping.model_authorizer = <%= class_name %>::ApplicationAuthorizer
44
-
45
- # To specify base application paginator for Wallaby
46
- # config.mapping.model_paginator = <%= class_name %>::ApplicationPaginator
47
-
48
- # To specify the max number of characters to truncate for index page
49
- # config.metadata.max = 20
50
-
51
- # To specify the default page size for pagination on index page
52
- # config.pagination.page_size = 20
53
-
54
- # To specify the sorting strategy to use, and valid values are:
55
- # :multiple - default value, allowing sorting on multiple columns
56
- # :single - sorting is allowed only on one column
57
- # config.sorting.strategy = :single
58
- end