rbbt-rest 1.8.37 → 1.8.38

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: 907a1b31052e9688f8af570b771d662e913daecf
4
- data.tar.gz: 781280a50c9eebc1aed87a656d3378747b066dfe
3
+ metadata.gz: df38cca124c115de7e9f144b2c1234e7138c8501
4
+ data.tar.gz: fe6002b363933c90433912c7c4c943742faf4236
5
5
  SHA512:
6
- metadata.gz: b95d87d47c5ab47d68dc4d42a1e42f164e14074902545609d1df32374495392f354622b06e84a06bb2a2d1138ce0514c56cf361b85ef5b5570e60d2fc8b2cb7e
7
- data.tar.gz: a532c5ac019c414a5851457af736347142e0f0bbb42781b64401ee48024be11063ef6a51c9755da5145e4b5d40f0cf9e72c6bbd9187a055b976d135f4fbcca3d
6
+ metadata.gz: 2fb51ca64c49a4845d9eb795a748bb52604b18f749c4132c50359ef2cbd12bd5367131279d3b72b576221f7c2898b80fd6abf5061886997668ce410220df1e78
7
+ data.tar.gz: a214ff4effdb4bb8c8d4521f9bc950b0a97353beb291dc4bc06cb8fc8c2f5d16c74ef425aece9a2c2d743a01b10b1c1cf8cc2f2de80c3d9c5c5ac814846f0750
@@ -323,23 +323,31 @@ module RbbtRESTHelpers
323
323
  @table_filters[field] = type
324
324
  end
325
325
 
326
- def self.save_tsv(tsv, path)
327
- Open.write(path, tsv.to_s)
328
- table_options = {:tsv_entity_options => tsv.entity_options}
329
- if tsv.entity_templates and tsv.entity_templates.any?
330
- table_options[:headers] ||= {}
331
- tsv.entity_templates.each do |field,template|
332
- next if template.nil?
333
- next if table_options[:headers].include? field
334
- info = template.info
335
- info.delete :format
336
- info.delete :annotation_types
337
- info.delete :annotated_array
338
- table_options[:headers][field] = [template.annotation_types.last.to_s, info]
339
- end
340
- end
341
- Open.write(path + '.table_options', table_options.to_yaml )
342
- end
326
+ #def self.save_tsv(tsv, path)
327
+ # iii :SAVE
328
+ # Open.write(path, tsv.to_s)
329
+ # table_options = {:tsv_entity_options => tsv.entity_options, :tsv_entity_templates => tsv.entity_templates}
330
+ # iii table_options
331
+ # if tsv.entity_templates and tsv.entity_templates.any?
332
+ # table_options[:headers] ||= {}
333
+ # tsv.entity_templates.each do |field,template|
334
+ # next if template.nil?
335
+ # next if table_options[:headers].include? field
336
+ # info = template.info
337
+ # info.delete :format
338
+ # info.delete :annotation_types
339
+ # info.delete :annotated_array
340
+ # table_options[:headers][field] = [template.annotation_types.last.to_s, info]
341
+ # end
342
+ # end
343
+ # Open.write(path + '.table_options', table_options.to_yaml )
344
+ #end
345
+ #
346
+ #def save_tsv(file)
347
+ # RbbtRESTHelpers.save_tsv(file)
348
+ #end
349
+
350
+
343
351
 
344
352
  def self.load_tsv(file)
345
353
  tsv = TSV.open(Open.open(file))
@@ -352,11 +360,6 @@ module RbbtRESTHelpers
352
360
  [tsv, table_options]
353
361
  end
354
362
 
355
- def save_tsv(file)
356
- RbbtRESTHelpers.save_tsv(file)
357
- end
358
-
359
-
360
363
  def load_tsv(file)
361
364
  RbbtRESTHelpers.load_tsv(file)
362
365
  end
@@ -1,12 +1,21 @@
1
1
  - table_columns_id = "rbbt_table_columns_" << (rand * 1000).to_i.to_s
2
+ - entity_headers = {} unless defined?(entity_headers) and entity_headers
2
3
  = reveal :column, table_columns_id, :class => 'ui compact button table_column' do
3
4
  %ul.table_column_selector.clean_list
4
5
  - if header
5
- - header.each do |field|
6
+ - header.each_with_index do |field,i|
6
7
  %li.ui.basic.segment
7
8
  %span.field= field
8
9
  %a.save_column_map.ui.compact.button(href="#") save map
9
- - if Entity.formats.include? field and Entity.formats[field].include? Entity::REST
10
+ - entity_type, options = entity_headers[field] || entity_headers[i]
11
+ - entity_type ||= Entity.formats.include?(field) && Entity.formats[field]
12
+ - begin
13
+ - entity_type = Entity.formats[entity_type] if String === entity_type and Entity.formats.include? entity_type
14
+ - entity_type = Kernel.const_get(entity_type) if String === entity_type
15
+ - rescue
16
+ - Log.exception $!
17
+ - entity_type = nil
18
+ - if entity_type and entity_type.include? Entity::REST
10
19
  %a.save_column_list.ui.compact.button(href="#") save list
11
20
  - else
12
21
  NO column selection
@@ -1,6 +1,6 @@
1
1
  - table_options = {} unless defined? table_options and table_options
2
2
  - entity_options = table_options[:tsv_entity_options] unless defined? entity_options and entity_options
3
- - headers = table_options[:headers]
3
+ - entity_headers = table_options[:headers] unless defined? entity_headers and entity_headers
4
4
  - table_id = table_options[:table_id] unless defined? table_id and table_id
5
5
  - caption = table_options[:caption] unless defined? caption and caption
6
6
  - table_class = table_options[:table_class] unless defined? table_class and table_class
@@ -74,7 +74,7 @@
74
74
 
75
75
  = partial_render('partials/table/filters', :table_url => table_url, :header => header, :id => "rbbt_reveal_" << Misc.digest(table_url))
76
76
 
77
- = partial_render('partials/table/column', :table_url => table_url, :header => header)
77
+ = partial_render('partials/table/column', :table_url => table_url, :header => header, :entity_headers => entity_headers)
78
78
 
79
79
  = partial_render('partials/table/files', :table_url => table_url)
80
80
 
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.37
4
+ version: 1.8.38
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-28 00:00:00.000000000 Z
11
+ date: 2016-11-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake