egov_utils 0.6.0 → 0.6.4

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
  SHA256:
3
- metadata.gz: 2dea4fb2c51dec77f9cf9c497124b654263c6bcca1a6d407b7df8967d2d996ca
4
- data.tar.gz: b600a26f595cbf04e750fdbfbe54cd68aafbc02187b57af58b0ad47a960e0192
3
+ metadata.gz: 15c9bb03cd2bb748b5d32a2ff051bd1083028d19f4c69c65637112722b871bcf
4
+ data.tar.gz: c160099429bee03754890907732dce50704f0430cb3bebcb2b3912f64d03a0ce
5
5
  SHA512:
6
- metadata.gz: 5b8ae83c1052f8a9b8a96959240b7422b304d26981c933ab1a935970780e824e1045931270c9a090e9ce8afd9421e2246fb2ae563ca4a6eaba348f2f6d0302db
7
- data.tar.gz: fe5c7cf049accc507c2f0caa718fbf10db566942d281b6790e8513d033eeb7c78eef2fc3ee21b98d4021f997a6bc35db2042a8965840e501124338d193c1756c
6
+ metadata.gz: 3833e1edb4557b8d67b3c102f3861c86f965ae9530f04af2ea37b654a13cc88b67f2f8a195675e243c46ea5e785765e58449a1c8e4f60466ddc0e139eb531de2
7
+ data.tar.gz: 2c678e87567ac4ee0a774463a0f92ccb93c973c380675db3b8400e0519eaa9a3923943ed5fce5dbef597d55e771759aaeac842fb8b332f1eef9227035a751d77
@@ -14,10 +14,12 @@ module EgovUtils
14
14
  all.detect{ |o| o.key == key }
15
15
  end
16
16
 
17
- def self.courts(organization_keys=nil)
17
+ def self.courts(organization_keys=nil, include_branches: true)
18
18
  all.select do |o|
19
19
  %w{OS KS MS}.include?(o.category_abbrev) &&
20
20
  (organization_keys.nil? || organization_keys.include?(o.key))
21
+ end.tap do |collection|
22
+ collection.select { _1.branch_of_id.nil? } unless include_branches
21
23
  end
22
24
  end
23
25
 
@@ -34,9 +36,10 @@ module EgovUtils
34
36
  where(key: key).first
35
37
  end
36
38
 
37
- def self.courts(organization_keys=nil)
39
+ def self.courts(organization_keys=nil, include_branches: true)
38
40
  filters = {category_abbrev: ['OS','KS', 'MS']}
39
41
  filters.merge!(key: organization_keys) if organization_keys.present?
42
+ filters.merge!(branch_of_id: [nil]) unless include_branches
40
43
  all(params: {f: filters, sort: {'0' => {path: 'category_abbrev'} }})
41
44
  end
42
45
 
@@ -25,7 +25,7 @@ $ ->
25
25
  downloadRecord = (format, index) ->
26
26
  grid = $("#<%= grid_id %>").swidget()
27
27
  item = grid.dataItem(index)
28
- window.location.href = '<%= polymorphic_path(schema.model) %>/'+item.id+'.'+format
28
+ $(event.target).data('id', item.id)
29
29
 
30
30
  <% if local_assigns[:detail_for] %>
31
31
  <% detail_col = schema.column(detail_for) %>
@@ -105,7 +105,7 @@ $ ->
105
105
  buttons: [
106
106
  <% if can?(:read, schema.model) %>
107
107
  <% local_assigns.fetch(:downloads, {}).each do |format, label| %>
108
- { cls: 'btn btn-sm btn-secondary', caption: '<%= label %>', click: prepareDownload('<%= format %>') },
108
+ { cls: 'btn btn-sm btn-secondary <%= "download-button-#{format}" %>', caption: '<%= label %>', click: prepareDownload('<%= format %>') },
109
109
  <% end %>
110
110
  <% end %>
111
111
  <% if can?(:update, schema.model) %>
@@ -5,5 +5,9 @@ module AzaharaSchemaCurrency
5
5
  association.name.to_s+'-'+attribute.try(:currency_code_col).to_s
6
6
  end
7
7
 
8
+ def currency_code(entity)
9
+ entity.try(currency_code_col)
10
+ end
11
+
8
12
  end
9
13
  end
@@ -20,7 +20,7 @@ module AzaharaSchemaCurrency
20
20
 
21
21
  def value(record)
22
22
  val = super(record)
23
- val = BigDecimal.new(val.to_s.presence || 0) unless val.is_a?(BigDecimal)
23
+ val = BigDecimal(val.to_s.presence || 0) unless val.is_a?(BigDecimal)
24
24
  val
25
25
  end
26
26
 
@@ -1,3 +1,3 @@
1
1
  module EgovUtils
2
- VERSION = '0.6.0'
2
+ VERSION = '0.6.4'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: egov_utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.6.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ondřej Ezr
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-11-21 00:00:00.000000000 Z
11
+ date: 2021-12-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails