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
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
{% from 'proposal/macros/comment.html' import comment_entry %}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="card my-6" id="incoming_txs">
|
||||
|
@ -18,69 +20,14 @@
|
|||
<input type="submit" value="add comment">
|
||||
</form>
|
||||
{% else %}
|
||||
You need to be logged in to comment.
|
||||
You need to be <a href="{{ url_for('login') }}">logged in</a> to comment.
|
||||
<br>
|
||||
{% endif %}
|
||||
|
||||
<br>
|
||||
|
||||
{% for c in proposal._comments %}
|
||||
<!-- Single Comment -->
|
||||
<div class="media mb-4 comment-container" id="comment-{{c.id}}">
|
||||
<div class="votearrow" title="upvote"></div>
|
||||
<div class="media-body">
|
||||
<span class="username">
|
||||
<a href="/user/{{ c.user.username }}">
|
||||
{{c.user.username}}
|
||||
{% if c.user.username == proposal.user.username %}
|
||||
<small>[op]</small>
|
||||
{% endif %}
|
||||
{% if c.user.admin %}
|
||||
<small>[admin]</small>
|
||||
{% endif %}
|
||||
</a>
|
||||
</span>
|
||||
<span class="date_posted">
|
||||
<a href="/proposal/{{proposal.id}}#comment-{{c.id}}">
|
||||
{{c.date_added.strftime('%Y-%m-%d %H:%M')}}
|
||||
</a>
|
||||
</span><br>
|
||||
<span data-id="{{c.id}}" class="body" style="{% if c.automated %}color:blue;{% endif %};word-break: break-all;">{{c.message}}</span>
|
||||
<br>
|
||||
{% if not c.automated %}
|
||||
<a class="reply" href="{{url_for('propsal_comment_reply', cid=c.id, pid=proposal.id)}}">reply</a>
|
||||
{% endif %}
|
||||
|
||||
{% for _c in c.comments %}
|
||||
<div class="media mt-4 comment-container" id="comment-{{_c.id}}">
|
||||
<div class="votearrow" title="upvote"></div>
|
||||
<div class="media-body" id="comment">
|
||||
<span class="username">
|
||||
<a href="/user/{{ _c.user.username }}">
|
||||
{{_c.user.username}}
|
||||
{% if _c.user.username == proposal.user.username %}
|
||||
<small>[op]</small>
|
||||
{% endif %}
|
||||
{% if _c.user.admin %}
|
||||
<small>[admin]</small>
|
||||
{% endif %}
|
||||
|
||||
</a>
|
||||
</span>
|
||||
<span class="date_posted">
|
||||
<a href="/proposal/{{proposal.id}}#comment-{{_c.id}}">
|
||||
{{_c.date_added.strftime('%Y-%m-%d %H:%M')}}
|
||||
</a>
|
||||
</span>
|
||||
<br>
|
||||
<span data-id="{{_c.id}}" class="body" style="word-break: break-all;">
|
||||
{{_c.message}}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% for c in proposal._comments if not c.automated %}
|
||||
{{ comment_entry(c, proposal) }}
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -95,11 +95,14 @@
|
|||
</div>
|
||||
<div class="col-lg-8">
|
||||
{{proposal.balance['available']|round(3) or 0 }} WOW Raised
|
||||
{% if (proposal.funds_target-proposal.balance['available']|float|round(3)) > 0 %}
|
||||
{% set remaining = proposal.funds_target - proposal.balance['available']|float|round(3) %}
|
||||
|
||||
{% if remaining > 0 %}
|
||||
({{ (proposal.funds_target - proposal.balance['available']|float|round(3)|int) }} WOW until goal)
|
||||
{% else %}
|
||||
{% elif remaining < 0 %}
|
||||
({{ (proposal.balance['available']-proposal.funds_target|float|round(3)|int) }} WOW past goal!)
|
||||
{% endif %}
|
||||
|
||||
<div class="progress">
|
||||
<div class="progress-bar progress-warning progress-bar" style="width: {{proposal.balance['pct']}}%;">
|
||||
</div>
|
||||
|
@ -112,7 +115,7 @@
|
|||
<div class="col-lg-8">
|
||||
{{proposal.spends['spent']|round(3) or 0}} WOW Paid out
|
||||
<div class="progress">
|
||||
<div class="progress-bar progress-warning progress-bar" style="width: {{proposal.spends['spent_remaining_pct']}}%;">
|
||||
<div class="progress-bar progress-warning progress-bar" style="width: {{proposal.spends['remaining_pct']}}%;">
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
|
@ -231,6 +234,21 @@
|
|||
</div>
|
||||
<!-- /.row -->
|
||||
{% endif %}
|
||||
|
||||
{% from 'proposal/macros/comment.html' import comment_entry %}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="card my-6" id="incoming_txs">
|
||||
<h5 id="comments" class="card-header">Events</h5>
|
||||
<div class="card-body comments-panel">
|
||||
{% for c in proposal._comments if c.automated %}
|
||||
{{ comment_entry(c, proposal) }}
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
|
|
Loading…
Reference in a new issue