rbbt-rest 1.8.37 → 1.8.38
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/table.rb +25 -22
- data/share/views/partials/table/column.haml +11 -2
- data/share/views/partials/table.haml +2 -2
- 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: df38cca124c115de7e9f144b2c1234e7138c8501
|
|
4
|
+
data.tar.gz: fe6002b363933c90433912c7c4c943742faf4236
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
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.
|
|
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
|
-
-
|
|
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
|
-
-
|
|
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.
|
|
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-
|
|
11
|
+
date: 2016-11-02 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rake
|