glib-web 0.0.2 → 0.0.3

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 (32) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/home_controller.rb +11 -0
  3. data/app/views/_nav_menu.json.jbuilder +84 -0
  4. data/app/views/actions/index.json.jbuilder +25 -0
  5. data/app/views/app/views/json_ui/vue/renderer.html.slim +24 -0
  6. data/app/views/forms/basic.json.jbuilder +53 -0
  7. data/app/views/forms/basic_post.json.jbuilder +10 -0
  8. data/app/views/forms/floating_submit.json.jbuilder +48 -0
  9. data/app/views/forms/generic_post.json.jbuilder +6 -0
  10. data/app/views/forms/index.json.jbuilder +34 -0
  11. data/app/views/forms/submit_indicator.json.jbuilder +32 -0
  12. data/app/views/forms/submit_indicator_post.json.jbuilder +12 -0
  13. data/app/views/home/index.json.jbuilder +92 -0
  14. data/app/views/lists/_infinite_scroll_section.json.jbuilder +10 -0
  15. data/app/views/lists/index.json.jbuilder +25 -0
  16. data/app/views/lists/infinite_scroll.json.jbuilder +27 -0
  17. data/app/views/lists/templating.json.jbuilder +45 -0
  18. data/app/views/pages/full_width_height.json.jbuilder +39 -0
  19. data/app/views/pages/index.json.jbuilder +35 -0
  20. data/app/views/pages/layout.json.jbuilder +35 -0
  21. data/app/views/pages/nav_buttons.json.jbuilder +32 -0
  22. data/app/views/panels/horizontal.json.jbuilder +213 -0
  23. data/app/views/panels/index.json.jbuilder +34 -0
  24. data/app/views/panels/split.json.jbuilder +360 -0
  25. data/app/views/panels/vertical.json.jbuilder +94 -0
  26. data/app/views/views/basic.json.jbuilder +21 -0
  27. data/app/views/views/carousels.json.jbuilder +100 -0
  28. data/app/views/views/images.json.jbuilder +48 -0
  29. data/app/views/views/index.json.jbuilder +34 -0
  30. data/config/routes.rb +4 -0
  31. data/lib/glib/engine.rb +1 -1
  32. metadata +30 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a5b06888ad9aae62cb5d7714c50edd9fbbc455fbd822b7b7ae472ee9a23c9046
4
- data.tar.gz: c72d407e1764989e9a2cd5eddb8bf641b6d4f8fd65f538cba2ad7f9cd15ca9cd
3
+ metadata.gz: 9fc3dad45f3ec17ec7fcdbfebd5324917c08f0464930e2268dc189dbe5ebd122
4
+ data.tar.gz: 6ee165f54418afae4430d91cbce584cecb019e8abff187f92ca1fd49af02e0d8
5
5
  SHA512:
6
- metadata.gz: 67805a1431ec5c3a009b2958d0c3004d2adf0d31556bc238ad50c936c4654babfed7c03702e9ad154e5528efcc429994ddd81327a3f2f2878c0393774093c236
7
- data.tar.gz: 9aca5dbcd9e10e8f14a759ed81e18a70b4b8a288b5fe948828ebfa0a89143637f751b34242bd49aefec1f286c5499ede0288525a8450c1644512bc49bb45d87d
6
+ metadata.gz: cbba99ee28d629efe9bd8833da5e7b82d647c39eb19883d328f1a29f11ea15783df9dc72848028d8b0c8fe004670ea2a5f5bfe7764bcd6bd968149d0d8527f9a
7
+ data.tar.gz: 753c3769dd1851b663081b0c4e157645658c2c7ea5267891d2813f8558e1d32f558416b92cdf4e6d5230c54fbf599a06b385bb9bd5e97aad1d4022380ceef0b2
@@ -0,0 +1,11 @@
1
+ class HomeController < ApplicationController
2
+
3
+ def json_ui_garage
4
+ @sample_image_url = 'https://cdn-images-1.medium.com/max/1200/1*Qc0XxYm-qAZL-7tjjlNfrg.png'
5
+
6
+ # prepend_view_path 'app/views/json_ui/garage'
7
+ path = "#{params[:path] || 'index'}"
8
+ render path
9
+ end
10
+
11
+ end
@@ -0,0 +1,84 @@
1
+ json.leftDrawer do
2
+ json.items do
3
+ json.child! do
4
+ json.icon do
5
+ json.materialName 'home'
6
+ end
7
+ json.text 'Home'
8
+ json.onClick do
9
+ json.action 'windows/open-v1'
10
+ json.url Glib::Web::Engine.routes.url_helpers.json_ui_garage_path(_render: 'v1')
11
+ end
12
+ end
13
+ end
14
+
15
+ json.items do
16
+ json.child! do
17
+ json.text 'Pages'
18
+ json.onClick do
19
+ json.action 'windows/open-v1'
20
+ json.url Glib::Web::Engine.routes.url_helpers.json_ui_garage_path(_render: 'v1', path: 'pages/index')
21
+ end
22
+ end
23
+ end
24
+
25
+ json.items do
26
+ json.child! do
27
+ json.text 'Lists'
28
+ json.onClick do
29
+ json.action 'windows/open-v1'
30
+ json.url Glib::Web::Engine.routes.url_helpers.json_ui_garage_path(_render: 'v1', path: 'lists/index')
31
+ end
32
+ end
33
+ end
34
+
35
+ json.items do
36
+ json.child! do
37
+ json.text 'Forms'
38
+ json.onClick do
39
+ json.action 'windows/open-v1'
40
+ json.url Glib::Web::Engine.routes.url_helpers.json_ui_garage_path(_render: 'v1', path: 'forms/index')
41
+ end
42
+ end
43
+ end
44
+
45
+ json.items do
46
+ json.child! do
47
+ json.text 'Panels'
48
+ json.onClick do
49
+ json.action 'windows/open-v1'
50
+ json.url Glib::Web::Engine.routes.url_helpers.json_ui_garage_path(_render: 'v1', path: 'panels/index')
51
+ end
52
+ end
53
+ end
54
+
55
+ json.items do
56
+ json.child! do
57
+ json.text 'Views'
58
+ json.onClick do
59
+ json.action 'windows/open-v1'
60
+ json.url Glib::Web::Engine.routes.url_helpers.json_ui_garage_path(_render: 'v1', path: 'views/index')
61
+ end
62
+ end
63
+ end
64
+
65
+ json.items do
66
+ json.child! do
67
+ json.text 'Actions'
68
+ json.onClick do
69
+ json.action 'windows/open-v1'
70
+ json.url Glib::Web::Engine.routes.url_helpers.json_ui_garage_path(_render: 'v1', path: 'actions/index')
71
+ end
72
+ end
73
+ end
74
+
75
+ json.items do
76
+ json.child! do
77
+ json.text 'Diagnostics'
78
+ json.onClick do
79
+ json.action 'dialogs/alert-v1'
80
+ json.message 'JSON UI v1.0'
81
+ end
82
+ end
83
+ end
84
+ end
@@ -0,0 +1,25 @@
1
+ json.title 'Components'
2
+
3
+ render './nav_menu', json: json
4
+
5
+ json_body_with_list json do
6
+ json.rows do
7
+ json.child! do
8
+ json.template 'default-v1'
9
+ json.title 'Alert'
10
+ json.onClick do
11
+ json.action 'dialogs/alert-v1'
12
+ json.message 'This is an alert'
13
+ end
14
+ end
15
+
16
+ # json.child! do
17
+ # json.template 'default-v1'
18
+ # json.title 'Remote Content'
19
+ # json.onClick do
20
+ # json.action 'dialogs/open-v1'
21
+ # json.url ''
22
+ # end
23
+ # end
24
+ end
25
+ end
@@ -0,0 +1,24 @@
1
+ doctype html
2
+ html
3
+ head
4
+ meta charset="utf-8"
5
+ meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"
6
+ title App
7
+ = csrf_meta_tags
8
+
9
+ = javascript_pack_tag 'vue_renderer', defer: true
10
+ /= javascript_include_tag 'vue_renderer_extras', defer: true
11
+
12
+ = stylesheet_pack_tag 'vue_renderer'
13
+ /= stylesheet_link_tag 'vue_renderer_extras', media: 'all'
14
+
15
+ link href="https://fonts.googleapis.com/css?family=Material+Icons" rel="stylesheet"
16
+
17
+ body
18
+ noscript
19
+ Please enable JavaScript to view this web site.
20
+
21
+ #app
22
+
23
+ javascript:
24
+ var __page = #{raw @__json_ui_orig_page};
@@ -0,0 +1,53 @@
1
+ json.title 'Forms'
2
+
3
+ render './nav_menu', json: json
4
+
5
+ options = {
6
+ url: json_ui_garage_url(path: 'forms/basic_post'),
7
+ method: 'post',
8
+ padding: { top: 12, left: 20, right: 20, bottom: 12 }
9
+ }
10
+ json_body_with_form json, nil, nil, options do
11
+ json.child! do
12
+ json.view 'fields/text-v1'
13
+ json.name 'user[name]'
14
+ json.width 'matchParent'
15
+ json.label 'Name'
16
+ end
17
+
18
+ json.child! do
19
+ json.view 'fields/email-v1'
20
+ json.name 'user[email]'
21
+ json.width 'matchParent'
22
+ json.label 'Email'
23
+ end
24
+
25
+ json.child! do
26
+ json.view 'fields/password-v1'
27
+ json.name 'user[password]'
28
+ json.width 'matchParent'
29
+ json.label 'Password'
30
+ end
31
+
32
+ json.child! do
33
+ json.view 'panels/split-v1'
34
+ json.width 'matchParent'
35
+
36
+ json.content do
37
+ json.right do
38
+ json.view 'button-v1'
39
+ json.text 'Submit'
40
+ json.onClick do
41
+ json.action 'forms/submit-v1'
42
+
43
+ # json.action 'forms/encode-v1'
44
+ # json.paramName 'formData'
45
+ # json.onEncoded do
46
+ # json.action 'http/post-v1'
47
+ # json.url json_ui_garage_url(path: 'forms/basic_post')
48
+ # end
49
+ end
50
+ end
51
+ end
52
+ end
53
+ end
@@ -0,0 +1,10 @@
1
+ name, email, password = params.require(:user).values_at(:name, :email, :password)
2
+ json.onResponse do
3
+ if name.present? && email.present? && password.present?
4
+ json.action 'dialogs/alert-v1'
5
+ json.message "Submitted information: #{name}, #{email}, #{password}"
6
+ else
7
+ json.action 'dialogs/alert-v1'
8
+ json.message 'Please enter all required information'
9
+ end
10
+ end
@@ -0,0 +1,48 @@
1
+ json.title 'Forms'
2
+
3
+ render './nav_menu', json: json
4
+
5
+ footer = Jbuilder.new do |json|
6
+ json.padding(top: 12, left: 20, right: 80, bottom: 12)
7
+ json.backgroundColor '#b3bac2'
8
+ json.subviews do
9
+ json.child! do
10
+ json.view 'label-v1'
11
+ json.text 'Demonstrates the use Floating Action Button on a form with footer'
12
+ end
13
+ end
14
+ end
15
+
16
+ options = {
17
+ url: json_ui_garage_url(path: 'forms/generic_post'),
18
+ method: 'post',
19
+ padding: { top: 12, left: 20, right: 20, bottom: 12 }
20
+ }
21
+ json_body_with_form json, nil, footer, options do
22
+ 30.times do |i|
23
+ json.child! do
24
+ json.view 'fields/text-v1'
25
+ json.name "user[field#{i}]"
26
+ json.width 'matchParent'
27
+ json.label "Field#{i}"
28
+ end
29
+ end
30
+
31
+ json.child! do
32
+ json.view 'button-v1'
33
+ json.text 'Submit'
34
+ json.onClick do
35
+ json.action 'forms/submit-v1'
36
+ end
37
+ end
38
+
39
+ json.child! do
40
+ json.view 'fab-v1'
41
+ json.icon do
42
+ json.materialName 'send'
43
+ end
44
+ json.onClick do
45
+ json.action 'forms/submit-v1'
46
+ end
47
+ end
48
+ end
@@ -0,0 +1,6 @@
1
+ sleep 0.5
2
+
3
+ json.onResponse do
4
+ json.action 'dialogs/alert-v1'
5
+ json.message 'Success!'
6
+ end
@@ -0,0 +1,34 @@
1
+ json.title 'Forms'
2
+
3
+ render './nav_menu', json: json
4
+
5
+ json_body_with_list json do
6
+ json.rows do
7
+ json.child! do
8
+ json.template 'thumbnail-v1'
9
+ json.title 'Basic'
10
+ json.onClick do
11
+ json.action 'windows/open-v1'
12
+ json.url Glib::Web::Engine.routes.url_helpers.json_ui_garage_path(_render: 'v1', path: 'forms/basic')
13
+ end
14
+ end
15
+
16
+ json.child! do
17
+ json.template 'thumbnail-v1'
18
+ json.title 'Submit Indicator'
19
+ json.onClick do
20
+ json.action 'windows/open-v1'
21
+ json.url Glib::Web::Engine.routes.url_helpers.json_ui_garage_path(_render: 'v1', path: 'forms/submit_indicator')
22
+ end
23
+ end
24
+
25
+ json.child! do
26
+ json.template 'thumbnail-v1'
27
+ json.title 'Floating Submit'
28
+ json.onClick do
29
+ json.action 'windows/open-v1'
30
+ json.url Glib::Web::Engine.routes.url_helpers.json_ui_garage_path(_render: 'v1', path: 'forms/floating_submit')
31
+ end
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,32 @@
1
+ json.title 'Forms'
2
+
3
+ render './nav_menu', json: json
4
+
5
+ options = {
6
+ url: json_ui_garage_url(path: 'forms/submit_indicator_post'),
7
+ method: 'post',
8
+ padding: { top: 12, left: 20, right: 20, bottom: 12 }
9
+ }
10
+ json_body_with_form json, nil, nil, options do
11
+ json.child! do
12
+ json.view 'fields/text-v1'
13
+ json.name 'user[name]'
14
+ json.width 'matchParent'
15
+ json.label 'Name'
16
+ end
17
+
18
+ json.child! do
19
+ json.view 'panels/split-v1'
20
+ json.width 'matchParent'
21
+
22
+ json.content do
23
+ json.right do
24
+ json.view 'button-v1'
25
+ json.text 'Submit'
26
+ json.onClick do
27
+ json.action 'forms/submit-v1'
28
+ end
29
+ end
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,12 @@
1
+ sleep 2
2
+
3
+ name = params.require(:user)[:name]
4
+ json.onResponse do
5
+ if name.present?
6
+ json.action 'dialogs/alert-v1'
7
+ json.message "Submitted information: #{name}"
8
+ else
9
+ json.action 'dialogs/alert-v1'
10
+ json.message 'Please enter all required information'
11
+ end
12
+ end
@@ -0,0 +1,92 @@
1
+ json.title 'Components'
2
+
3
+ render './nav_menu', json: json
4
+
5
+ search_mode = !params[:name].nil?
6
+
7
+ json.rightNavButtons do
8
+ json.child! do
9
+ json.icon do
10
+ json.materialName 'search'
11
+ end
12
+ json.onClick do
13
+ json.action 'dialogs/open-v1'
14
+ # json.url merchants_url(name: search_mode ? nil : '')
15
+ end
16
+ end
17
+ end
18
+
19
+ json_body_with_list json do
20
+ # json.header do
21
+ # json.subviews do
22
+ # json.child! do
23
+ # json.view 'label-v1'
24
+ # json.text 'TODO: Implement search'
25
+ # end
26
+ #
27
+ # json.child! do
28
+ # json.view 'map-v1'
29
+ # json.latitude 13.4837
30
+ # json.longitude 144.7917
31
+ # json.zoom 11
32
+ # json.height '250px'
33
+ # end
34
+ # end
35
+ # end
36
+
37
+ json.rows do
38
+ json.child! do
39
+ json.template 'thumbnail-v1'
40
+ json.title 'Pages'
41
+ json.onClick do
42
+ json.action 'windows/open-v1'
43
+ json.url Glib::Web::Engine.routes.url_helpers.json_ui_garage_path(path: 'pages/index')
44
+ end
45
+ end
46
+
47
+ json.child! do
48
+ json.template 'thumbnail-v1'
49
+ json.title 'Lists'
50
+ json.onClick do
51
+ json.action 'windows/open-v1'
52
+ json.url Glib::Web::Engine.routes.url_helpers.json_ui_garage_path(path: 'lists/index')
53
+ end
54
+ end
55
+
56
+ json.child! do
57
+ json.template 'thumbnail-v1'
58
+ json.title 'Forms'
59
+ json.onClick do
60
+ json.action 'windows/open-v1'
61
+ json.url Glib::Web::Engine.routes.url_helpers.json_ui_garage_path(path: 'forms/index')
62
+ end
63
+ end
64
+
65
+ json.child! do
66
+ json.template 'thumbnail-v1'
67
+ json.title 'Panels'
68
+ json.onClick do
69
+ json.action 'windows/open-v1'
70
+ json.url Glib::Web::Engine.routes.url_helpers.json_ui_garage_path(path: 'panels/index')
71
+ end
72
+ end
73
+
74
+ json.child! do
75
+ json.template 'thumbnail-v1'
76
+ json.title 'Views'
77
+ json.onClick do
78
+ json.action 'windows/open-v1'
79
+ json.url Glib::Web::Engine.routes.url_helpers.json_ui_garage_path(path: 'views/index')
80
+ end
81
+ end
82
+
83
+ json.child! do
84
+ json.template 'thumbnail-v1'
85
+ json.title 'Actions'
86
+ json.onClick do
87
+ json.action 'windows/open-v1'
88
+ json.url Glib::Web::Engine.routes.url_helpers.json_ui_garage_path(path: 'actions/index')
89
+ end
90
+ end
91
+ end
92
+ end