egov_utils 0.6.2 → 0.6.5
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7272a3c0cac6560ef3b6244bb42668eec41cf9c45526b00aa0e3359459fc79c2
|
4
|
+
data.tar.gz: efa34b24439875bb9a5ec5f6484264a6862234e4f806bc0de50c1e3bbc94f328
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
<%
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
<%
|
108
|
-
|
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
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
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:
|
data/lib/egov_utils/version.rb
CHANGED
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.
|
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:
|
11
|
+
date: 2022-03-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|