glib-web 0.3.9 → 0.3.10

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: b13a0d5398903f6b1e6795d7a34dce9c064dd05a7df740d47cd15690fdd906eb
4
- data.tar.gz: 4195513ba393a6d4f0fff811f01355b2aef1793caf3c3fb7d609d3df3d31cfc2
3
+ metadata.gz: 12c6f0412005aeff7117e83650cd6df244565451044f9813d04914bb5ade0b57
4
+ data.tar.gz: d7ab3a02df1aaef6aeaf9edfd24744c5ceb334067f37958fd1da50fd1663f3ae
5
5
  SHA512:
6
- metadata.gz: 7162957076123f6f803f6c854f1099bf1e44f1ff27c7900d24ef3eb3ab259491459c3071a343683d800cab007d744d7ddfe0fba31e47c4b09fd8e32abcbb0e1e
7
- data.tar.gz: 816b64172b98f4e1907894b93265adad533d319b0561fe2f73439d0c47c7e9da52a67d0bf6eb7a94a5d54ca50755e88ae2a6f143e6bc08324b2e486f5c981d1e
6
+ metadata.gz: bd5d4772eac30d21ab0cec9d81eb2445f7e752de2d29cb8e94118a823bbcaae2cfe77219bf2f77441e0929adbb4d31fcda9de9ed1694fca9122c34540e9acfd3
7
+ data.tar.gz: a28093f3bea1e7deaa8a9f992f4c7a3f589a9fc7730ef712163349187fd5977f22bb385ed9cd10bd04c74863c42527b6b8cc73c40db4f900da52d1df205bc975
@@ -1,13 +1,18 @@
1
1
  module Glib
2
2
  module DynamicTextsHelper
3
- def dt(key, default_value = '', options: { scope: 'itinerarybuilder', lang: 'en' })
3
+ def dt(key, default_value = '', **args)
4
4
  new_key = key
5
+ options = {
6
+ scope: args.fetch(:scope, 'itinerarybuilder'),
7
+ lang: args.fetch(:lang, 'en')
8
+ }
5
9
 
6
10
  if key.starts_with?('.')
7
11
  new_key = "#{controller_name}.#{action_name}#{key}"
8
12
  end
9
13
 
10
- Glib::Text.get_content(new_key, default_value, options: options)
14
+ content = Glib::Text.get_content(new_key, default_value, options: options)
15
+ content.gsub(/\{\{(\w+)\}\}/) { args.fetch($1.to_sym, "{{#{$1}}}") }
11
16
  end
12
17
  end
13
18
  end
@@ -61,8 +61,9 @@ module Glib
61
61
 
62
62
  class P < AbstractText
63
63
  end
64
-
64
+
65
65
  class Label < AbstractText
66
+ string :format
66
67
  action :onClick
67
68
  end
68
69
 
@@ -76,7 +77,7 @@ module Glib
76
77
  string :url
77
78
  action :onClick
78
79
  end
79
-
80
+
80
81
  class Icon < View
81
82
  string :name
82
83
  action :onClick
@@ -86,7 +87,7 @@ module Glib
86
87
  # icon :icon
87
88
  # string :text
88
89
  # end
89
-
90
+
90
91
  class Button < View
91
92
  icon :icon, cache: true
92
93
  string :text, cache: true
@@ -111,7 +112,7 @@ module Glib
111
112
  int :zoom
112
113
  string :dataUrl
113
114
  end
114
-
115
+
115
116
  class Chip < View
116
117
  string :text
117
118
  end
@@ -119,10 +120,10 @@ module Glib
119
120
  class Calendar < View
120
121
  string :dataUrl
121
122
  end
122
-
123
+
123
124
  class TabBar < View
124
125
  color :color
125
-
126
+
126
127
  def tabButtons(block)
127
128
  json.tabButtons do
128
129
  block.call page.menu_builder
@@ -140,7 +141,7 @@ module Glib
140
141
  # end
141
142
  # end
142
143
  # end
143
-
144
+
144
145
  end
145
146
 
146
147
  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.3.9
4
+ version: 0.3.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - ''