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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 014c4ac9d0e0697d6bc03657034af9917640fc5e
4
- data.tar.gz: e41f9ffa62f5be852f3a3e496ffc261c9fec0562
3
+ metadata.gz: 907a1b31052e9688f8af570b771d662e913daecf
4
+ data.tar.gz: 781280a50c9eebc1aed87a656d3378747b066dfe
5
5
  SHA512:
6
- metadata.gz: 175858ce0d5689c2018706c3c19e3e41e184b00fc0d3c8bbea8971ff8dc1ab9e3970b848c49f006bdb19f9012818000d5fd647fc73b48b5ba8a4bffc7415f84c
7
- data.tar.gz: dc46e6ce05fac3a94542324b1df756688b2e69c0576d9d0a3dfd21db3e7d081fefe1bd7917f018f95f6e066ffa57a8f6991cad1f71a4ea3e335f96f33a106b5f
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 }")
@@ -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.low "Adding resource path: #{Misc.fingerprint path}"
20
+ Log.medium "Adding resource path: #{Misc.fingerprint path}"
21
21
  KnowledgeBaseRESTHelpers.association_resources.unshift path
22
22
 
23
23
  if priority_templates
@@ -223,3 +223,7 @@ ul.tasks
223
223
  ul.stacktrace
224
224
  li > span
225
225
  margin-left: 0.5em
226
+
227
+ .hide_overflow
228
+ overflow: hidden
229
+ text-overflow: ellipsis
@@ -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('--', '&#8212;').sub('->', '&#8680;')
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.36
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-26 00:00:00.000000000 Z
11
+ date: 2016-10-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake