egov_utils 0.1.13 → 0.1.14

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
  SHA1:
3
- metadata.gz: 3bee9e427897dfb93fc4f42d0b146def3c4cdd0c
4
- data.tar.gz: 625f0ca14a939d628e64b2cff3ba81d3fdadc74d
3
+ metadata.gz: f6c4be8eccb7929f4340ccb89aaf8d0d466c3261
4
+ data.tar.gz: 752a655bafde59bd66ed2859bed42be105160ab4
5
5
  SHA512:
6
- metadata.gz: b9a9f694b7d5e2ee741ae28fb7459fe0242921b76a53e0a113d629e8dba33510faee48f826c08577a9c06009106ddcedf0d48e78b24af168b91b11c7cab3e390
7
- data.tar.gz: e352cfd5672c519d8363b5c69a576e2f6b9e7ccacb6a341b3f9236c0d9ea1620fd84c5278024879c44d2db6c42017041510368796981512b58cac7bacf9b1f46
6
+ metadata.gz: f7e6a2e1c8c4a399df72338fb8f20dbbf9023eea284615c6a6a97881927daaacbed6de3138d1c7f888304b1d5017c9b25d37e04af82de328f9dc6af695392d18
7
+ data.tar.gz: 11262efc0e515fb6e9efef7716fb8f492da6f2e0e32e8224f297ab1da8011ab429d99b09369b51ffc278591bc460f0326610a9e5e7b5a89242c94eca9233fba1
data/README.md CHANGED
@@ -15,7 +15,7 @@ To be done:
15
15
 
16
16
  ## Usage
17
17
 
18
- Detailed developers documentation can be found at [Documentation](https://git.servis.justice.cz/libraries/egov_utils-rails/wikis/Documentation).
18
+ Detailed developers documentation can be found at [Documentation](https://git.servis.justice.cz/libraries/egov_utils-rails/wikis/home).
19
19
 
20
20
  Framework uses configuration in file config/config.yml
21
21
 
@@ -10,14 +10,12 @@
10
10
  // Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
11
11
  // about supported directives.
12
12
  //
13
- //= require i18n
14
13
  //= require moment
15
14
  //= require moment/cs
16
15
  //= require popper
17
16
  //= require bootstrap-sprockets
18
17
  //= require bootstrap-datetimepicker
19
18
  //= require shieldui-all.min
20
- //= require egov_utils/setup_locale
21
19
  //= require i18n/translations
22
20
  //= require egov_utils/eGovUtilities
23
21
  //= require egov_utils/roles
@@ -14,6 +14,7 @@ $.widget 'egov_utils.fileUid',
14
14
  @container.append(@element).append(@file_uid_gui)
15
15
 
16
16
  @element.css(position: 'absolute', top: 0, left: 0, 'background-color': 'transparent')
17
+ @element.attr('tabindex', -1)
17
18
 
18
19
  @form = @element.closest('form')
19
20
  @form.on 'submit', (evt)->
@@ -2,7 +2,7 @@ module EgovUtils
2
2
  class District < AzaharaSchema::Attribute
3
3
 
4
4
  def initialize
5
- super(EgovUtils::Address, 'district', 'list')
5
+ super(EgovUtils::Address, 'district', 'love')
6
6
  end
7
7
 
8
8
  def available_values
@@ -2,7 +2,7 @@ module EgovUtils
2
2
  class Region < AzaharaSchema::Attribute
3
3
 
4
4
  def initialize
5
- super(EgovUtils::Address, 'region', 'list')
5
+ super(EgovUtils::Address, 'region', 'love')
6
6
  end
7
7
 
8
8
  def available_values
@@ -1,4 +1,13 @@
1
1
  module EgovUtils
2
2
  module ApplicationHelper
3
+
4
+ def i18n_js_set_locales_tag
5
+ s = ''
6
+ s << "window.I18n.defaultLocale = '#{I18n.default_locale}';"
7
+ s << "window.I18n.locale = '#{I18n.locale}';"
8
+ s
9
+ javascript_tag s
10
+ end
11
+
3
12
  end
4
13
  end
@@ -1,9 +1,13 @@
1
1
  module EgovUtils
2
2
  class Person < ApplicationRecord
3
3
 
4
+ belongs_to :residence, class_name: 'EgovUtils::Address', optional: true
5
+
4
6
  validates :firstname, :lastname, :birth_date, presence: true
5
7
  validates :birth_date, uniqueness: { scope: [:firstname, :lastname] }, birthday: true
6
8
 
9
+ accepts_nested_attributes_for :residence
10
+
7
11
  def fullname
8
12
  firstname.to_s + ' ' + lastname.to_s
9
13
  end
@@ -2,6 +2,6 @@ class BirthdayValidator < ActiveModel::EachValidator
2
2
  def validate_each(record, attribute, value)
3
3
  return if options[:allow_nil] && value.presence.nil?
4
4
  record.errors.add(attribute, :in_past) if !value || value >= Time.now.to_date
5
- record.errors.add(attribute, :after_1920) if !value || value <= Date.new(1930, 1, 1)
5
+ record.errors.add(attribute, :after_1920) if !value || value <= Date.new(1920, 1, 1)
6
6
  end
7
7
  end
@@ -1,3 +1,6 @@
1
1
  = form.text_field(:firstname)
2
2
  = form.text_field(:lastname)
3
3
  = form.date_field(:birth_date, data: {'date-view-mode' => 'decades', 'date-min-date' => Date.new(1920, 1, 1).to_s, 'date-max-date' => Date.today.to_s, 'date-use-current' => false, 'date-view-date' => Date.new(1950, 1, 1).to_s })
4
+ = form.text_field(:birth_place)
5
+ = form.fields_for(:residence, person.residence || EgovUtils::Address.new) do |fields|
6
+ = render 'egov_utils/addresses/form', form: fields, address: fields.object
@@ -35,6 +35,7 @@ cs:
35
35
 
36
36
  model_attributes: &my_attributes
37
37
  egov_utils/address:
38
+ full_address: Adresa
38
39
  street: Ulice
39
40
  number: "Č.p./Č.o."
40
41
  house_number: Č. popisné
@@ -0,0 +1,6 @@
1
+ class AddBirthPlaceAndResidenceToPeople < ActiveRecord::Migration[5.1]
2
+ def change
3
+ add_column :egov_utils_people, :birth_place, :string
4
+ add_reference :egov_utils_people, :residence, foreign_key: {to_table: :egov_utils_addresses}
5
+ end
6
+ end
@@ -51,7 +51,7 @@ module EgovUtils
51
51
  def host_dns
52
52
  require 'resolv'
53
53
  @host_dns = Resolv::DNS.open do |dns|
54
- dns.getresouce('_ldap._tcp.'+options['domain'], Resolv::DNS::Resource::IN::SRV)
54
+ dns.getresource('_ldap._tcp.'+options['domain'], Resolv::DNS::Resource::IN::SRV)
55
55
  end
56
56
  end
57
57
 
@@ -30,6 +30,7 @@ module EgovUtils
30
30
  AzaharaSchema::Outputs.register(Grid::ShieldGrid)
31
31
  end
32
32
  ActiveSupport.on_load(:action_controller) do
33
+ ::ActionController::Base.helper EgovUtils::ApplicationHelper
33
34
  ::ActionController::Base.helper EgovUtils::GridHelper
34
35
  end
35
36
  end
@@ -5,7 +5,7 @@ module EgovUtils
5
5
 
6
6
  def render
7
7
  res = super
8
- res << @template_object.javascript_tag(javascript_str(@options))
8
+ res << @template_object.javascript_tag(javascript_str(@options.stringify_keys))
9
9
  res
10
10
  end
11
11
 
@@ -16,9 +16,9 @@ module EgovUtils
16
16
 
17
17
  def javascript_str(options)
18
18
  agendas = all_agendas
19
- agendas &= @options.delete('agendas') if @options['agendas']
19
+ agendas &= options.delete('agendas') if options['agendas']
20
20
  index = name_and_id_index(options)
21
- tag_id = @options.fetch("id") { tag_id(index) }
21
+ tag_id = options.fetch("id") { tag_id(index) }
22
22
 
23
23
  str = "$(function(){"
24
24
  str << " $('##{tag_id}').fileUid({ available_agendas: #{ agendas.to_json } });"
@@ -28,7 +28,6 @@ module EgovUtils
28
28
  str << " };"
29
29
  str << " $(document).on('turbolinks:before-cache', destroy_evt_method);"
30
30
  str << "});"
31
- pp str
32
31
  str
33
32
  end
34
33
 
@@ -1,3 +1,3 @@
1
1
  module EgovUtils
2
- VERSION = '0.1.13'
2
+ VERSION = '0.1.14'
3
3
  end
@@ -573,3 +573,15 @@ $shield-grid-radius: $border-radius;
573
573
  .sui-treeview{position:relative;display:block;list-style:none;color:#333;background-color:#fff;outline:0;font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:14px;line-height:normal;overflow:visible;cursor:default;padding-top:1em;padding-bottom:1em;padding-left:.5em;padding-right:.5em;text-align:left}.sui-treeview-list,ul.sui-treeview-list{list-style:none;margin:0;padding:0;outline:0;padding-left:16px}.sui-treeview-item,li.sui-treeview-item{padding:.2em}.sui-treeview-item-toggle{display:inline-block;width:16px;height:16px;text-align:center;vertical-align:middle;overflow:hidden;cursor:pointer;margin-left:-16px}.sui-treeview-item-toggle-expanded{display:inline-block;zoom:1;width:0;height:0;line-height:0;border-left:.4em solid transparent;border-right:.4em solid transparent;border-top:.4em solid;position:relative;top:-2px}.sui-treeview-item-toggle-collapsed{display:inline-block;zoom:1;width:0;height:0;line-height:0;border-left:.4em solid;border-top:.4em solid transparent;border-bottom:.4em solid transparent;position:relative}.sui-treeview-item-check{display:inline-block;width:16px;height:16px;text-align:center;vertical-align:middle;overflow:visible;margin-left:.5em;margin-right:.2em}.sui-treeview-item-text{font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:14px;display:inline-block;vertical-align:middle;margin-left:.2em;padding-left:.3em;padding-right:.3em;padding-top:.2em;padding-bottom:.2em}.sui-treeview-item-text:hover{color:#fff;background-color:#4fa7ef}.sui-treeview-item-text-dragging,.sui-treeview-item-text-dragging:hover{color:#fff;background-color:#428bca}.sui-treeview-item-text-dropover{color:#fff;background-color:#4fa7ef}.sui-treeview-item-icon{display:inline-block;width:16px;height:16px;text-align:center;vertical-align:middle;overflow:hidden;margin-right:.5em}.sui-treeview-item-toggle-loading{width:16px;height:16px;overflow:hidden;background-repeat:no-repeat;background-image:url(image-path("shieldui/loading-light-bootstrap-small.gif"))}.sui-treeview-item-toggle-loading .sui-treeview-item-toggle-expanded,.sui-treeview-item-toggle-loading .sui-treeview-item-toggle-collapsed{display:none}.sui-treeview-focus .sui-treeview-item-selected>.sui-treeview-item-content>.sui-treeview-item-text,.sui-treeview-focus .sui-treeview-item-selected>.sui-treeview-item-content>.sui-treeview-item-text:hover{color:#fff;background-color:#4fa7ef}.sui-treeview-item-active>.sui-treeview-item-content>.sui-treeview-item-text,.sui-treeview-item-active>.sui-treeview-item-content>.sui-treeview-item-text:hover,.sui-treeview-focus .sui-treeview-item-active>.sui-treeview-item-content>.sui-treeview-item-text,.sui-treeview-focus .sui-treeview-item-active>.sui-treeview-item-content>.sui-treeview-item-text:hover{color:#fff;background-color:#428bca}.sui-treeview-item-disabled{pointer-events:none;cursor:default;opacity:.4;color:#333}.sui-treeview-item-disabled .sui-checkbox{opacity:1}
574
574
  .sui-upload{position:relative;display:block;color:#333;background-color:#fff;border:solid 1px #e7e7e7;outline:0;font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:14px;line-height:normal;text-align:left}.sui-upload-dropfiles{padding:1em}.sui-upload-dropfiles-hover{color:#333;background-color:#f8f8f8}.sui-upload-button{display:inline-block;vertical-align:top;position:relative;overflow:hidden;cursor:pointer;text-align:center;font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:14px;line-height:normal;padding:.3em;color:#333;background-color:#f8f8f8;border:solid 1px #e7e7e7;user-select:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-o-user-select:none;-ms-user-select:none;-webkit-touch-callout:none}.sui-upload-button:hover{color:#fff;background-color:#4fa7ef}.sui-upload-button:active{color:#fff;background-color:#428bca}.sui-upload-button input{cursor:pointer;filter:alpha(opacity=0);opacity:0;margin:0;padding:0;position:absolute;right:0;bottom:0;font-size:500px;z-index:1}.sui-upload-button-text{font-size:14px}.sui-upload-drop{display:inline-block;vertical-align:top;padding-left:1em;padding-right:.3em;padding-top:.3em;padding-bottom:.3em;border:solid 1px transparent;font-style:italic}.sui-upload-files,ul.sui-upload-files{list-style:none;margin:0 0 1em;padding:0;outline:0}.sui-upload-file,li.sui-upload-file{padding-top:.5em;padding-bottom:.5em;padding-left:1em;padding-right:10em;position:relative}.sui-upload-file-progress{position:absolute;top:.8em;right:2.7em;display:inline-block;width:7em;height:.5em;float:right;border:solid 1px #e7e7e7;overflow:hidden;user-select:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-o-user-select:none;-ms-user-select:none;-webkit-touch-callout:none}.sui-upload-file-progress-inner{display:inline-block;height:.5em;background-color:#428bca;vertical-align:top}.sui-upload-file-no-progress,li.sui-upload-file-no-progress{padding-right:2.5em}.sui-upload-file-text-sep{margin-right:.3em}.sui-upload-file-action{position:absolute;top:.32em;right:1em;cursor:pointer;color:#428bca;user-select:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-o-user-select:none;-ms-user-select:none;-webkit-touch-callout:none}.sui-upload-file-action:hover{color:#4fa7ef}.sui-upload-file-error{color:#333;background-color:#f2dede}.sui-upload-button-upload{display:block;margin:1em}.sui-upload-disabled{pointer-events:none;cursor:default;opacity:.4}.sui-upload-disabled .sui-upload-button,.sui-upload-disabled .sui-upload-button:hover,.sui-upload-disabled .sui-upload-button:active{pointer-events:none;cursor:default;color:#333;background-color:#f8f8f8;border:solid 1px #e7e7e7}.sui-upload-disabled .sui-upload-button input{cursor:default}.sui-upload-disabled .sui-upload-file-action,.sui-upload-disabled .sui-upload-file-action:hover{pointer-events:none;cursor:default;color:#428bca}.sui-upload-form{display:none}.sui-upload-iframe{display:none}
575
575
  .sui-window{display:block;color:#333;background-color:#fff;box-shadow:0 0 7px #e7e7e7;border-style:solid;border-width:1px;border-color:#e7e7e7;z-index:1100;line-height:normal;font-size:14px;font-family:'Helvetica Neue',Helvetica,Arial,sans-serif}.sui-window-titlebar{position:relative;clear:both;width:100%;height:35px;overflow:hidden;color:#fff;border-color:#4fa7ef;background-color:#428bca}.sui-window-title{float:left;display:inline-block;padding:.7em}.sui-window-icons{float:right;display:inline-block;margin-top:6px;margin-right:2px}.sui-window-button,.sui-button.sui-window-button{width:22px;height:22px;cursor:pointer;margin-right:3px;padding:0;text-align:center;border:0;background-color:transparent;background-image:none}.sui-window-button:hover{background-color:#4fa7ef}.sui-window-button-icon{margin:auto;margin-top:2px}.sui-window-button-icon-close{background-position:-48px 0}.sui-window-button-icon-maximize{background-position:-64px 0}.sui-window-button-icon-restore{background-position:-80px 0}.sui-window-button-icon-minimize{background-position:-96px 0}.sui-window-button-icon-unminimize{background-position:-80px 0}.sui-window-button-icon-pin{background-position:-112px 0}.sui-window-button-icon-unpin{background-position:-128px 0}.sui-window-content{position:relative;clear:both;display:inline-block;overflow:auto;padding:7px;background-color:#fff}.sui-window-modal{position:absolute;top:0;left:0;width:100%;height:100%;z-index:1000;background-color:#919191;opacity:.35;filter:alpha(opacity=35)}
576
+
577
+ // CUSTOM
578
+ .sui-grid-core .sui-table
579
+ {
580
+ user-select: auto;
581
+ -webkit-user-select: auto;
582
+ -khtml-user-select: auto;
583
+ -moz-user-select: auto;
584
+ -o-user-select: auto;
585
+ -ms-user-select: auto;
586
+ -webkit-touch-callout: auto;
587
+ }
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.13
4
+ version: 0.1.14
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-27 00:00:00.000000000 Z
11
+ date: 2017-11-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -279,7 +279,6 @@ files:
279
279
  - app/assets/javascripts/egov_utils/file_uid.coffee
280
280
  - app/assets/javascripts/egov_utils/groups.js
281
281
  - app/assets/javascripts/egov_utils/roles.coffee.erb
282
- - app/assets/javascripts/egov_utils/setup_locale.coffee.erb
283
282
  - app/assets/javascripts/egov_utils/users.js
284
283
  - app/assets/stylesheets/egov_utils/application.scss
285
284
  - app/assets/stylesheets/egov_utils/groups.css
@@ -344,6 +343,7 @@ files:
344
343
  - db/migrate/20170801154511_install_audited.rb
345
344
  - db/migrate/20170809150646_create_egov_utils_people.rb
346
345
  - db/migrate/20170824111701_create_egov_utils_groups.rb
346
+ - db/migrate/20171103141234_add_birth_place_and_residence_to_people.rb
347
347
  - lib/bootstrap_form/datetimepicker.rb
348
348
  - lib/bootstrap_form/fileuid.rb
349
349
  - lib/bootstrap_form/helpers/bootstrap4.rb
@@ -1,2 +0,0 @@
1
- window.I18n.defaultLocale = "<%= I18n.default_locale %>";
2
- window.I18n.locale = "<%= I18n.locale %>";