glib-web 2.6.2 → 3.0.0.pre.beta1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 626a7318bab15d6f40a56eab8a88f93168ecbf5c5848a06ac36074faffd8e4f7
4
- data.tar.gz: 3dfdf7e1026acde4790640d3df5594a56cb591459ee2c12ba3623080ffd78c6e
3
+ metadata.gz: 36c7ef52875565dc8845937e540ad4bb859c2c1d8c2413a6eb2610e02011cc42
4
+ data.tar.gz: f7bc7fedc31848d543ba0e79404d293a611cdbbcb20573a37645d28e81fba19a
5
5
  SHA512:
6
- metadata.gz: 4c89bbef5dca79b924d5e9d8442828b1721cab5f6e51bd035d117c177557924fd20acbeb4475728cfecc39b89457763380f66489f4cbc38249be4d199dcf276e
7
- data.tar.gz: 47d96447564dcecc2e2649aeb8872268564c0ab13c13a26483a00f1bbad5877863fefa280ae651e710846e964089b1cdb1bcbb890afb8ab4d4fcec6762bb17b6
6
+ metadata.gz: 47910b5b21257d0d2902ff536ff2c1cb13e8154ee1bc2a919f66b1dc1ade9a7aedd967a1abc1d9deef2f7286ac0720db6bda4adb33d44ea0cea2af3de94738a2
7
+ data.tar.gz: 0fd5393e2bec762bd4b05d46f825ba168a31454ccc7d6100d286f706cebb2a40ef6eba9662651dbb389074375e973b9b15ae58d74d481a72a7b61e39c83df8c1
@@ -1,7 +1,6 @@
1
1
  class Glib::JsonUi::ActionBuilder
2
2
  module Dialogs
3
3
  class Alert < Action
4
- string :title
5
4
  string :message
6
5
  action :onLoad
7
6
  action :onClose
@@ -45,7 +44,6 @@ class Glib::JsonUi::ActionBuilder
45
44
  bool :showClose
46
45
  string :fullscreen
47
46
  length :width
48
- length :height
49
47
  end
50
48
 
51
49
  class Reload < Action
@@ -9,8 +9,5 @@ class Glib::JsonUi::ActionBuilder
9
9
  array :steps
10
10
  int :startFrom
11
11
  end
12
-
13
- class Stop < Action
14
- end
15
12
  end
16
13
  end
@@ -37,7 +37,7 @@ module Glib
37
37
  action :onLongPress
38
38
  icon :icon
39
39
  bool :avatar
40
- # action :onReorder
40
+ action :onReorder
41
41
  string :paramNameForFormData
42
42
  string :paramNameForNewAbsoluteIndex
43
43
  string :paramNameForNewSectionIndex
@@ -46,7 +46,9 @@ module Glib
46
46
  string :id # Deprecated
47
47
  string :paramNameForNewIndex # Deprecated
48
48
 
49
- panels_builder :accessory, :header, :body, :footer
49
+ # # NOTE: Experimental. Still deciding whether this needs to be a full blown panel or
50
+ # # an array of badges (with relevant properties, e.g. text, color, etc)
51
+ # views :accessoryViews
50
52
  end
51
53
 
52
54
  class Featured < Standard
@@ -76,7 +76,6 @@ class Glib::JsonUi::ViewBuilder
76
76
  class Text < AbstractField
77
77
  int :maxLength
78
78
  icon :leftIcon
79
- icon :rightIcon
80
79
  string :leftText
81
80
  string :rightText
82
81
  action :onTypeStart
@@ -115,7 +114,6 @@ class Glib::JsonUi::ViewBuilder
115
114
  class Submit < AbstractField
116
115
  string :text
117
116
  color :color
118
- icon :icon
119
117
  end
120
118
 
121
119
  class CheckGroup < AbstractField
@@ -303,8 +301,7 @@ class Glib::JsonUi::ViewBuilder
303
301
  end
304
302
 
305
303
  class Otp < AbstractField
306
- int :length
307
- string :type
304
+ int :lengths
308
305
  end
309
306
 
310
307
  class Rating < AbstractField
@@ -140,7 +140,6 @@ class Glib::JsonUi::ViewBuilder
140
140
  action :onScrollToBottom
141
141
 
142
142
  int :responsiveCols
143
- hash :dragSupport
144
143
 
145
144
  def firstSection(block)
146
145
  json.sections [1] do
@@ -243,7 +242,6 @@ class Glib::JsonUi::ViewBuilder
243
242
  string :distribution
244
243
  string :align
245
244
  action :onClick
246
- hash :dragSupport
247
245
  end
248
246
 
249
247
  class Flow < View
@@ -243,6 +243,7 @@ module Glib
243
243
 
244
244
  class TabBar < View
245
245
  int :height
246
+ int :activeIndex
246
247
  color :color
247
248
 
248
249
  def buttons(block)
@@ -14,24 +14,21 @@ page.form \
14
14
  form.spacer height: 6
15
15
  form.fields_otp \
16
16
  name: 'user[otp_summary1]',
17
- length: 7,
18
- type: 'text'
17
+ lengths: 7
19
18
 
20
19
  form.spacer height: 20
21
- form.h2 text: 'OTP Custom Length and input type number'
20
+ form.h2 text: 'OTP Custom Length'
22
21
  form.spacer height: 6
23
22
  form.fields_otp \
24
23
  name: 'user[otp_summary2]',
25
- length: 3,
26
- type: 'number'
24
+ lengths: 3
27
25
 
28
26
  form.spacer height: 20
29
27
  form.h2 text: 'OTP with Long Field'
30
28
  form.spacer height: 6
31
29
  form.fields_otp \
32
30
  name: 'user[otp_summary3]',
33
- length: 20,
34
- type: 'text'
31
+ lengths: 20
35
32
 
36
33
  form.spacer height: 20
37
34
  form.fields_submit text: 'Submit'
@@ -15,13 +15,7 @@ page.form url: json_ui_garage_url(path: 'forms/generic_post'), method: 'post', p
15
15
  'melbourne' => 'Melbourne',
16
16
  'sydney' => 'Sydney',
17
17
  }
18
- form.fields_select \
19
- name: 'user[city]',
20
- width: 'matchParent',
21
- label: 'City1',
22
- placeholder: 'This is a placeholder',
23
- options: languages.map { |k, v| { value: k, text: v } },
24
- value: 'canberra'
18
+ form.fields_select name: 'user[city]', width: 'matchParent', label: 'City', options: languages.map { |k, v| { value: k, text: v } }, value: 'canberra'
25
19
  form.fields_select name: 'user[cities][]', width: 'matchParent', label: 'Cities', options: languages.map { |k, v| { value: k, text: v } }, value: ['melbourne', 'sydney'], multiple: true
26
20
 
27
21
  form.spacer height: 20
@@ -17,11 +17,8 @@ page.scroll childViews: ->(scroll) do
17
17
  checkValue: '16+',
18
18
  uncheckValue: '0-16',
19
19
  label: 'I am over 16 (has default value)',
20
- paramNameForFormData: 'message',
21
20
  onChange: ->(action) do
22
- action.dialogs_alert title: 'Submit data?', onClose: ->(subaction) do
23
- action.forms_submit
24
- end
21
+ action.forms_submit
25
22
  end
26
23
 
27
24
  form.fields_check \
@@ -46,7 +43,7 @@ page.scroll childViews: ->(scroll) do
46
43
  onChange: ->(action) do
47
44
  action.snackbars_select message: 'Submit data?', buttons: ->(menu) do
48
45
  menu.button text: 'Yes, submit', onClick: ->(subaction) do
49
- subaction.forms_submit
46
+ action.forms_submit
50
47
  end
51
48
  end
52
49
  end
@@ -60,7 +57,6 @@ page.scroll childViews: ->(scroll) do
60
57
  group.fields_radio value: 'senior', label: 'Senior'
61
58
  group.fields_radio value: 'junior', label: 'Junior'
62
59
  end,
63
- paramNameForFormData: 'message',
64
60
  onChange: ->(action) do
65
61
  action.sheets_select message: 'Submit data?', buttons: ->(menu) do
66
62
  menu.button text: 'Yes, submit', onClick: ->(subaction) do
@@ -82,20 +78,6 @@ page.scroll childViews: ->(scroll) do
82
78
  end
83
79
  end
84
80
 
85
-
86
- form.spacer height: 20
87
- form.h2 text: 'Textarea'
88
- form.fields_textarea \
89
- name: 'user[bio]',
90
- width: 'matchParent',
91
- onChange: ->(action) do
92
- action.sheets_select message: 'Submit data?', buttons: ->(menu) do
93
- menu.button text: 'Yes, submit', onClick: ->(subaction) do
94
- action.forms_submit
95
- end
96
- end
97
- end
98
-
99
81
  form.spacer height: 20
100
82
  form.h2 text: 'Text (Asynchronous)'
101
83
  form.fields_text \
@@ -104,23 +86,6 @@ page.scroll childViews: ->(scroll) do
104
86
  onChange: ->(action) do
105
87
  action.http_post url: json_ui_garage_url(path: 'forms/generic_post')
106
88
  end
107
-
108
- form.spacer height: 20
109
- rules = { fileType: 'image', maxFileSize: 5000, fileTypeErrorText: 'Invalid!', maxFileSizeErrorText: 'Too big!' }
110
- form.fields_file \
111
- name: 'user[photo][]',
112
- width: 'matchParent',
113
- label: 'Avatar',
114
- accepts: rules,
115
- directUploadUrl: rails_direct_uploads_url,
116
- placeholderView: { type: 'avatar', width: 100, height: 100, url: 'data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBxMREBUREhAWFhUWGBcVFRgXFxUVFxcWGRUWFxYVFRUYHSggGB0lHRgVITEhJSkrLi4uGB8zODMtNygtLisBCgoKBQUFDgUFDis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f8lp/9h+nfcp5cvaX7osMEtYSGwbByCOBnTV9ONEAOv0w2oX3KY7Vl8jqY8KURhA1seNaIMB9+mG1C+5o4rLyDq48KIwgCTseNUAsuVx2IGXtJYYCNbDjWqOBJm3Dsg+mRL1CFoiwZcv3itzyDq48KUWWOAEjj+5IONF0PgbcDu+y0ESxQYREQEREBERAREQEREBERARfTGE4BdDGNbiaoNbYUhN3QfdbQy9penJYZMGbsONao4EmbcO3OiAHX6YbUL7uj+6rLyDq48KURpAEjj+5VQC25XHYgbfrhsWGAjWw41R4J1cOFKoMllyo5IGX6lYYCDN2HdHgkzbh2QGvv0NNqF93RWXkGjce1EaQBJ2Pf1QC25UV2IGXtL90WGAjWw71RwJM24dudEBrr9DTasRDLRIn819PIOrj2ojSAJOx7+qD4iWbce60uYRiF0MBGth3qskkmYw/exByIustacBPlRa3QW4TIPGvyQaEW91nl7QWPw53hBpRbhZydo7p5FZFwQaUXSYDRiSshu1rRLf8APFBoZDJwC2CEAZEzO4LbEde1T9FgESkdb67KoPqJo1HKWxfIZe0lhgIq7DujgSZtw7eiA11+hptQvu6P7qsvIOrj2ojSAJOx7+qAW3KiuxAy9pfuiwwEa2HeqOBJmMO3OiAHX6Gm1C65QV2rLzPVx7IwgUdj3QfVp1eqWfVREGqy49PskfW7IiDZasOv3WYGr3REGuy49FiPrdkRBstWHX7rMHV7rKINVlx6LEXX7IiDZasBzWYOp3+qyiDVZcTyWIuv2+iIg2WrAc1mHqdD9URB8WXEr5fr9R9ERBttOr1Sz6vdZRBpsuPT7JH1uyIg2WrDqswdTuiINdlxPJYtOt0REH//2Q==' },
117
- onChange: ->(action) do
118
- action.sheets_select message: 'Submit data?', buttons: ->(menu) do
119
- menu.button text: 'Yes, submit', onClick: ->(subaction) do
120
- action.forms_submit
121
- end
122
- end
123
- end
124
89
  end
125
90
 
126
91
  end
@@ -11,7 +11,9 @@ section.rows builder: ->(row) do
11
11
  array.each do |i|
12
12
  index = page_index * batch_count + i
13
13
  if local_assigns[:reorder]
14
- row.thumbnail title: "Item #{index}"
14
+ row.thumbnail title: "Item #{index}", onReorder: ->(action) do
15
+ action.dialogs_notification title: "Item #{index}"
16
+ end, paramNameForFormData: 'message', paramNameForNewIndex: 'new_index'
15
17
  else
16
18
  row.thumbnail title: "Item #{index}", subtitle: "Sub Item #{index}", subsubtitle: "Sub Sub Item #{index}"
