egov_utils 0.6.2 → 0.6.5

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: 6c7404de774b1b5bb75b4528608dbf47d049bcafdb9b53d8f8dfb2089ef12ac8
4
- data.tar.gz: b748146456eb6e9db1c5cdf9fba4cd523084fe05d99fdc5cadf1ac5f48274356
3
+ metadata.gz: 7272a3c0cac6560ef3b6244bb42668eec41cf9c45526b00aa0e3359459fc79c2
4
+ data.tar.gz: efa34b24439875bb9a5ec5f6484264a6862234e4f806bc0de50c1e3bbc94f328
5
5
  SHA512:
6
- metadata.gz: ff6e3b1508eb5e1d5f95e5e8945c2c6d9d99e715b3e096f75484c553aff80bd7f6d3c84fa37e1a2cc7dcced18451dfe563f9465fb65b5e952fe4469dc91879f0
7
- data.tar.gz: c5ecb9e8209c7996add1aaca3021b71a6b5ab9464272a605cf0ead3b6312c7981382a365aff1dbddad8afc1c1573651c922b40e44b967d984bdf687b3f8855e4
6
+ metadata.gz: bbc0af4ecbbc3053f2f2acac70fa3ff230c76fca968bd4c6f8df7f6aad50ebb7f220b133651c809a9f1fce7030ff22519022916772f58015061deaf274743774
7
+ data.tar.gz: b9406e6401ba19e89d1caa1435173069966e8447d9734140b150950d6440812b53533b6c0079241ab07ced94ba279ccea54ef191675955c62cad35f962ba2b1b
@@ -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
 
@@ -98,25 +98,27 @@ $ ->
98
98
  <% schema.columns.each do |col| %>
99
99
  <%= raw column_for_grid(grid, col) %>
100
100
  <% end %>
101
- <% if can?(:update, schema.model) || (local_assigns.fetch(:allow_delete, false) && can?(:destroy, schema.model)) %>
102
- {
103
- width: 150
104
- title: "<%= t('label_actions') %>"
105
- buttons: [
106
- <% if can?(:read, schema.model) %>
107
- <% local_assigns.fetch(:downloads, {}).each do |format, label| %>
108
- { cls: 'btn btn-sm btn-secondary <%= "download-button-#{format}" %>', caption: '<%= label %>', click: prepareDownload('<%= format %>') },
101
+ <% unless local_assigns.fetch(:disable_actions, false) %>
102
+ <% if can?(:update, schema.model) || (local_assigns.fetch(:allow_delete, false) && can?(:destroy, schema.model)) %>
103
+ {
104
+ width: 150
105
+ title: "<%= t('label_actions') %>"
106
+ buttons: [
107
+ <% if can?(:read, schema.model) %>
108
+ <% local_assigns.fetch(:downloads, {}).each do |format, label| %>
109
+ { cls: 'btn btn-sm btn-secondary <%= "download-button-#{format}" %>', caption: '<%= label %>', click: prepareDownload('<%= format %>') },
110
+ <% end %>
109
111
  <% end %>
110
- <% end %>
111
- <% if can?(:update, schema.model) %>
112
- {cls: 'btn btn-sm btn-primary', caption: '<%= t('label_edit') %>', click: editRecord},
113
- <% end %>
114
- <%= additional_grid_edit_buttons(schema) %>
115
- <% if local_assigns.fetch(:allow_delete, false) && can?(:destroy, schema.model) %>
116
- {commandName: 'delete', caption: '<%= t('label_delete') %>'}
117
- <% end %>
118
- ]
119
- }
112
+ <% if can?(:update, schema.model) %>
113
+ {cls: 'btn btn-sm btn-primary', caption: '<%= t('label_edit') %>', click: editRecord},
114
+ <% end %>
115
+ <%= additional_grid_edit_buttons(schema) %>
116
+ <% if local_assigns.fetch(:allow_delete, false) && can?(:destroy, schema.model) %>
117
+ {commandName: 'delete', caption: '<%= t('label_delete') %>'}
118
+ <% end %>
119
+ ]
120
+ }
121
+ <% end %>
120
122
  <% end %>
121
123
  ],
122
124
  sorting:
@@ -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
@@ -1,3 +1,3 @@
1
1
  module EgovUtils
2
- VERSION = '0.6.2'
2
+ VERSION = '0.6.5'
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.2
4
+ version: 0.6.5
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-26 00:00:00.000000000 Z
11
+ date: 2022-03-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails