wallaby 5.1.4 → 5.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/wallaby/abstract_resources_controller.rb +1 -1
  3. data/app/views/wallaby/resources/form/_belongs_to.html.erb +1 -0
  4. data/app/views/wallaby/resources/form/_bigint.html.erb +1 -0
  5. data/app/views/wallaby/resources/form/_bigserial.html.erb +1 -0
  6. data/app/views/wallaby/resources/form/_binary.html.erb +1 -0
  7. data/app/views/wallaby/resources/form/_bit.html.erb +1 -0
  8. data/app/views/wallaby/resources/form/_bit_varying.html.erb +1 -0
  9. data/app/views/wallaby/resources/form/_blob.html.erb +1 -0
  10. data/app/views/wallaby/resources/form/_boolean.html.erb +1 -0
  11. data/app/views/wallaby/resources/form/_box.html.erb +1 -3
  12. data/app/views/wallaby/resources/form/_cidr.html.erb +1 -3
  13. data/app/views/wallaby/resources/form/_circle.html.erb +1 -3
  14. data/app/views/wallaby/resources/form/_citext.html.erb +1 -0
  15. data/app/views/wallaby/resources/form/_color.html.erb +1 -0
  16. data/app/views/wallaby/resources/form/_date.html.erb +1 -0
  17. data/app/views/wallaby/resources/form/_daterange.html.erb +1 -0
  18. data/app/views/wallaby/resources/form/_datetime.html.erb +1 -0
  19. data/app/views/wallaby/resources/form/_decimal.html.erb +1 -0
  20. data/app/views/wallaby/resources/form/_dropdown.html.erb +1 -0
  21. data/app/views/wallaby/resources/form/_email.html.erb +1 -0
  22. data/app/views/wallaby/resources/form/_file.html.erb +1 -0
  23. data/app/views/wallaby/resources/form/_float.html.erb +1 -0
  24. data/app/views/wallaby/resources/form/_has_and_belongs_to_many.html.erb +1 -0
  25. data/app/views/wallaby/resources/form/_has_many.html.erb +1 -0
  26. data/app/views/wallaby/resources/form/_hstore.html.erb +1 -3
  27. data/app/views/wallaby/resources/form/_inet.html.erb +1 -3
  28. data/app/views/wallaby/resources/form/_int4range.html.erb +1 -0
  29. data/app/views/wallaby/resources/form/_int8range.html.erb +1 -0
  30. data/app/views/wallaby/resources/form/_integer.html.erb +1 -0
  31. data/app/views/wallaby/resources/form/_json.html.erb +1 -0
  32. data/app/views/wallaby/resources/form/_jsonb.html.erb +1 -0
  33. data/app/views/wallaby/resources/form/_line.html.erb +1 -3
  34. data/app/views/wallaby/resources/form/_longblob.html.erb +1 -0
  35. data/app/views/wallaby/resources/form/_longtext.html.erb +1 -0
  36. data/app/views/wallaby/resources/form/_lseg.html.erb +1 -3
  37. data/app/views/wallaby/resources/form/_ltree.html.erb +1 -3
  38. data/app/views/wallaby/resources/form/_macaddr.html.erb +1 -3
  39. data/app/views/wallaby/resources/form/_markdown.html.erb +1 -0
  40. data/app/views/wallaby/resources/form/_mediumblob.html.erb +1 -0
  41. data/app/views/wallaby/resources/form/_mediumtext.html.erb +1 -0
  42. data/app/views/wallaby/resources/form/_money.html.erb +1 -0
  43. data/app/views/wallaby/resources/form/_numrange.html.erb +1 -0
  44. data/app/views/wallaby/resources/form/_password.html.erb +1 -0
  45. data/app/views/wallaby/resources/form/_path.html.erb +1 -3
  46. data/app/views/wallaby/resources/form/_point.html.erb +1 -0
  47. data/app/views/wallaby/resources/form/_polygon.html.erb +1 -3
  48. data/app/views/wallaby/resources/form/_serial.html.erb +1 -0
  49. data/app/views/wallaby/resources/form/_sti.html.erb +1 -0
  50. data/app/views/wallaby/resources/form/_string.html.erb +1 -0
  51. data/app/views/wallaby/resources/form/_text.html.erb +1 -0
  52. data/app/views/wallaby/resources/form/_time.html.erb +1 -0
  53. data/app/views/wallaby/resources/form/_tinyblob.html.erb +1 -0
  54. data/app/views/wallaby/resources/form/_tinytext.html.erb +1 -0
  55. data/app/views/wallaby/resources/form/_tsrange.html.erb +1 -0
  56. data/app/views/wallaby/resources/form/_tstzrange.html.erb +1 -0
  57. data/app/views/wallaby/resources/form/_tsvector.html.erb +1 -0
  58. data/app/views/wallaby/resources/form/_unsigned_bigint.html.erb +1 -0
  59. data/app/views/wallaby/resources/form/_unsigned_decimal.html.erb +1 -0
  60. data/app/views/wallaby/resources/form/_unsigned_float.html.erb +1 -0
  61. data/app/views/wallaby/resources/form/_unsigned_integer.html.erb +1 -0
  62. data/app/views/wallaby/resources/form/_uuid.html.erb +1 -0
  63. data/app/views/wallaby/resources/form/_xml.html.erb +1 -0
  64. data/app/views/wallaby/resources/show/_image.html.erb +1 -5
  65. data/lib/adaptors/wallaby/active_record/model_service_provider/querier/transformer.rb +1 -0
  66. data/lib/helpers/wallaby/form_helper.rb +15 -0
  67. data/lib/interfaces/wallaby/model_decorator.rb +5 -3
  68. data/lib/interfaces/wallaby/model_decorator/field_helpers.rb +4 -6
  69. data/{app → lib}/routes/wallaby/resources_router.rb +1 -13
  70. data/lib/utils/wallaby/utils.rb +1 -1
  71. data/lib/wallaby/engine.rb +22 -8
  72. data/lib/wallaby/version.rb +1 -1
  73. metadata +7 -7
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: '09976f4239802ee3dc2eb137068c2f6289f0cf7a'
4
- data.tar.gz: 724958b07b53194c30c6ccc9bf314791ae0c894e
3
+ metadata.gz: d350fea3b2b5c2c80941c75875aa66a6a660efaa
4
+ data.tar.gz: ff4f3f8a4edeafa44eb548e6e89a3a1a26a74602
5
5
  SHA512:
6
- metadata.gz: 2c83059d14238fa032b1a41d44b2809cbbb5b27613335498e8f550296d974a4168697a6b7952f12f6424b7ebbf04f479184911e2c417cc2cbb65c7fc8f2cb914
7
- data.tar.gz: 147288bc92b01a8b9a8f98ce3d9f134e57dca63a1fafea891bb0916b6b79d3449cc3d8ac0d9cd3578871fd51d0a6ecb224a167835dd580d8a6dab2fc79984d9a
6
+ metadata.gz: 630a3c2632aca7189885132b805c6bf6cffd71497ff1562e844040eeab96af18048871c841a359a41fddf6044f8ece6880a185085a9fb0afc118f7b26438a323
7
+ data.tar.gz: f9f092cc627eb09b631c0ac0bb4394019a5b9ac5c56ebb970c752a8b8845e0819bb9efc4b32875790ea16ff0392b359dd8f0b8859236cc245df5564c5cdc1a14
@@ -319,7 +319,7 @@ module Wallaby
319
319
  end
320
320
  end
321
321
 
322
- # Get current model decorator so that we could retrive metadata for given
322
+ # Get current model decorator so that we could retrieve metadata for given
323
323
  # model class.
324
324
  def current_model_decorator
325
325
  @current_model_decorator ||= helpers.model_decorator current_model_class
@@ -48,6 +48,7 @@ readonly = cannot? :edit, metadata[:class]
48
48
  <% end %>
49
49
  </div>
50
50
  <%= form.error_messages field_name %>
51
+ <%= hint_of metadata %>
51
52
  <% unless metadata[:is_polymorphic] %>
52
53
  <p class="help-block">
53
54
  <%= new_link metadata[:class] %>
@@ -15,4 +15,5 @@ The following params are the variables that can be used in this partial.
15
15
  </div>
16
16
  </div>
17
17
  <%= form.error_messages field_name %>
18
+ <%= hint_of metadata %>
18
19
  </div>
@@ -15,4 +15,5 @@ The following params are the variables that can be used in this partial.
15
15
  </div>
16
16
  </div>
17
17
  <%= form.error_messages field_name %>
18
+ <%= hint_of metadata %>
18
19
  </div>
@@ -18,4 +18,5 @@ The following params are the variables that can be used in this partial.
18
18
  </div>
19
19
  </div>
20
20
  <%= form.error_messages field_name %>
21
+ <%= hint_of metadata %>
21
22
  </div>
@@ -15,4 +15,5 @@ The following params are the variables that can be used in this partial.
15
15
  </div>
16
16
  </div>
17
17
  <%= form.error_messages field_name %>
18
+ <%= hint_of metadata %>
18
19
  </div>
@@ -15,4 +15,5 @@ The following params are the variables that can be used in this partial.
15
15
  </div>
16
16
  </div>
17
17
  <%= form.error_messages field_name %>
18
+ <%= hint_of metadata %>
18
19
  </div>
@@ -18,4 +18,5 @@ The following params are the variables that can be used in this partial.
18
18
  </div>
19
19
  </div>
20
20
  <%= form.error_messages field_name %>
21
+ <%= hint_of metadata %>
21
22
  </div>
@@ -20,4 +20,5 @@ The following params are the variables that can be used in this partial.
20
20
  </div>
21
21
  </div>
22
22
  <%= form.error_messages field_name %>
23
+ <%= hint_of metadata %>
23
24
  </div>
@@ -15,7 +15,5 @@ The following params are the variables that can be used in this partial.
15
15
  </div>
16
16
  </div>
17
17
  <%= form.error_messages field_name %>
18
- <p class="help-block">
19
- <%= t 'hints.box_html' %>
20
- </p>
18
+ <%= hint_of metadata %>
21
19
  </div>
@@ -15,7 +15,5 @@ The following params are the variables that can be used in this partial.
15
15
  </div>
16
16
  </div>
17
17
  <%= form.error_messages field_name %>
18
- <p class="help-block">
19
- <%= t 'hints.cidr_html' %>
20
- </p>
18
+ <%= hint_of metadata %>
21
19
  </div>
@@ -15,7 +15,5 @@ The following params are the variables that can be used in this partial.
15
15
  </div>
16
16
  </div>
17
17
  <%= form.error_messages field_name %>
18
- <p class="help-block">
19
- <%= t 'hints.circle_html' %>
20
- </p>
18
+ <%= hint_of metadata %>
21
19
  </div>
@@ -11,6 +11,7 @@ The following params are the variables that can be used in this partial.
11
11
  <%= form.label field_name, metadata[:label] %>
12
12
  <%= form.text_area field_name, class: 'form-control', data: { init: 'summernote' } %>
13
13
  <%= form.error_messages field_name %>
14
+ <%= hint_of metadata %>
14
15
  </div>
15
16
 
16
17
  <% unless @summernote_init %>
@@ -15,6 +15,7 @@ The following params are the variables that can be used in this partial.
15
15
  </div>
16
16
  </div>
17
17
  <%= form.error_messages field_name %>
18
+ <%= hint_of metadata %>
18
19
  </div>
19
20
 
20
21
  <% unless @colorpicker_init %>
@@ -18,6 +18,7 @@ The following params are the variables that can be used in this partial.
18
18
  </div>
19
19
  </div>
20
20
  <%= form.error_messages field_name %>
21
+ <%= hint_of metadata %>
21
22
  </div>
22
23
 
23
24
  <% unless @datepicker_init %>
@@ -26,6 +26,7 @@ The following params are the variables that can be used in this partial.
26
26
  </div>
27
27
  </div>
28
28
  <%= form.error_messages field_name %>
29
+ <%= hint_of metadata %>
29
30
  </div>
30
31
 
31
32
  <% unless @datepicker_init %>
@@ -18,6 +18,7 @@ The following params are the variables that can be used in this partial.
18
18
  </div>
19
19
  </div>
20
20
  <%= form.error_messages field_name %>
21
+ <%= hint_of metadata %>
21
22
  </div>
22
23
 
23
24
  <% unless @datetimepicker_init %>
@@ -15,4 +15,5 @@ The following params are the variables that can be used in this partial.
15
15
  </div>
16
16
  </div>
17
17
  <%= form.error_messages field_name %>
18
+ <%= hint_of metadata %>
18
19
  </div>
@@ -15,4 +15,5 @@ The following params are the variables that can be used in this partial.
15
15
  </div>
16
16
  </div>
17
17
  <%= form.error_messages field_name %>
18
+ <%= hint_of metadata %>
18
19
  </div>
@@ -11,4 +11,5 @@ The following params are the variables that can be used in this partial.
11
11
  <%= form.label field_name, metadata[:label] %>
12
12
  <%= form.email_field field_name, class: 'form-control' %>
13
13
  <%= form.error_messages field_name %>
14
+ <%= hint_of metadata %>
14
15
  </div>
@@ -18,4 +18,5 @@ The following params are the variables that can be used in this partial.
18
18
  </div>
19
19
  </div>
20
20
  <%= form.error_messages field_name %>
21
+ <%= hint_of metadata %>
21
22
  </div>
@@ -15,4 +15,5 @@ The following params are the variables that can be used in this partial.
15
15
  </div>
16
16
  </div>
17
17
  <%= form.error_messages field_name %>
18
+ <%= hint_of metadata %>
18
19
  </div>
@@ -41,6 +41,7 @@ readonly = cannot? :edit, metadata[:class]
41
41
  <% end %>
42
42
  </div>
43
43
  <%= form.error_messages field_name %>
44
+ <%= hint_of metadata %>
44
45
  <p class="help-block">
45
46
  <%= new_link metadata[:class] %>
46
47
  </p>
@@ -40,6 +40,7 @@ readonly = cannot? :edit, metadata[:class]
40
40
  <% end %>
41
41
  </div>
42
42
  <%= form.error_messages field_name %>
43
+ <%= hint_of metadata %>
43
44
  <p class="help-block">
44
45
  <%= new_link metadata[:class] %>
45
46
  </p>
@@ -11,9 +11,7 @@ The following params are the variables that can be used in this partial.
11
11
  <%= form.label field_name, metadata[:label] %>
12
12
  <%= form.text_area field_name, value: value.to_s[%r(\A{(.*)}\Z), 1], class: 'form-control', data: { init: 'codemirror', mode: 'ruby' } %>
13
13
  <%= form.error_messages field_name %>
14
- <p class="help-block">
15
- <%= t 'hints.hstore_html' %>
16
- </p>
14
+ <%= hint_of metadata %>
17
15
  </div>
18
16
 
19
17
  <% unless @codemirror_init %>
@@ -15,7 +15,5 @@ The following params are the variables that can be used in this partial.
15
15
  </div>
16
16
  </div>
17
17
  <%= form.error_messages field_name %>
18
- <p class="help-block">
19
- <%= t 'hints.inet_html' %>
20
- </p>
18
+ <%= hint_of metadata %>
21
19
  </div>
@@ -24,4 +24,5 @@ The following params are the variables that can be used in this partial.
24
24
  </div>
25
25
  </div>
26
26
  <%= form.error_messages field_name %>
27
+ <%= hint_of metadata %>
27
28
  </div>
@@ -24,4 +24,5 @@ The following params are the variables that can be used in this partial.
24
24
  </div>
25
25
  </div>
26
26
  <%= form.error_messages field_name %>
27
+ <%= hint_of metadata %>
27
28
  </div>
@@ -15,4 +15,5 @@ The following params are the variables that can be used in this partial.
15
15
  </div>
16
16
  </div>
17
17
  <%= form.error_messages field_name %>
18
+ <%= hint_of metadata %>
18
19
  </div>
@@ -12,6 +12,7 @@ The following params are the variables that can be used in this partial.
12
12
  <%= form.label field_name, metadata[:label] %>
13
13
  <%= form.text_area field_name, value: form_value, class: 'form-control', data: { init: 'codemirror', mode: 'javascript' } %>
14
14
  <%= form.error_messages field_name %>
15
+ <%= hint_of metadata %>
15
16
  </div>
16
17
 
17
18
  <% unless @codemirror_init %>
@@ -12,6 +12,7 @@ The following params are the variables that can be used in this partial.
12
12
  <%= form.label field_name, metadata[:label] %>
13
13
  <%= form.text_area field_name, value: form_value, class: 'form-control', data: { init: 'codemirror', mode: 'javascript' } %>
14
14
  <%= form.error_messages field_name %>
15
+ <%= hint_of metadata %>
15
16
  </div>
16
17
 
17
18
  <% unless @codemirror_init %>
@@ -15,7 +15,5 @@ The following params are the variables that can be used in this partial.
15
15
  </div>
16
16
  </div>
17
17
  <%= form.error_messages field_name %>
18
- <p class="help-block">
19
- <%= t 'hints.line_html' %>
20
- </p>
18
+ <%= hint_of metadata %>
21
19
  </div>
@@ -18,4 +18,5 @@ The following params are the variables that can be used in this partial.
18
18
  </div>
19
19
  </div>
20
20
  <%= form.error_messages field_name %>
21
+ <%= hint_of metadata %>
21
22
  </div>
@@ -11,6 +11,7 @@ The following params are the variables that can be used in this partial.
11
11
  <%= form.label field_name, metadata[:label] %>
12
12
  <%= form.text_area field_name, class: 'form-control', data: { init: 'summernote' } %>
13
13
  <%= form.error_messages field_name %>
14
+ <%= hint_of metadata %>
14
15
  </div>
15
16
 
16
17
  <% unless @summernote_init %>
@@ -15,7 +15,5 @@ The following params are the variables that can be used in this partial.
15
15
  </div>
16
16
  </div>
17
17
  <%= form.error_messages field_name %>
18
- <p class="help-block">
19
- <%= t 'hints.lseg_html' %>
20
- </p>
18
+ <%= hint_of metadata %>
21
19
  </div>
@@ -15,7 +15,5 @@ The following params are the variables that can be used in this partial.
15
15
  </div>
16
16
  </div>
17
17
  <%= form.error_messages field_name %>
18
- <p class="help-block">
19
- <%= t 'hints.ltree_html' %>
20
- </p>
18
+ <%= hint_of metadata %>
21
19
  </div>
@@ -15,7 +15,5 @@ The following params are the variables that can be used in this partial.
15
15
  </div>
16
16
  </div>
17
17
  <%= form.error_messages field_name %>
18
- <p class="help-block">
19
- <%= t 'hints.macaddr_html' %>
20
- </p>
18
+ <%= hint_of metadata %>
21
19
  </div>
@@ -11,6 +11,7 @@ The following params are the variables that can be used in this partial.
11
11
  <%= form.label field_name, metadata[:label] %>
12
12
  <%= form.text_area field_name, class: 'form-control', data: { init: 'codemirror', mode: 'gfm' } %>
13
13
  <%= form.error_messages field_name %>
14
+ <%= hint_of metadata %>
14
15
  </div>
15
16
 
16
17
  <% unless @codemirror_init %>
@@ -18,4 +18,5 @@ The following params are the variables that can be used in this partial.
18
18
  </div>
19
19
  </div>
20
20
  <%= form.error_messages field_name %>
21
+ <%= hint_of metadata %>
21
22
  </div>
@@ -11,6 +11,7 @@ The following params are the variables that can be used in this partial.
11
11
  <%= form.label field_name, metadata[:label] %>
12
12
  <%= form.text_area field_name, class: 'form-control', data: { init: 'summernote' } %>
13
13
  <%= form.error_messages field_name %>
14
+ <%= hint_of metadata %>
14
15
  </div>
15
16
 
16
17
  <% unless @summernote_init %>
@@ -18,4 +18,5 @@ The following params are the variables that can be used in this partial.
18
18
  </div>
19
19
  </div>
20
20
  <%= form.error_messages field_name %>
21
+ <%= hint_of metadata %>
21
22
  </div>
@@ -24,4 +24,5 @@ The following params are the variables that can be used in this partial.
24
24
  </div>
25
25
  </div>
26
26
  <%= form.error_messages field_name %>
27
+ <%= hint_of metadata %>
27
28
  </div>
@@ -15,4 +15,5 @@ The following params are the variables that can be used in this partial.
15
15
  </div>
16
16
  </div>
17
17
  <%= form.error_messages field_name %>
18
+ <%= hint_of metadata %>
18
19
  </div>
@@ -11,7 +11,5 @@ The following params are the variables that can be used in this partial.
11
11
  <%= form.label field_name, metadata[:label] %>
12
12
  <%= form.text_field field_name, class: 'form-control' %>
13
13
  <%= form.error_messages field_name %>
14
- <p class="help-block">
15
- <%= t 'hints.path_html' %>
16
- </p>
14
+ <%= hint_of metadata %>
17
15
  </div>
@@ -24,4 +24,5 @@ The following params are the variables that can be used in this partial.
24
24
  </div>
25
25
  </div>
26
26
  <%= form.error_messages field_name %>
27
+ <%= hint_of metadata %>
27
28
  </div>
@@ -11,7 +11,5 @@ The following params are the variables that can be used in this partial.
11
11
  <%= form.label field_name, metadata[:label] %>
12
12
  <%= form.text_field field_name, class: 'form-control' %>
13
13
  <%= form.error_messages field_name %>
14
- <p class="help-block">
15
- <%= t 'hints.polygon_html' %>
16
- </p>
14
+ <%= hint_of metadata %>
17
15
  </div>
@@ -15,4 +15,5 @@ The following params are the variables that can be used in this partial.
15
15
  </div>
16
16
  </div>
17
17
  <%= form.error_messages field_name %>
18
+ <%= hint_of metadata %>
18
19
  </div>
@@ -15,4 +15,5 @@ The following params are the variables that can be used in this partial.
15
15
  </div>
16
16
  </div>
17
17
  <%= form.error_messages field_name %>
18
+ <%= hint_of metadata %>
18
19
  </div>
@@ -15,4 +15,5 @@ The following params are the variables that can be used in this partial.
15
15
  </div>
16
16
  </div>
17
17
  <%= form.error_messages field_name %>
18
+ <%= hint_of metadata %>
18
19
  </div>
@@ -11,6 +11,7 @@ The following params are the variables that can be used in this partial.
11
11
  <%= form.label field_name, metadata[:label] %>
12
12
  <%= form.text_area field_name, class: 'form-control', data: { init: 'summernote' } %>
13
13
  <%= form.error_messages field_name %>
14
+ <%= hint_of metadata %>
14
15
  </div>
15
16
 
16
17
  <% unless @summernote_init %>
@@ -18,6 +18,7 @@ The following params are the variables that can be used in this partial.
18
18
  </div>
19
19
  </div>
20
20
  <%= form.error_messages field_name %>
21
+ <%= hint_of metadata %>
21
22
  </div>
22
23
 
23
24
  <% unless @timepicker_init %>
@@ -18,4 +18,5 @@ The following params are the variables that can be used in this partial.
18
18
  </div>
19
19
  </div>
20
20
  <%= form.error_messages field_name %>
21
+ <%= hint_of metadata %>
21
22
  </div>
@@ -11,6 +11,7 @@ The following params are the variables that can be used in this partial.
11
11
  <%= form.label field_name, metadata[:label] %>
12
12
  <%= form.text_area field_name, class: 'form-control', data: { init: 'summernote' } %>
13
13
  <%= form.error_messages field_name %>
14
+ <%= hint_of metadata %>
14
15
  </div>
15
16
 
16
17
  <% unless @summernote_init %>
@@ -26,6 +26,7 @@ The following params are the variables that can be used in this partial.
26
26
  </div>
27
27
  </div>
28
28
  <%= form.error_messages field_name %>
29
+ <%= hint_of metadata %>
29
30
  </div>
30
31
 
31
32
  <% unless @datetimepicker_init %>
@@ -26,6 +26,7 @@ The following params are the variables that can be used in this partial.
26
26
  </div>
27
27
  </div>
28
28
  <%= form.error_messages field_name %>
29
+ <%= hint_of metadata %>
29
30
  </div>
30
31
 
31
32
  <% unless @datetimepicker_init %>
@@ -11,4 +11,5 @@ The following params are the variables that can be used in this partial.
11
11
  <%= form.label field_name, metadata[:label] %>
12
12
  <%= form.text_area field_name, class: 'form-control' %>
13
13
  <%= form.error_messages field_name %>
14
+ <%= hint_of metadata %>
14
15
  </div>
@@ -15,4 +15,5 @@ The following params are the variables that can be used in this partial.
15
15
  </div>
16
16
  </div>
17
17
  <%= form.error_messages field_name %>
18
+ <%= hint_of metadata %>
18
19
  </div>
@@ -15,4 +15,5 @@ The following params are the variables that can be used in this partial.
15
15
  </div>
16
16
  </div>
17
17
  <%= form.error_messages field_name %>
18
+ <%= hint_of metadata %>
18
19
  </div>
@@ -15,4 +15,5 @@ The following params are the variables that can be used in this partial.
15
15
  </div>
16
16
  </div>
17
17
  <%= form.error_messages field_name %>
18
+ <%= hint_of metadata %>
18
19
  </div>
@@ -15,4 +15,5 @@ The following params are the variables that can be used in this partial.
15
15
  </div>
16
16
  </div>
17
17
  <%= form.error_messages field_name %>
18
+ <%= hint_of metadata %>
18
19
  </div>
@@ -15,4 +15,5 @@ The following params are the variables that can be used in this partial.
15
15
  </div>
16
16
  </div>
17
17
  <%= form.error_messages field_name %>
18
+ <%= hint_of metadata %>
18
19
  </div>
@@ -11,6 +11,7 @@ The following params are the variables that can be used in this partial.
11
11
  <%= form.label field_name, metadata[:label] %>
12
12
  <%= form.text_area field_name, class: 'form-control', data: { init: 'codemirror', mode: 'xml' } %>
13
13
  <%= form.error_messages field_name %>
14
+ <%= hint_of metadata %>
14
15
  </div>
15
16
 
16
17
  <% unless @codemirror_init %>
@@ -2,8 +2,4 @@
2
2
  <%# @param field_name [String] name of the field %>
3
3
  <%# @param value [Object] value of the field %>
4
4
  <%# @param metadata [Hash] metadata of the field %>
5
- <% if value.nil? %>
6
- <%= null %>
7
- <% else %>
8
- <%= image_tag value, (metadata[:options] || {}) %>
9
- <% end %>
5
+ <%= value ? image_tag(value, metadata[:options].to_h) : null %>
@@ -43,6 +43,7 @@ module Wallaby
43
43
  rule left: simple(:left), op: simple(:op), right: simple(:right) do
44
44
  oped = op.try :to_str
45
45
  operator = SIMPLE_OPERATORS[oped]
46
+ # skip if the operator is unknown
46
47
  next unless operator
47
48
  lefted = left.try :to_str
48
49
  convert = case oped
@@ -41,5 +41,20 @@ module Wallaby
41
41
  end
42
42
  options_for_select options, select_options
43
43
  end
44
+
45
+ # To fetch the hints from the following keys:
46
+ # - hints.#{type}_html
47
+ # - hints.#{type}
48
+ # @param metadata [Hash]
49
+ # @return [String, nil] HTML
50
+ def hint_of(metadata)
51
+ type = metadata[:type]
52
+ hint = metadata[:hint]
53
+ # @see http://guides.rubyonrails.org/i18n.html#using-safe-html-translations
54
+ hint ||= type && t("hints.#{type}_html", default: '').presence
55
+ hint ||= type && t("hints.#{type}", default: '').presence
56
+ return unless hint
57
+ content_tag :p, hint, class: 'help-block'
58
+ end
44
59
  end
45
60
  end
@@ -1,9 +1,11 @@
1
1
  module Wallaby
2
2
  # Model Decorator interface, designed to maintain metadata information for all
3
3
  # the fields coming from data source (database/api)
4
- # @see Wallaby::ResourceDecorator for more information on how to customise
4
+ # @see Wallaby::ResourceDecorator for more information on how to customize
5
5
  # metadata information
6
6
  class ModelDecorator
7
+ include FieldHelpers
8
+
7
9
  attr_reader :model_class
8
10
  attr_writer \
9
11
  :field_names, :index_field_names, :show_field_names, :form_field_names
@@ -117,8 +119,8 @@ module Wallaby
117
119
  # Ensure type is present
118
120
  # @param type [String, Symbol, nil] type of a field
119
121
  # @return [String, Symbol] type name
120
- def validate_presence_of(type)
121
- type || raise(::ArgumentError, 'Type is required.')
122
+ def validate_presence_of(field_name, type)
123
+ type || raise(::ArgumentError, "Type is required for #{field_name}.")
122
124
  end
123
125
  end
124
126
  end
@@ -16,7 +16,7 @@ module Wallaby
16
16
 
17
17
  # @return [String, Symbol] type for a given field
18
18
  def type_of(field_name)
19
- validate_presence_of metadata_of(field_name)[:type]
19
+ validate_presence_of field_name, metadata_of(field_name)[:type]
20
20
  end
21
21
 
22
22
  # @return [Hash] index metadata information for a given field
@@ -31,7 +31,7 @@ module Wallaby
31
31
 
32
32
  # @return [String, Symbol] index type for a given field
33
33
  def index_type_of(field_name)
34
- validate_presence_of index_metadata_of(field_name)[:type]
34
+ validate_presence_of field_name, index_metadata_of(field_name)[:type]
35
35
  end
36
36
 
37
37
  # @return [Hash] show metadata information for a given field
@@ -46,7 +46,7 @@ module Wallaby
46
46
 
47
47
  # @return [String, Symbol] show type for a given field
48
48
  def show_type_of(field_name)
49
- validate_presence_of show_metadata_of(field_name)[:type]
49
+ validate_presence_of field_name, show_metadata_of(field_name)[:type]
50
50
  end
51
51
 
52
52
  # @return [Hash] form metadata information for a given field
@@ -61,10 +61,8 @@ module Wallaby
61
61
 
62
62
  # @return [String, Symbol] form type for a given field
63
63
  def form_type_of(field_name)
64
- validate_presence_of form_metadata_of(field_name)[:type]
64
+ validate_presence_of field_name, form_metadata_of(field_name)[:type]
65
65
  end
66
66
  end
67
-
68
- include FieldHelpers
69
67
  end
70
68
  end
@@ -1,4 +1,5 @@
1
1
  module Wallaby
2
+ # @private
2
3
  # This is the core of wallaby that dynamically dispatches request to
3
4
  # appropriate controller and action.
4
5
  class ResourcesRouter
@@ -32,16 +33,3 @@ module Wallaby
32
33
  end
33
34
  end
34
35
  end
35
-
36
- # NOTE: please keep this block at the end.
37
- # otherwise, it might go into a endless reloading loop
38
- # NOTE: Rails reload! will hit here
39
- if Rails.env.development?
40
- puts <<-DEBUG
41
- [ WALLABY ] reload! triggered
42
- 1. Clear all the maps
43
- 2. Preload all files under folder `app` (instead of eager load)
44
- DEBUG
45
- Wallaby::Map.clear
46
- Wallaby::Utils.preload_all
47
- end
@@ -67,7 +67,7 @@ module Wallaby
67
67
  class_name = name.classify
68
68
  class_name.constantize unless Module.const_defined? class_name
69
69
  rescue NameError, LoadError => e
70
- Rails.logger.debug ">>>>>>>>> PRELOAD ERROR: #{e.message}"
70
+ Rails.logger.debug " [WALLABY] Preload warning: #{e.message}"
71
71
  Rails.logger.debug e.backtrace.slice(0, 5)
72
72
  end
73
73
  end
@@ -23,17 +23,15 @@ require 'csv'
23
23
  require 'securerandom'
24
24
 
25
25
  module Wallaby
26
- # Rails engine
26
+ # @private
27
27
  class Engine < ::Rails::Engine
28
- # isolate_namespace Wallaby
29
-
30
- initializer 'wallaby.deflate' do |app|
28
+ initializer 'wallaby.deflate' do |_|
31
29
  # default to Gzip HTML
32
- app.config.middleware.use Rack::Deflater
30
+ config.middleware.use Rack::Deflater
33
31
  end
34
32
 
35
- initializer 'wallaby.assets.precompile' do |app|
36
- app.config.assets.precompile +=
33
+ initializer 'wallaby.assets.precompile' do |_|
34
+ config.assets.precompile +=
37
35
  %w(
38
36
  codemirror* codemirror/**/*
39
37
  wallaby/404.png wallaby/422.png wallaby/500.png
@@ -41,13 +39,28 @@ module Wallaby
41
39
  )
42
40
  end
43
41
 
42
+ initializer 'wallaby.development.reload' do |_|
43
+ # NOTE: Rails reload! will hit here
44
+ # @see http://rmosolgo.github.io/blog/2017/04/12/watching-files-during-rails-development/
45
+ config.to_prepare do
46
+ if Rails.env.development? || Rails.configuration.eager_load
47
+ Rails.logger.debug ' [WALLABY] Reloading...'
48
+ ::Wallaby::Map.clear
49
+ ::Wallaby::Utils.preload_all
50
+ end
51
+ end
52
+ end
53
+
44
54
  config.before_eager_load do
45
55
  # We need to ensure that the core models are loaded before anything else
56
+ Rails.logger.debug ' [WALLABY] Preload all model files.'
46
57
  ::Wallaby::Utils.preload 'app/models/**/*.rb'
47
58
  end
48
59
 
49
60
  config.after_initialize do
61
+ # Preload the rest files
50
62
  unless Rails.env.development? || Rails.configuration.eager_load
63
+ Rails.logger.debug ' [WALLABY] Preload files after initialize.'
51
64
  ::Wallaby::Utils.preload_all
52
65
  end
53
66
  end
@@ -62,11 +75,12 @@ require 'wallaby/configuration/pagination'
62
75
  require 'wallaby/configuration/features'
63
76
 
64
77
  require 'utils/wallaby/utils'
78
+ require 'routes/wallaby/resources_router'
65
79
  require 'tree/wallaby/node'
66
80
 
67
81
  require 'interfaces/wallaby/mode'
68
- require 'interfaces/wallaby/model_decorator'
69
82
  require 'interfaces/wallaby/model_decorator/field_helpers'
83
+ require 'interfaces/wallaby/model_decorator'
70
84
  require 'interfaces/wallaby/model_finder'
71
85
  require 'interfaces/wallaby/model_service_provider'
72
86
  require 'interfaces/wallaby/model_pagination_provider'
@@ -1,3 +1,3 @@
1
1
  module Wallaby
2
- VERSION = '5.1.4'.freeze
2
+ VERSION = '5.1.5'.freeze
3
3
  end
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: 5.1.4
4
+ version: 5.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tianwen Chen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-01-21 00:00:00.000000000 Z
11
+ date: 2018-03-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bootstrap-sass
@@ -70,16 +70,16 @@ dependencies:
70
70
  name: font-awesome-sass
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ">="
73
+ - - "<"
74
74
  - !ruby/object:Gem::Version
75
- version: '0'
75
+ version: 5.0.0
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ">="
80
+ - - "<"
81
81
  - !ruby/object:Gem::Version
82
- version: '0'
82
+ version: 5.0.0
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: jbuilder
85
85
  requirement: !ruby/object:Gem::Requirement
@@ -276,7 +276,6 @@ files:
276
276
  - app/controllers/wallaby/base_controller.rb
277
277
  - app/controllers/wallaby/resources_controller.rb
278
278
  - app/controllers/wallaby/secure_controller.rb
279
- - app/routes/wallaby/resources_router.rb
280
279
  - app/security/ability.rb
281
280
  - app/views/layouts/wallaby/application.html.erb
282
281
  - app/views/layouts/wallaby/error.html.erb
@@ -540,6 +539,7 @@ files:
540
539
  - lib/parsers/wallaby/parser.rb
541
540
  - lib/responders/wallaby/abstract_responder.rb
542
541
  - lib/responders/wallaby/resources_responder.rb
542
+ - lib/routes/wallaby/resources_router.rb
543
543
  - lib/servicers/wallaby/abstract_model_servicer.rb
544
544
  - lib/servicers/wallaby/model_servicer.rb
545
545
  - lib/services/wallaby/link_options_normalizer.rb