smartkiosk-server 0.10.9 → 0.10.10

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/app/admin/agents.rb CHANGED
@@ -71,10 +71,13 @@ ActiveAdmin.register Agent do
71
71
  t.column :provider
72
72
  t.column :created_at
73
73
  end
74
- button(
75
- link_to I18n.t('smartkiosk.full_list'),
76
- admin_payments_path(:q => {:agent_id_eq => agent.id})
77
- )
74
+
75
+ div(:class => 'more') do
76
+ text_node link_to(
77
+ link_to I18n.t('smartkiosk.full_list'),
78
+ admin_payments_path(:q => {:agent_id_eq => agent.id})
79
+ )
80
+ end
78
81
  end
79
82
  end
80
83
 
@@ -137,7 +137,13 @@ ActiveAdmin.register Gateway do
137
137
  t.column :provider
138
138
  t.column :created_at
139
139
  end
140
- button(link_to I18n.t('smartkiosk.full_list'), admin_payments_path(:q => {:gateway_id_eq => gateway.id}))
140
+
141
+ div(:class => 'more') do
142
+ text_node link_to(
143
+ I18n.t('smartkiosk.full_list'),
144
+ admin_payments_path(:q => {:gateway_id_eq => gateway.id})
145
+ )
146
+ end
141
147
  end
142
148
 
143
149
  active_admin_comments
@@ -7,7 +7,7 @@ ActiveAdmin.register Provider do
7
7
 
8
8
  controller do
9
9
  def scoped_collection
10
- Provider.includes(:provider_profile)
10
+ Provider.includes(:provider_profile, :gateways)
11
11
  end
12
12
  end
13
13
 
@@ -34,10 +34,16 @@ ActiveAdmin.register Provider do
34
34
  column :icon do |x|
35
35
  image_tag(x.icon.url(:thumb)) unless x.icon.blank?
36
36
  end
37
- column :provider_profile
37
+ column :title, :sortable => :title do |x|
38
+ link_to x.title, [:admin, x]
39
+ end
38
40
  column :keyword
39
- column :title
40
- column :provider_gateways_count
41
+ column :provider_profile
42
+ column :provider_gateways_count, :sortable => :provider_gateways_count do |x|
43
+ x.gateways.map do |g|
44
+ link_to g.title, [:admin, g]
45
+ end.join(', ').html_safe
46
+ end
41
47
  column :updated_at
42
48
  default_actions
43
49
  end
@@ -115,10 +121,13 @@ ActiveAdmin.register Provider do
115
121
  t.column :provider
116
122
  t.column :created_at
117
123
  end
118
- button(
119
- link_to I18n.t('smartkiosk.full_list'),
120
- admin_payments_path(:q => {:provider_id_eq => provider.id})
121
- )
124
+
125
+ div(:class => 'more') do
126
+ text_node link_to(
127
+ link_to I18n.t('smartkiosk.full_list'),
128
+ admin_payments_path(:q => {:provider_id_eq => provider.id})
129
+ )
130
+ end
122
131
  end
123
132
 
124
133
  active_admin_comments
@@ -340,10 +340,13 @@ ActiveAdmin.register Terminal do
340
340
  t.column :modem_balance
341
341
  t.column :modem_signal_level
342
342
  end
343
- button(
344
- link_to I18n.t('smartkiosk.admin.panels.terminals.all_pings'),
345
- pings_admin_terminal_path(terminal.id)
346
- )
343
+
344
+ div(:class => 'more') do
345
+ text_node link_to(
346
+ I18n.t('smartkiosk.admin.panels.terminals.all_pings'),
347
+ pings_admin_terminal_path(terminal.id)
348
+ )
349
+ end
347
350
  end
348
351
 
349
352
  panel I18n.t('activerecord.models.collection.other') do
@@ -353,10 +356,13 @@ ActiveAdmin.register Terminal do
353
356
  t.column :approved_payments_sum
354
357
  t.column :collected_at
355
358
  end
356
- button(
357
- link_to I18n.t('smartkiosk.full_list'),
358
- admin_collections_path(:q => {:terminal_id_eq => terminal.id})
359
- )
359
+
360
+ div(:class => 'more') do
361
+ text_node link_to(
362
+ link_to I18n.t('smartkiosk.full_list'),
363
+ admin_collections_path(:q => {:terminal_id_eq => terminal.id})
364
+ )
365
+ end
360
366
  end
361
367
 
362
368
  active_admin_comments
@@ -32,6 +32,14 @@ body.active_admin {
32
32
  color: #414141;
33
33
  }
34
34
 
35
+ .panel {
36
+ .more {
37
+ font-weight: bold;
38
+ margin-top: 10px;
39
+ font-size: 1.1em;
40
+ }
41
+ }
42
+
35
43
  //
36
44
  // WRAPPER
37
45
  //
@@ -1,55 +1,57 @@
1
- table_for(terminal.pings, :class => 'index_table index', :i18n => TerminalPing) do |t|
2
- t.column :created_at
3
- t.column :condition do |x|
4
- status_tag I18n.t("smartkiosk.terminal_conditions.#{x.condition}"), x.condition.to_sym
5
- end
6
- t.column :state do |x|
7
- I18n.t "smartkiosk.terminal_states.#{x.state}"
8
- end
9
- t.column :version
10
- t.column :ip
11
- t.column :queues do |x|
12
- ul do
13
- x.queues.each do |queue, count|
14
- li :style => 'white-space: nowrap' do
15
- b queue+':'
16
- span count
1
+ paginated_collection(Kaminari.paginate_array(terminal.pings).page(params[:page]).per(15), download_links: false) do
2
+ table_for(collection, :class => 'index_table index', :i18n => TerminalPing) do |t|
3
+ t.column :created_at
4
+ t.column :condition do |x|
5
+ status_tag I18n.t("smartkiosk.terminal_conditions.#{x.condition}"), x.condition.to_sym
6
+ end
7
+ t.column :state do |x|
8
+ I18n.t "smartkiosk.terminal_states.#{x.state}"
9
+ end
10
+ t.column :version
11
+ t.column :ip
12
+ t.column :queues do |x|
13
+ ul do
14
+ x.queues.each do |queue, count|
15
+ li :style => 'white-space: nowrap' do
16
+ b queue+':'
17
+ span count
18
+ end
17
19
  end
18
20
  end
19
21
  end
20
- end
21
- t.column :banknotes do |x|
22
- ul do
23
- x.banknotes.each do |banknote, count|
24
- li :style => 'white-space: nowrap' do
25
- b banknote+':'
26
- span count
22
+ t.column :banknotes do |x|
23
+ ul do
24
+ x.banknotes.each do |banknote, count|
25
+ li :style => 'white-space: nowrap' do
26
+ b banknote+':'
27
+ span count
28
+ end
27
29
  end
28
30
  end
29
31
  end
30
- end
31
- Terminal::HARDWARE.each do |hardware|
32
- t.column :"#{hardware}_error" do |x|
33
- div :style => 'white-space: nowrap' do
34
- if x.error(hardware).blank?
35
- status_tag I18n.t('formtastic.no'), :ok
36
- else
37
- status_tag(
38
- (
39
- I18n.t("smartkiosk.hardware.#{hardware}.errors")[x.error(hardware)] ||
40
- I18n.t('smartkiosk.unlocalized') + " (#{x.error(hardware)})"
41
- ),
42
- :error
43
- )
32
+ Terminal::HARDWARE.each do |hardware|
33
+ t.column :"#{hardware}_error" do |x|
34
+ div :style => 'white-space: nowrap' do
35
+ if x.error(hardware).blank?
36
+ status_tag I18n.t('formtastic.no'), :ok
37
+ else
38
+ status_tag(
39
+ (
40
+ I18n.t("smartkiosk.hardware.#{hardware}.errors")[x.error(hardware)] ||
41
+ I18n.t('smartkiosk.unlocalized') + " (#{x.error(hardware)})"
42
+ ),
43
+ :error
44
+ )
45
+ end
44
46
  end
45
47
  end
46
48
  end
49
+ t.column :cash_sum
50
+ t.column :cash_count
51
+ t.column :cash_acceptor_version
52
+ t.column :printer_version
53
+ t.column :modem_balance
54
+ t.column :modem_signal_level
55
+ t.column :modem_version
47
56
  end
48
- t.column :cash_sum
49
- t.column :cash_count
50
- t.column :cash_acceptor_version
51
- t.column :printer_version
52
- t.column :modem_balance
53
- t.column :modem_signal_level
54
- t.column :modem_version
55
57
  end
data/config/deploy.rb CHANGED
@@ -20,7 +20,7 @@ set :user, "deployer"
20
20
  set :deploy_to, "/home/deployer/www/#{application}"
21
21
 
22
22
  after 'deploy:update_code', 'deploy:configure'
23
- before 'deploy:create_symlink', 'deploy:install'
23
+ before 'deploy:create_symlink', 'deploy:install' if ENV['DEPLOY_DB']
24
24
 
25
25
  namespace :deploy do
26
26
  task :configure do
@@ -8,6 +8,7 @@ require 'active_admin/inputs/filter_date_range_input_fix'
8
8
  require 'paper_trail/version_fix'
9
9
  require 'formtastic/inputs/selectable_check_boxes'
10
10
  require 'dav4rack/build_resource'
11
+ require 'kaminari/array_extension_fix'
11
12
 
12
13
  ActiveAdmin.setup do |config|
13
14
  # TODO: Remove this as soon as AA fixed
@@ -59,6 +59,8 @@ ru:
59
59
  empty: "%{model} не найдено"
60
60
  entry:
61
61
  one: "запись"
62
+ few: "записей"
63
+ many: "записей"
62
64
  other: "записей"
63
65
  multiple: "Результат: %{model} <b>%{from}&nbsp;-&nbsp;%{to}</b> из <b>%{total}</b>"
64
66
  one: "Результат: <b>1</b> %{model}"
@@ -44,6 +44,11 @@ ru:
44
44
  min:
45
45
  too_large: должно быть меньше До
46
46
  models:
47
+ terminal_ping:
48
+ few: Пинга
49
+ many: Пингов
50
+ one: Пинг
51
+ other: Пинги
47
52
  terminal_profile_promotion:
48
53
  few: Быстрые иконки
49
54
  many: Быстрых иконок
@@ -0,0 +1,10 @@
1
+ module Kaminari
2
+ class PaginatableArray < Array
3
+ # AA tries to reorder selection to ease SQL count query
4
+ # In cases when we use array as a collection source we
5
+ # need this method to do nothing and be chainable
6
+ def reorder(*args)
7
+ self
8
+ end
9
+ end
10
+ end
@@ -1,5 +1,5 @@
1
1
  module Smartkiosk
2
2
  module Server
3
- VERSION = '0.10.9'
3
+ VERSION = '0.10.10'
4
4
  end
5
5
  end
@@ -21,9 +21,9 @@ module Smartkiosk
21
21
  end
22
22
 
23
23
  # ActiveAdmin
24
- ActiveAdmin.setup do |config|
25
- config.load_paths << Smartkiosk::Server::Engine.root.join('app/admin').to_s
26
- end
24
+ aa_load_path = Smartkiosk::Server::Engine.root.join('app/admin').to_s
25
+ ActiveAdmin.application.load_paths << aa_load_path
26
+ config.eager_load_paths.reject!{|x| x == aa_load_path}
27
27
 
28
28
  # TODO: Remove this as soon as AA fixed
29
29
  config.after_initialize do
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.10.9
4
+ version: 0.10.10
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2013-02-14 00:00:00.000000000 Z
13
+ date: 2013-02-15 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rails
@@ -272,6 +272,7 @@ files:
272
272
  - lib/dav4rack/build_resource.rb
273
273
  - lib/formtastic/inputs/selectable_check_boxes.rb
274
274
  - lib/gem_stasher.rb
275
+ - lib/kaminari/array_extension_fix.rb
275
276
  - lib/paper_trail/version_fix.rb
276
277
  - lib/report_builder.rb
277
278
  - lib/seeder.rb
@@ -321,7 +322,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
321
322
  version: '0'
322
323
  segments:
323
324
  - 0
324
- hash: -1984096690378961328
325
+ hash: -3287935658302651935
325
326
  required_rubygems_version: !ruby/object:Gem::Requirement
326
327
  none: false
327
328
  requirements:
@@ -330,7 +331,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
330
331
  version: '0'
331
332
  segments:
332
333
  - 0
333
- hash: -1984096690378961328
334
+ hash: -3287935658302651935
334
335
  requirements: []
335
336
  rubyforge_project:
336
337
  rubygems_version: 1.8.23