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.
- checksums.yaml +4 -4
- data/app/controllers/home_controller.rb +11 -0
- data/app/views/_nav_menu.json.jbuilder +84 -0
- data/app/views/actions/index.json.jbuilder +25 -0
- data/app/views/app/views/json_ui/vue/renderer.html.slim +24 -0
- data/app/views/forms/basic.json.jbuilder +53 -0
- data/app/views/forms/basic_post.json.jbuilder +10 -0
- data/app/views/forms/floating_submit.json.jbuilder +48 -0
- data/app/views/forms/generic_post.json.jbuilder +6 -0
- data/app/views/forms/index.json.jbuilder +34 -0
- data/app/views/forms/submit_indicator.json.jbuilder +32 -0
- data/app/views/forms/submit_indicator_post.json.jbuilder +12 -0
- data/app/views/home/index.json.jbuilder +92 -0
- data/app/views/lists/_infinite_scroll_section.json.jbuilder +10 -0
- data/app/views/lists/index.json.jbuilder +25 -0
- data/app/views/lists/infinite_scroll.json.jbuilder +27 -0
- data/app/views/lists/templating.json.jbuilder +45 -0
- data/app/views/pages/full_width_height.json.jbuilder +39 -0
- data/app/views/pages/index.json.jbuilder +35 -0
- data/app/views/pages/layout.json.jbuilder +35 -0
- data/app/views/pages/nav_buttons.json.jbuilder +32 -0
- data/app/views/panels/horizontal.json.jbuilder +213 -0
- data/app/views/panels/index.json.jbuilder +34 -0
- data/app/views/panels/split.json.jbuilder +360 -0
- data/app/views/panels/vertical.json.jbuilder +94 -0
- data/app/views/views/basic.json.jbuilder +21 -0
- data/app/views/views/carousels.json.jbuilder +100 -0
- data/app/views/views/images.json.jbuilder +48 -0
- data/app/views/views/index.json.jbuilder +34 -0
- data/config/routes.rb +4 -0
- data/lib/glib/engine.rb +1 -1
- metadata +30 -1
@@ -0,0 +1,25 @@
|
|
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 'Templating'
|
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: 'lists/templating')
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
json.child! do
|
17
|
+
json.template 'thumbnail-v1'
|
18
|
+
json.title 'Infinite Scroll'
|
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: 'lists/infinite_scroll')
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
|
2
|
+
page = params[:page].to_i
|
3
|
+
nextPage = {
|
4
|
+
url: json_ui_garage_url(path: 'lists/infinite_scroll', page: page + 1, section_only: 'v1'),
|
5
|
+
autoLoad: true
|
6
|
+
}
|
7
|
+
|
8
|
+
# TODO: Cater
|
9
|
+
# - for SEO: one URL for a standalone page and one URL for pagination only
|
10
|
+
# - for generic approach, e.g. excluding nav_menu when there is no change
|
11
|
+
if params[:section_only].present?
|
12
|
+
json.nextPage nextPage
|
13
|
+
json.sections do
|
14
|
+
json.child! do
|
15
|
+
render 'json_ui/garage/lists/infinite_scroll_section', json: json, page: page
|
16
|
+
end
|
17
|
+
end
|
18
|
+
else
|
19
|
+
json.title 'Lists'
|
20
|
+
|
21
|
+
render './nav_menu', json: json
|
22
|
+
|
23
|
+
options = { nextPage: nextPage }
|
24
|
+
json_body_with_list json, nil, nil, options do
|
25
|
+
render 'json_ui/garage/lists/infinite_scroll_section', json: json, page: page
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
json.title 'Lists'
|
2
|
+
|
3
|
+
render './nav_menu', json: json
|
4
|
+
|
5
|
+
json_body_with_list json do
|
6
|
+
json.header do
|
7
|
+
json.subviews do
|
8
|
+
json.child! do
|
9
|
+
json.view 'label-v1'
|
10
|
+
json.text 'Section Header'
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
json.rows do
|
16
|
+
json.child! do
|
17
|
+
json.template 'thumbnail-v1'
|
18
|
+
json.title 'Click me'
|
19
|
+
json.onClick do
|
20
|
+
json.action 'dialogs/alert-v1'
|
21
|
+
json.message 'Perform action'
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
json.child! do
|
26
|
+
json.template 'thumbnail-v1'
|
27
|
+
json.title 'Item with subtitle'
|
28
|
+
json.subtitle 'Item subtitle'
|
29
|
+
end
|
30
|
+
|
31
|
+
json.child! do
|
32
|
+
json.template 'thumbnail-v1'
|
33
|
+
json.title 'Item with thumbnail image'
|
34
|
+
json.subtitle 'Item subtitle'
|
35
|
+
json.imageUrl @sample_image_url
|
36
|
+
end
|
37
|
+
|
38
|
+
json.child! do
|
39
|
+
json.template 'featured-v1'
|
40
|
+
json.title 'Featured with featured image'
|
41
|
+
json.subtitle 'Item subtitle'
|
42
|
+
json.imageUrl @sample_image_url
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
json.title 'Pages'
|
2
|
+
|
3
|
+
render './nav_menu', json: json
|
4
|
+
|
5
|
+
json.header do
|
6
|
+
json.padding(left: 20, right: 20, top: 5, bottom: 5)
|
7
|
+
json.backgroundColor '#b3bac2'
|
8
|
+
json.subviews do
|
9
|
+
json.child! do
|
10
|
+
json.view 'h1-v1'
|
11
|
+
json.text 'Header'
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
json.content do
|
17
|
+
json.height 'matchParent'
|
18
|
+
json.padding(top: 15, left: 20, right: 20, bottom: 15)
|
19
|
+
json.subviews do
|
20
|
+
json.child! do
|
21
|
+
json.view 'button-v1'
|
22
|
+
json.width 'matchParent'
|
23
|
+
json.height 'matchParent'
|
24
|
+
json.text 'Full Width/Height'
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
json.footer do
|
30
|
+
json.height 80
|
31
|
+
json.padding(left: 20, right: 20, top: 5, bottom: 5)
|
32
|
+
json.backgroundColor '#b3bac2'
|
33
|
+
json.subviews do
|
34
|
+
json.child! do
|
35
|
+
json.view 'h1-v1'
|
36
|
+
json.text 'Footer'
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
json.title 'Pages'
|
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 'Nav Buttons'
|
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: 'pages/nav_buttons')
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
json.child! do
|
17
|
+
json.template 'thumbnail-v1'
|
18
|
+
json.title 'Hamburger Layout'
|
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: 'pages/layout')
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
json.child! do
|
26
|
+
json.template 'thumbnail-v1'
|
27
|
+
json.title 'Full Width/Height'
|
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: 'pages/full_width_height')
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
json.title 'Pages'
|
2
|
+
|
3
|
+
render './nav_menu', json: json
|
4
|
+
|
5
|
+
header = Jbuilder.new do |json|
|
6
|
+
json.padding(top: 12, left: 20, right: 20, bottom: 12)
|
7
|
+
json.backgroundColor '#b3bac2'
|
8
|
+
json.subviews do
|
9
|
+
json.child! do
|
10
|
+
json.view 'h1-v1'
|
11
|
+
json.text 'Header'
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
footer = Jbuilder.new do |json|
|
17
|
+
json.padding(top: 12, left: 20, right: 20, bottom: 12)
|
18
|
+
json.backgroundColor '#b3bac2'
|
19
|
+
json.subviews do
|
20
|
+
json.child! do
|
21
|
+
json.view 'h1-v1'
|
22
|
+
json.text 'Footer'
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
options = {padding: {top: 20, left: 20, right: 20, bottom: 20}}
|
28
|
+
json_body_with_scroll json, header, footer, options do
|
29
|
+
(1..100).each do |index|
|
30
|
+
json.child! do
|
31
|
+
json.view 'label-v1'
|
32
|
+
json.text 'Content'
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
json.title 'Pages'
|
2
|
+
|
3
|
+
render './nav_menu', json: json
|
4
|
+
|
5
|
+
json.rightNavButtons do
|
6
|
+
json.child! do
|
7
|
+
json.icon do
|
8
|
+
json.materialName 'search'
|
9
|
+
end
|
10
|
+
json.onClick do
|
11
|
+
json.action 'dialogs/alert-v1'
|
12
|
+
json.message 'Perform some action'
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
json.child! do
|
17
|
+
json.icon do
|
18
|
+
json.materialName 'map'
|
19
|
+
end
|
20
|
+
json.onClick do
|
21
|
+
json.action 'dialogs/alert-v1'
|
22
|
+
json.message 'Perform some action'
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
json_body_with_scroll json do
|
28
|
+
json.child! do
|
29
|
+
json.view 'label-v1'
|
30
|
+
json.text 'See the right menu buttons on the nav bar'
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,213 @@
|
|
1
|
+
json.title 'Components'
|
2
|
+
|
3
|
+
render './nav_menu', json: json
|
4
|
+
|
5
|
+
json_body_with_scroll json do
|
6
|
+
json.child! do
|
7
|
+
json.view 'h1-v1'
|
8
|
+
json.text 'Horizontal panel'
|
9
|
+
end
|
10
|
+
json.child! do
|
11
|
+
json.view 'panels/horizontal-v1'
|
12
|
+
json.backgroundColor '#b3bac2'
|
13
|
+
json.subviews do
|
14
|
+
json.child! do
|
15
|
+
json.view 'button-v1'
|
16
|
+
json.text '1'
|
17
|
+
end
|
18
|
+
|
19
|
+
json.child! do
|
20
|
+
json.view 'button-v1'
|
21
|
+
json.text '2'
|
22
|
+
end
|
23
|
+
|
24
|
+
json.child! do
|
25
|
+
json.view 'button-v1'
|
26
|
+
json.text '3'
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
json.child! do
|
32
|
+
json.view 'label-v1'
|
33
|
+
json.text "\n"
|
34
|
+
end
|
35
|
+
json.child! do
|
36
|
+
json.view 'h1-v1'
|
37
|
+
json.text 'Horizontal panel with equal filling'
|
38
|
+
end
|
39
|
+
json.child! do
|
40
|
+
json.view 'panels/horizontal-v1'
|
41
|
+
json.backgroundColor '#b3bac2'
|
42
|
+
json.width 300
|
43
|
+
json.distribution 'fillEqually'
|
44
|
+
json.subviews do
|
45
|
+
json.child! do
|
46
|
+
json.view 'button-v1'
|
47
|
+
json.text '1'
|
48
|
+
end
|
49
|
+
|
50
|
+
json.child! do
|
51
|
+
json.view 'button-v1'
|
52
|
+
json.text '2'
|
53
|
+
json.height 50
|
54
|
+
end
|
55
|
+
|
56
|
+
json.child! do
|
57
|
+
json.view 'button-v1'
|
58
|
+
json.text '3'
|
59
|
+
json.height 70
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
json.child! do
|
65
|
+
json.view 'label-v1'
|
66
|
+
json.text "\n"
|
67
|
+
end
|
68
|
+
json.child! do
|
69
|
+
json.view 'h1-v1'
|
70
|
+
json.text 'Horizontal panel with equal spacing'
|
71
|
+
end
|
72
|
+
json.child! do
|
73
|
+
json.view 'panels/horizontal-v1'
|
74
|
+
json.backgroundColor '#b3bac2'
|
75
|
+
json.width 300
|
76
|
+
json.distribution 'spaceEqually'
|
77
|
+
json.subviews do
|
78
|
+
json.child! do
|
79
|
+
json.view 'button-v1'
|
80
|
+
json.text '1'
|
81
|
+
end
|
82
|
+
|
83
|
+
json.child! do
|
84
|
+
json.view 'button-v1'
|
85
|
+
json.text '2'
|
86
|
+
end
|
87
|
+
|
88
|
+
json.child! do
|
89
|
+
json.view 'button-v1'
|
90
|
+
json.text '3'
|
91
|
+
end
|
92
|
+
end
|
93
|
+
end
|
94
|
+
|
95
|
+
json.child! do
|
96
|
+
json.view 'label-v1'
|
97
|
+
json.text "\n"
|
98
|
+
end
|
99
|
+
json.child! do
|
100
|
+
json.view 'h1-v1'
|
101
|
+
json.text 'Horizontal panel (containing vertical panel)'
|
102
|
+
end
|
103
|
+
json.child! do
|
104
|
+
json.view 'panels/horizontal-v1'
|
105
|
+
json.subviews do
|
106
|
+
json.child! do
|
107
|
+
json.view 'button-v1'
|
108
|
+
json.text '1'
|
109
|
+
end
|
110
|
+
|
111
|
+
json.child! do
|
112
|
+
json.view 'panels/vertical-v1'
|
113
|
+
json.subviews do
|
114
|
+
json.child! do
|
115
|
+
json.view 'button-v1'
|
116
|
+
json.text 'A'
|
117
|
+
end
|
118
|
+
|
119
|
+
json.child! do
|
120
|
+
json.view 'button-v1'
|
121
|
+
json.text 'B'
|
122
|
+
end
|
123
|
+
end
|
124
|
+
end
|
125
|
+
|
126
|
+
json.child! do
|
127
|
+
json.view 'button-v1'
|
128
|
+
json.text '3'
|
129
|
+
end
|
130
|
+
end
|
131
|
+
end
|
132
|
+
|
133
|
+
json.child! do
|
134
|
+
json.view 'label-v1'
|
135
|
+
json.text "\n"
|
136
|
+
end
|
137
|
+
json.child! do
|
138
|
+
json.view 'h1-v1'
|
139
|
+
json.text 'Horizontal panel with equal filling (containing vertical panel)'
|
140
|
+
end
|
141
|
+
json.child! do
|
142
|
+
json.view 'panels/horizontal-v1'
|
143
|
+
json.width 'matchParent'
|
144
|
+
json.distribution 'fillEqually'
|
145
|
+
json.subviews do
|
146
|
+
json.child! do
|
147
|
+
json.view 'button-v1'
|
148
|
+
json.text '1'
|
149
|
+
end
|
150
|
+
|
151
|
+
json.child! do
|
152
|
+
json.view 'panels/vertical-v1'
|
153
|
+
json.subviews do
|
154
|
+
json.child! do
|
155
|
+
json.view 'button-v1'
|
156
|
+
json.text 'A'
|
157
|
+
end
|
158
|
+
|
159
|
+
json.child! do
|
160
|
+
json.view 'button-v1'
|
161
|
+
json.text 'B'
|
162
|
+
end
|
163
|
+
end
|
164
|
+
end
|
165
|
+
|
166
|
+
json.child! do
|
167
|
+
json.view 'button-v1'
|
168
|
+
json.text '3'
|
169
|
+
end
|
170
|
+
end
|
171
|
+
end
|
172
|
+
|
173
|
+
json.child! do
|
174
|
+
json.view 'label-v1'
|
175
|
+
json.text "\n"
|
176
|
+
end
|
177
|
+
json.child! do
|
178
|
+
json.view 'h1-v1'
|
179
|
+
json.text 'Horizontal panel with equal spacing (containing vertical panel)'
|
180
|
+
end
|
181
|
+
json.child! do
|
182
|
+
json.view 'panels/horizontal-v1'
|
183
|
+
json.width 'matchParent'
|
184
|
+
json.distribution 'spaceEqually'
|
185
|
+
json.subviews do
|
186
|
+
json.child! do
|
187
|
+
json.view 'button-v1'
|
188
|
+
json.text '1'
|
189
|
+
end
|
190
|
+
|
191
|
+
json.child! do
|
192
|
+
json.view 'panels/vertical-v1'
|
193
|
+
json.subviews do
|
194
|
+
json.child! do
|
195
|
+
json.view 'button-v1'
|
196
|
+
json.text 'A'
|
197
|
+
end
|
198
|
+
|
199
|
+
json.child! do
|
200
|
+
json.view 'button-v1'
|
201
|
+
json.text 'B'
|
202
|
+
end
|
203
|
+
end
|
204
|
+
end
|
205
|
+
|
206
|
+
json.child! do
|
207
|
+
json.view 'button-v1'
|
208
|
+
json.text '3'
|
209
|
+
end
|
210
|
+
end
|
211
|
+
end
|
212
|
+
|
213
|
+
end
|