egov_utils 0.2.7 → 0.2.8

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: d662d4819604ac94eb10520bbcaf61ae0c5131417c211f340766b026d9243dae
4
- data.tar.gz: ee9510ce33f7a049a16412027ee1d966e8f343eda886ba8198b8699e14bbae4b
3
+ metadata.gz: 8c2499139cfa8692403a74faeed87240dd10ebc2f3a7ac54bc31756d2b58aba0
4
+ data.tar.gz: c4e10eca543b921d75615b0dd092ff7a498a77ee28a22149e3be1660c4f40dae
5
5
  SHA512:
6
- metadata.gz: f150dd50a3326b9879dc35fa0f7fefc0783f90cd74a977604f4207fc0487edd777a923455e9181c2478469ee9c8d780c709c274646681fd7b7fa34018ae8e9c6
7
- data.tar.gz: 7e8dfb724d40a94c232d1504a1eb55b759ea0f93c5f367e6e5dbe2f1926b86fa1b810e5917e3a59fefa9335a51658ecb47e099d2c9bc2a4e4393d38c413f0149
6
+ metadata.gz: bd7164c382d9b2a55c95b421be0c93204c807403ac6f3ebdac510a8d6fd4d64232fff479535dd37a7b2380c5f7a98af90f9cfed0461a0eae21c6a9b03edb861f
7
+ data.tar.gz: 0ad652a2bb582c9dd45bf3aea1d287b14dd0d00407d3945818a3e1ce50fd48daf08518ab4dcc8de0226287e7ed92b875a2317dd851d9f4a3a70de41974b54a58
@@ -4,6 +4,7 @@ $ ->
4
4
  page_size ||= 50
5
5
  additional_params ||= {}
6
6
  create_attributes ||= {}
7
+ create_model ||= schema.model
7
8
  %>
8
9
 
9
10
  after_modal_submit = (evt, data)->
@@ -15,7 +16,7 @@ $ ->
15
16
 
16
17
  <%# would be a bit cleaner to give the filled form to the shield grid create method, then send the form by ajax %>
17
18
  createRecord = (evt)->
18
- $.ajax('<%= new_polymorphic_path(schema.model, create_attributes.merge(format: :js)) %>')
19
+ $.ajax('<%= new_polymorphic_path(create_model, create_attributes.merge(format: :js)) %>')
19
20
 
20
21
 
21
22
  editRecord = (index)->
@@ -74,10 +75,10 @@ $ ->
74
75
  create: (items, success, error) ->
75
76
  newItem = items[0]
76
77
  $.ajax
77
- url: '<%= polymorphic_path(schema.model, format: :json) %>'
78
+ url: '<%= polymorphic_path(create_model, format: :json) %>'
78
79
  type: 'POST'
79
80
  dataType: 'json'
80
- data: { <%= grid.model_name.name.underscore %>: newItem.data }
81
+ data: { <%= create_model.model_name.name.underscore %>: newItem.data }
81
82
  complete: (xhr) ->
82
83
  if xhr.readyState == 4 and xhr.status == 201
83
84
  newItem.data.id = xhr.responseJSON.id
@@ -136,7 +137,7 @@ $ ->
136
137
  toolbar: [
137
138
  {
138
139
  buttons: [
139
- { cls: 'btn btn-primary', caption: '<%= t('helpers.submit.create', model: grid.model_name.human) %>', click: createRecord }
140
+ { cls: 'btn btn-primary', caption: '<%= t('helpers.submit.create', model: create_model.model_name.human) %>', click: createRecord }
140
141
  ],
141
142
  position: 'top'
142
143
  }
@@ -84,7 +84,7 @@ module EgovUtils
84
84
  COURT_SENAT_SNIPPET = Snippet.new('senat', :integer, :any)
85
85
 
86
86
  TYPES = {
87
- 'court' => Type.new(BC_SNIPPET, DASH_SNIPPET, COURT_AGEND_SNIPPET, DASH_SNIPPET, COURT_SENAT_SNIPPET, SLASH_SNIPPET, YEAR_SNIPPET),
87
+ 'court' => Type.new(COURT_SENAT_SNIPPET, DASH_SNIPPET, COURT_AGEND_SNIPPET, DASH_SNIPPET, BC_SNIPPET, SLASH_SNIPPET, YEAR_SNIPPET),
88
88
  'msp' => Type.new(BC_SNIPPET, SLASH_SNIPPET, YEAR_SNIPPET, DASH_SNIPPET, REGISTER_SNIPPET)
89
89
  }
90
90
 
@@ -1,3 +1,3 @@
1
1
  module EgovUtils
2
- VERSION = '0.2.7'
2
+ VERSION = '0.2.8'
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.2.7
4
+ version: 0.2.8
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-02-07 00:00:00.000000000 Z
11
+ date: 2018-02-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails