From e6365fcc934b2af84ab45da94c020c704b4b8444 Mon Sep 17 00:00:00 2001 From: Tanguy Pruvot Date: Mon, 25 Apr 2016 10:04:55 +0200 Subject: [PATCH] wallet: refactor graphes + vertical scroll to show more txs --- web/yaamp/modules/site/coin.php | 47 ++-- web/yaamp/modules/site/coin_market_graph.php | 210 ++++++++++++++++ web/yaamp/modules/site/coin_results.php | 250 ++----------------- 3 files changed, 258 insertions(+), 249 deletions(-) create mode 100644 web/yaamp/modules/site/coin_market_graph.php diff --git a/web/yaamp/modules/site/coin.php b/web/yaamp/modules/site/coin.php index eef84bb..12785c2 100644 --- a/web/yaamp/modules/site/coin.php +++ b/web/yaamp/modules/site/coin.php @@ -8,9 +8,6 @@ if (!$coin) { $this->pageTitle = 'Wallet - '.$coin->symbol; -$maxrows = arraySafeVal($_REQUEST,'rows',15); -$since = arraySafeVal($_REQUEST,'since',time()-(7*24*3600)); - if (!empty($coin->algo) && $coin->algo != 'PoS') user()->setState('yaamp-algo', $coin->algo); @@ -23,15 +20,10 @@ $sellamount = $coin->balance; echo getAdminSideBarLinks().'

'; echo getAdminWalletLinks($coin, $info, 'wallet'); -echo '
'; +$maxrows = arraySafeVal($_REQUEST,'rows', 200); +$since = arraySafeVal($_REQUEST,'since', time() - (7*24*3600)); // one week -// todo: use router createUrl -$url = '/site/coin?id='.$coin->id.'&since='.(time()-31*24*3600).'&rows='.($maxrows*2); -$moreurl = CHtml::link('Click here to show more transactions...', $url); - -echo '

'.$moreurl.'
'; - -echo '
'; +echo '
'; /* echo "
MAKE CONFIG & START"; @@ -60,15 +52,30 @@ echo <<CLEAR EARNINGS
UPDATE BLOCKS
DO PAYMENTS - -









-









-









- +
+ +
+ +end; + +JavascriptReady("graph_refresh(); $(window).resize(graph_refresh);"); \ No newline at end of file diff --git a/web/yaamp/modules/site/coin_results.php b/web/yaamp/modules/site/coin_results.php index 95c931a..a85b38b 100644 --- a/web/yaamp/modules/site/coin_results.php +++ b/web/yaamp/modules/site/coin_results.php @@ -35,17 +35,12 @@ echo ", ".CHtml::link($reserved1, "/site/payments?id=".$coin->id)." $symbol clea ////////////////////////////////////////////////////////////////////////////////////// echo << -tr.ssrow.bestmarket { background-color: #dfd; } -tr.ssrow.disabled { background-color: #fdd; color: darkred; } -tr.ssrow.orphan { color: darkred; } - - +
- - - + + + @@ -57,7 +52,7 @@ tr.ssrow.orphan { color: darkred; } end; -$list = getdbolist('db_markets', "coinid={$coin->id} ORDER BY price DESC"); +$list = getdbolist('db_markets', "coinid={$coin->id} ORDER BY disabled, priority, price DESC"); $bestmarket = getBestMarket($coin); foreach($list as $market) @@ -119,13 +114,13 @@ foreach($list as $market) echo 'enable'; else echo 'disable'; - echo ' delete'; + echo ' delete'; echo ''; echo ""; } -echo "
NamePricePrice2MarketBidAsk Deposit Balance Locked

"; +echo "
"; ////////////////////////////////////////////////////////////////////////////////////// @@ -144,7 +139,7 @@ if ($DCR) { $tickets += arraySafeVal($stakeinfo, 'immature', 0); } -echo ''; +echo '
'; echo ''; echo ''; echo ''; @@ -193,7 +188,7 @@ $blocks = isset($info['blocks'])? $info['blocks']: ''; echo ''; if(!empty($errors)) - echo ""; + echo ''; else echo ""; @@ -217,17 +212,16 @@ echo ''; echo ''; echo '
'.round_difficulty($coin->difficulty).'$blocks'.$blocks.'$blocks'.$index.'
'; -echo '
'; - ////////////////////////////////////////////////////////////////////////////////////// // last week $list_since = arraySafeVal($_GET,'since',time()-(7*24*3600)); -$maxrows = arraySafeVal($_GET,'rows', 15); +$maxrows = arraySafeVal($_GET,'rows', 200); $maxrows = min($maxrows, 2500); echo << @@ -375,10 +369,16 @@ foreach($txs_array as $tx) echo '
'; +$url = '/site/coin?id='.$coin->id.'&since='.(time()-31*24*3600).'&rows='.($maxrows*2); +$moreurl = CHtml::link('Click here to show more transactions...', $url); + +echo '
'.$moreurl.'
'; +echo '
'; + ////////////////////////////////////////////////////////////////////////////////////// echo << +
@@ -426,216 +426,6 @@ if (empty($sums)) { echo '
'; -////////////////////////////////////////////////////////////////////////////////////// - -if (strpos(YIIMP_WATCH_CURRENCIES, $coin->symbol) === false) return; - -JavascriptFile("/extensions/jqplot/jquery.jqplot.js"); -JavascriptFile("/extensions/jqplot/plugins/jqplot.enhancedLegendRenderer.js"); -JavascriptFile("/extensions/jqplot/plugins/jqplot.dateAxisRenderer.js"); -JavascriptFile("/extensions/jqplot/plugins/jqplot.highlighter.js"); - -echo << -#graph_history_price, #graph_history_balance { - width: 75%; height: 300px; float: right; - margin-top: 16px; +if (strpos(YIIMP_WATCH_CURRENCIES, $coin->symbol) !== false) { + $this->renderPartial('coin_market_graph', array('coin'=>$coin)); } -.jqplot-title { - margin-bottom: 3px; -} -.jqplot-cursor-tooltip, -.jqplot-highlighter-tooltip { - background: rgba(220,220,220, .5) !important; - border: 1px solid gray; - padding: 2px 4px; -} -.jqplot-xaxis-tick { - margin-top: 4px; -} -.jqplot-y2axis-tick { - font-size: 7pt; - margin-top: -4px; - margin-left: 8px; - width: 36px; -} -.jqplot-table-legend-swatch { - height: 8px; - width: 8px; - margin-top: 2px; - margin-left: 16px; -} - - -
-
- - -end; - -JavascriptReady("graph_refresh(); $(window).resize(graph_refresh);"); \ No newline at end of file