tramway-export 0.1.2 → 0.1.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6efec3400a742beb5e3e85a4f0a19270d5cb2cbbea6168378bdd99fbb14c069e
4
- data.tar.gz: 999acb1d3f85e7b4e3f707ffc69c231e5f2e995e4cfd6e65aefa1473cc00c785
3
+ metadata.gz: 99c1c96295830ed89b78703601a271c2f97b86e74a9861b6c1ae195b6b9eb11c
4
+ data.tar.gz: 7fc5cb109af932fb9f9e58121d1af6dbcd8fef51d554a0c62f47695b89ef7182
5
5
  SHA512:
6
- metadata.gz: f0286a74912d48df5a94df645396eed603e347fd1c7df2b298818392636a3a084f6df7412a237ef1d2decc1fdb62c234a66622b0469dc8b20032d50934ac6204
7
- data.tar.gz: 87a08b8382f726068f612d30096f27b977c018a0bf9218944c73f14da39fbe2f1e0ddb50179cf5bdffe3486471dec1882b51e844949931292e137fb11de71b8d
6
+ metadata.gz: b737162f887a2723004983a7831dbefe50f55b1dbf36d594210d28156e2b9fe6cd8ebd7825342fd0c9bc6570f0b68d4e91f21adced0eb33f4309686b7746d4ea
7
+ data.tar.gz: 85494e426307467abe02c7e9753d62fd713b346866cfbb17f82962e3fbd18e71cd19206919ae0eb78e9efc797e32a39c4a70b08776ea002a5565b853340ab697
data/README.md CHANGED
@@ -24,20 +24,20 @@ $ bundle
24
24
  Tramway::Export.set_exportable_models YourModel, project: :your_project_name
25
25
  ```
26
26
 
27
- #### 4. Create decorator that describes, how your model should be exported. You need to create exactly decorator name `app/decorators/#{your_model_name}_xlsx_decorator.rb`
27
+ #### 4. Create decorator that describes, how your model should be exported. You need to create exactly decorator name `app/decorators/#{your_model_name}_xls_decorator.rb`
28
28
 
29
29
 
30
- *app/decorators/your_model_xlsx_decorator.rb*
30
+ *app/decorators/your_model_xls_decorator.rb*
31
31
 
32
32
  ```ruby
33
- class YourModelXlsxDecorator < Tramway::Export::Xlsx::ApplicationDecorator
33
+ class YourModelXlsDecorator < Tramway::Export::Xls::ApplicationDecorator
34
34
  class << self
35
35
  def columns
36
36
  %i[column1 column2 column3] # here array of strings or symbols with columns names. It'll be used as headers in Excel file
37
37
  end
38
38
 
39
39
  def filename
40
- `your_file_name.xlsx`
40
+ `your_file_name.xls`
41
41
  end
42
42
  end
43
43
 
@@ -57,6 +57,11 @@ end
57
57
 
58
58
  #### 5. Restart your server and visit index page of models in your admin panel
59
59
 
60
+ ### User instructions
61
+
62
+ English coming soon
63
+
64
+ [На русском](https://github.com/ulmic/tramway-dev/blob/develop/tramway-export/docs/russian/README.md)
60
65
 
61
66
  ## Contributing
62
67
  Contribution directions go here.
@@ -8,6 +8,7 @@ class Tramway::Export::ExportsController < Tramway::Admin::ApplicationController
8
8
  model_class = model_class_name(params[:model])
9
9
  xls_decorator_class = xls_decorator_class_name(params[:model])
10
10
  records = model_class.active.order(id: :desc).send scope
11
+ records = records.ransack(params[:filter]).result if params[:filter]
11
12
  records = records.send "#{current_user.role}_scope", current_user.id
12
13
  records = xls_decorator_class.decorate records
13
14
 
@@ -6,5 +6,5 @@
6
6
  = fa_icon(:download)
7
7
  .dropdown-menu{ aria: { labelledby: id } }
8
8
  - decorator_class.collections.each do |collection|
9
- = link_to collection_human_name(model_name: model_name, collection_name: collection), Tramway::Export::Engine.routes.url_helpers.exports_path(model: model_class, scope: collection), class: 'dropdown-item'
9
+ = link_to collection_human_name(model_name: model_name, collection_name: collection), Tramway::Export::Engine.routes.url_helpers.exports_path(model: model_class, scope: collection, filter: params[:filter].permit!), class: 'dropdown-item'
10
10
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Tramway
4
4
  module Export
5
- VERSION = '0.1.2'
5
+ VERSION = '0.1.3'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tramway-export
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pavel Kalashnikov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-02-16 00:00:00.000000000 Z
11
+ date: 2020-03-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: xls_exporter