17
19
  end
@@ -30,11 +30,5 @@ else
30
30
  end
31
31
  render 'json_ui/garage/lists/autoload_section', page: page, page_index: page_index, reorder: true
32
32
  end
33
- ], dragSupport: {
34
- onDrop: {
35
- action: 'dialogs/alert'
36
- },
37
- paramNameForFormData: 'message',
38
- paramNameForNewIndex: 'new_index'
39
- }
33
+ ]
40
34
  end
@@ -11,22 +11,6 @@ json_ui_page json do |page|
11
11
  section.rows builder: ->(template) do
12
12
  template.thumbnail title: 'Click me', onClick: ->(action) do
13
13
  action.windows_open url: json_ui_garage_url(path: 'home/blank')
14
- end,
15
- accessory: ->(accessory) do
16
- accessory.header \
17
- width: 'matchParent',
18
- backgroundColor: '#b3bac2',
19
- padding: { top: 10, bottom: 10, left: 10, right: 10 },
20
- childViews: ->(bottom) do
21
- bottom.label text: 'Custom row header'
22
- end
23
- accessory.footer \
24
- width: 'matchParent',
25
- backgroundColor: '#b3bac2',
26
- padding: { top: 10, bottom: 10, left: 10, right: 10 },
27
- childViews: ->(bottom) do
28
- bottom.label text: 'Custom row footer'
29
- end
30
14
  end
31
15
  template.thumbnail title: 'Item with icon and subtitle', subtitle: 'Item subtitle', icon: 'facebook'
32
16
  template.thumbnail title: 'Item with chips', chips: ->(menu) do
@@ -6,42 +6,44 @@ json_ui_page json do |page|
6
6
  page.scroll padding: glib_json_padding_body, childViews: ->(scroll) do
7
7
  scroll.panels_column lg: { cols: 8 }, childViews: ->(column) do
8
8
  column.h2 text: 'Tab Bar with Badge'
9
- column.tabBar buttons: ->(menu) do
10
- badges = [
11
- {
12
- text: nil,
13
- backgroundColor: nil
14
- },
15
- {
16
- text: 8,
17
- backgroundColor: '#272551'
18
- },
19
- {
20
- text: '⭐⭐⭐',
21
- backgroundColor: '#008000'
22
- }
23
- ]
24
- {
25
- 'FIRST' => 'home',
26
- 'SECOND' => 'schedule',
27
- 'THIRD' => 'analytics'
28
- }.each_with_index do |(text, icon), index|
29
- menu.button \
30
- icon: icon,
31
- text: text,
32
- badge: badges[index],
33
- disabled: params[:tab].to_i == index,
34
- onClick: ->(action) do
35
- action.windows_reload \
36
- url: json_ui_garage_url(
37
- path: 'pages/tab_bar',
38
- tab: index,
39
- tab_2: params[:tab_2],
40
- tab_3: params[:tab_3]
41
- )
9
+ column.tabBar \
10
+ activeIndex: params[:tab].to_i,
11
+ buttons: ->(menu) do
12
+ badges = [
13
+ {
14
+ text: nil,
15
+ backgroundColor: nil
16
+ },
17
+ {
18
+ text: 8,
19
+ backgroundColor: '#272551'
20
+ },
21
+ {
22
+ text: '⭐⭐⭐',
23
+ backgroundColor: '#008000'
24
+ }
25
+ ]
26
+ {
27
+ 'FIRST' => 'home',
28
+ 'SECOND' => 'schedule',
29
+ 'THIRD' => 'analytics'
30
+ }.each_with_index do |(text, icon), index|
31
+ menu.button \
32
+ icon: icon,
33
+ text: text,
34
+ badge: badges[index],
35
+ disabled: params[:tab].to_i == index,
36
+ onClick: ->(action) do
37
+ action.windows_reload \
38
+ url: json_ui_garage_url(
39
+ path: 'pages/tab_bar',
40
+ tab: index,
41
+ tab_2: params[:tab_2],
42
+ tab_3: params[:tab_3]
43
+ )
44
+ end
42
45
  end
43
- end
44
- end
46
+ end
45
47
  column.spacer height: 10
46
48
 
47
49
  column.label text: "Tab index #{params[:tab].to_i} selected"
@@ -55,22 +57,25 @@ json_ui_page json do |page|
55
57
 
56
58
  scroll.panels_column lg: { cols: 8 }, childViews: ->(column) do
57
59
  column.h2 text: "Tab Bar with 'full-width-divider'"
58
- column.tabBar styleClass: 'full-width-divider', buttons: ->(menu) do
59
- 5.times do |index|
60
- menu.button \
61
- text: "Tab #{index}",
62
- disabled: params[:tab_2].to_i == index,
63
- onClick: ->(action) do
64
- action.windows_reload \
65
- url: json_ui_garage_url(
66
- path: 'pages/tab_bar',
67
- tab: params[:tab],
68
- tab_2: index,
69
- tab_3: params[:tab_3]
70
- )
60
+ column.tabBar \
61
+ activeIndex: params[:tab_2].to_i,
62
+ styleClass: 'full-width-divider',
63
+ buttons: ->(menu) do
64
+ 5.times do |index|
65
+ menu.button \
66
+ text: "Tab #{index}",
67
+ disabled: params[:tab_2].to_i == index,
68
+ onClick: ->(action) do
69
+ action.windows_reload \
70
+ url: json_ui_garage_url(
71
+ path: 'pages/tab_bar',
72
+ tab: params[:tab],
73
+ tab_2: index,
74
+ tab_3: params[:tab_3]
75
+ )
76
+ end
71
77
  end
72
78
  end
73
- end
74
79
  column.spacer height: 10
75
80
 
76
81
  column.label text: "Tab-2 index #{params[:tab_2].to_i} selected"
@@ -79,22 +84,25 @@ json_ui_page json do |page|
79
84
 
80
85
  scroll.panels_column lg: { cols: 8 }, childViews: ->(column) do
81
86
  column.h2 text: "Tab Bar 'with no-grow'"
82
- column.tabBar styleClass: 'no-grow', buttons: ->(menu) do
83
- 5.times do |index|
84
- menu.button \
85
- text: "Tab #{index}",
86
- disabled: params[:tab_3].to_i == index,
87
- onClick: ->(action) do
88
- action.windows_reload \
89
- url: json_ui_garage_url(
90
- path: 'pages/tab_bar',
91
- tab: params[:tab],
92
- tab_2: params[:tab_2],
93
- tab_3: index
94
- )
87
+ column.tabBar \
88
+ activeIndex: params[:tab_3].to_i,
89
+ styleClass: 'no-grow',
90
+ buttons: ->(menu) do
91
+ 5.times do |index|
92
+ menu.button \
93
+ text: "Tab #{index}",
94
+ disabled: params[:tab_3].to_i == index,
95
+ onClick: ->(action) do
96
+ action.windows_reload \
97
+ url: json_ui_garage_url(
98
+ path: 'pages/tab_bar',
99
+ tab: params[:tab],
100
+ tab_2: params[:tab_2],
101
+ tab_3: index
102
+ )
103
+ end
95
104
  end
96
105
  end
97
- end
98
106
  column.spacer height: 10
99
107
 
100
108
  column.label text: "Tab-3 index #{params[:tab_3].to_i} selected"
@@ -1,6 +1,7 @@
1
1
  progress = params[:progress]&.to_i&.between?(0, 5) ? params[:progress].to_i : 0
2
2
 
3
3
  tview.panels_responsive \
4
+ width: 400,
4
5
  childViews: ->(res) do
5
6
  res.panels_column sm: { cols: 11 }, childViews: ->(subcolumn) do
6
7
  subcolumn.panels_column sm: { cols: 2, padding: { right: 10 } }, childViews: ->(inner_column) do
@@ -127,19 +127,6 @@ json_ui_page json do |page|
127
127
  action.windows_open url: json_ui_garage_url(path: 'home/blank')
128
128
  end
129
129
 
130
- scroll.spacer height: 20
131
- scroll.h1 text: 'Drag-and-drop support'
132
- scroll.panels_horizontal backgroundColor: '#b3bac2', width: 300, distribution: 'spaceEqually', childViews: ->(panel) do
133
- panel.button id: 'button1', text: '1'
134
- panel.button id: 'button2', text: '2'
135
- panel.button id: 'button3', text: '3'
136
- end, dragSupport: {
137
- onDrop: {
138
- action: 'dialogs/alert',
139
- },
140
- paramNameForFormData: 'message'
141
- }
142
-
143
130
  scroll.label text: "\n"
144
131
  end
145
132
  end
@@ -72,7 +72,7 @@ json_ui_page json do |page|
72
72
  left.button text: '1'
73
73
  end
74
74
  content.center childViews: ->(center) do
75
- center.label text: 'a very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very long text'
75
+ center.label text: 'a very very very very very very very very very very very very very very very very very very very very very very very very very very very very long text'
76
76
  end
77
77
  content.right childViews: ->(right) do
78
78
  right.button text: '2'
@@ -26,7 +26,7 @@ page.scroll padding: glib_json_padding_body, childViews: ->(scroll) do
26
26
  end
27
27
 
28
28
  scroll.spacer height: 14
29
- scroll.h2 text: 'Breadcrumbs (experimental)'
29
+ scroll.h2 text: 'Breadcrumbs'
30
30
  scroll.spacer height: 6
31
31
  scroll.panels_ul \
32
32
  width: 'matchParent',
@@ -37,11 +37,8 @@ page.scroll padding: glib_json_padding_body, childViews: ->(scroll) do
37
37
  ul.button text: 'Level 1', styleClass: 'link', onClick: ->(action) do
38
38
  action.windows_open url: json_ui_garage_url(path: 'home/blank')
39
39
  end
40
-
41
- ul.button icon: 'keyboard_arrow_down', text: 'Level 2', styleClass: 'link', childButtons: ->(menu) do
42
- menu.button text: 'Dropdown item 1'
43
- menu.button text: 'Dropdown item 2'
44
- menu.button text: 'Dropdown item 3'
40
+ ul.button text: 'Level 2', styleClass: 'link', onClick: ->(action) do
41
+ action.windows_open url: json_ui_garage_url(path: 'home/blank')
45
42
  end
46
43
  ul.label text: 'Level 3'
47
44
  end
@@ -8,34 +8,26 @@
8
8
  <title>App</title>
9
9
  <%= csrf_meta_tags %>
10
10
 
11
- <%= javascript_pack_tag 'vue_renderer', defer: true %>
11
+ <%= vite_javascript_tag 'vue_renderer', defer: true %>
12
12
  <%#= javascript_include_tag 'vue_renderer_extras', defer: true %>
13
13
 
14
- <%= stylesheet_pack_tag 'vue_renderer' %>
14
+ <%= vite_stylesheet_tag 'vue_renderer' %>
15
15
 
16
16
  <link href="//fonts.googleapis.com/css?family=Material+Icons" rel="stylesheet" />
17
-
18
- <%# Without this, checkboxes and radio buttons will not display. %>
19
- <link href="//cdn.materialdesignicons.com/2.1.99/css/materialdesignicons.min.css" rel="stylesheet" />
20
-
21
- <%= yield :head %>
22
-
23
- <% if @__glib_head_code %>
24
- <%= @__glib_head_code.html_safe %>
25
- <% end %>
17
+ <%# Without this, checkboxes and radio buttons will not display. %>
18
+ <link href="//cdn.materialdesignicons.com/2.1.99/css/materialdesignicons.min.css" rel="stylesheet" />
19
+ <%= yield :head %>
20
+ <% if @__glib_head_code %>
21
+ <%= @__glib_head_code.html_safe %>
22
+ <% end %>
26
23
  </head>
27
-
28
24
  <body>
29
25
  <%= yield :header %>
30
-
31
26
  <noscript>Please enable JavaScript to view this web site.</noscript>
32
27
  <div id="app"></div>
33
-
34
28
  <script>
35
29
  var __page = <%= raw @__json_ui_orig_page%>;
36
30
  </script>
37
-
38
31
  <%= yield :footer %>
39
32
  </body>
40
-
41
33
  </html>
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: 2.6.2
4
+ version: 3.0.0.pre.beta1
5
5
  platform: ruby
6
6
  authors:
7
7
  - ''
@@ -309,11 +309,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
309
309
  version: '0'
310
310
  required_rubygems_version: !ruby/object:Gem::Requirement
311
311
  requirements:
312
- - - ">="
312
+ - - ">"
313
313
  - !ruby/object:Gem::Version
314
- version: '0'
314
+ version: 1.3.1
315
315
  requirements: []
316
- rubygems_version: 3.1.6
316
+ rubygems_version: 3.1.4
317
317
  signing_key:
318
318
  specification_version: 4
319
319
  summary: ''