smartkiosk-server 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +32 -0
- data/.rspec +1 -0
- data/Capfile +4 -0
- data/Gemfile +71 -0
- data/Gemfile.lock +439 -0
- data/Guardfile +25 -0
- data/LICENSE +287 -0
- data/README.md +13 -0
- data/Rakefile +5 -0
- data/app/acquirers/cards_mkb_acquirer.rb +87 -0
- data/app/acquirers/cash_acquirer.rb +22 -0
- data/app/admin/agents.rb +108 -0
- data/app/admin/collections.rb +62 -0
- data/app/admin/commissions.rb +87 -0
- data/app/admin/gateways.rb +183 -0
- data/app/admin/limits.rb +82 -0
- data/app/admin/payments.rb +246 -0
- data/app/admin/provider_groups.rb +60 -0
- data/app/admin/provider_profiles.rb +11 -0
- data/app/admin/provider_receipt_templates.rb +82 -0
- data/app/admin/providers.rb +201 -0
- data/app/admin/rebates.rb +83 -0
- data/app/admin/report_results.rb +66 -0
- data/app/admin/report_templates.rb +209 -0
- data/app/admin/reports.rb +158 -0
- data/app/admin/revisions.rb +120 -0
- data/app/admin/system_receipt_templates.rb +76 -0
- data/app/admin/terminal_builds.rb +39 -0
- data/app/admin/terminal_profiles.rb +123 -0
- data/app/admin/terminals.rb +388 -0
- data/app/admin/users.rb +117 -0
- data/app/admin/versions.rb +131 -0
- data/app/admin/welcome.rb +64 -0
- data/app/assets/fonts/PT_Sans-Web-Bold.eot +0 -0
- data/app/assets/fonts/PT_Sans-Web-Bold.svg +6386 -0
- data/app/assets/fonts/PT_Sans-Web-Bold.ttf +0 -0
- data/app/assets/fonts/PT_Sans-Web-Bold.woff +0 -0
- data/app/assets/fonts/PT_Sans-Web-Regular.eot +0 -0
- data/app/assets/fonts/PT_Sans-Web-Regular.svg +5650 -0
- data/app/assets/fonts/PT_Sans-Web-Regular.ttf +0 -0
- data/app/assets/fonts/PT_Sans-Web-Regular.woff +0 -0
- data/app/assets/images/chosen-sprite.png +0 -0
- data/app/assets/javascripts/active_admin/chosen.js.erb.coffee +12 -0
- data/app/assets/javascripts/active_admin/qtip.js.coffee +22 -0
- data/app/assets/javascripts/active_admin/sortable_forms.js.coffee +14 -0
- data/app/assets/javascripts/active_admin.js.coffee +9 -0
- data/app/assets/javascripts/application.js +15 -0
- data/app/assets/javascripts/report_templates.js.coffee +10 -0
- data/app/assets/javascripts/terminals.js.coffee +12 -0
- data/app/assets/stylesheets/active_admin/PIE.css.scss +18 -0
- data/app/assets/stylesheets/active_admin/filter_numeric_range.css.scss +14 -0
- data/app/assets/stylesheets/active_admin/selectable_check_boxes.css.scss +12 -0
- data/app/assets/stylesheets/active_admin/sortable_forms.css.scss +11 -0
- data/app/assets/stylesheets/active_admin.css.scss +705 -0
- data/app/assets/stylesheets/fonts.css.scss +14 -0
- data/app/assets/stylesheets/provider_groups.css.scss +12 -0
- data/app/assets/stylesheets/provider_receipt_templates.css.scss +12 -0
- data/app/assets/stylesheets/terminals.css.scss +9 -0
- data/app/controllers/application_controller.rb +12 -0
- data/app/controllers/collections_controller.rb +10 -0
- data/app/controllers/payments_controller.rb +73 -0
- data/app/controllers/system_receipt_templates_controller.rb +10 -0
- data/app/controllers/terminal_builds_controller.rb +5 -0
- data/app/controllers/terminal_orders_controller.rb +25 -0
- data/app/controllers/terminal_pings_controller.rb +45 -0
- data/app/controllers/welcome_controller.rb +5 -0
- data/app/helpers/active_admin/report_templates_helper.rb +56 -0
- data/app/helpers/active_admin/views_helper.rb +20 -0
- data/app/helpers/application_helper.rb +2 -0
- data/app/mailers/.gitkeep +0 -0
- data/app/models/.gitkeep +0 -0
- data/app/models/ability.rb +30 -0
- data/app/models/agent.rb +24 -0
- data/app/models/collection.rb +65 -0
- data/app/models/commission.rb +77 -0
- data/app/models/commission_section.rb +75 -0
- data/app/models/gateway.rb +99 -0
- data/app/models/gateway_attachment.rb +9 -0
- data/app/models/gateway_setting.rb +7 -0
- data/app/models/gateway_switch.rb +7 -0
- data/app/models/limit.rb +77 -0
- data/app/models/limit_section.rb +58 -0
- data/app/models/payment.rb +322 -0
- data/app/models/provider.rb +59 -0
- data/app/models/provider_field.rb +7 -0
- data/app/models/provider_gateway.rb +47 -0
- data/app/models/provider_group.rb +45 -0
- data/app/models/provider_profile.rb +9 -0
- data/app/models/provider_rebate.rb +69 -0
- data/app/models/provider_receipt_template.rb +85 -0
- data/app/models/rebate.rb +84 -0
- data/app/models/report.rb +71 -0
- data/app/models/report_result.rb +11 -0
- data/app/models/report_template.rb +56 -0
- data/app/models/revision.rb +104 -0
- data/app/models/role.rb +48 -0
- data/app/models/system_receipt_template.rb +13 -0
- data/app/models/terminal.rb +126 -0
- data/app/models/terminal_build.rb +62 -0
- data/app/models/terminal_order.rb +42 -0
- data/app/models/terminal_ping.rb +120 -0
- data/app/models/terminal_profile.rb +51 -0
- data/app/models/terminal_profile_promotion.rb +18 -0
- data/app/models/terminal_profile_provider.rb +11 -0
- data/app/models/terminal_profile_provider_group.rb +19 -0
- data/app/models/user.rb +38 -0
- data/app/models/user_role.rb +45 -0
- data/app/reports/agents_report.rb +81 -0
- data/app/reports/collections_report.rb +151 -0
- data/app/reports/payments_report.rb +189 -0
- data/app/reports/terminals_report.rb +123 -0
- data/app/uploaders/file_uploader.rb +53 -0
- data/app/uploaders/icon_uploader.rb +15 -0
- data/app/uploaders/zip_uploader.rb +53 -0
- data/app/views/admin/gateways/providers.html.arb +10 -0
- data/app/views/admin/revisions/payments.html.arb +28 -0
- data/app/views/admin/terminal_profiles/_tree.html.haml +35 -0
- data/app/views/admin/terminal_profiles/sort.html.haml +21 -0
- data/app/views/admin/terminals/pings.html.arb +55 -0
- data/app/views/admin/terminals/upgrade_build.html.arb +30 -0
- data/app/views/layouts/application.html.erb +1 -0
- data/app/views/welcome/index.html.erb +25 -0
- data/app/workers/pay_worker.rb +11 -0
- data/app/workers/report_worker.rb +7 -0
- data/app/workers/revise_worker.rb +7 -0
- data/config/acquiring.yml +13 -0
- data/config/application.rb +75 -0
- data/config/boot.rb +6 -0
- data/config/database.yml +17 -0
- data/config/deploy/roundlake-passenger.rb +3 -0
- data/config/deploy/roundlake-trinidad.rb +3 -0
- data/config/deploy.rb +37 -0
- data/config/environment.rb +5 -0
- data/config/environments/development.rb +39 -0
- data/config/environments/production.rb +67 -0
- data/config/environments/test.rb +37 -0
- data/config/initializers/active_admin.rb +31 -0
- data/config/initializers/backtrace_silencers.rb +7 -0
- data/config/initializers/devise.rb +232 -0
- data/config/initializers/inflections.rb +15 -0
- data/config/initializers/mime_types.rb +5 -0
- data/config/initializers/money.rb +6 -0
- data/config/initializers/redis.rb +4 -0
- data/config/initializers/secret_token.rb +7 -0
- data/config/initializers/session_store.rb +8 -0
- data/config/initializers/setup_rack.rb +1 -0
- data/config/initializers/wrap_parameters.rb +14 -0
- data/config/locales/active_admin.ru.yml +71 -0
- data/config/locales/activerecord.ru.yml +645 -0
- data/config/locales/devise.ru.yml +57 -0
- data/config/locales/ru.yml +33 -0
- data/config/locales/smartkiosk.gateways.ru.yml +241 -0
- data/config/locales/smartkiosk.hardware.ru.yml +38 -0
- data/config/locales/smartkiosk.reports.ru.yml +56 -0
- data/config/locales/smartkiosk.ru.yml +163 -0
- data/config/nginx.conf +9 -0
- data/config/redis.yml +9 -0
- data/config/routes.rb +48 -0
- data/config/schedule.rb +13 -0
- data/config/sidekiq.yml +5 -0
- data/config/trinidad.yml +6 -0
- data/config.ru +4 -0
- data/db/migrate/20120825083035_create_terminals.rb +47 -0
- data/db/migrate/20120825083305_create_payments.rb +51 -0
- data/db/migrate/20120827062618_devise_create_users.rb +50 -0
- data/db/migrate/20120827132621_create_admin_notes.rb +17 -0
- data/db/migrate/20120827132622_move_admin_notes_to_comments.rb +25 -0
- data/db/migrate/20120903193346_create_providers.rb +24 -0
- data/db/migrate/20120922075345_create_collections.rb +26 -0
- data/db/migrate/20120922080440_create_agents.rb +29 -0
- data/db/migrate/20120922081104_create_commissions.rb +10 -0
- data/db/migrate/20120927035841_create_gateways.rb +13 -0
- data/db/migrate/20120927040626_create_provider_gateways.rb +13 -0
- data/db/migrate/20120927091849_create_limits.rb +10 -0
- data/db/migrate/20120927164647_create_roles.rb +14 -0
- data/db/migrate/20121003131522_create_report_templates.rb +18 -0
- data/db/migrate/20121007135652_create_reports.rb +13 -0
- data/db/migrate/20121008073905_create_report_results.rb +10 -0
- data/db/migrate/20121017114538_create_gateway_settings.rb +12 -0
- data/db/migrate/20121017114556_create_gateway_attachments.rb +10 -0
- data/db/migrate/20121019132606_create_revisions.rb +19 -0
- data/db/migrate/20121023073501_create_gateway_switches.rb +10 -0
- data/db/migrate/20121112142743_create_terminal_orders.rb +13 -0
- data/db/migrate/20121118191553_create_versions.rb +19 -0
- data/db/migrate/20121125093414_create_system_receipt_templates.rb +9 -0
- data/db/migrate/20121127192257_create_terminal_builds.rb +10 -0
- data/db/migrate/20121212053441_create_rebates.rb +15 -0
- data/db/migrate/20121216143855_create_provider_receipt_templates.rb +9 -0
- data/db/migrate/20130101091100_create_terminal_profiles.rb +13 -0
- data/db/migrate/20130101091734_create_provider_rebates.rb +21 -0
- data/db/migrate/20130102164447_create_limit_sections.rb +14 -0
- data/db/migrate/20130102164503_create_commission_sections.rb +17 -0
- data/db/migrate/20130102171743_create_provider_profiles.rb +10 -0
- data/db/migrate/20130103152507_create_provider_fields.rb +17 -0
- data/db/migrate/20130103154526_create_provider_groups.rb +10 -0
- data/db/migrate/20130104063628_create_terminal_profile_providers.rb +11 -0
- data/db/migrate/20130104090957_create_terminal_profile_provider_groups.rb +11 -0
- data/db/migrate/20130108091644_create_terminal_profile_promotions.rb +10 -0
- data/db/schema.rb +489 -0
- data/db/seeds/receipt_templates/payment.txt +19 -0
- data/db/seeds/receipt_templates/system/balance.txt +13 -0
- data/db/seeds/receipt_templates/system/collection.txt +17 -0
- data/db/seeds/receipt_templates/system/touchtest.txt +15 -0
- data/db/seeds.rb +18 -0
- data/doc/README_FOR_APP +2 -0
- data/init.rb +1 -0
- data/lib/active_admin/cancan_integration.rb +81 -0
- data/lib/active_admin/form_builder_fix.rb +76 -0
- data/lib/active_admin/inputs/filter_date_range_input_fix.rb +24 -0
- data/lib/active_admin/inputs/filter_multiple_select_input.rb +18 -0
- data/lib/active_admin/inputs/filter_numeric_range_input.rb +31 -0
- data/lib/active_admin/resource_controller_fix.rb +23 -0
- data/lib/active_admin/views/pages/base_fix.rb +13 -0
- data/lib/assets/.gitkeep +0 -0
- data/lib/blueprints.rb +79 -0
- data/lib/date_expander.rb +38 -0
- data/lib/dav4rack/build_resource.rb +59 -0
- data/lib/formtastic/inputs/selectable_check_boxes.rb +39 -0
- data/lib/paper_trail/version_fix.rb +3 -0
- data/lib/report_builder.rb +88 -0
- data/lib/seeder.rb +103 -0
- data/lib/smartkiosk/server/version.rb +5 -0
- data/lib/smartkiosk/server.rb +35 -0
- data/lib/string_file.rb +12 -0
- data/lib/tasks/.gitkeep +0 -0
- data/lib/tasks/db.rake +27 -0
- data/lib/tasks/dump.rake +53 -0
- data/lib/tasks/matrioshka.rake +16 -0
- data/log/.gitkeep +0 -0
- data/log/gateways/.gitkeep +0 -0
- data/public/404.html +26 -0
- data/public/422.html +26 -0
- data/public/500.html +25 -0
- data/public/robots.txt +5 -0
- data/script/rails +6 -0
- data/smartkiosk-server.gemspec +23 -0
- data/spec/controllers/collections_controller_spec.rb +32 -0
- data/spec/controllers/payments_controller_spec.rb +123 -0
- data/spec/controllers/system_receipt_templates_controller_spec.rb +5 -0
- data/spec/controllers/terminal_builds_controller_spec.rb +5 -0
- data/spec/controllers/terminal_orders_controller_spec.rb +32 -0
- data/spec/controllers/terminal_pings_controller_spec.rb +31 -0
- data/spec/spec_helper.rb +66 -0
- data/vendor/assets/javascripts/.gitkeep +0 -0
- data/vendor/assets/javascripts/chosen.jquery.js +1026 -0
- data/vendor/assets/javascripts/datepicker-ru.jquery.js +21 -0
- data/vendor/assets/javascripts/nestedSortable.jquery.js +429 -0
- data/vendor/assets/javascripts/qtip.jquery.js +3403 -0
- data/vendor/assets/stylesheets/.gitkeep +0 -0
- data/vendor/assets/stylesheets/chosen.jquery.css +397 -0
- data/vendor/assets/stylesheets/modules/PIE.htc +96 -0
- data/vendor/assets/stylesheets/qtip.jquery.css.scss +604 -0
- data/vendor/plugins/.gitkeep +0 -0
- metadata +333 -0
@@ -0,0 +1,55 @@
|
|
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
|
17
|
+
end
|
18
|
+
end
|
19
|
+
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
|
27
|
+
end
|
28
|
+
end
|
29
|
+
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
|
+
)
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
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
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
table :style => 'width: 80%', :align => 'center' do
|
2
|
+
tr do
|
3
|
+
td :style => 'width: 40%;' do
|
4
|
+
div :style => 'padding-right: 20px;' do
|
5
|
+
h3 I18n.t('smartkiosk.admin.messages.terminals.terminals_to_upgrade'), :style => 'font-weight: bold;'
|
6
|
+
assigns[:terminals].each_with_index do |t, i|
|
7
|
+
div t.keyword, :style => 'width: 33%; float: left'
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
11
|
+
td :style => 'width: 1px;' do
|
12
|
+
div :style => 'padding: 40px; background-color: #FFADAD' do
|
13
|
+
h2 I18n.t('smartkiosk.admin.messages.terminals.build_to_upgrade'), :style => 'white-space: nowrap'
|
14
|
+
form :action => upgrade_admin_terminal_path(assigns[:ids]), :method => :post do
|
15
|
+
input :type => 'hidden', :name => 'authenticity_token', :value => form_authenticity_token
|
16
|
+
select :name => 'build_id', :class => 'chosen', :style => 'width: 400px' do
|
17
|
+
TerminalBuild.all.each do |tb|
|
18
|
+
option tb.version, :value => tb.id
|
19
|
+
end
|
20
|
+
end
|
21
|
+
div :style => 'margin-top: 15px' do
|
22
|
+
input :value => I18n.t('smartkiosk.admin.actions.terminals.upgrade'), :type => 'submit'
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
td do
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= yield %>
|
@@ -0,0 +1,25 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>Access rejected (403)</title>
|
5
|
+
<style type="text/css">
|
6
|
+
body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
|
7
|
+
div.dialog {
|
8
|
+
width: 25em;
|
9
|
+
padding: 0 4em;
|
10
|
+
margin: 4em auto 0 auto;
|
11
|
+
border: 1px solid #ccc;
|
12
|
+
border-right-color: #999;
|
13
|
+
border-bottom-color: #999;
|
14
|
+
}
|
15
|
+
h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
|
16
|
+
</style>
|
17
|
+
</head>
|
18
|
+
|
19
|
+
<body>
|
20
|
+
<div class="dialog">
|
21
|
+
<h1>You are not supposed to be here.</h1>
|
22
|
+
<p>You might be unauthorized or just mistyped the url.</p>
|
23
|
+
</div>
|
24
|
+
</body>
|
25
|
+
</html>
|
@@ -0,0 +1,13 @@
|
|
1
|
+
- type: cash
|
2
|
+
class: CashAcquirer
|
3
|
+
- type: inner_card, foreign_card
|
4
|
+
class: CardsMkbAcquirer
|
5
|
+
dhi: 'tcp://195.191.76.150:4007'
|
6
|
+
processing_code: "00000000"
|
7
|
+
merchant_type: "4814"
|
8
|
+
acquirer_country: "643"
|
9
|
+
entry_mode: "9010"
|
10
|
+
condition_code: "00"
|
11
|
+
acquirer: "443222"
|
12
|
+
terminal_id: "49990001"
|
13
|
+
acceptor_id: "510000000000016"
|
@@ -0,0 +1,75 @@
|
|
1
|
+
require File.expand_path('../boot', __FILE__)
|
2
|
+
|
3
|
+
require 'rails/all'
|
4
|
+
|
5
|
+
if defined?(Bundler)
|
6
|
+
# If you precompile assets before deploying to production, use this line
|
7
|
+
Bundler.require(*Rails.groups(:assets => %w(development test)))
|
8
|
+
# If you want your assets lazily compiled in production, use this line
|
9
|
+
# Bundler.require(:default, :assets, Rails.env)
|
10
|
+
end
|
11
|
+
|
12
|
+
require_relative '../lib/smartkiosk/server/version'
|
13
|
+
|
14
|
+
module Smartkiosk
|
15
|
+
module Server
|
16
|
+
def self.revision
|
17
|
+
file = File.expand_path '../../REVISION', __FILE__
|
18
|
+
File.exist?(file) ? File.read(file).strip : nil
|
19
|
+
end
|
20
|
+
|
21
|
+
class Application < Rails::Application
|
22
|
+
# Settings in config/environments/* take precedence over those specified here.
|
23
|
+
# Application configuration should go into files in config/initializers
|
24
|
+
# -- all .rb files in that directory are automatically loaded.
|
25
|
+
|
26
|
+
# Custom directories with classes and modules you want to be autoloadable.
|
27
|
+
config.autoload_paths += %W(#{config.root}/acquirers #{config.root}/reports #{config.root}/lib)
|
28
|
+
|
29
|
+
# Only load the plugins named here, in the order given (default is alphabetical).
|
30
|
+
# :all can be used as a placeholder for all plugins not explicitly named.
|
31
|
+
# config.plugins = [ :exception_notification, :ssl_requirement, :all ]
|
32
|
+
|
33
|
+
# Activate observers that should always be running.
|
34
|
+
# config.active_record.observers = :cacher, :garbage_collector, :forum_observer
|
35
|
+
|
36
|
+
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
|
37
|
+
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
|
38
|
+
# config.time_zone = 'Central Time (US & Canada)'
|
39
|
+
|
40
|
+
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
|
41
|
+
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
|
42
|
+
config.i18n.default_locale = :ru
|
43
|
+
config.i18n.locale = :ru
|
44
|
+
|
45
|
+
# Configure the default encoding used in templates for Ruby 1.9.
|
46
|
+
config.encoding = "utf-8"
|
47
|
+
|
48
|
+
# Configure sensitive parameters which will be filtered from the log file.
|
49
|
+
config.filter_parameters += [:password]
|
50
|
+
|
51
|
+
# Enable escaping HTML in JSON.
|
52
|
+
config.active_support.escape_html_entities_in_json = true
|
53
|
+
|
54
|
+
# Use SQL instead of Active Record's schema dumper when creating the database.
|
55
|
+
# This is necessary if your schema can't be completely dumped by the schema dumper,
|
56
|
+
# like if you have constraints or database-specific column types
|
57
|
+
# config.active_record.schema_format = :sql
|
58
|
+
|
59
|
+
# Enforce whitelist mode for mass assignment.
|
60
|
+
# This will create an empty whitelist of attributes available for mass-assignment for all models
|
61
|
+
# in your app. As such, your models will need to explicitly whitelist or blacklist accessible
|
62
|
+
# parameters by using an attr_accessible or attr_protected declaration.
|
63
|
+
config.active_record.whitelist_attributes = false
|
64
|
+
|
65
|
+
config.active_record.default_timezone = :local
|
66
|
+
config.active_record.time_zone_aware_attributes = false
|
67
|
+
|
68
|
+
# Enable the asset pipeline
|
69
|
+
config.assets.enabled = true
|
70
|
+
|
71
|
+
# Version of your assets, change this if you want to expire all your assets
|
72
|
+
config.assets.version = '1.0'
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
data/config/boot.rb
ADDED
data/config/database.yml
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
development:
|
2
|
+
adapter: sqlite3
|
3
|
+
database: db/development.sqlite3
|
4
|
+
pool: 5
|
5
|
+
timeout: 5000
|
6
|
+
|
7
|
+
test:
|
8
|
+
adapter: sqlite3
|
9
|
+
database: db/test.sqlite3
|
10
|
+
pool: 5
|
11
|
+
timeout: 5000
|
12
|
+
|
13
|
+
production:
|
14
|
+
adapter: sqlite3
|
15
|
+
database: db/production.sqlite3
|
16
|
+
pool: 5
|
17
|
+
timeout: 5000
|
data/config/deploy.rb
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
require 'bundler/capistrano'
|
2
|
+
require 'sidekiq/capistrano'
|
3
|
+
require 'capistrano/ext/multistage'
|
4
|
+
|
5
|
+
set :stages, %w(roundlake-passenger roundlake-trinidad mkb mkb-test)
|
6
|
+
set :default_stage, 'roundlake-passenger'
|
7
|
+
set :application, 'smartkiosk'
|
8
|
+
|
9
|
+
on :start do
|
10
|
+
set :rails_env, 'production'
|
11
|
+
end
|
12
|
+
|
13
|
+
set :repository, 'git@github.com:smartkiosk/smartkiosk-server.git'
|
14
|
+
|
15
|
+
set :keep_releases, 1
|
16
|
+
|
17
|
+
set :use_sudo, false
|
18
|
+
set :user, "deployer"
|
19
|
+
|
20
|
+
set :deploy_to, "/home/deployer/www/#{application}"
|
21
|
+
|
22
|
+
after 'deploy:update_code', 'deploy:configure'
|
23
|
+
before 'deploy:create_symlink', 'deploy:install'
|
24
|
+
|
25
|
+
namespace :deploy do
|
26
|
+
task :configure do
|
27
|
+
run "ln -f #{shared_path}/config/database.yml #{release_path}/config/database.yml"
|
28
|
+
end
|
29
|
+
|
30
|
+
task :install do
|
31
|
+
run "cd #{release_path}; bundle exec rake db:install RAILS_ENV=#{rails_env} SEED_TEST=true"
|
32
|
+
end
|
33
|
+
|
34
|
+
task :restart do
|
35
|
+
run "touch #{current_path}/tmp/restart.txt"
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
Rails.application.class.configure do
|
2
|
+
config.enabled = true
|
3
|
+
|
4
|
+
# Settings specified here will take precedence over those in config/application.rb
|
5
|
+
|
6
|
+
# In the development environment your application's code is reloaded on
|
7
|
+
# every request. This slows down response time but is perfect for development
|
8
|
+
# since you don't have to restart the web server when you make code changes.
|
9
|
+
config.cache_classes = false
|
10
|
+
|
11
|
+
# Log error messages when you accidentally call methods on nil.
|
12
|
+
config.whiny_nils = true
|
13
|
+
|
14
|
+
# Show full error reports and disable caching
|
15
|
+
config.consider_all_requests_local = true
|
16
|
+
config.action_controller.perform_caching = false
|
17
|
+
|
18
|
+
# Don't care if the mailer can't send
|
19
|
+
config.action_mailer.raise_delivery_errors = false
|
20
|
+
|
21
|
+
# Print deprecation notices to the Rails logger
|
22
|
+
config.active_support.deprecation = :log
|
23
|
+
|
24
|
+
# Only use best-standards-support built into browsers
|
25
|
+
config.action_dispatch.best_standards_support = :builtin
|
26
|
+
|
27
|
+
# Raise exception on mass assignment protection for Active Record models
|
28
|
+
config.active_record.mass_assignment_sanitizer = :strict
|
29
|
+
|
30
|
+
# Log the query plan for queries taking more than this (works
|
31
|
+
# with SQLite, MySQL, and PostgreSQL)
|
32
|
+
#config.active_record.auto_explain_threshold_in_seconds = 0.5
|
33
|
+
|
34
|
+
# Do not compress assets
|
35
|
+
config.assets.compress = false
|
36
|
+
|
37
|
+
# Expands the lines which load the assets
|
38
|
+
config.assets.debug = true
|
39
|
+
end
|
@@ -0,0 +1,67 @@
|
|
1
|
+
Rails.application.class.configure do
|
2
|
+
# Settings specified here will take precedence over those in config/application.rb
|
3
|
+
|
4
|
+
# Code is not reloaded between requests
|
5
|
+
config.cache_classes = true
|
6
|
+
|
7
|
+
# Full error reports are disabled and caching is turned on
|
8
|
+
config.consider_all_requests_local = false
|
9
|
+
config.action_controller.perform_caching = true
|
10
|
+
|
11
|
+
# Disable Rails's static asset server (Apache or nginx will already do this)
|
12
|
+
config.serve_static_assets = true
|
13
|
+
|
14
|
+
# Compress JavaScripts and CSS
|
15
|
+
config.assets.compress = true
|
16
|
+
|
17
|
+
# Don't fallback to assets pipeline if a precompiled asset is missed
|
18
|
+
config.assets.compile = false
|
19
|
+
|
20
|
+
# Generate digests for assets URLs
|
21
|
+
config.assets.digest = true
|
22
|
+
|
23
|
+
# Defaults to nil and saved in location specified by config.assets.prefix
|
24
|
+
# config.assets.manifest = YOUR_PATH
|
25
|
+
|
26
|
+
# Specifies the header that your server uses for sending files
|
27
|
+
# config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
|
28
|
+
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
|
29
|
+
|
30
|
+
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
|
31
|
+
# config.force_ssl = true
|
32
|
+
|
33
|
+
# See everything in the log (default is :info)
|
34
|
+
# config.log_level = :debug
|
35
|
+
|
36
|
+
# Prepend all log lines with the following tags
|
37
|
+
# config.log_tags = [ :subdomain, :uuid ]
|
38
|
+
|
39
|
+
# Use a different logger for distributed setups
|
40
|
+
# config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
|
41
|
+
|
42
|
+
# Use a different cache store in production
|
43
|
+
# config.cache_store = :mem_cache_store
|
44
|
+
|
45
|
+
# Enable serving of images, stylesheets, and JavaScripts from an asset server
|
46
|
+
# config.action_controller.asset_host = "http://assets.example.com"
|
47
|
+
|
48
|
+
# Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
|
49
|
+
config.assets.precompile += %w( modules/PIE.htc )
|
50
|
+
|
51
|
+
# Disable delivery errors, bad email addresses will be ignored
|
52
|
+
# config.action_mailer.raise_delivery_errors = false
|
53
|
+
|
54
|
+
# Enable threaded mode
|
55
|
+
config.threadsafe!
|
56
|
+
|
57
|
+
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
|
58
|
+
# the I18n.default_locale when a translation can not be found)
|
59
|
+
config.i18n.fallbacks = true
|
60
|
+
|
61
|
+
# Send deprecation notices to registered listeners
|
62
|
+
config.active_support.deprecation = :notify
|
63
|
+
|
64
|
+
# Log the query plan for queries taking more than this (works
|
65
|
+
# with SQLite, MySQL, and PostgreSQL)
|
66
|
+
# config.active_record.auto_explain_threshold_in_seconds = 0.5
|
67
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
Rails.application.class.configure do
|
2
|
+
# Settings specified here will take precedence over those in config/application.rb
|
3
|
+
|
4
|
+
# The test environment is used exclusively to run your application's
|
5
|
+
# test suite. You never need to work with it otherwise. Remember that
|
6
|
+
# your test database is "scratch space" for the test suite and is wiped
|
7
|
+
# and recreated between test runs. Don't rely on the data there!
|
8
|
+
config.cache_classes = false
|
9
|
+
|
10
|
+
# Configure static asset server for tests with Cache-Control for performance
|
11
|
+
config.serve_static_assets = true
|
12
|
+
config.static_cache_control = "public, max-age=3600"
|
13
|
+
|
14
|
+
# Log error messages when you accidentally call methods on nil
|
15
|
+
config.whiny_nils = true
|
16
|
+
|
17
|
+
# Show full error reports and disable caching
|
18
|
+
config.consider_all_requests_local = true
|
19
|
+
config.action_controller.perform_caching = false
|
20
|
+
|
21
|
+
# Raise exceptions instead of rendering exception templates
|
22
|
+
config.action_dispatch.show_exceptions = false
|
23
|
+
|
24
|
+
# Disable request forgery protection in test environment
|
25
|
+
config.action_controller.allow_forgery_protection = false
|
26
|
+
|
27
|
+
# Tell Action Mailer not to deliver emails to the real world.
|
28
|
+
# The :test delivery method accumulates sent emails in the
|
29
|
+
# ActionMailer::Base.deliveries array.
|
30
|
+
config.action_mailer.delivery_method = :test
|
31
|
+
|
32
|
+
# Raise exception on mass assignment protection for Active Record models
|
33
|
+
config.active_record.mass_assignment_sanitizer = :strict
|
34
|
+
|
35
|
+
# Print deprecation notices to the stderr
|
36
|
+
config.active_support.deprecation = :stderr
|
37
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
require 'active_admin/cancan_integration'
|
2
|
+
require 'active_admin/views/pages/base_fix'
|
3
|
+
require 'active_admin/form_builder_fix'
|
4
|
+
require 'active_admin/resource_controller_fix'
|
5
|
+
require 'active_admin/inputs/filter_numeric_range_input'
|
6
|
+
require 'active_admin/inputs/filter_multiple_select_input'
|
7
|
+
require 'active_admin/inputs/filter_date_range_input_fix'
|
8
|
+
require 'paper_trail/version_fix'
|
9
|
+
require 'formtastic/inputs/selectable_check_boxes'
|
10
|
+
require 'dav4rack/build_resource'
|
11
|
+
|
12
|
+
ActiveAdmin.setup do |config|
|
13
|
+
# TODO: Remove this as soon as AA fixed
|
14
|
+
I18n.locale = :ru
|
15
|
+
I18n.load_path += Dir[File.expand_path("../../locales/**/*.yml", __FILE__)]
|
16
|
+
I18n.reload!
|
17
|
+
|
18
|
+
config.site_title = proc { I18n.t "smartkiosk.admin.title" }
|
19
|
+
|
20
|
+
config.batch_actions = true
|
21
|
+
|
22
|
+
config.namespace :admin do |admin_namespace|
|
23
|
+
admin_namespace.root_to = "dashboard#index"
|
24
|
+
end
|
25
|
+
|
26
|
+
config.authentication_method = :authenticate_user!
|
27
|
+
config.current_user_method = :current_user
|
28
|
+
config.logout_link_path = :destroy_user_session_path
|
29
|
+
|
30
|
+
config.register_javascript 'http://api-maps.yandex.ru/2.0-stable/?load=package.full&lang=ru-RU'
|
31
|
+
end
|
@@ -0,0 +1,7 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
|
4
|
+
# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
|
5
|
+
|
6
|
+
# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
|
7
|
+
# Rails.backtrace_cleaner.remove_silencers!
|