egov_utils 0.4.4 → 0.4.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: 98563db37b266366066d36a56ebb7ed53534541e7336222bf661e6ddbc16e4d1
4
- data.tar.gz: df82245adc227118e0a5121533577892a0f600d2e8686326d99977898fbf4745
3
+ metadata.gz: 95806a00ea00056d9b5fde6021f6c21396b32e2df79cd83013c5037d6b70e8bd
4
+ data.tar.gz: f4b1b82603961bfa405a571a3334f9d314e6ae7d1a4129207c20a7443ea5be18
5
5
  SHA512:
6
- metadata.gz: 3f04dbb11e0fd2f5d60549866692fccea5d2e4f1e5fdaff2866df22dc6ae9bd80104ad85ccda527b266a3865928ddc06155f9b9599d5f8536b062e48863babb1
7
- data.tar.gz: d5b00342147737881c3710fe8f22e6456c5c31a419c34a765531e18d326579ee4f2990e0d0c477b8e328e4591e8d8e7bb30af066667513aa6015abbcd7f9b75b
6
+ metadata.gz: 1940243795ec41628b229e5c8c11d4cf72c9756a64b392bffda8ca592fb352acf5c9b0f827f8984b15e249908a2d8ec101b1626f00c2f2b55b2c61a9c044937f
7
+ data.tar.gz: bfa492468b390a86787ea875592fa4b2708044f5d24060621df3547262926d6136d351ce9dc92cfa0bcef5cb3c410e60dc1c8f2b5efc8dc15bdb9678bdf12487
@@ -5,6 +5,8 @@
5
5
  @import 'select2/select2';
6
6
  @import 'egov_utils/select2-bootstrap';
7
7
 
8
+ @import 'shield-custom/all';
9
+
8
10
  @import "cookies_eu";
9
11
 
10
12
  .button_to {
@@ -2,7 +2,7 @@ module EgovUtils
2
2
  class FullAddress < AzaharaSchema::DerivedAttribute
3
3
 
4
4
  def initialize(model, name, **options)
5
- super(model, name, :concat, 'city', 'street', options)
5
+ super(model, name, :concat, 'postcode', 'city', 'street', 'number', options)
6
6
  end
7
7
 
8
8
  def build_json_options!(options)
@@ -33,6 +33,7 @@ module EgovUtils
33
33
  end
34
34
 
35
35
  def add_users
36
+ render_404 and return if @group.allow_member_assign?
36
37
  @users = User.not_in_group(@group).where(:id => (params[:user_id] || params[:user_ids])).to_a
37
38
  @group.users << @users
38
39
  respond_to do |format|
@@ -26,7 +26,7 @@ module EgovUtils
26
26
  def ldap_members
27
27
  if provider.present?
28
28
  Rails.cache.fetch("#{cache_key}/ldap_members", expires_in: 2.hours) do
29
- auth_source.group_members(ldap_uid)
29
+ auth_source.group_members(ldap_dn)
30
30
  end
31
31
  else
32
32
  []
@@ -1,8 +1,9 @@
1
1
  %h2= @group.name
2
2
 
3
- = link_to(new_users_group_path(@group), remote: true) do
4
- %i.fa.fa-plus-circle{'aria-hidden' => 'true'}
5
- = t('label_add_group_member')
3
+ - if @group.allow_member_assign? && can?(:manage, @group)
4
+ = link_to(new_users_group_path(@group), remote: true) do
5
+ %i.fa.fa-plus-circle{'aria-hidden' => 'true'}
6
+ = t('label_add_group_member')
6
7
  %ul
7
8
  - @group.users.each do |user|
8
9
  %li= user.fullname
@@ -8,3 +8,5 @@ AzaharaSchema::AttributeFormatter.__send__('prepend', AzaharaSchemaCurrency::Att
8
8
 
9
9
  require 'azahara_schema_currency/association_attribute_patch'
10
10
  AzaharaSchema::AssociationAttribute.__send__('prepend', AzaharaSchemaCurrency::AssociationAttributePatch)
11
+ require 'azahara_schema_currency/aggregation_attribute_patch'
12
+ AzaharaSchema::AggregationAttribute.__send__('prepend', AzaharaSchemaCurrency::AggregationAttributePatch)
@@ -0,0 +1,9 @@
1
+ module AzaharaSchemaCurrency
2
+ module AggregationAttributePatch
3
+
4
+ def currency_code(entity)
5
+ 'czk'
6
+ end
7
+
8
+ end
9
+ end
@@ -4,7 +4,7 @@ module AzaharaSchemaCurrency
4
4
  def format_value_html(attribute, unformated_value, **options)
5
5
  case attribute.type
6
6
  when 'currency'
7
- Money.new(unformated_value, options[:currency_code].to_s.upercase.presence).format
7
+ Money.from_amount(unformated_value, options[:currency_code].to_s.upcase.presence).format
8
8
  else
9
9
  super
10
10
  end
@@ -18,5 +18,11 @@ module AzaharaSchemaCurrency
18
18
  entity.try(currency_code_col)
19
19
  end
20
20
 
21
+ def value(record)
22
+ val = super(record)
23
+ val = BigDecimal.new( val.to_s ) unless val.is_a?(BigDecimal)
24
+ val
25
+ end
26
+
21
27
  end
22
28
  end
@@ -1,3 +1,3 @@
1
1
  module EgovUtils
2
- VERSION = '0.4.4'
2
+ VERSION = '0.4.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.4.4
4
+ version: 0.4.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: 2018-06-19 00:00:00.000000000 Z
11
+ date: 2018-07-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -538,6 +538,7 @@ files:
538
538
  - db/migrate/20180403150556_create_egov_utils_legal_people.rb
539
539
  - db/migrate/20180424143207_add_titles_to_natural_people.rb
540
540
  - lib/azahara_schema_currency.rb
541
+ - lib/azahara_schema_currency/aggregation_attribute_patch.rb
541
542
  - lib/azahara_schema_currency/association_attribute_patch.rb
542
543
  - lib/azahara_schema_currency/attribute_formatter_patch.rb
543
544
  - lib/azahara_schema_currency/currency_attribute.rb