glib-web 0.4.23 → 0.4.24

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 44f56b6f20013c8665e3b044739028764d66b7bd
4
- data.tar.gz: 6d06c9cdb1675fd7b4a52992c2efeac135069bcf
3
+ metadata.gz: 94f1a8366e5cece6ec76d5ea2bd1d540cbfc25aa
4
+ data.tar.gz: 448751b5cedab8ced7afc9c1b532522528dbec37
5
5
  SHA512:
6
- metadata.gz: 62b319bacfaeb022fed0fe1614c23dd2d72c85fc452fa539e95906c8d0e3e35d9d8f262302edc0a5e84548f29831b812cd09858492e5fab95a4b0a50d81b44d1
7
- data.tar.gz: 94d0bec30592a9d69e9789add39c865a895b1d16360d554bc053a6e57ce6519afc908a999b250dfeb3dfd66025925e1d710837ac6ce9cf90601cce4f8dcf21d1
6
+ metadata.gz: '036089a9ccfc6432ec3d4197ae9037eddb049ac6d5fade3830b9e5b2a0b015ae1d9a3e4262ecbf4b5873d1f3441efe2e3f58af0038337f2867788540dae5cc11'
7
+ data.tar.gz: b256a373e8443457af3a210898fe3277f618c573ba46d367c4a9c81a40c741c550b76d91135000d099ee52bfb3ef1634dd4134ff8b2c4e49b13d5659c1a49a2c
@@ -72,6 +72,10 @@ module Glib
72
72
 
73
73
  def navBar(options = {})
74
74
  json.navBar do
75
+ # json.leftItems do
76
+ # options[:leftItems]&.call @menu_builder
77
+ # end
78
+ json.logoUrl "http://localhost:3000/assets/logo_dark-02d9b6a91fdbf22515da7b921d31367b70696214415f6789d2f90232e4a287b7.svg"
75
79
  json.rightItems do
76
80
  options[:rightItems]&.call @menu_builder
77
81
  end
@@ -25,7 +25,7 @@ class Glib::JsonUi::ViewBuilder
25
25
  end
26
26
 
27
27
  def field_label(prop, args)
28
- I18n.t("activerecord.attributes.#{@model_name}.#{prop}", args)
28
+ I18n.t("dt_models.#{@model_name}.#{prop}.label", args.merge(default: nil)) || I18n.t("activerecord.attributes.#{@model_name}.#{prop}", args)
29
29
  end
30
30
 
31
31
  def hint_label(prop, args)
@@ -91,6 +91,7 @@ module Glib
91
91
  string :url
92
92
  string :base64Data
93
93
  action :onClick
94
+ string :fit
94
95
  end
95
96
 
96
97
  class Avatar < View
@@ -1,4 +1,4 @@
1
- json.title 'Dynamic Texts'
1
+ json.title 'Dynamic Text Service'
2
2
 
3
3
  json_ui_page json do |page|
4
4
  render "#{@path_prefix}/nav_menu", json: json, page: page
@@ -1,25 +1,47 @@
1
- json.title 'Dynamic Texts'
1
+ json.title 'Image Service'
2
2
 
3
- json_ui_page json do |page|
4
- render "#{@path_prefix}/nav_menu", json: json, page: page
3
+ # See https://docs.imgix.com/apis/url/size/fit#clip
4
+ page = json_ui_page json
5
+ render "#{@path_prefix}/nav_menu", json: json, page: page
5
6
 
6
- page.scroll padding: glib_json_padding_body, childViews: ->(scroll) do
7
- bucket = 'itinerarybuilder-demo'
7
+ page.scroll padding: glib_json_padding_body, childViews: ->(scroll) do
8
+ bucket = 'itinerarybuilder-demo'
8
9
 
9
- # NOTE: The current implementation does not follow the exact behaviour described in https://docs.imgix.com/apis/url/size/fit#clip
10
- scroll.h1 text: 'fit: clip (default)'
11
- scroll.spacer height: 6
12
- scroll.image url: dynamic_image_url(glib_json_image_blob_key, bucket: bucket)
10
+ # TODO: This needs fixing
11
+ scroll.h1 text: 'Original size'
12
+ scroll.spacer height: 6
13
+ scroll.image url: dynamic_image_url(glib_json_image_blob_key, bucket: bucket, w: nil, h: nil)
13
14
 
14
- scroll.spacer height: 20
15
- scroll.h1 text: 'fit: crop'
16
- scroll.spacer height: 6
17
- scroll.image url: dynamic_image_url(glib_json_image_blob_key, bucket: bucket, fit: 'crop')
15
+ scroll.h1 text: 'fit: clip (default) to width'
16
+ scroll.spacer height: 6
17
+ scroll.image url: dynamic_image_url(glib_json_image_blob_key, bucket: bucket, w: 100, h: nil)
18
18
 
19
- scroll.spacer height: 20
20
- scroll.h1 text: 'fit: fill'
21
- scroll.spacer height: 6
22
- scroll.image url: dynamic_image_url(glib_json_image_blob_key, bucket: bucket, fit: 'fill')
23
- end
19
+ scroll.spacer height: 20
20
+ scroll.h1 text: 'fit: clip (default) to height'
21
+ scroll.spacer height: 6
22
+ scroll.image url: dynamic_image_url(glib_json_image_blob_key, bucket: bucket, w: nil, h: 100)
24
23
 
24
+ scroll.spacer height: 20
25
+ scroll.h1 text: 'fit: crop to width'
26
+ scroll.spacer height: 6
27
+ scroll.image url: dynamic_image_url(glib_json_image_blob_key, bucket: bucket, fit: 'crop', w: 100, h: nil)
28
+
29
+ scroll.spacer height: 20
30
+ scroll.h1 text: 'fit: crop to height'
31
+ scroll.spacer height: 6
32
+ scroll.image url: dynamic_image_url(glib_json_image_blob_key, bucket: bucket, fit: 'crop', w: nil, h: 100)
33
+
34
+ # Currently this doesn't behave the same way as https://docs.imgix.com/apis/url/size/fit#fill
35
+ #
36
+ # scroll.spacer height: 20
37
+ # scroll.h1 text: 'fit: fill to width'
38
+ # scroll.spacer height: 6
39
+ # scroll.image url: dynamic_image_url(glib_json_image_blob_key, bucket: bucket, fit: 'fill', w: 2000, h: nil)
40
+
41
+ # Currently this doesn't behave the same way as https://docs.imgix.com/apis/url/size/fit#fill
42
+ #
43
+ # scroll.spacer height: 20
44
+ # scroll.h1 text: 'fit: fill to height'
45
+ # scroll.spacer height: 6
46
+ # scroll.image url: dynamic_image_url(glib_json_image_blob_key, bucket: bucket, fit: 'fill', w: nil, h: 2000)
25
47
  end
@@ -3,6 +3,8 @@ json.title 'Views'
3
3
  page = json_ui_page json
4
4
  render "#{@path_prefix}/nav_menu", json: json, page: page
5
5
 
6
+ small_image_url = 'https://icons-for-free.com/iconfiles/png/128/of+thrones+game+thrones+series+character+avatar+jon+snow-1320568555745862611.png'
7
+
6
8
  page.scroll padding: glib_json_padding_body, childViews: ->(scroll) do
7
9
  scroll.h2 text: 'Avatar'
8
10
  scroll.spacer height: 6
@@ -13,16 +15,6 @@ page.scroll padding: glib_json_padding_body, childViews: ->(scroll) do
13
15
  scroll.spacer height: 6
14
16
  scroll.icon name: 'info'
15
17
 
16
- scroll.spacer height: 20
17
- scroll.h2 text: 'Full-width image'
18
- scroll.spacer height: 6
19
- scroll.image url: glib_json_image_standard_url
20
-
21
- scroll.spacer height: 20
22
- scroll.h2 text: 'Width-constraint image'
23
- scroll.spacer height: 6
24
- scroll.image width: 100, url: glib_json_image_standard_url
25
-
26
18
  scroll.spacer height: 20
27
19
  scroll.h2 text: 'Image with base64 data'
28
20
  scroll.spacer height: 6
@@ -38,5 +30,63 @@ page.scroll padding: glib_json_padding_body, childViews: ->(scroll) do
38
30
  else
39
31
  scroll.label text: 'Include "rqrcode" gem to enable this'
40
32
  end
33
+
34
+ scroll.spacer height: 60
35
+ scroll.hr
36
+
37
+ scroll.spacer height: 60
38
+ scroll.h2 text: 'Original size'
39
+ scroll.spacer height: 6
40
+ scroll.image url: glib_json_image_standard_url
41
+
42
+ scroll.spacer height: 20
43
+ scroll.h2 text: 'Original size'
44
+ scroll.spacer height: 6
45
+ scroll.image url: small_image_url
46
+
47
+ # Reference: https://docs.imgix.com/apis/url/size/fit#clip
48
+ scroll.spacer height: 20
49
+ scroll.h2 text: 'fit: clip (default) to full width (scale down)'
50
+ scroll.spacer height: 6
51
+ scroll.image width: 'matchParent', url: glib_json_image_standard_url
52
+
53
+ scroll.spacer height: 20
54
+ scroll.h2 text: 'fit: clip (default) to full width (scale up)'
55
+ scroll.spacer height: 6
56
+ scroll.image width: 'matchParent', url: small_image_url
57
+
58
+ scroll.spacer height: 20
59
+ scroll.h2 text: 'fit: clip (default) to width (scale down)'
60
+ scroll.spacer height: 6
61
+ scroll.image width: 100, url: glib_json_image_standard_url
62
+
63
+ # TODO: Make sure this is the same as https://docs.imgix.com/apis/url/size/fit#clip
64
+ scroll.spacer height: 20
65
+ scroll.h2 text: 'fit: clip (default) to height (scale down)'
66
+ scroll.spacer height: 6
67
+ scroll.image height: 100, url: glib_json_image_standard_url
68
+
69
+ scroll.spacer height: 20
70
+ scroll.h2 text: 'fit: clip (default) to width (scale up)'
71
+ scroll.spacer height: 6
72
+ scroll.image width: 240, url: small_image_url
73
+
74
+ # TODO: Make sure this is the same as https://docs.imgix.com/apis/url/size/fit#clip
75
+ scroll.spacer height: 20
76
+ scroll.h2 text: 'fit: clip (default) to height (scale up)'
77
+ scroll.spacer height: 6
78
+ scroll.image height: 240, url: small_image_url
41
79
 
80
+ # TODO: Make sure this is the same as https://docs.imgix.com/apis/url/size/fit#crop
81
+ # Reference: https://docs.imgix.com/apis/url/size/fit#crop
82
+ scroll.spacer height: 20
83
+ scroll.h2 text: 'fit: crop to width'
84
+ scroll.spacer height: 6
85
+ scroll.image width: 100, url: glib_json_image_standard_url, fit: :crop
86
+
87
+ # TODO: Make sure this is the same as https://docs.imgix.com/apis/url/size/fit#crop
88
+ scroll.spacer height: 20
89
+ scroll.h2 text: 'fit: crop to height'
90
+ scroll.spacer height: 6
91
+ scroll.image height: 100, url: glib_json_image_standard_url, fit: :crop
42
92
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: glib-web
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.23
4
+ version: 0.4.24
5
5
  platform: ruby
6
6
  authors:
7
7
  - ''