egov_utils 0.1.8 → 0.1.9

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
  SHA1:
3
- metadata.gz: 8dc38fa0416565242924d9ebeb791045b161ceb6
4
- data.tar.gz: c01d6e8805f452153af31645d66b0f6790c667ea
3
+ metadata.gz: 0acb8a903d4ec6302d92915fff9a99e203ea7e76
4
+ data.tar.gz: 8320e02ca0f684d1542ee7d1ea9d0b08882782ed
5
5
  SHA512:
6
- metadata.gz: 99562775b395aa79b168c1f211966c1c53f56092917ac983fba32f12049894073f9b164eba3e31cade214e226310f21feb00ca88e485b9c95bdd8ed1bad1c4b8
7
- data.tar.gz: c2d6006bf8f2bd68f2c2c2851c0c0b72e16a261b4004158d8736b742f5a75decda01581deb05f1b4ba88071b4ee1578448e794b6151b2ba53762b61758882c71
6
+ metadata.gz: f02b14675f1cb7215cca5143e3c813b853423e9906a374ff6580d0dea06a5f81f6f78ffa24ce3272fde4a1ef83c125a3d952d81bddacda461116c934989aa633
7
+ data.tar.gz: a8b9243c8928d3207325d55250ff1556c12ede9aa75e3160963d673728a2ea6bd91cfd9d1f6ed11a27d4472c42852739342fe9e85688f6c84074565c647e2424
@@ -1,8 +1,14 @@
1
1
  module EgovUtils
2
2
  module GridHelper
3
+ def grid_attributes_i18n_kyes(attribute)
4
+ keys = [ ('activerecord.attributes.'+attribute.model.model_name.i18n_key.to_s+'.'+attribute.name).to_sym ]
5
+ keys.concat( grid_attributes_i18n_kyes(attribute.attribute) ) if attribute.respond_to?(:attribute)
6
+ keys
7
+ end
8
+
3
9
  def type_for_grid(type)
4
10
  case type
5
- when 'integer', 'float'
11
+ when 'integer', 'float', 'decimal'
6
12
  'Number'
7
13
  when 'string', 'list'
8
14
  'String'
@@ -29,7 +35,7 @@ module EgovUtils
29
35
  def column_for_grid(grid, attribute)
30
36
  s = "{"
31
37
  s << "field: '#{attribute.name}'"
32
- s << ", title: '#{I18n.t('model_attributes.'+grid.model_i18n_key.to_s+'.'+attribute.name)}'"
38
+ s << ", title: '#{I18n.t('model_attributes.'+grid.model_i18n_key.to_s+'.'+attribute.name, default: grid_attributes_i18n_kyes(attribute))}'"
33
39
  s << ", columnTemplate: '<a href=\"#{polymorphic_path(grid.schema.model)}/{id}\">{#{attribute.name}}</div>'" if attribute.name == grid.schema.main_attribute_name
34
40
  if attribute.type == 'list'
35
41
  s << ", format: ( (value) -> I18n.t(value, {scope: 'activerecord.attributes.#{attribute.model.model_name.i18n_key}.#{attribute.name.to_s.pluralize}'}) ) "
@@ -12,6 +12,8 @@ cs:
12
12
  label_approve: Schválit
13
13
  label_new: Nový
14
14
  label_edit: Upravit
15
+ label_profile: Profil
16
+ label_logout: Odhlásit
15
17
 
16
18
  common_labels:
17
19
  new_record: "Nový %{model}"
@@ -1,3 +1,3 @@
1
1
  module EgovUtils
2
- VERSION = '0.1.8'
2
+ VERSION = '0.1.9'
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.1.8
4
+ version: 0.1.9
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: 2017-10-17 00:00:00.000000000 Z
11
+ date: 2017-10-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails