rbbt-rest 1.4.2 → 1.4.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rbbt/rest/common/cache.rb +1 -1
- data/lib/rbbt/rest/common/render.rb +2 -2
- data/lib/rbbt/rest/common/table.rb +2 -2
- data/lib/rbbt/rest/entity/list.rb +2 -3
- data/lib/rbbt/rest/entity/rest.rb +1 -1
- data/lib/rbbt/rest/knowledge_base/query.rb +5 -0
- data/share/views/compass/layout.sass +0 -1
- data/share/views/compass/workflow.sass +17 -10
- data/share/views/form.haml +3 -3
- data/share/views/job_result.haml +2 -1
- data/share/views/partials/table.haml +22 -16
- 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: 8812343a2a8345c1f58516ea3564d9f7c69a242c
|
4
|
+
data.tar.gz: 0a82376a6d54a79d43e0dec28a621c042648ccdd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ea16ac1a23c93d58ca5d8c808a7b4c650022fa250e7831403203c75b8e0e25474bf19232343102e0b07a4af397a39ee9c192924f5d1b0dc3222ef869f933ad08
|
7
|
+
data.tar.gz: 6fb04bf125f9cdccefa1db06f0723133f60b65e8761314aaba1288e14ad9bbfd3f4441e5bfc65bd0968e9dc10a8510f952e44a3489f086197c83658013126e23
|
@@ -15,7 +15,7 @@ module RbbtRESTHelpers
|
|
15
15
|
|
16
16
|
def cache(name, params = {}, &block)
|
17
17
|
@cache_type ||= params[:cache_type] if params[:cache_type]
|
18
|
-
return yield if name.nil? or cache_type.nil? or cache_type == :none
|
18
|
+
return yield if name.nil? or @cache_type.nil? or @cache_type == :none
|
19
19
|
|
20
20
|
send_file = consume_parameter(:_send_file, params)
|
21
21
|
|
@@ -77,7 +77,7 @@ module RbbtRESTHelpers
|
|
77
77
|
|
78
78
|
def template_render(template, locals = {}, cache = nil, cache_options = {})
|
79
79
|
template_file = locate_template(template)
|
80
|
-
layout_file = layout ? locate_template("layout") : nil
|
80
|
+
layout_file = @layout ? locate_template("layout") : nil
|
81
81
|
|
82
82
|
render(template_file, locals, layout_file, cache, cache_options)
|
83
83
|
end
|
@@ -149,7 +149,7 @@ module RbbtRESTHelpers
|
|
149
149
|
text ||= filename
|
150
150
|
|
151
151
|
filename = Misc.sanitize_filename(filename)
|
152
|
-
f =
|
152
|
+
f = settings.file_dir[filename].find
|
153
153
|
FileUtils.mkdir_p(File.dirname(f))
|
154
154
|
yield(f)
|
155
155
|
|
@@ -215,9 +215,9 @@ module RbbtRESTHelpers
|
|
215
215
|
|
216
216
|
entity_options = options[:entity_options]
|
217
217
|
|
218
|
-
Misc.prepare_entity(value, type, entity_options) if Entity.formats.include?
|
218
|
+
Misc.prepare_entity(value, type, entity_options) if Entity.formats.include?(type) and not options[:unnamed]
|
219
219
|
|
220
|
-
value = value.link if value.respond_to? :link
|
220
|
+
value = value.link if value.respond_to? :link and not options[:unnamed]
|
221
221
|
|
222
222
|
Array === value ? value.collect{|v| v.to_s} * ", " : value
|
223
223
|
end
|
@@ -25,7 +25,7 @@ module Entity
|
|
25
25
|
Entity.entity_list_cache[entity_type.to_s][user.to_s][id]
|
26
26
|
end
|
27
27
|
|
28
|
-
path.
|
28
|
+
path.find
|
29
29
|
end
|
30
30
|
|
31
31
|
def self.list_files(user = nil)
|
@@ -60,8 +60,7 @@ module Entity
|
|
60
60
|
path = list_file(entity_type, id, :public) unless path != nil and File.exists? path
|
61
61
|
path = list_file(entity_type, id) unless path != nil and File.exists? path
|
62
62
|
|
63
|
-
|
64
|
-
raise "List not found: #{ id }" if path.nil?
|
63
|
+
raise "List not found: #{ id }" if path.nil? or not File.exists? path
|
65
64
|
|
66
65
|
begin
|
67
66
|
list = Annotated.load_tsv TSV.open(path)
|
@@ -175,7 +175,7 @@ module Entity
|
|
175
175
|
reuse = options.delete("reuse") if reuse.nil?
|
176
176
|
reuse = true if reuse.nil?
|
177
177
|
|
178
|
-
Entity::List.save_list(entity_type.to_s, id, self) unless reuse and File.exists?
|
178
|
+
Entity::List.save_list(entity_type.to_s, id, self) unless reuse and File.exists?(Entity::List.list_file(entity_type.to_s, id, self))
|
179
179
|
|
180
180
|
klasses = self.klasses
|
181
181
|
klasses << 'entity_list'
|
@@ -1,7 +1,11 @@
|
|
1
1
|
require 'rbbt/util/misc'
|
2
2
|
require 'rbbt/knowledge_base'
|
3
|
+
require 'rbbt/rest/knowledge_base/helpers'
|
3
4
|
|
4
5
|
class KnowledgeBaseRESTQuery < Sinatra::Application
|
6
|
+
include RbbtRESTHelpers
|
7
|
+
include KnowledgeBaseRESTHelpers
|
8
|
+
register Sinatra::RbbtAuth
|
5
9
|
|
6
10
|
get '/knowledge_base/:name/:database/children/:entity' do
|
7
11
|
name = consume_parameter :name
|
@@ -205,6 +209,7 @@ class KnowledgeBaseRESTQuery < Sinatra::Application
|
|
205
209
|
acc
|
206
210
|
}
|
207
211
|
|
212
|
+
@format ||= :json
|
208
213
|
case @format
|
209
214
|
when :tsv
|
210
215
|
content_type "text/tab-separated-values"
|
@@ -1,5 +1,5 @@
|
|
1
1
|
ul.tasks
|
2
|
-
margin-top:
|
2
|
+
margin-top: 1em
|
3
3
|
li
|
4
4
|
display: block !important
|
5
5
|
|
@@ -35,23 +35,30 @@ ul.tasks
|
|
35
35
|
width: 5em
|
36
36
|
float: right
|
37
37
|
.examples
|
38
|
+
margin: 2em 0
|
38
39
|
ul
|
39
40
|
li
|
40
41
|
+rbbt_menu_item($color_bg: $base3, $color_menu_border: $base3)
|
41
42
|
|
42
|
-
|
43
|
-
+clear_fix
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
43
|
+
.job_control
|
44
|
+
+clear_fix()
|
45
|
+
margin: 1em 0
|
46
|
+
dt
|
47
|
+
display: none
|
48
|
+
//dt, dd
|
49
|
+
display: inline-block
|
50
|
+
dd.job_control, dd.job_files
|
51
|
+
ul
|
52
|
+
+rbbt_button_list($color_bg: $color_menu_bg)
|
53
|
+
background-color: $color_top_menu
|
54
|
+
width: auto
|
55
|
+
float: left
|
56
|
+
li a
|
51
57
|
|
52
58
|
|
53
59
|
.workflow.tasks
|
54
60
|
font-size: 1.2em
|
55
61
|
p
|
56
62
|
max-width: 60em
|
63
|
+
margin-left: 1em
|
57
64
|
|
data/share/views/form.haml
CHANGED
@@ -5,12 +5,12 @@
|
|
5
5
|
.workflow_task(id=id)
|
6
6
|
.title
|
7
7
|
%h3
|
8
|
+
%a(href="/#{workflow.to_s}")= workflow
|
9
|
+
—
|
8
10
|
=Misc.humanize task
|
9
|
-
.workflow_link
|
10
|
-
%a(href="/#{workflow.to_s}")= workflow
|
11
11
|
.description
|
12
12
|
- if task_info[:description]
|
13
|
-
.task_description
|
13
|
+
%p.task_description
|
14
14
|
:markdown
|
15
15
|
#{task_info[:description]}
|
16
16
|
|
data/share/views/job_result.haml
CHANGED
@@ -12,8 +12,13 @@
|
|
12
12
|
|
13
13
|
- list_links = table_options[:list_links] unless defined? list_links and list_links
|
14
14
|
|
15
|
+
- footer = table_options[:footer] unless defined? footer and footer
|
16
|
+
- footer = true if footer.nil?
|
17
|
+
|
15
18
|
- page = @page unless defined? page and not page.nil?
|
16
19
|
|
20
|
+
- unnamed = table_options[:unnamed]
|
21
|
+
|
17
22
|
%table(id="#{Misc.snake_case(table_id)}" class=table_class attr-url=table_url attr-total_size=total_size attr-page=page)
|
18
23
|
|
19
24
|
- if table_id
|
@@ -41,28 +46,29 @@
|
|
41
46
|
- row.each_with_index do |value, i|
|
42
47
|
- list_id = "#{ Misc.humanize(table_id) }: #{header[i]} for #{row.first}" if list_links and table_id and header and AnnotatedArray === value
|
43
48
|
- field = header ? header[i] : nil
|
44
|
-
- val = table_value(value, field, :list_id => list_id, :unnamed =>
|
49
|
+
- val = table_value(value, field, :list_id => list_id, :unnamed => unnamed, :entity_options => entity_options)
|
45
50
|
%td= Float === val ? "%.5g" % val : val.to_s
|
46
51
|
|
47
52
|
|
48
53
|
-#{{{ TFOOT
|
49
|
-
|
50
|
-
%
|
51
|
-
%
|
54
|
+
- if footer
|
55
|
+
%tfoot
|
56
|
+
%tr
|
57
|
+
%th(colspan="#{header ? header.length : 100}")
|
52
58
|
|
53
|
-
|
54
|
-
|
59
|
+
- if page
|
60
|
+
= partial_render('partials/table/page', :page => page, :total_size => total_size)
|
55
61
|
|
56
|
-
|
57
|
-
|
62
|
+
- if table_url
|
63
|
+
%ul.table_actions
|
58
64
|
|
59
|
-
|
60
|
-
|
61
|
-
|
65
|
+
= partial_render('partials/table/filters', :table_url => table_url, :header => header, :id => "rbbt_reveal_" << Misc.digest(table_url))
|
66
|
+
|
67
|
+
= partial_render('partials/table/column', :table_url => table_url, :header => header)
|
62
68
|
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
69
|
+
= partial_render('partials/table/files', :table_url => table_url)
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
|
68
74
|
|
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.4.
|
4
|
+
version: 1.4.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Miguel Vazquez
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-09-
|
11
|
+
date: 2014-09-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|