rbbt-rest 1.8.36 → 1.8.37
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/lib/rbbt/rest/common/locate.rb +13 -0
- data/lib/rbbt/rest/entity/render.rb +6 -0
- data/lib/rbbt/rest/main.rb +1 -1
- data/share/views/compass/misc.sass +4 -0
- data/share/views/entity_partials/list_container.haml +2 -2
- data/share/views/public/js/helpers/helpers.js +11 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 907a1b31052e9688f8af570b771d662e913daecf
|
4
|
+
data.tar.gz: 781280a50c9eebc1aed87a656d3378747b066dfe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b95d87d47c5ab47d68dc4d42a1e42f164e14074902545609d1df32374495392f354622b06e84a06bb2a2d1138ce0514c56cf361b85ef5b5570e60d2fc8b2cb7e
|
7
|
+
data.tar.gz: a532c5ac019c414a5851457af736347142e0f0bbb42781b64401ee48024be11063ef6a51c9755da5145e4b5d40f0cf9e72c6bbd9187a055b976d135f4fbcca3d
|
@@ -51,6 +51,19 @@ module RbbtRESTHelpers
|
|
51
51
|
raise TemplateMissing, "File #{ file } not found"
|
52
52
|
end
|
53
53
|
|
54
|
+
def find_all_from_resource(resource, pattern)
|
55
|
+
resource.glob(pattern)
|
56
|
+
end
|
57
|
+
|
58
|
+
def find_all(pattern)
|
59
|
+
paths = []
|
60
|
+
file_resources.each do |resource|
|
61
|
+
paths.concat find_all_from_resource(resource, pattern)
|
62
|
+
end
|
63
|
+
|
64
|
+
paths
|
65
|
+
end
|
66
|
+
|
54
67
|
#{{{ SASS
|
55
68
|
|
56
69
|
def self.add_sass_load_path(path)
|
@@ -44,6 +44,7 @@ module EntityRESTHelpers
|
|
44
44
|
name = entity.respond_to?(:name)? entity.name : entity
|
45
45
|
@title = "#{name} [#{$title}]"
|
46
46
|
|
47
|
+
Log.low "Rendering #{ entity }: #{ template_file }"
|
47
48
|
layout_file = layout ? locate_template("layout") : nil
|
48
49
|
|
49
50
|
render(template_file, locals, layout_file, "Entity: #{ entity }")
|
@@ -57,6 +58,7 @@ module EntityRESTHelpers
|
|
57
58
|
name = entity.respond_to?(:name)? entity.name : entity
|
58
59
|
@title = "#{action} #{name} [#{$title}]"
|
59
60
|
|
61
|
+
Log.low "Rendering #{ entity } #{ action }: #{ template_file }"
|
60
62
|
layout_file = layout ? locate_template("layout") : nil
|
61
63
|
|
62
64
|
render(template_file, locals, layout_file, "Action #{ action }: #{ entity }")
|
@@ -70,6 +72,7 @@ module EntityRESTHelpers
|
|
70
72
|
name = id
|
71
73
|
@title = "#{name} [#{$title}]"
|
72
74
|
|
75
|
+
Log.low "Rendering #{list.base_type.to_s} list: #{ template_file }"
|
73
76
|
layout_file = layout ? locate_template("layout") : nil
|
74
77
|
|
75
78
|
render(template_file, locals, layout_file, "Entity list: #{ id }")
|
@@ -83,6 +86,7 @@ module EntityRESTHelpers
|
|
83
86
|
name = id
|
84
87
|
@title = "#{action} #{name} [#{$title}]"
|
85
88
|
|
89
|
+
Log.low "Rendering #{list.base_type.to_s} list #{ action }: #{ template_file }"
|
86
90
|
layout_file = layout ? locate_template("layout") : nil
|
87
91
|
|
88
92
|
render(template_file, locals, layout_file, "Action #{ action } for list: #{ id }")
|
@@ -97,6 +101,7 @@ module EntityRESTHelpers
|
|
97
101
|
name = map_id
|
98
102
|
@title = "#{name} [#{$title}]"
|
99
103
|
|
104
|
+
Log.low "Rendering #{type} map: #{ template_file }"
|
100
105
|
layout_file = layout ? locate_template("layout") : nil
|
101
106
|
|
102
107
|
render(template_file, locals, layout_file, "Entity map: #{ map_id }")
|
@@ -110,6 +115,7 @@ module EntityRESTHelpers
|
|
110
115
|
name = id
|
111
116
|
@title = "#{action} #{name} [#{$title}]"
|
112
117
|
|
118
|
+
Log.low "Rendering #{type} map #{ action }: #{ template_file }"
|
113
119
|
layout_file = layout ? locate_template("layout") : nil
|
114
120
|
|
115
121
|
render(template_file, locals, layout_file, "Action #{ action } for map: #{ id }")
|
data/lib/rbbt/rest/main.rb
CHANGED
@@ -17,7 +17,7 @@ module Sinatra
|
|
17
17
|
module RbbtRESTMain
|
18
18
|
|
19
19
|
def self.add_resource_path(path, priority_templates = false)
|
20
|
-
Log.
|
20
|
+
Log.medium "Adding resource path: #{Misc.fingerprint path}"
|
21
21
|
KnowledgeBaseRESTHelpers.association_resources.unshift path
|
22
22
|
|
23
23
|
if priority_templates
|
@@ -12,7 +12,7 @@
|
|
12
12
|
%span.title
|
13
13
|
- title = text || id
|
14
14
|
= title.sub('--', '—').sub('->', '⇨')
|
15
|
-
.content
|
15
|
+
.content.hide_overflow
|
16
16
|
- if (defined? force and force) or list.length < 500
|
17
17
|
- if list.respond_to? :link
|
18
18
|
= list.link * ", "
|
@@ -37,7 +37,7 @@
|
|
37
37
|
%span.title
|
38
38
|
- title = text || id
|
39
39
|
= title.sub('--', '—').sub('->', '⇨')
|
40
|
-
.content
|
40
|
+
.content.hide_overflow
|
41
41
|
- if (defined? force and force) or list.length < 500
|
42
42
|
- if list.respond_to? :link
|
43
43
|
= list.link * ", "
|
@@ -98,7 +98,7 @@ function require_js(url, success, script){
|
|
98
98
|
var _success = function(script_text){ required_js.push(url); console.log("Required and loaded JS: " + url); if (typeof success == 'function'){ success(script) }; }
|
99
99
|
if (typeof rbbt.proxy != 'undefined')
|
100
100
|
url = rbbt.proxy + url
|
101
|
-
$.ajax({url: url, cache:cache, dataType:'script', async: async, success: _success} ).fail(function(jqxhr, settings, exception){ console.log('Failed to load ' + url)
|
101
|
+
$.ajax({url: url, cache:cache, dataType:'script', async: async, success: _success} ).fail(function(jqxhr, settings, exception){ console.log('Failed to load ' + url + ': ' + exception)});
|
102
102
|
}
|
103
103
|
}
|
104
104
|
}
|
@@ -306,3 +306,13 @@ function intersect(array1, array2){
|
|
306
306
|
return array2.indexOf(n) != -1
|
307
307
|
});
|
308
308
|
}
|
309
|
+
|
310
|
+
function clean_array_properties(array){
|
311
|
+
var n = {}
|
312
|
+
|
313
|
+
for(var i = 0; i < array.length; i += 1){
|
314
|
+
n[i.toString()] = array[i]
|
315
|
+
}
|
316
|
+
|
317
|
+
return(n)
|
318
|
+
}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rbbt-rest
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.8.
|
4
|
+
version: 1.8.37
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Miguel Vazquez
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-10-
|
11
|
+
date: 2016-10-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|