glib-web 0.4.23 → 0.4.24
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/helpers/glib/json_ui/page_helper.rb +4 -0
- data/app/helpers/glib/json_ui/view_builder/panels.rb +1 -1
- data/app/helpers/glib/json_ui/view_builder.rb +1 -0
- data/app/views/json_ui/garage/services/dynamic_text.json.jbuilder +1 -1
- data/app/views/json_ui/garage/services/image.json.jbuilder +40 -18
- data/app/views/json_ui/garage/views/images.json.jbuilder +60 -10
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 94f1a8366e5cece6ec76d5ea2bd1d540cbfc25aa
|
4
|
+
data.tar.gz: 448751b5cedab8ced7afc9c1b532522528dbec37
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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)
|
@@ -1,25 +1,47 @@
|
|
1
|
-
json.title '
|
1
|
+
json.title 'Image Service'
|
2
2
|
|
3
|
-
|
4
|
-
|
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
|
-
|
7
|
-
|
7
|
+
page.scroll padding: glib_json_padding_body, childViews: ->(scroll) do
|
8
|
+
bucket = 'itinerarybuilder-demo'
|
8
9
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
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
|
-
|
15
|
-
|
16
|
-
|
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
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
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
|