egov_utils 0.3.2 → 0.3.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 +4 -4
- data/app/models/egov_utils/principal.rb +12 -2
- data/app/views/egov_utils/addresses/_form.html.haml +3 -3
- data/config/locales/cs.yml +4 -3
- data/lib/bootstrap_form/datetimepicker.rb +1 -1
- data/lib/egov_utils/engine.rb +1 -0
- data/lib/egov_utils/helpers/tags/datetime_field_patch.rb +7 -0
- data/lib/egov_utils/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a0e499d916b193c97d48999f4862bddf853c70c7e2458f718641ecbec895cded
|
4
|
+
data.tar.gz: a502e385e0afb8be990fdc438cd94433afc6984853b1aec8fa1dfbefa0d398dc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 002bd6cc5358ac39753abb16e3e276e0a965addbab6b3c191dd53579d8eb94ffa2badf155d20f4690e114f33c5059360c6f697e53fc13fe959690337198869f4
|
7
|
+
data.tar.gz: 6b77faa9d8755c12e75ae565242eb65bc20c29448ee90eaa1c01ea5bef3bee9d41a90b8e425d66d6ea24bd24ab31c8e3337a632df1f8d432344de2e365edefb7
|
@@ -37,14 +37,24 @@ module EgovUtils
|
|
37
37
|
organization_by_domain.try(:key)
|
38
38
|
end
|
39
39
|
|
40
|
-
def organization_id
|
40
|
+
def organization_id
|
41
|
+
organization_by_domain.try(:id)
|
42
|
+
end
|
43
|
+
|
44
|
+
def organization_id_by_key(organization_key=self.organization_key)
|
41
45
|
EgovUtils::Organization.find_by_key(organization_key).try(:id)
|
42
46
|
end
|
43
47
|
|
44
48
|
def organization_with_suborganizations_keys(organization_key=self.organization_key)
|
45
49
|
return [] unless organization_key
|
46
50
|
Rails.cache.fetch("organizations/#{organization_key}/org_with_suborgs_keys") do
|
47
|
-
[organization_key] + ( organization_key && EgovUtils::Organization.where(superior_id:
|
51
|
+
[organization_key] + ( organization_key && EgovUtils::Organization.where(superior_id: organization_id_by_key(organization_key)).collect(&:key) || [] )
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
def organization_with_suborganizations_ids(organization_id=self.organization_id)
|
56
|
+
Rails.cache.fetch("organizations/#{organization_key}/org_with_suborgs_ids") do
|
57
|
+
[organization_id] + ( organization_id && EgovUtils::Organization.where(superior_id: organization_id).collect(&:id) || [] )
|
48
58
|
end
|
49
59
|
end
|
50
60
|
end
|
@@ -17,9 +17,9 @@
|
|
17
17
|
.col-12
|
18
18
|
- form.object.country ||= EgovUtils::Address::CZ_ISO_CODE
|
19
19
|
= form.select2 :country, EgovUtils::Address.countries.collect{|c| [c[:name],c[:iso_id]]}, {}, class: 'country-select'
|
20
|
-
|
21
|
-
|
22
|
-
|
20
|
+
/.col-12
|
21
|
+
/ %div.validation-button
|
22
|
+
/ = link_to t('label_validate_address'), 'javascript:void(0)', class: 'btn btn-secondary address-validator-btn'
|
23
23
|
|
24
24
|
:javascript
|
25
25
|
$(function(){
|
data/config/locales/cs.yml
CHANGED
@@ -44,18 +44,19 @@ cs:
|
|
44
44
|
|
45
45
|
label_approve: Schválit
|
46
46
|
label_new: Nový
|
47
|
+
label_create: Vytvořit
|
47
48
|
label_edit: Upravit
|
49
|
+
label_save: Uložit
|
50
|
+
label_delete: Smazat
|
51
|
+
label_ok: OK
|
48
52
|
label_profile: Profil
|
49
53
|
label_change_password: Změnit heslo
|
50
54
|
label_login: Přihlásit
|
51
55
|
label_logout: Odhlásit
|
52
56
|
label_signup: Registrovat
|
53
57
|
label_validate_address: Zvalidovat
|
54
|
-
label_save: Uložit
|
55
58
|
label_ldap: LDAP
|
56
59
|
label_search: Vyhledat
|
57
|
-
label_delete: Smazat
|
58
|
-
label_ok: OK
|
59
60
|
label_actions: Akce
|
60
61
|
label_done: hotovo
|
61
62
|
label_add_group_member: Přidat uživatele
|
@@ -20,7 +20,7 @@ module BootstrapForm
|
|
20
20
|
def datetime_local_field(name, *args)
|
21
21
|
options = args.extract_options!.symbolize_keys!
|
22
22
|
options[:datetimepicker] = true
|
23
|
-
options[:data] = {'date-extra-formats' => [BootstrapForm::DATE_FORMAT_JS+"THH:mm:ss
|
23
|
+
options[:data] = {'date-extra-formats' => [BootstrapForm::DATE_FORMAT_JS+"THH:mm"+(options[:include_seconds] ? ':ss' : '')]}.merge(options[:data] || {})
|
24
24
|
options[:append] = calendar_addon
|
25
25
|
args << options
|
26
26
|
super
|
data/lib/egov_utils/engine.rb
CHANGED
@@ -108,6 +108,7 @@ module EgovUtils
|
|
108
108
|
|
109
109
|
require 'egov_utils/helpers/tags/datetime_field_patch'
|
110
110
|
ActionView::Helpers::Tags::DatetimeField.prepend(EgovUtils::Helpers::Tags::DatetimeFieldPatch)
|
111
|
+
ActionView::Helpers::Tags::DatetimeLocalField.prepend(EgovUtils::Helpers::Tags::DatetimeLocalFieldPatch)
|
111
112
|
|
112
113
|
ActionView::Helpers::Tags::DateField.redefine_method(:format_date) do |value|
|
113
114
|
value.try(:strftime, BootstrapForm::DATE_FORMAT_RUBY)
|
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.3.
|
4
|
+
version: 0.3.3
|
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: 2018-04-
|
11
|
+
date: 2018-04-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|