tabulatr2 0.9.36 → 0.9.37

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: 3cf75ddf6c1a0276ed849323837d544d5dc6e2e6
4
- data.tar.gz: 212f098deb57c6318d559455eb9b404508dc7dab
3
+ metadata.gz: 53dad1e2c59e15c866b409f8865792fccef046d3
4
+ data.tar.gz: 5c4be7ebbb61b317706be92d5f2b38690257a98c
5
5
  SHA512:
6
- metadata.gz: 12394834ee77dd68a0a91f7922e5ec28f8c2adf79b913132fefb6771d899d250a362e2d0bfe6a75121a1c4c46b0cdefa4f2abad63d5cabe10c2cc51e79bff8b1
7
- data.tar.gz: 69f9df7bb1586e200deb0624469665df12aef70f785b8a6f4b421b61d3f1848a0a3546646dde07bae8967952e834aa4e2e6cd3c7be1bb667f225c651f04291a4
6
+ metadata.gz: 9f99fe355295d552b97d96d917344d4511eb72fe99d5720c034152be772de2ade98d412cf705905351ff0a0fa6205b871af29490ab987bf7b68f1919c62d0f44
7
+ data.tar.gz: f8dbe093d43d35b9f3e5dcb4fbe26c94aabeeab2f1925635b763d51266ceeb587ea735048b449eadf5976a908d493f1f4c7aed7193b4632f770858fe459b1fcc
@@ -62,7 +62,7 @@ function tabulatrInitialize() {
62
62
  if (use_ajax)
63
63
  table_obj.updateTable(params, true);
64
64
  else
65
- table_obj.sendRequestWithoutAjax(params);
65
+ table_obj.sendRequestWithoutAjax(params, a.data('extension'));
66
66
  }
67
67
  });
68
68
 
@@ -36,13 +36,16 @@ Tabulatr.prototype = {
36
36
  this.loadDataFromServer(hash);
37
37
  },
38
38
 
39
- sendRequestWithoutAjax: function(hash) {
39
+ sendRequestWithoutAjax: function(hash, extension) {
40
40
  var data = this.getDataForAjax(hash);
41
41
  var url;
42
42
  if ($('table#'+ this.id).data('path') == '#')
43
- url = $(location).attr("pathname") + ".pdf?" + $.param(data)
43
+ url = $(location).attr("pathname");
44
44
  else
45
- url = $('table#'+ this.id).data('path') + ".pdf?" + $.param(data);
45
+ url = $('table#'+ this.id).data('path');
46
+ if (!extension || extension.length == 0)
47
+ extension = 'txt';
48
+ url = url.replace(/\/+$/, "") + '.' + extension + '?' + $.param(data);
46
49
  window.open(url);
47
50
  },
48
51
 
@@ -28,14 +28,17 @@
28
28
  ul.dropdown-menu role="menu" aria-labelledby="dLabel" data-confirm-text=t('tabulatr.batch_confirm_text')
29
29
  - table_options[:batch_actions].each do |key, data|
30
30
  - if data.is_a?(String)
31
- - label = data
32
- - download = false
31
+ - label = data
32
+ - download = false
33
+ - extension = nil
33
34
  - else
34
35
  - label = data[:text]
35
36
  - download = !!data[:download]
37
+ - extension = data[:extension]
36
38
  li
37
39
  = link_to label, '#', class: "batch-action-inputs", data: { \
38
40
  "do-batch-action-name" => iname, \
39
41
  "do-batch-action" => key, \
40
42
  "table-id" => table_id, \
41
- "download" => download }
43
+ "download" => download, \
44
+ "extension" => extension }
@@ -32,9 +32,9 @@ class Tabulatr::Data::Invoker
32
32
  @result ||= if @batch_action == name
33
33
  s = yield(@ids)
34
34
  if s.is_a?(Hash) && s[:data]
35
- Tabulatr::Responses::RawResponse.new(s[:data])
35
+ Tabulatr::Responses::RawResponse.new(s[:data], filename: s[:filename], type: s[:type])
36
36
  elsif s.is_a?(Hash) && s[:file]
37
- Tabulatr::Responses::FileResponse.new(s[:file], filename: s[:filename])
37
+ Tabulatr::Responses::FileResponse.new(s[:file], filename: s[:filename], type: s[:type])
38
38
  elsif s.is_a?(Hash) && s[:url]
39
39
  Tabulatr::Responses::RedirectResponse.new(s[:url], ids: @ids)
40
40
  else
@@ -22,5 +22,5 @@
22
22
  #++
23
23
 
24
24
  module Tabulatr
25
- VERSION = "0.9.36"
25
+ VERSION = "0.9.37"
26
26
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tabulatr2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.36
4
+ version: 0.9.37
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Horn
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2017-11-07 00:00:00.000000000 Z
13
+ date: 2017-12-05 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rails
@@ -280,7 +280,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
280
280
  version: '0'
281
281
  requirements: []
282
282
  rubyforge_project:
283
- rubygems_version: 2.6.13
283
+ rubygems_version: 2.6.14
284
284
  signing_key:
285
285
  specification_version: 4
286
286
  summary: A tight DSL to build tables of ActiveRecord models with sorting, pagination,