Skip to content

Commit

Permalink
Latest changes: security, UI, models
Browse files Browse the repository at this point in the history
  • Loading branch information
demuskov committed Mar 21, 2018
1 parent 550bda5 commit a75b73b
Show file tree
Hide file tree
Showing 56 changed files with 9,233 additions and 1,205 deletions.
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -515,4 +515,4 @@ DEPENDENCIES
whenever (~> 0.9.2)

BUNDLED WITH
1.15.4
1.16.1
4 changes: 3 additions & 1 deletion app/api/api_v2/helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ def format_ticker(ticker)
low: ticker[:low],
high: ticker[:high],
last: ticker[:last],
vol: ticker[:volume]
vol: ticker[:volume],
volbtc: ticker[:volume2],
change: if ticker[:open] == 0 then 0 else (ticker[:last]-ticker[:open])/ticker[:open] end
}
}
end
Expand Down
7 changes: 3 additions & 4 deletions app/assets/javascripts/component_ui/market_switch.js.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,10 @@ window.MarketSwitchUI = flight.component ->
.attr('title', ticker.last)
.html("<span class='#{trend}'>#{formatter.ticker_price ticker.last}</span>")

p1 = parseFloat(ticker.open)
p2 = parseFloat(ticker.last)
trend = formatter.trend(p1 <= p2)

if @current_unit == 'volume'
p1 = parseFloat(ticker.open)
p2 = parseFloat(ticker.last)
trend = formatter.trend(p1 <= p2)
select.find('td.change').html("<span class='#{trend}'>#{formatter.price_change(p1, p2)}%</span>")
else
select.find('td.change').html("<span class='#{trend}'>#{formatter.round(ticker.volume2, 4)}</span>")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,6 @@ app.directive 'accounts', ->
else
$scope.accounts = Account.select (item) ->
return (parseFloat(item.balance) + parseFloat(item.locked) > 0.0000000001)
@selectedCurrency = window.location.hash.split('/')[2] || $scope.accounts[0].currency
$scope.currency = @selectedCurrency
ctrl.state.transitionTo("deposits.currency", {currency: @selectedCurrency})
ctrl.selectedCurrency = @selectedCurrency
ctrl.currentAction = "deposits"
$scope.$apply()

# Might have a better way
Expand Down
50 changes: 50 additions & 0 deletions app/assets/javascripts/funds/models/withdraw.js.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,56 @@ class Withdraw extends PeatioModel.Model
when 'mmb' then 'mambocoins'
when 'pnx' then 'phantomxcoins'
when 'mix' then 'mixcoins'
when 'kreds' then 'kredscoins'
when 'bkt' then 'bankittcoins'
when 'snx' then 'snxcoins'
when 'giro' then 'girocoins'
when 'onex' then 'onexcoins'
when 'pushi' then 'pushicoins'
when 'vrt' then 'virtuscoins'
when 'zaca' then 'zacacoins'
when 'xhm' then 'xhimeracoins'
when 'xar' then 'xarucoins'
when 'rupx' then 'rupayacoins'
when 'frm' then 'ferrumcoins'
when 'men' then 'peoplecoins'
when 'mun' then 'muncoins'
when 'onemc' then 'millioncoins'
when 'alp' then 'alphacoins'
when 'zel' then 'zelcashcoins'
when 'amx' then 'amerocoins'
when 'pew' then 'brofistcoins'
when 'fsc' then 'friendshipcoins'
when 'sln' then 'salencoins'
when 'usx' then 'unifiedsocietycoins'
when 'bsx' then 'bitspacecoins'
when 'eot' then 'eotcoins'
when 'xap' then 'apolloncoins'
when 'miac' then 'miacoins'
when 'kc' then 'krakencoins'
when 'arhm' then 'archimedcoins'
when 'olmp' then 'olympiccoins'
when 'onz' then 'onzcoins'
when 'agn' then 'agenacoins'
when 'crz' then 'corezcoins'
when 'enix' then 'enixtcoins'
when 'snc' then 'stannumcoins'
when 'quaz' then 'quazcoins'
when 'scriv' then 'scrivcoins'
when 'ethf' then 'ethfcoins'
when 'arepa' then 'arepacoins'
when 'sub1x' then 'sub1xcoins'
when 'cheese' then 'cheesecoins'
when 'jiyo' then 'jiyocoins'
when 'pyro' then 'pyrocoins'
when 'roe' then 'rovercoins'
when 'citr' then 'citruscoins'
when 'xen' then 'xeoncoins'
when 'edl' then 'edollarcoins'
when 'cru' then 'curiumcoins'
when 'ndc' then 'needlecoins'
when 'zls' then 'zaliascoins'
when 'proton' then 'protoncoins'
#currency

window.Withdraw = Withdraw
54 changes: 54 additions & 0 deletions app/assets/javascripts/locales/en.js.erb
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,60 @@




























































Expand Down
6 changes: 4 additions & 2 deletions app/assets/stylesheets/features/funds.css.scss
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@
}
.currency-logo {
text-align: center;
width: 20%;
max-width: 90px;
min-width: 90px;
img {
max-height: 32px;
max-width: 32px;
Expand All @@ -108,7 +109,8 @@
}
.currency-state {
text-align: center;
width: 40%;
max-width: 16px;
max-height: 16px;
padding: 3px 0px 0;
img {
max-height: 12px;
Expand Down
29 changes: 29 additions & 0 deletions app/assets/stylesheets/market.css.scss
Original file line number Diff line number Diff line change
Expand Up @@ -707,6 +707,35 @@ chat_tabs_wrapper {
&.pew { tr.quote-pew { display: block; } }
&.fsc { tr.quote-fsc { display: block; } }
&.sln { tr.quote-sln { display: block; } }
&.usx { tr.quote-usx { display: block; } }
&.bsx { tr.quote-bsx { display: block; } }
&.eot { tr.quote-eot { display: block; } }
&.xap { tr.quote-xap { display: block; } }
&.miac { tr.quote-miac { display: block; } }
&.kc { tr.quote-kc { display: block; } }
&.arhm { tr.quote-arhm { display: block; } }
&.olmp { tr.quote-olmp { display: block; } }
&.onz { tr.quote-onz { display: block; } }
&.agn { tr.quote-agn { display: block; } }
&.crz { tr.quote-crz { display: block; } }
&.enix { tr.quote-enix { display: block; } }
&.snc { tr.quote-snc { display: block; } }
&.quaz { tr.quote-quaz { display: block; } }
&.scriv { tr.quote-scriv { display: block; } }
&.ethf { tr.quote-ethf { display: block; } }
&.arepa { tr.quote-arepa { display: block; } }
&.sub1x { tr.quote-sub1x { display: block; } }
&.cheese { tr.quote-cheese { display: block; } }
&.jiyo { tr.quote-jiyo { display: block; } }
&.pyro { tr.quote-pyro { display: block; } }
&.roe { tr.quote-roe { display: block; } }
&.citr { tr.quote-citr { display: block; } }
&.xen { tr.quote-xen { display: block; } }
&.edl { tr.quote-edl { display: block; } }
&.cru { tr.quote-cru { display: block; } }
&.ndc { tr.quote-ndc { display: block; } }
&.zls { tr.quote-zls { display: block; } }
&.proton { tr.quote-proton { display: block; } }
/*markets*/
}
}
Expand Down
6 changes: 3 additions & 3 deletions app/controllers/admin/withdraws/banks_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ class BanksController < ::Admin::Withdraws::BaseController
load_and_authorize_resource :class => '::Withdraws::Bank'

def index
start_at = DateTime.now.ago(60 * 60 * 24)
@one_banks = @banks.with_aasm_state(:accepted, :processing).order("id DESC")
@all_banks = @banks.without_aasm_state(:accepted, :processing).where('created_at > ?', start_at).order("id DESC")
start_at = DateTime.now.ago(60 * 60 * 24 * 3)
@one_banks = @banks.with_aasm_state(:almost_done, :processing).order("id DESC")
@all_banks = @banks.without_aasm_state(:almost_done, :processing).where('created_at > ?', start_at).order("id DESC")
end

def show
Expand Down
6 changes: 3 additions & 3 deletions app/controllers/admin/withdraws/doges_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ class DogesController < ::Admin::Withdraws::BaseController
load_and_authorize_resource :class => '::Withdraws::Doge'

def index
start_at = DateTime.now.ago(60 * 60 * 24)
@one_doges = @doges.with_aasm_state(:accepted).order("id DESC")
@all_doges = @doges.without_aasm_state(:accepted).where('created_at > ?', start_at).order("id DESC")
start_at = DateTime.now.ago(60 * 60 * 24 * 3)
@one_doges = @doges.with_aasm_state(:almost_done).order("id DESC")
@all_doges = @doges.without_aasm_state(:almost_done).where('created_at > ?', start_at).order("id DESC")
end

def show
Expand Down
6 changes: 3 additions & 3 deletions app/controllers/admin/withdraws/ethers_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ class EthersController < ::Admin::Withdraws::BaseController
load_and_authorize_resource :class => '::Withdraws::Ether'

def index
start_at = DateTime.now.ago(60 * 60 * 24)
@one_ethers = @ethers.with_aasm_state(:accepted).order("id DESC")
@all_ethers = @ethers.without_aasm_state(:accepted).where('created_at > ?', start_at).order("id DESC")
start_at = DateTime.now.ago(60 * 60 * 24 * 3)
@one_ethers = @ethers.with_aasm_state(:almost_done).order("id DESC")
@all_ethers = @ethers.without_aasm_state(:almost_done).where('created_at > ?', start_at).order("id DESC")
end

def show
Expand Down
6 changes: 3 additions & 3 deletions app/controllers/admin/withdraws/gravios_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ class GraviosController < ::Admin::Withdraws::BaseController
load_and_authorize_resource :class => '::Withdraws::Gravio'

def index
start_at = DateTime.now.ago(60 * 60 * 24)
@one_gravios = @gravios.with_aasm_state(:accepted).order("id DESC")
@all_gravios = @gravios.without_aasm_state(:accepted).where('created_at > ?', start_at).order("id DESC")
start_at = DateTime.now.ago(60 * 60 * 24 * 3)
@one_gravios = @gravios.with_aasm_state(:almost_done).order("id DESC")
@all_gravios = @gravios.without_aasm_state(:almost_done).where('created_at > ?', start_at).order("id DESC")
end

def show
Expand Down
6 changes: 3 additions & 3 deletions app/controllers/admin/withdraws/ltcs_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ class LtcsController < ::Admin::Withdraws::BaseController
load_and_authorize_resource :class => '::Withdraws::Ltc'

def index
start_at = DateTime.now.ago(60 * 60 * 24)
@one_ltcs = @ltcs.with_aasm_state(:accepted).order("id DESC")
@all_ltcs = @ltcs.without_aasm_state(:accepted).where('created_at > ?', start_at).order("id DESC")
start_at = DateTime.now.ago(60 * 60 * 24 * 3)
@one_ltcs = @ltcs.with_aasm_state(:almost_done).order("id DESC")
@all_ltcs = @ltcs.without_aasm_state(:almost_done).where('created_at > ?', start_at).order("id DESC")
end

def show
Expand Down
6 changes: 3 additions & 3 deletions app/controllers/admin/withdraws/poseidons_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ class PoseidonsController < ::Admin::Withdraws::BaseController
load_and_authorize_resource :class => '::Withdraws::Poseidon'

def index
start_at = DateTime.now.ago(60 * 60 * 24)
@one_poseidons = @poseidons.with_aasm_state(:accepted).order("id DESC")
@all_poseidons = @poseidons.without_aasm_state(:accepted).where('created_at > ?', start_at).order("id DESC")
start_at = DateTime.now.ago(60 * 60 * 24 * 3)
@one_poseidons = @poseidons.with_aasm_state(:almost_done).order("id DESC")
@all_poseidons = @poseidons.without_aasm_state(:almost_done).where('created_at > ?', start_at).order("id DESC")
end

def show
Expand Down
6 changes: 3 additions & 3 deletions app/controllers/admin/withdraws/satoshis_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ class SatoshisController < ::Admin::Withdraws::BaseController
load_and_authorize_resource :class => '::Withdraws::Satoshi'

def index
start_at = DateTime.now.ago(60 * 60 * 24)
@one_satoshis = @satoshis.with_aasm_state(:accepted).order("id DESC")
@all_satoshis = @satoshis.without_aasm_state(:accepted).where('created_at > ?', start_at).order("id DESC")
start_at = DateTime.now.ago(60 * 60 * 24 * 3)
@one_satoshis = @satoshis.with_aasm_state(:almost_done).order("id DESC")
@all_satoshis = @satoshis.without_aasm_state(:almost_done).where('created_at > ?', start_at).order("id DESC")
end

def show
Expand Down
Loading

0 comments on commit a75b73b

Please sign in to comment.