caboose-cms 0.8.30 → 0.8.31

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: abf8f13099c22abe4922f0cfd9aaec07a86fbaf5
4
- data.tar.gz: 528e1e16f607dea988a917f09822252ebfad8df1
3
+ metadata.gz: c8f8a99af4e04e3ae411be155833129e5ceb95fc
4
+ data.tar.gz: 378c7c4b12f24ce825eb2e2631b17736c7a8acc8
5
5
  SHA512:
6
- metadata.gz: 6eb21880efb9b0f0708c8615bb170f68da0b04974073f346f3910ed3ffa40957602a12bc4a8a3b0ea9c596ddae8f36a7560bf3264669a2f19949c821e78eda8d
7
- data.tar.gz: 986f33648d2091779acbceefba4102081a804c6983612e1f21df52a847dd5d8ab06f3083d53cc6512aafbb1d86b834cc16198d6f9b5e1229294306e5d3a5d8ef
6
+ metadata.gz: 08fe603657e033d8edfb2892d0a12d834d121052cd9cd954105a10883ab0594fba597f179fc4dd70d3e0f38a61e434a1627abefab6ff0160a7ec62e00fee0172
7
+ data.tar.gz: 3a90f78c0d4d64d59058fac1e7220a0dbac735cabab46b819675f4044d0dabeaf17e5d481e88860287a6027c1d959bba627c6da31292043b47473598da5786f0
@@ -89,6 +89,8 @@ IndexTable.prototype = {
89
89
  custom_row_controls: false,
90
90
  after_print: false,
91
91
  table_class: 'data',
92
+ allow_export: false,
93
+ export_url: false,
92
94
 
93
95
  //============================================================================
94
96
  // End of parameters
@@ -287,6 +289,7 @@ IndexTable.prototype = {
287
289
  if (this.allow_bulk_import ) controls.append($('<input/>').attr('type', 'button').attr('id', this.container + '_bulk_import' ).val('Import' ).click(function(e) { that.bulk_import(); })).append(' ');
288
290
  if (this.allow_duplicate ) controls.append($('<input/>').attr('type', 'button').attr('id', this.container + '_duplicate' ).val('Duplicate' ).click(function(e) { that.duplicate(); })).append(' ');
289
291
  if (this.allow_bulk_delete ) controls.append($('<input/>').attr('type', 'button').attr('id', this.container + '_bulk_delete' ).val('Delete' ).click(function(e) { that.bulk_delete(); })).append(' ');
292
+ if (this.allow_export ) controls.append($('<input/>').attr('type', 'button').attr('id', this.container + '_export' ).val('Export' ).click(function(e) { that.csv_export(); })).append(' ');
290
293
 
291
294
  var c = $('#' + that.container);
292
295
  c.empty();
@@ -689,6 +692,18 @@ IndexTable.prototype = {
689
692
  });
690
693
  },
691
694
 
695
+ csv_export: function()
696
+ {
697
+ var that = this;
698
+ var p = this.pager_params();
699
+ var qs = [];
700
+ $.each(p, function(k,v) {
701
+ if (k != '[object Object]') qs.push('' + k + '=' + encodeURIComponent(v));
702
+ });
703
+ var url = that.export_url ? that.export_url : that.base_url + '/export.csv';
704
+ window.location = url + '?' + qs.join('&');
705
+ },
706
+
692
707
  pager_div: function(summary)
693
708
  {
694
709
  var that = this;
@@ -1,3 +1,3 @@
1
1
  module Caboose
2
- VERSION = '0.8.30'
2
+ VERSION = '0.8.31'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: caboose-cms
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.30
4
+ version: 0.8.31
5
5
  platform: ruby
6
6
  authors:
7
7
  - William Barry
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-07-29 00:00:00.000000000 Z
11
+ date: 2016-08-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pg