smartkiosk-server 0.9.0 → 0.9.1
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.
- data/Gemfile +1 -1
- data/Gemfile.lock +16 -20
- data/app/admin/terminal_profiles.rb +10 -1
- data/app/models/provider_group.rb +1 -1
- data/app/models/terminal.rb +2 -2
- data/app/models/terminal_profile.rb +7 -28
- data/app/models/terminal_profile_provider_group.rb +0 -4
- data/app/views/admin/terminal_profiles/_tree.html.haml +3 -4
- data/app/views/admin/terminal_profiles/sort.html.haml +1 -1
- data/config/locales/smartkiosk.ru.yml +1 -1
- data/lib/smartkiosk/server/version.rb +1 -1
- metadata +8 -8
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -6,21 +6,6 @@ GIT
|
|
6
6
|
eventmachine
|
7
7
|
iso8583
|
8
8
|
|
9
|
-
GIT
|
10
|
-
remote: git@github.com:smartkiosk/payzilla.git
|
11
|
-
revision: df21479aeac3c1c92cb9a09e160cdcfa4d152502
|
12
|
-
specs:
|
13
|
-
payzilla (0.0.1)
|
14
|
-
crack
|
15
|
-
cyberplat_pki
|
16
|
-
gpgme-ffi
|
17
|
-
gyoku
|
18
|
-
json
|
19
|
-
rake
|
20
|
-
rest-client
|
21
|
-
savon
|
22
|
-
webmoney (= 0.0.15.pre)
|
23
|
-
|
24
9
|
GIT
|
25
10
|
remote: https://github.com/guard/guard-spork.git
|
26
11
|
revision: dbaa8531850347474d5a7ee626a9a2a64f7e653c
|
@@ -157,6 +142,7 @@ GEM
|
|
157
142
|
digest-crc (0.3.0)
|
158
143
|
erubis (2.7.0)
|
159
144
|
eventmachine (1.0.0)
|
145
|
+
eventmachine (1.0.0-java)
|
160
146
|
execjs (1.4.0)
|
161
147
|
multi_json (~> 1.0)
|
162
148
|
facter (1.6.17)
|
@@ -183,7 +169,7 @@ GEM
|
|
183
169
|
highline (1.6.15)
|
184
170
|
hike (1.2.1)
|
185
171
|
htmlentities (4.3.1)
|
186
|
-
httpi (2.0.
|
172
|
+
httpi (2.0.2)
|
187
173
|
rack
|
188
174
|
i18n (0.6.1)
|
189
175
|
i18n_yaml_sorter (0.2.0)
|
@@ -238,6 +224,16 @@ GEM
|
|
238
224
|
paper_trail (2.7.0)
|
239
225
|
activerecord (~> 3.0)
|
240
226
|
railties (~> 3.0)
|
227
|
+
payzilla (0.0.2)
|
228
|
+
crack
|
229
|
+
cyberplat_pki
|
230
|
+
gpgme-ffi
|
231
|
+
gyoku
|
232
|
+
json
|
233
|
+
rake
|
234
|
+
rest-client
|
235
|
+
savon
|
236
|
+
webmoney (= 0.0.15.pre)
|
241
237
|
pg (0.14.1)
|
242
238
|
polyamorous (0.5.0)
|
243
239
|
activerecord (~> 3.0)
|
@@ -319,13 +315,13 @@ GEM
|
|
319
315
|
railties (~> 3.2.0)
|
320
316
|
sass (>= 3.1.10)
|
321
317
|
tilt (~> 1.3)
|
322
|
-
savon (2.0
|
318
|
+
savon (2.1.0)
|
323
319
|
akami (~> 1.2.0)
|
324
320
|
builder (>= 2.1.2)
|
325
321
|
gyoku (~> 1.0.0)
|
326
|
-
httpi (~> 2.0.
|
322
|
+
httpi (~> 2.0.2)
|
327
323
|
nokogiri (>= 1.4.0)
|
328
|
-
nori (~> 2.0.
|
324
|
+
nori (~> 2.0.3)
|
329
325
|
wasabi (~> 3.0.0)
|
330
326
|
sidekiq (2.6.4)
|
331
327
|
celluloid (~> 0.12.0)
|
@@ -415,7 +411,7 @@ DEPENDENCIES
|
|
415
411
|
meta_search (>= 1.1.0)
|
416
412
|
money
|
417
413
|
paper_trail
|
418
|
-
payzilla
|
414
|
+
payzilla (= 0.0.2)
|
419
415
|
pg
|
420
416
|
pry
|
421
417
|
rails (= 3.2.11)
|
@@ -71,7 +71,16 @@ ActiveAdmin.register TerminalProfile do
|
|
71
71
|
end
|
72
72
|
end
|
73
73
|
|
74
|
-
member_action :sort, :title => I18n.t('smartkiosk.admin.actions.terminal_profiles.sort')
|
74
|
+
member_action :sort, :title => I18n.t('smartkiosk.admin.actions.terminal_profiles.sort') do
|
75
|
+
@terminal_profile = TerminalProfile
|
76
|
+
.includes(
|
77
|
+
{:terminal_profile_providers => :provider},
|
78
|
+
{:terminal_profile_provider_groups => :provider_group}
|
79
|
+
)
|
80
|
+
.find(params[:id])
|
81
|
+
|
82
|
+
@terminal_profile.actualize_links!
|
83
|
+
end
|
75
84
|
|
76
85
|
#
|
77
86
|
# SHOW
|
@@ -15,7 +15,7 @@ class ProviderGroup < ActiveRecord::Base
|
|
15
15
|
|
16
16
|
belongs_to :provider_group
|
17
17
|
has_many :provider_groups, :order => :title
|
18
|
-
has_many :providers
|
18
|
+
has_many :providers
|
19
19
|
has_many :terminal_profile_provider_groups, :dependent => :destroy
|
20
20
|
|
21
21
|
accepts_nested_attributes_for :providers
|
data/app/models/terminal.rb
CHANGED
@@ -43,7 +43,7 @@ class Terminal < ActiveRecord::Base
|
|
43
43
|
overload = Hash[*terminal_profile.terminal_profile_providers.map{|x| [x.provider_id, x]}.flatten]
|
44
44
|
|
45
45
|
providers.map do |x|
|
46
|
-
icon = overload[x.id].icon
|
46
|
+
icon = overload[x.id].icon rescue nil
|
47
47
|
|
48
48
|
if icon.blank?
|
49
49
|
icon = x.icon.try(:url)
|
@@ -72,7 +72,7 @@ class Terminal < ActiveRecord::Base
|
|
72
72
|
overload = Hash[*terminal_profile.terminal_profile_provider_groups.map{|x| [x.provider_group_id, x]}.flatten]
|
73
73
|
|
74
74
|
ProviderGroup.all.map do |x|
|
75
|
-
icon = overload[x.id].icon
|
75
|
+
icon = overload[x.id].icon rescue nil
|
76
76
|
|
77
77
|
if icon.blank?
|
78
78
|
icon = x.icon.try(:url)
|
@@ -15,37 +15,16 @@ class TerminalProfile < ActiveRecord::Base
|
|
15
15
|
accepts_nested_attributes_for :terminal_profile_providers
|
16
16
|
accepts_nested_attributes_for :terminal_profile_provider_groups
|
17
17
|
|
18
|
-
def
|
19
|
-
|
20
|
-
|
18
|
+
def actualize_links!
|
19
|
+
group_ids = [-1] + terminal_profile_provider_groups.map{|x| x.provider_group_id}
|
20
|
+
prov_ids = [-1] + terminal_profile_providers.map{|x| x.provider_id}
|
21
21
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
ProviderGroup.all.each do |pg|
|
26
|
-
unless pgids.include?(pg.id)
|
27
|
-
data << TerminalProfileProviderGroup.new(:provider_group_id => pg.id, :terminal_profile_id => id)
|
28
|
-
end
|
22
|
+
ProviderGroup.where(ProviderGroup.arel_table[:id].not_in group_ids).each do |pg|
|
23
|
+
terminal_profile_provider_groups << TerminalProfileProviderGroup.new(:provider_group_id => pg.id, :terminal_profile_id => id)
|
29
24
|
end
|
30
25
|
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
def terminal_profile_providers(category=nil)
|
35
|
-
category = category.id if !category.blank? && category.respond_to?(:id)
|
36
|
-
search = category.nil? ? {} : {:provider_group_id => category}
|
37
|
-
|
38
|
-
data = TerminalProfileProvider.includes(:provider).
|
39
|
-
where(:terminal_profile_id => id, :providers => search).
|
40
|
-
order("terminal_profile_providers.priority")
|
41
|
-
pids = data.map{|x| x.provider_id}
|
42
|
-
|
43
|
-
Provider.where(search).all.each do |p|
|
44
|
-
unless pids.include?(p.id)
|
45
|
-
data << TerminalProfileProvider.new(:provider_id => p.id, :terminal_profile_id => id)
|
46
|
-
end
|
26
|
+
Provider.where(Provider.arel_table[:id].not_in prov_ids).each do |p|
|
27
|
+
terminal_profile_providers << TerminalProfileProvider.new(:provider_id => p.id, :terminal_profile_id => id)
|
47
28
|
end
|
48
|
-
|
49
|
-
data
|
50
29
|
end
|
51
30
|
end
|
@@ -12,8 +12,4 @@ class TerminalProfileProviderGroup < ActiveRecord::Base
|
|
12
12
|
validates :terminal_profile, :presence => true
|
13
13
|
|
14
14
|
delegate :title, :to => :terminal_profile
|
15
|
-
|
16
|
-
def terminal_profile_providers
|
17
|
-
terminal_profile.terminal_profile_providers(provider_group_id)
|
18
|
-
end
|
19
15
|
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
- if entry.is_a?(TerminalProfileProviderGroup)
|
2
|
-
%li.input{:style => 'padding-right: 0px; padding-left: 0px; cursor: move', :'data-id' => entry.
|
2
|
+
%li.input{:style => 'padding-right: 0px; padding-left: 0px; cursor: move', :'data-id' => entry.provider_group_id, :'data-parent' => entry.provider_group.provider_group_id}
|
3
3
|
%div{:style => 'padding-left: 10px; padding-bottom: 5px; border-bottom: 1px dashed gray'}
|
4
4
|
⇅
|
5
5
|
= image_tag(entry.icon.url(:thumb), :style => 'vertical-align: middle') unless entry.icon.blank?
|
@@ -13,9 +13,8 @@
|
|
13
13
|
%input{:type => 'hidden', :name => "terminal_profile_provider_groups[][provider_group_id]", :value => entry.provider_group_id}
|
14
14
|
%input{:type => 'hidden', :name => "terminal_profile_provider_groups[][priority]", :value => entry.priority}
|
15
15
|
%ol{:style => 'padding-left:30px'}
|
16
|
-
- subs = @terminal_profile.terminal_profile_provider_groups
|
17
|
-
- subs
|
18
|
-
- subs += entry.terminal_profile_providers
|
16
|
+
- subs = @terminal_profile.terminal_profile_provider_groups.select{|x| x.provider_group.provider_group_id == entry.provider_group_id}
|
17
|
+
- subs += @terminal_profile.terminal_profile_providers.select{|x| x.provider.provider_group_id == entry.provider_group_id}
|
19
18
|
|
20
19
|
- subs.sort_by{|x| x.priority}.each_with_index do |x|
|
21
20
|
= render 'tree', :entry => x, :level => level+1
|
@@ -15,7 +15,7 @@
|
|
15
15
|
|
16
16
|
= semantic_form_for [:admin, @terminal_profile], :html => { :multipart => true } do |f|
|
17
17
|
= f.inputs :class => 'sortable', :style => 'padding: 0px; margin: 0px' do
|
18
|
-
- @terminal_profile.terminal_profile_provider_groups.select{|x| x.provider_group.
|
18
|
+
- @terminal_profile.terminal_profile_provider_groups.select{|x| x.provider_group.provider_group_id.blank?}.each_with_index do |g, i|
|
19
19
|
= render 'tree', :entry => g, :level => 0
|
20
20
|
|
21
21
|
= f.actions
|
@@ -55,7 +55,7 @@ ru:
|
|
55
55
|
provider_fields:
|
56
56
|
values_hint: Значения для списка через запятую
|
57
57
|
keyword_hint: Не требуется для поля лицевого счета
|
58
|
-
mask_hint: "Маска ввода (5-4-
|
58
|
+
mask_hint: "Маска ввода (5-4-8: три поля на 5, 4 и 8 символов)"
|
59
59
|
panels:
|
60
60
|
gateways:
|
61
61
|
settings: Настройки
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: smartkiosk-server
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-02-
|
12
|
+
date: 2013-02-04 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
16
|
-
requirement: &
|
16
|
+
requirement: &70109942827260 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - =
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 3.2.11
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70109942827260
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: matrioshka
|
27
|
-
requirement: &
|
27
|
+
requirement: &70109942826720 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,7 +32,7 @@ dependencies:
|
|
32
32
|
version: 0.1.1
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70109942826720
|
36
36
|
description: Smartkiosk server application
|
37
37
|
email:
|
38
38
|
- boris@roundlake.ru
|
@@ -307,7 +307,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
307
307
|
version: '0'
|
308
308
|
segments:
|
309
309
|
- 0
|
310
|
-
hash:
|
310
|
+
hash: 3459367265776858922
|
311
311
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
312
312
|
none: false
|
313
313
|
requirements:
|
@@ -316,7 +316,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
316
316
|
version: '0'
|
317
317
|
segments:
|
318
318
|
- 0
|
319
|
-
hash:
|
319
|
+
hash: 3459367265776858922
|
320
320
|
requirements: []
|
321
321
|
rubyforge_project:
|
322
322
|
rubygems_version: 1.8.15
|