glib-web 0.3.9 → 0.3.10
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 12c6f0412005aeff7117e83650cd6df244565451044f9813d04914bb5ade0b57
|
4
|
+
data.tar.gz: d7ab3a02df1aaef6aeaf9edfd24744c5ceb334067f37958fd1da50fd1663f3ae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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 = '',
|
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
|