rbbt-rest 1.8.1 → 1.8.2

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
  SHA1:
3
- metadata.gz: e5a15e2401428dad996aad8a55691eafbdb1072e
4
- data.tar.gz: ab4a0ab01e3f193522dfb07780e2a753eb346c71
3
+ metadata.gz: 9db115f33017c66595437648ad05997d452733a6
4
+ data.tar.gz: abda02054f71c7d38d6024524d755bcc2fb1dff6
5
5
  SHA512:
6
- metadata.gz: 956ef3ffb42a95aa91fe3d04afcc1c2f1759c98fb17008669889ce254fd9476e9aa8cc1d4b44a8cdd08ff736208f3b06532b22f36ec1ac52750b9e05f18e6a21
7
- data.tar.gz: 5243450b240ae44c7b24f53c79f4527acaa014a8e88000402cbbba5daac5462dccb4ceb20c83e5ab202c9d9594d67ceca0904717938263b3e67b71f90779e810
6
+ metadata.gz: ea5dbd2c6b35d1de6975818ac8916a2ea7430680ad5a17bf73be7b5d01c5b3136360a2ff138654593a7cefe97d51120fa1b87972265f8bb7d7b7cfdb3331546d
7
+ data.tar.gz: 15a3cbed98f5c0b531df9aa0b56936c644dca35b17676bb88bab6f0ea61ef8b4e8b7838c551f78f674ac25e2aa8d5d4a44d77c592dc91143d9c2fdfae555b02b
@@ -290,13 +290,16 @@ module RbbtRESTHelpers
290
290
  value = value[0..99]
291
291
  end
292
292
 
293
- res = if options[:span]
293
+ res = case options[:span]
294
+ when true, "true", :true
294
295
  Array === value ? value.collect{|v| "<span class='table_value'>#{v.to_s}</span>"} * ", " : "<span class='table_value'>#{value}</span>"
296
+ when :long, "long"
297
+ Array === value ? value.collect{|v| "<span class='table_value long'>#{v.to_s}</span>"} * " " : "<span class='table_value long'>#{value}</span>"
295
298
  else
296
299
  Array === value ? value.collect{|v| v.to_s} * ", " : value
297
300
  end
298
301
 
299
- res = "<span class='table_value strip'>[#{ strip } entries, 100 shown]</span>" + res if strip
302
+ res = "<span class='table_value strip'>[#{ strip } entries, 100 shown]</span> " + res if strip
300
303
 
301
304
  res
302
305
  end
@@ -317,6 +320,7 @@ module RbbtRESTHelpers
317
320
  if tsv.entity_templates and tsv.entity_templates.any?
318
321
  table_options[:headers] ||= {}
319
322
  tsv.entity_templates.each do |field,template|
323
+ next if template.nil?
320
324
  next if table_options[:headers].include? field
321
325
  info = template.info
322
326
  info.delete :format
@@ -1,7 +1,8 @@
1
1
  class ListContainer
2
- attr_accessor :lists
3
- def initialize
2
+ attr_accessor :lists, :block
3
+ def initialize(&block)
4
4
  @lists = []
5
+ @block = block
5
6
  end
6
7
 
7
8
  def add(list_id, list = nil, text = nil, options = {}, &block)
@@ -50,3 +50,13 @@ table > caption
50
50
 
51
51
  .filters + p
52
52
  margin-top: 2em
53
+
54
+ .table_value
55
+ white-space: nowrap
56
+ &.strip
57
+ font-weight: bold
58
+ &.long
59
+ overflow: hidden
60
+ text-overflow: ellipsis
61
+ float: left
62
+ clear: left
@@ -1,51 +1,54 @@
1
1
  .entity_list.ui.styled.accordion
2
- - container.lists.each do |id, list, text, options|
3
- - if Proc === list
4
- = fragment do
5
- - list = list.call
6
- - next if list.nil?
7
- .title
8
- = list.respond_to?(:list_link) ? list.list_link(:length, id) : list.length
9
- %span.title
10
- - title = text || id
11
- = title.sub('--', '&#8212;').sub('->', '&#8680;')
12
- .content
13
- - if (defined? force and force) or list.length < 500
14
- - if list.respond_to? :link
15
- = list.link * ", "
16
- - else
17
- = list * ", "
18
- - else
19
- = modal_fragment "Too many entities to list" do
2
+ = fragment do
3
+ - if container.block
4
+ - container.block.call(container)
5
+ - container.lists.each do |id, list, text, options|
6
+ - if Proc === list
7
+ = fragment do
8
+ - list = list.call
9
+ - next if list.nil?
10
+ .title
11
+ = list.respond_to?(:list_link) ? list.list_link(:length, id) : list.length
12
+ %span.title
13
+ - title = text || id
14
+ = title.sub('--', '&#8212;').sub('->', '&#8680;')
15
+ .content
16
+ - if (defined? force and force) or list.length < 500
20
17
  - if list.respond_to? :link
21
18
  = list.link * ", "
22
19
  - else
23
20
  = list * ", "
24
- - else
25
- - if list.empty?
26
- .title
27
- = 0
28
- %span.title
29
- - title = text || id
30
- = title.sub('--', '&#8212;').sub('->', '&#8680;')
31
- - else
32
- .title
33
- = list.respond_to?(:list_link) ? list.list_link(:length, id) : list.length
34
- %span.title
35
- - title = text || id
36
- = title.sub('--', '&#8212;').sub('->', '&#8680;')
37
- .content
38
- - if (defined? force and force) or list.length < 500
39
- - if list.respond_to? :link
40
- = list.link * ", "
41
21
  - else
42
- = list * ", "
43
- - else
44
- = reveal "Too many entities to list" do
45
- = fragment do
22
+ = modal_fragment "Too many entities to list" do
46
23
  - if list.respond_to? :link
47
24
  = list.link * ", "
48
25
  - else
49
26
  = list * ", "
27
+ - else
28
+ - if list.empty?
29
+ .title
30
+ = 0
31
+ %span.title
32
+ - title = text || id
33
+ = title.sub('--', '&#8212;').sub('->', '&#8680;')
34
+ - else
35
+ .title
36
+ = list.respond_to?(:list_link) ? list.list_link(:length, id) : list.length
37
+ %span.title
38
+ - title = text || id
39
+ = title.sub('--', '&#8212;').sub('->', '&#8680;')
40
+ .content
41
+ - if (defined? force and force) or list.length < 500
42
+ - if list.respond_to? :link
43
+ = list.link * ", "
44
+ - else
45
+ = list * ", "
46
+ - else
47
+ = reveal "Too many entities to list" do
48
+ = fragment do
49
+ - if list.respond_to? :link
50
+ = list.link * ", "
51
+ - else
52
+ = list * ", "
50
53
 
51
54
 
@@ -2,9 +2,9 @@
2
2
  %dt.ui.header Job control
3
3
  %dd.job_control
4
4
  .ui.buttons
5
- %a.ui.small.button(href="/#{[workflow.to_s, task, jobname] * "/"}?_update=clean") clean
6
- %a.ui.small.button(href="/#{[workflow.to_s, task, jobname, "info"] * "/"}") info
7
- %a.ui.small.button(href="/#{[workflow.to_s, task, jobname] * "/"}?_format=raw") raw
5
+ %a.ui.small.button(href="/#{[workflow.to_s, task, jobname] * "/"}?_update=clean") clean job
6
+ %a.ui.small.button(href="/#{[workflow.to_s, task, jobname, "info"] * "/"}") job info
7
+ %a.ui.small.button(href="/#{[workflow.to_s, task, jobname] * "/"}?_format=raw") get raw result file
8
8
 
9
9
  - files = job.files - ["html", "html.info"]
10
10
  - if files.any?
@@ -27,7 +27,7 @@ function contract_ellipsis(elem, max){
27
27
  elem.text(new_content);
28
28
  }else{
29
29
  var links = [];
30
- var head = elements.slice(0, max);
30
+ var head = elements.slice(0, max).removeClass('long');
31
31
  head.each(function(){ links.push(this.outerHTML)})
32
32
  new_content = links.join(", ");
33
33
  elem.html(new_content);
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.1
4
+ version: 1.8.2
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-03-23 00:00:00.000000000 Z
11
+ date: 2016-03-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake