mirror of
https://git.wownero.com/wownero/wownero-funding-system.git
synced 2024-08-15 00:53:45 +00:00
Some template changes
This commit is contained in:
parent
470173db63
commit
92eac2ee20
3 changed files with 56 additions and 89 deletions
|
@ -246,7 +246,9 @@ class Proposal(base):
|
|||
print('error; get_transfers_out; %d' % self.id)
|
||||
return rtn
|
||||
|
||||
data['remaining_pct'] = 0.0
|
||||
prices = Summary.fetch_prices()
|
||||
|
||||
for tx in data['txs']:
|
||||
if prices:
|
||||
tx['amount_usd'] = coin_to_usd(amt=tx['amount_human'], btc_per_coin=prices['coin-btc'], usd_per_btc=prices['btc-usd'])
|
||||
|
@ -259,10 +261,10 @@ class Proposal(base):
|
|||
data['pct'] = 0.0
|
||||
data['spent'] = 0.0
|
||||
|
||||
if data['spent']:
|
||||
data['remaining_pct'] = 100 / float(data['sum'] / data['spent'])
|
||||
else:
|
||||
data['remaining_pct'] = 0.0
|
||||
cache_key_in = 'coin_balance_pid_%d' % self.id
|
||||
data_in = cache.get(cache_key_in)
|
||||
if data_in and data['spent']:
|
||||
data['remaining_pct'] = 100 / float(data_in['sum'] / data['spent'])
|
||||
|
||||
return data
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue