wallaby-core 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/wallaby/resources_controller.rb +6 -375
  3. data/app/security/ability.rb +1 -1
  4. data/config/locales/wallaby.en.yml +92 -128
  5. data/config/locales/wallaby_class.en.yml +0 -21
  6. data/lib/adaptors/wallaby/custom/model_service_provider.rb +8 -8
  7. data/lib/authorizers/wallaby/cancancan_authorization_provider.rb +2 -1
  8. data/lib/authorizers/wallaby/pundit_authorization_provider.rb +2 -2
  9. data/lib/concerns/wallaby/application_concern.rb +111 -0
  10. data/lib/concerns/wallaby/authentication_concern.rb +93 -0
  11. data/lib/concerns/wallaby/authorizable.rb +1 -1
  12. data/lib/concerns/wallaby/decoratable.rb +1 -1
  13. data/lib/concerns/wallaby/paginatable.rb +1 -1
  14. data/lib/concerns/wallaby/resourcable.rb +4 -0
  15. data/lib/concerns/wallaby/resources_concern.rb +433 -0
  16. data/lib/concerns/wallaby/servicable.rb +1 -1
  17. data/lib/errors/wallaby/model_not_found.rb +1 -1
  18. data/lib/errors/wallaby/resource_not_found.rb +1 -1
  19. data/lib/helpers/wallaby/application_helper.rb +6 -0
  20. data/lib/helpers/wallaby/form_helper.rb +2 -3
  21. data/lib/helpers/wallaby/index_helper.rb +2 -2
  22. data/lib/helpers/wallaby/links_helper.rb +5 -5
  23. data/lib/helpers/wallaby/styling_helper.rb +17 -3
  24. data/lib/interfaces/wallaby/mode.rb +2 -2
  25. data/lib/interfaces/wallaby/model_decorator.rb +1 -1
  26. data/lib/paginators/wallaby/model_paginator.rb +1 -1
  27. data/lib/routes/wallaby/resources_router.rb +1 -1
  28. data/lib/servicers/wallaby/model_servicer.rb +2 -1
  29. data/lib/services/wallaby/map/model_class_collector.rb +1 -1
  30. data/lib/services/wallaby/type_renderer.rb +2 -2
  31. data/lib/utils/wallaby/locale.rb +53 -0
  32. data/lib/utils/wallaby/logger.rb +21 -0
  33. data/lib/utils/wallaby/model_utils.rb +1 -1
  34. data/lib/utils/wallaby/module_utils.rb +1 -1
  35. data/lib/utils/wallaby/utils.rb +1 -1
  36. data/lib/wallaby/core.rb +6 -0
  37. data/lib/wallaby/core/version.rb +1 -1
  38. data/lib/wallaby/engine.rb +3 -3
  39. data/lib/wallaby/map.rb +1 -1
  40. metadata +7 -4
  41. data/app/controllers/wallaby/application_controller.rb +0 -84
  42. data/app/controllers/wallaby/secure_controller.rb +0 -81
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 52359ec55f58d6479a497e4d8bb412d2ff4e2a22781abb034721a580d6321a87
4
- data.tar.gz: 14009b74724c111574addf3869e4f2bc5b96eae721a40a61c9885773bfb7eb05
3
+ metadata.gz: b808379fa5d1d1105d40bd2c9f6f960c0c2ebbfab0fffead3c483b1cd07fab4d
4
+ data.tar.gz: 1cdfde9da6cf530b366fb31a5ed659d9d4175181cb8ec28b6588f686a50a7ece
5
5
  SHA512:
6
- metadata.gz: 7e772e4457e4892ad725f6d0e65de0854f7cafeaa163c00fb3c4f3c9d88c44e25623bfe5b26fca01454e1bf2facf5d4f904c65a2bdf278ff3a22945679c0054b
7
- data.tar.gz: a0a7fa9c558e05e8e62b4570265d4e2d1f063960550bf06148535be0cbb7aa571d416e932419cd0493b209e21c0ab249766de1299105eedbb62e5c3d416e902d
6
+ metadata.gz: 81f0c8d139ec9975ce47ffb157fb12c273f44c7496c8b071d40e0fed1498226e19ca7ab3254fe2d825b0ed8936a74db1341f2c40d0e3dfa46091880603dbeba2
7
+ data.tar.gz: fb8f6be411fb84876a7ed7a1f9aa0f5f51341e97a3bdd6d2803c6357c1e8f32bed20d9b11e14bad886f926123d33a65bd49879a572f318b56ddc3a8bb4c897c4
@@ -1,382 +1,13 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Wallaby
4
+ ResourcesController = Class.new configuration.base_controller
5
+
4
6
  # Resources controller, superclass for all customization controllers.
5
- # It contains CRUD template action methods (`index`/`new`/`create`/`edit`/`update`/`destroy`)
7
+ # It contains CRUD template action methods
8
+ # (`index`/`new`/`create`/`edit`/`update`/`destroy`)
6
9
  # that allow subclasses to override.
7
- class ResourcesController < ::Wallaby::SecureController
8
- extend Authorizable::ClassMethods
9
- extend Baseable::ClassMethods
10
- extend Decoratable::ClassMethods
11
- extend Paginatable::ClassMethods
12
- extend Resourcable::ClassMethods
13
- extend Servicable::ClassMethods
14
-
15
- include View
16
- prepend Prefixable
17
-
18
- include Authorizable
19
- include Decoratable
20
- include Defaultable
21
- include Paginatable
22
- include Resourcable
23
- include Servicable
24
-
25
- self.responder = ResourcesResponder
26
- respond_to :html
27
- respond_to :json
28
- respond_to :csv, only: :index
29
- helper ResourcesHelper
30
- before_action :authenticate_user!
31
-
32
- # @note This is a template method that can be overridden by subclasses.
33
- # This is an action for landing page display. It does nothing more than rendering `home` template.
34
- #
35
- # It can be replaced completely in subclasses as below:
36
- #
37
- # ```
38
- # def home
39
- # generate_dashboard_report
40
- # end
41
- # ```
42
- def home
43
- # do nothing
44
- end
45
-
46
- # @note This is a template method that can be overridden by subclasses.
47
- # This is a resourceful action to list records that user can access.
48
- #
49
- # It can be customized as below in subclasses:
50
- #
51
- # `WARN: Please keep in mind that Wallaby User Interface requires **index**
52
- # action to respond to **csv** and **json** format as well.`
53
- #
54
- # ```
55
- # def index
56
- # # do something before the origin action
57
- # options = {} # NOTE: see `options` parameter for more details
58
- # index!(options) do |format| # NOTE: this is better than using `super`
59
- # # NOTE: this block is for `respond_with` which works similar to `respond_to`
60
- # # customize response behaviour, or do something before the request is rendered
61
- # end
62
- # end
63
- # ```
64
- #
65
- # Otherwise, it can be replaced completely in subclasses:
66
- #
67
- # `WARN: Please keep in mind that Wallaby User Interface requires **index**
68
- # action to respond to **csv** and **json** format as well.`
69
- #
70
- # ```
71
- # def index
72
- # # NOTE: `@collection` will be used by the view, please ensure it is assigned, for example:
73
- # @collection = Product.all
74
- # respond_with @collection
75
- # end
76
- # ```
77
- # @param options [Hash] (since 5.2.0) options for
78
- # {https://www.rubydoc.info/gems/responders/ActionController/RespondWith#respond_with-instance_method
79
- # respond_with}
80
- # @yield [format] block for
81
- # {https://www.rubydoc.info/gems/responders/ActionController/RespondWith#respond_with-instance_method
82
- # respond_with}
83
- # to customize response behaviour.
84
- # @raise [Wallaby::Forbidden] if user has no access
85
- def index(options = {}, &block)
86
- current_authorizer.authorize :index, current_model_class
87
- respond_with collection, options, &block
88
- end
89
-
90
- alias index! index
91
-
92
- # @note This is a template method that can be overridden by subclasses.
93
- # This is a resourceful action to show the form to create record that user is allowed to.
94
- #
95
- # It can be customized as below in subclasses:
96
- #
97
- # ```
98
- # def new
99
- # # do something before the origin action
100
- # options = {} # NOTE: see `options` parameter for more details
101
- # new!(options) do |format| # NOTE: this is better than using `super`
102
- # # NOTE: this block is for `respond_with` which works similar to `respond_to`
103
- # # customize response behaviour, or do something before the request is rendered
104
- # end
105
- # end
106
- # ```
107
- #
108
- # Otherwise, it can be replaced completely in subclasses:
109
- #
110
- # ```
111
- # def new
112
- # # NOTE: `@resource` will be used by the view, please ensure it is assigned, for example:
113
- # @resource = Product.new new_arrival: true
114
- # end
115
- # ```
116
- # @param options [Hash] (since 5.2.0) options for
117
- # {https://www.rubydoc.info/gems/responders/ActionController/RespondWith#respond_with-instance_method
118
- # respond_with}
119
- # @yield [format] block for
120
- # {https://www.rubydoc.info/gems/responders/ActionController/RespondWith#respond_with-instance_method
121
- # respond_with}
122
- # to customize response behaviour.
123
- # @raise [Wallaby::Forbidden] if user has no access
124
- def new(options = {}, &block)
125
- current_authorizer.authorize :new, resource
126
- respond_with resource, options, &block
127
- end
128
-
129
- alias new! new
130
-
131
- # @note This is a template method that can be overridden by subclasses.
132
- # This is a resourceful action to create a record that user is allowed to.
133
- #
134
- # If record is created successfully, user will be navigated to the record show page.
135
- # Otherwise, the form will be shown again with error messages.
136
- #
137
- # It can be customized as below in subclasses:
138
- #
139
- # ```
140
- # def create
141
- # # do something before the origin action
142
- # options = {} # NOTE: see `options` parameter for more details
143
- # create!(options) do |format| # NOTE: this is better than using `super`
144
- # # NOTE: this block is for `respond_with` which works similar to `respond_to`
145
- # # customize response behaviour, or do something before the request is rendered
146
- # end
147
- # end
148
- # ```
149
- #
150
- # Otherwise, it can be replaced completely in subclasses:
151
- #
152
- # ```
153
- # def create
154
- # # NOTE: `@resource` will be used by the view, please ensure it is assigned, for example:
155
- # @resource = Product.new resource_params.merge(new_arrival: true)
156
- # if @resource.save
157
- # redirect_to helper.index_path(current_model_class)
158
- # else
159
- # render :new
160
- # end
161
- # end
162
- # ```
163
- # @param options [Hash] (since 5.2.0) options for
164
- # {https://www.rubydoc.info/gems/responders/ActionController/RespondWith#respond_with-instance_method
165
- # respond_with}. In addition, options `:params` is supported, see below
166
- # @option options [ActionController::Parameters, Hash] :params
167
- # permitted parameters for servicer to create the record. _(defaults to: {#resource_params})_
168
- # @yield [format] block for
169
- # {https://www.rubydoc.info/gems/responders/ActionController/RespondWith#respond_with-instance_method
170
- # respond_with}
171
- # to customize response behaviour.
172
- # @raise [Wallaby::Forbidden] if user has no access
173
- def create(options = {}, &block)
174
- set_defaults_for :create, options
175
- current_authorizer.authorize :create, resource
176
- current_servicer.create resource, options.delete(:params)
177
- respond_with resource, options, &block
178
- end
179
-
180
- alias create! create
181
-
182
- # @note This is a template method that can be overridden by subclasses.
183
- # This is a resourceful action to display the record details that user is allowed to.
184
- #
185
- # It can be customized as below in subclasses:
186
- #
187
- # ```
188
- # def show
189
- # # do something before the origin action
190
- # options = {} # NOTE: see `options` parameter for more details
191
- # show!(options) do |format| # NOTE: this is better than using `super`
192
- # # NOTE: this block is for `respond_with` which works similar to `respond_to`
193
- # # customize response behaviour, or do something before the request is rendered
194
- # end
195
- # end
196
- # ```
197
- #
198
- # Otherwise, it can be replaced completely in subclasses:
199
- #
200
- # ```
201
- # def show
202
- # # NOTE: `@resource` will be used by the view, please ensure it is assigned, for example:
203
- # @resource = Product.find_by_slug params[:id]
204
- # end
205
- # ```
206
- # @param options [Hash] (since 5.2.0) options for
207
- # {https://www.rubydoc.info/gems/responders/ActionController/RespondWith#respond_with-instance_method
208
- # respond_with}
209
- # @yield [format] block for
210
- # {https://www.rubydoc.info/gems/responders/ActionController/RespondWith#respond_with-instance_method
211
- # respond_with}
212
- # to customize response behaviour.
213
- # @raise [Wallaby::Forbidden] if user has no access
214
- def show(options = {}, &block)
215
- current_authorizer.authorize :show, resource
216
- respond_with resource, options, &block
217
- end
218
-
219
- alias show! show
220
-
221
- # @note This is a template method that can be overridden by subclasses.
222
- # This is a resourceful action to show the form to edit record that user is allowed to.
223
- #
224
- # It can be customized as below in subclasses:
225
- #
226
- # ```
227
- # def edit
228
- # # do something before the origin action
229
- # options = {} # NOTE: see `options` parameter for more details
230
- # edit!(options) do |format| # NOTE: this is better than using `super`
231
- # # NOTE: this block is for `respond_with` which works similar to `respond_to`
232
- # # customize response behaviour, or do something before the request is rendered
233
- # end
234
- # end
235
- # ```
236
- #
237
- # Otherwise, it can be replaced completely in subclasses:
238
- #
239
- # ```
240
- # def edit
241
- # # NOTE: `@resource` will be used by the view, please ensure it is assigned, for example:
242
- # @resource = Product.find_by_slug params[:id]
243
- # end
244
- # ```
245
- # @param options [Hash] (since 5.2.0) options for
246
- # {https://www.rubydoc.info/gems/responders/ActionController/RespondWith#respond_with-instance_method
247
- # respond_with}
248
- # @yield [format] block for
249
- # {https://www.rubydoc.info/gems/responders/ActionController/RespondWith#respond_with-instance_method
250
- # respond_with}
251
- # to customize response behaviour.
252
- # @raise [Wallaby::Forbidden] if user has no access
253
- def edit(options = {}, &block)
254
- current_authorizer.authorize :edit, resource
255
- respond_with resource, options, &block
256
- end
257
-
258
- alias edit! edit
259
-
260
- # @note This is a template method that can be overridden by subclasses.
261
- # This is a resourceful action to update the record that user is allowed to.
262
- #
263
- # If record is updated successfully, user will be navigated to the record show page.
264
- # Otherwise, the form will be shown again with error messages.
265
- #
266
- # It can be customized as below in subclasses:
267
- #
268
- # ```
269
- # def update
270
- # # do something before the origin action
271
- # options = {} # NOTE: see `options` parameter for more details
272
- # update!(options) do |format| # NOTE: this is better than using `super`
273
- # # NOTE: this block is for `respond_with` which works similar to `respond_to`
274
- # # customize response behaviour, or do something before the request is rendered
275
- # end
276
- # end
277
- # ```
278
- #
279
- # Otherwise, it can be replaced completely in subclasses:
280
- #
281
- # ```
282
- # def update
283
- # # NOTE: `@resource` will be used by the view, please ensure it is assigned, for example:
284
- # @resource = Product.find_by_slug params[:id]
285
- # @resource.assign_attributes resource_params.merge(new_arrival: true)
286
- # if @resource.save
287
- # redirect_to helper.index_path(current_model_class)
288
- # else
289
- # render :new
290
- # end
291
- # end
292
- # ```
293
- # @param options [Hash] (since 5.2.0) options for
294
- # {https://www.rubydoc.info/gems/responders/ActionController/RespondWith#respond_with-instance_method
295
- # respond_with}. In addition, options `:params` is supported, see below
296
- # @option options [ActionController::Parameters, Hash] :params
297
- # permitted parameters for servicer to update the record. _(defaults to: {#resource_params})_
298
- # @yield [format] block for
299
- # {https://www.rubydoc.info/gems/responders/ActionController/RespondWith#respond_with-instance_method
300
- # respond_with}
301
- # to customize response behaviour.
302
- # @raise [Wallaby::Forbidden] if user has no access
303
- def update(options = {}, &block)
304
- set_defaults_for :update, options
305
- current_authorizer.authorize :update, resource
306
- current_servicer.update resource, options.delete(:params)
307
- respond_with resource, options, &block
308
- end
309
-
310
- alias update! update
311
-
312
- # @note This is a template method that can be overridden by subclasses.
313
- # This is a resourceful action to delete the record that user is allowed to.
314
- #
315
- # It can be customized as below in subclasses:
316
- #
317
- # ```
318
- # def destroy
319
- # # do something before the origin action
320
- # options = {} # NOTE: see `options` parameter for more details
321
- # destroy!(options) do |format| # NOTE: this is better than using `super`
322
- # # NOTE: this block is for `respond_with` which works similar to `respond_to`
323
- # # customize response behaviour, or do something before the request is rendered
324
- # end
325
- # end
326
- # ```
327
- #
328
- # Otherwise, it can be replaced completely in subclasses:
329
- #
330
- # ```
331
- # def destroy
332
- # # NOTE: `@resource` will be used by the view, please ensure it is assigned, for example:
333
- # @resource = Product.find_by_slug params[:id]
334
- # @resource.destroy
335
- # redirect_to helper.index_path(current_model_class)
336
- # end
337
- # ```
338
- # @param options [Hash] (since 5.2.0) options for
339
- # {https://www.rubydoc.info/gems/responders/ActionController/RespondWith#respond_with-instance_method
340
- # respond_with}. In addition, options `:params` is supported, see below
341
- # @option options [ActionController::Parameters, Hash] :params
342
- # permitted parameters for servicer to destroy the record. _(defaults to: {#resource_params})_
343
- # @yield [format] block for
344
- # {https://www.rubydoc.info/gems/responders/ActionController/RespondWith#respond_with-instance_method
345
- # respond_with}
346
- # to customize response behaviour.
347
- # @raise [Wallaby::Forbidden] if user has no access
348
- def destroy(options = {}, &block)
349
- set_defaults_for :destroy, options
350
- current_authorizer.authorize :destroy, resource
351
- current_servicer.destroy resource, options.delete(:params)
352
- respond_with resource, options, &block
353
- end
354
-
355
- alias destroy! destroy
356
-
357
- # @note This is a template method that can be overridden by subclasses.
358
- # To whitelist the params for {#create} and {#update} actions.
359
- #
360
- # If Wallaby cannot generate the correct strong parameters, it can be replaced, for example:
361
- #
362
- # ```
363
- # def resource_params
364
- # params.fetch(:product, {}).permit(:name, :sku)
365
- # end
366
- # ```
367
- # @return [ActionController::Parameters] whitelisted params
368
- def resource_params
369
- @resource_params ||= current_servicer.permit params, action_name
370
- end
371
-
372
- # @!method collection(options = {}, &block)
373
- # (see Wallaby::Resourcable#collection)
374
- # @see Wallaby::Resourcable#collection
375
- alias collection! collection
376
-
377
- # @!method resource(options = {}, &block)
378
- # (see Wallaby::Resourcable#resource)
379
- # @see Wallaby::Resourcable#resource
380
- alias resource! resource
10
+ class ResourcesController
11
+ include ResourcesConcern
381
12
  end
382
13
  end
@@ -4,7 +4,7 @@
4
4
  # Defualt ability for wallaby
5
5
  # If main app has defined `ability.rb`, this file will not be loaded/used.
6
6
  class Ability
7
- include ::CanCan::Ability
7
+ include ::CanCan::Ability if defined?(::CanCan)
8
8
 
9
9
  # @param _user [Object]
10
10
  def initialize(_user)
@@ -1,140 +1,104 @@
1
- # Files in the config/locales directory are used for internationalization
2
- # and are automatically loaded by Rails. If you want to use locales other
3
- # than English, add the necessary files in this directory.
4
- #
5
- # To use the locales, use `I18n.t`:
6
- #
7
- # I18n.t 'hello'
8
- #
9
- # In views, this is aliased to just `t`:
10
- #
11
- # <%= t('hello') %>
12
- #
13
- # To use a different locale, set it with `I18n.locale`:
14
- #
15
- # I18n.locale = :es
16
- #
17
- # This would use the information in config/locales/es.yml.
18
- #
19
- # To learn more, please read the Rails Internationalization guide
20
- # available at http://guides.rubyonrails.org/i18n.html.
21
-
22
1
  en:
23
- labels:
24
- count: 'Count: '
25
- auto_select_hint: 'Type to select...'
26
- upload: 'Upload'
27
- empty: 'null'
28
- na: 'n/a'
29
- edit: 'Edit # %{id}'
30
- create: 'Create a %{model}'
2
+ wallaby:
3
+ labels:
4
+ count: 'Count: '
5
+ auto_select_hint: 'Type to select...'
6
+ upload: 'Upload'
7
+ empty: 'null'
8
+ na: 'n/a'
9
+ edit: 'Edit # %{id}'
10
+ create: 'Create a %{model}'
31
11
 
32
- buttons:
33
- save: 'Save'
12
+ buttons:
13
+ save: 'Save'
34
14
 
35
- links:
36
- new: 'Create %{model}'
37
- show: 'Show'
38
- edit: 'Edit'
39
- delete: 'Delete'
40
- cancel: 'Cancel'
41
- confirm:
42
- delete: 'Please confirm to delete'
43
- export: 'Export as %{ext}'
15
+ links:
16
+ new: 'Create %{model}'
17
+ show: 'Show'
18
+ edit: 'Edit'
19
+ delete: 'Delete'
20
+ cancel: 'Cancel'
21
+ confirm:
22
+ delete: 'Please confirm to delete'
23
+ export: 'Export as %{ext}'
44
24
 
45
- http_errors:
46
- report_error_html: 'And report the error <a href="https://github.com/reinteractive/wallaby/issues/new" target="_blank">here</a>.'
47
- not_implemented: 'Not implemented.'
48
- internal_server_error: 'Hope you feel better.'
49
- bad_request: 'Your request is not supported.'
50
- not_found: 'Not found.'
51
- unprocessable_entity: 'Your request cannot be processed.'
52
- unauthorized: 'You need to sign in to access this page.'
53
- forbidden: 'You need permission to access this page.'
25
+ http_errors:
26
+ report_error_html: 'And report the error <a href="https://github.com/reinteractive/wallaby/issues/new" target="_blank">here</a>.'
27
+ not_implemented: 'Not implemented.'
28
+ internal_server_error: 'Hope you feel better.'
29
+ bad_request: 'Your request is not supported.'
30
+ not_found: 'Not found.'
31
+ unprocessable_entity: 'Your request cannot be processed.'
32
+ unauthorized: 'You need to sign in to access this page.'
33
+ forbidden: 'You need permission to access this page.'
54
34
 
55
- json_errors:
56
- not_implemented: 'Not implemented.'
57
- internal_server_error: 'Internal server error.'
58
- bad_request: 'Your request is not supported.'
59
- not_found: 'Not found.'
60
- unprocessable_entity: 'Your request cannot be processed.'
61
- unauthorized: 'You need to sign in to access this page.'
62
- forbidden: 'You need permission to access this page.'
35
+ json_errors:
36
+ not_implemented: 'Not implemented.'
37
+ internal_server_error: 'Internal server error.'
38
+ bad_request: 'Your request is not supported.'
39
+ not_found: 'Not found.'
40
+ unprocessable_entity: 'Your request cannot be processed.'
41
+ unauthorized: 'You need to sign in to access this page.'
42
+ forbidden: 'You need permission to access this page.'
63
43
 
64
- errors:
65
- invalid:
66
- models: '%{models} are invalid models.'
67
- inheritance: '%{klass} does not inherit from %{parent}.'
68
- type_required: 'Type is required for %{field_name}.'
69
- not_found:
70
- collection: 'Records cannot be found. Click + button to add one.'
71
- model: 'Model %{model} cannot be found.'
72
- resource: 'Record %{resource} cannot be found.'
73
- unprocessable_entity:
74
- keyword_search: 'Unable to perform keyword search when no text fields can be used.'
75
- field_colon_search: 'Unable to perform field colon search for %{invalid_fields}.'
76
- model: 'Unable to handle model %{model}.'
77
- unauthorized: 'User %{user} is trying to perform %{action} on %{subject}'
78
- pundit:
44
+ errors:
45
+ invalid:
46
+ models: '%{models} are invalid models.'
47
+ inheritance: '%{klass} does not inherit from %{parent}.'
48
+ type_required: 'Type is required for %{field_name}.'
79
49
  not_found:
80
- scope_policy: 'Cannot find scope policy for %{scope}.'
81
- attributes_for: 'Cannot find attributes for %{subject}.'
82
- activerecord:
83
- paginatable: '%{collection} is not paginatable.'
84
- required: '%{subject} is required.'
85
- not_implemented:
86
- model_servicer: 'Custom model servicer method `%{method_name}` is not implemented'
87
-
88
- pagination:
89
- prev: 'Prev'
90
- next: 'Next'
91
- from_to: '%{from} to %{to}'
92
- of: ' of '
93
- total_count: '%{total}'
94
- pers: 'Page Size'
95
- pages: 'Page Number'
50
+ collection: 'Records cannot be found. Click + button to add one.'
51
+ model: 'Model %{model} cannot be found.'
52
+ resource: 'Record %{resource} cannot be found.'
53
+ unprocessable_entity:
54
+ keyword_search: 'Unable to perform keyword search when no text fields can be used.'
55
+ field_colon_search: 'Unable to perform field colon search for %{invalid_fields}.'
56
+ model: 'Unable to handle model %{model}.'
57
+ unauthorized: 'User %{user} is trying to perform %{action} on %{subject}'
58
+ pundit:
59
+ not_found:
60
+ scope_policy: 'Cannot find scope policy for %{scope}.'
61
+ attributes_for: 'Cannot find attributes for %{subject}.'
62
+ required: '%{subject} is required.'
63
+ not_implemented:
64
+ model_servicer: 'Custom model servicer method `%{method_name}` is not implemented'
96
65
 
97
- filters:
98
- title: 'Filters'
99
- all: 'All'
66
+ pagination:
67
+ prev: 'Prev'
68
+ next: 'Next'
69
+ from_to: '%{from} to %{to}'
70
+ of: ' of '
71
+ total_count: '%{total}'
72
+ pers: 'Page Size'
73
+ pages: 'Page Number'
100
74
 
101
- search:
102
- hint: 'Press enter to search.'
75
+ filters:
76
+ title: 'Filters'
77
+ all: 'All'
103
78
 
104
- hints:
105
- box_html: 'Format: <code>(x1, y1), (x2, y2)</code> where <i>(x1,y1)</i> and <i>(x2,y2)</i> are any two opposite corners of the box.'
106
- cidr_html: 'Example: <code>192.168.1.1/24</code> which holds an IPv4 or IPv6 network specification.'
107
- circle_html: 'Format: <code><(x, y), r></code> where <i>(x,y)</i> is the center point and <i>r</i> is the radius of the circle.'
108
- hstore_html: 'Format: <code>"Key1" => "Value1", "Key2" => "Value2"</code> is used for input and output, includes zero or more <i>key => value</i> pairs separated by commas.'
109
- inet_html: 'Example: <code>192.168.1.1/24</code> which holds an IPv4 or IPv6 network specification.'
110
- line_html: 'Format: <code>{ A, B, C }</code> which are represented by the linear equation <i>Ax + By + C = 0</i>.'
111
- lseg_html: 'Format: <code>[(x1, y1), (x2, y2)]</code> where <i>(x1,y1)</i> and <i>(x2,y2)</i> are the end points of the line segment.'
112
- ltree_html: 'Example: <code>Top.Countries.Europe.Russia</code> which is a sequence of zero or more labels separated by dots.'
113
- macaddr_html: 'Example: <code>08:00:2b:01:02:03</code> which stores MAC addresses.'
114
- path_html: 'Format: <code>((x1, y1) , ... , (xn, yn))</code> where the points are the end points of the line segments comprising the path.'
115
- polygon_html: 'Format: <code>((x1, y1) , ... , (xn, yn))</code> where the points are the end points of the line segments comprising the boundary of the polygon.'
79
+ search:
80
+ hint: 'Press enter to search.'
116
81
 
117
- deprecation:
118
- authorizer: "[DEPRECATION] `authorizer` will be removed from 5.3.*. Please use `current_authorizer` instead.\n(called from %{from})"
119
- current_model_service: "[DEPRECATION] `current_model_service` will be removed from 5.3.*. Please use `current_servicer` instead.\n(called from %{from})"
120
- find_filter_name: "[DEPRECATION] `Wallaby::Utils.find_filter_name` will be removed from 5.3.*. Please use `Wallaby::FilterUtils.filter_name_by` instead.\n(called from %{from})"
121
- form_type_partial_render: "[DEPRECATION] `form_type_partial_render` will be removed from 5.3.*. Please use `type_render` instead.\n(called from %{from})"
122
- index_params: "[DEPRECATION] `index_params` will be removed from 5.3.*.\n(called from %{from})"
123
- paginator_of: "[DEPRECATION] `paginator_of` will be removed from 5.3.*. Please use `current_paginator` instead.\n(called from %{from})"
124
- resource_paginator_inheirtance: "[DEPRECATION] `Wallaby::ResourcePaginator` will be removed from 5.3.*. Please inherit from `Wallaby::ModelPaginator` instead.\n(called from %{from})"
125
- resource_paginator=: "[DEPRECATION] `resource_paginator=` will be removed from 5.3.*. Please use `model_paginator=` instead.\n(called from %{from})"
126
- type_partial_render: "[DEPRECATION] `type_partial_render` will be removed from 5.3.*. Please use `type_render` instead.\n(called from %{from})"
82
+ hints:
83
+ box_html: 'Format: <code>(x1, y1), (x2, y2)</code> where <i>(x1,y1)</i> and <i>(x2,y2)</i> are any two opposite corners of the box.'
84
+ cidr_html: 'Example: <code>192.168.1.1/24</code> which holds an IPv4 or IPv6 network specification.'
85
+ circle_html: 'Format: <code><(x, y), r></code> where <i>(x,y)</i> is the center point and <i>r</i> is the radius of the circle.'
86
+ hstore_html: 'Format: <code>"Key1" => "Value1", "Key2" => "Value2"</code> is used for input and output, includes zero or more <i>key => value</i> pairs separated by commas.'
87
+ inet_html: 'Example: <code>192.168.1.1/24</code> which holds an IPv4 or IPv6 network specification.'
88
+ line_html: 'Format: <code>{ A, B, C }</code> which are represented by the linear equation <i>Ax + By + C = 0</i>.'
89
+ lseg_html: 'Format: <code>[(x1, y1), (x2, y2)]</code> where <i>(x1,y1)</i> and <i>(x2,y2)</i> are the end points of the line segment.'
90
+ ltree_html: 'Example: <code>Top.Countries.Europe.Russia</code> which is a sequence of zero or more labels separated by dots.'
91
+ macaddr_html: 'Example: <code>08:00:2b:01:02:03</code> which stores MAC addresses.'
92
+ path_html: 'Format: <code>((x1, y1) , ... , (xn, yn))</code> where the points are the end points of the line segments comprising the path.'
93
+ polygon_html: 'Format: <code>((x1, y1) , ... , (xn, yn))</code> where the points are the end points of the line segments comprising the boundary of the polygon.'
127
94
 
128
- fa:
129
- # map fa 5's icon name to version 4
130
- # @see this fa migration document https://fontawesome.com/how-to-use/on-the-web/setup/upgrading-from-version-4
131
- v4:
132
- clock: 'clock-o'
133
- bars: 'navicon'
134
- calendar: 'calendar-o'
135
- check-square: 'check-square-o'
136
- square: 'square-o'
137
- link: 'chain'
138
- user: 'user-o'
139
- v5:
140
- no-need: 'no-need'
95
+ deprecation:
96
+ authorizer: "[DEPRECATION] `authorizer` will be removed from 5.3.*. Please use `current_authorizer` instead.\n(called from %{from})"
97
+ current_model_service: "[DEPRECATION] `current_model_service` will be removed from 5.3.*. Please use `current_servicer` instead.\n(called from %{from})"
98
+ find_filter_name: "[DEPRECATION] `Wallaby::Utils.find_filter_name` will be removed from 5.3.*. Please use `Wallaby::FilterUtils.filter_name_by` instead.\n(called from %{from})"
99
+ form_type_partial_render: "[DEPRECATION] `form_type_partial_render` will be removed from 5.3.*. Please use `type_render` instead.\n(called from %{from})"
100
+ index_params: "[DEPRECATION] `index_params` will be removed from 5.3.*.\n(called from %{from})"
101
+ paginator_of: "[DEPRECATION] `paginator_of` will be removed from 5.3.*. Please use `current_paginator` instead.\n(called from %{from})"
102
+ resource_paginator_inheirtance: "[DEPRECATION] `Wallaby::ResourcePaginator` will be removed from 5.3.*. Please inherit from `Wallaby::ModelPaginator` instead.\n(called from %{from})"
103
+ resource_paginator=: "[DEPRECATION] `resource_paginator=` will be removed from 5.3.*. Please use `model_paginator=` instead.\n(called from %{from})"
104
+ type_partial_render: "[DEPRECATION] `type_partial_render` will be removed from 5.3.*. Please use `type_render` instead.\n(called from %{from})"