egov_utils 0.3.2 → 0.3.3

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: f91e4fd34931a6237076b8c8e859cb184c5d61f1ae1c2310800d795d03eee04a
4
- data.tar.gz: da90da14b07d985a456c5742fc17ef50cafb40718ad91e6bc69b23bc55a65f26
3
+ metadata.gz: a0e499d916b193c97d48999f4862bddf853c70c7e2458f718641ecbec895cded
4
+ data.tar.gz: a502e385e0afb8be990fdc438cd94433afc6984853b1aec8fa1dfbefa0d398dc
5
5
  SHA512:
6
- metadata.gz: defc11887b3528370c76e42de8a7c6b93cb48ca7067675f68378a9e8ee4ef0832d83328e606d925a70b222fa2b2e4801ad1e81757015b32082e8cfb40f6c1df2
7
- data.tar.gz: 923f682a552728d002baef7a27101d976c209318fd920104994db7acc624ff4595d1666971af5dc3132d7d4f05cc57f2bfa2a3fa7ad01079b0d87c55132f5d89
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(organization_key=self.organization_key)
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: organization_id(organization_key)).collect(&:key) || [] )
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
- .col-12
21
- %div.validation-button
22
- = link_to t('label_validate_address'), 'javascript:void(0)', class: 'btn btn-secondary address-validator-btn'
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(){
@@ -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"]}.merge(options[:data] || {})
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
@@ -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)
@@ -17,6 +17,13 @@ module EgovUtils
17
17
  end
18
18
 
19
19
  end
20
+
21
+ module DatetimeLocalFieldPatch
22
+ private
23
+ def format_date(value)
24
+ value.try(:strftime, "%Y-%m-%dT%H:%M")
25
+ end
26
+ end
20
27
  end
21
28
  end
22
29
  end
@@ -1,3 +1,3 @@
1
1
  module EgovUtils
2
- VERSION = '0.3.2'
2
+ VERSION = '0.3.3'
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.3.2
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-12 00:00:00.000000000 Z
11
+ date: 2018-04-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails