2018-06-26 21:48:25 +00:00
|
|
|
{% extends "base.html" %}
|
|
|
|
{% block content %}
|
|
|
|
<!-- Page Content -->
|
|
|
|
<div class="container" style="margin-bottom:140px;">
|
2018-06-30 23:16:37 +00:00
|
|
|
{% include 'messages.html' %}
|
2018-06-26 21:48:25 +00:00
|
|
|
|
|
|
|
<div class="row">
|
|
|
|
|
|
|
|
<!-- Post Content Column -->
|
|
|
|
<div class="col-lg-12">
|
|
|
|
<!-- Title -->
|
2018-08-18 21:41:31 +00:00
|
|
|
<h1 class="mt-4" style="margin-bottom: 0.1rem;">
|
|
|
|
{{ proposal.headline }}
|
|
|
|
|
|
|
|
<div id="point-wow-left">
|
|
|
|
<img src="/static/point-left.png" style="margin-left: 10px;width: 60px;">
|
|
|
|
<span style="color: #fc4dff;font-size: 16px;font-style: italic;font-weight: bold;margin-left: 6px;">wow</span>
|
|
|
|
</div>
|
|
|
|
</h1>
|
2018-06-26 21:48:25 +00:00
|
|
|
|
2018-07-04 18:37:32 +00:00
|
|
|
<p>
|
|
|
|
<span style="color:grey;">
|
|
|
|
Posted on {{ proposal.date_added.strftime('%Y-%m-%d') }} by <a href="/user/{{ proposal.user.username }}">{{ proposal.user.username}}</a>
|
|
|
|
</span>
|
|
|
|
<br>
|
|
|
|
<span>
|
|
|
|
Status:
|
|
|
|
{% if proposal.status == 0 %}
|
|
|
|
<span style="color:red;">Disabled</span>
|
|
|
|
{% elif proposal.status == 1 %}
|
|
|
|
Seeking community approval
|
|
|
|
{% elif proposal.status == 2 %}
|
|
|
|
Seeking funding
|
|
|
|
{% elif proposal.status == 3 %}
|
2018-08-18 20:51:32 +00:00
|
|
|
WIP / Help needed
|
2018-07-04 19:13:07 +00:00
|
|
|
{% elif proposal.status == 4 %}
|
2018-07-04 18:37:32 +00:00
|
|
|
Completed
|
|
|
|
{% endif %}
|
|
|
|
</span>
|
2018-07-04 21:14:54 +00:00
|
|
|
{% if proposal.status <= 1 %}
|
|
|
|
<br>
|
|
|
|
<span>
|
|
|
|
Target: <b>{{proposal.funds_target|round}}</b> WOW
|
2018-07-12 00:39:49 +00:00
|
|
|
{% if proposal.funds_target_usd %}
|
|
|
|
<small>➞ {{proposal.funds_target_usd}} USD</small>
|
|
|
|
{% endif %}
|
2018-07-04 21:14:54 +00:00
|
|
|
</span>
|
|
|
|
{% endif %}
|
2018-06-26 21:48:25 +00:00
|
|
|
</p>
|
|
|
|
|
|
|
|
<p>
|
2018-06-28 11:47:44 +00:00
|
|
|
{% if proposal.user.username == current_user.username or current_user.admin %}
|
2018-06-26 21:48:25 +00:00
|
|
|
<a href="/proposal/{{proposal.id}}/edit">
|
|
|
|
<button type="button" class="btn btn-success btn-sm">Edit</button>
|
|
|
|
</a>
|
|
|
|
{% endif %}
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<hr>
|
2018-07-04 18:37:32 +00:00
|
|
|
{% if proposal.status >= 2 %}
|
2018-06-26 21:48:25 +00:00
|
|
|
<div class="row">
|
|
|
|
<div class="col-md-12">
|
|
|
|
<div class="card my-4">
|
|
|
|
<h5 class="card-header">Funds</h5>
|
|
|
|
<div class="card-body">
|
|
|
|
<div class="row the-bar">
|
|
|
|
<div class="col-lg-4">
|
|
|
|
<table class="table proposal-info-table">
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<td>Target</td>
|
2018-07-12 00:39:49 +00:00
|
|
|
<td>
|
|
|
|
<span class="badge">{{proposal.funds_target|round}} WOW
|
|
|
|
{% if proposal.funds_target_usd %}
|
|
|
|
<small>➞ {{proposal.funds_target_usd}} USD</small>
|
|
|
|
{% endif %}
|
|
|
|
</span>
|
|
|
|
</td>
|
2018-06-26 21:48:25 +00:00
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>Progress</td>
|
|
|
|
<td><span class="badge">{{proposal.balance['pct'] |round}} %</span></td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-lg-8">
|
|
|
|
{{proposal.balance['txs'] | length}} individual contributions
|
|
|
|
{% if proposal.balance['txs'] %}
|
|
|
|
<small>
|
|
|
|
<a style="margin:4px;" href="#incoming_txs">Details...</a>
|
|
|
|
</small>
|
|
|
|
{% endif %}
|
|
|
|
<div class="progress">
|
|
|
|
<div class="progress-bar progress-monero progress-bar-striped" style="width: 100.0%;">
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<hr>
|
|
|
|
</div>
|
|
|
|
<div class="col-lg-8">
|
|
|
|
{{proposal.balance['remaining'] or 0}} WOW available
|
|
|
|
|
|
|
|
<div class="progress">
|
|
|
|
<div class="progress-bar progress-warning progress-bar" style="width: {{proposal.balance['remaining_pct']}}%;">
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="row" style="margin-top:16px;">
|
|
|
|
<div class="col-lg-12">
|
|
|
|
Donatation address:
|
2018-07-04 18:37:32 +00:00
|
|
|
<pre class="proposal_address">{% if proposal.addr_donation %}{{ proposal.addr_donation }}{% else %}<small>None generated yet</small>{% endif %}</pre>
|
2018-06-26 21:48:25 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2018-07-04 18:37:32 +00:00
|
|
|
{% elif proposal.status == 0 %}
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-lg-12">
|
|
|
|
<div class="alert alert-danger">
|
|
|
|
<img src="/static/doge_head.png" style="width: 64px;margin-right: 8px;">
|
|
|
|
This proposal is disabled.
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
2018-06-26 21:48:25 +00:00
|
|
|
|
|
|
|
<div class="proposal_content">
|
|
|
|
<!-- Post Content -->
|
|
|
|
{{proposal.html | safe}}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
{% include 'comments.html' %}
|
|
|
|
|
|
|
|
<style>
|
|
|
|
#incoming_txs li.list-group-item {
|
|
|
|
padding-top: 4px;
|
|
|
|
padding-bottom: 4px;
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
|
|
|
|
{% if proposal.balance['txs'] %}
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-md-12">
|
|
|
|
<div class="card my-6" id="incoming_txs">
|
|
|
|
<h5 class="card-header">Incoming transactions <small>({{proposal.balance['txs']|length}})</small></h5>
|
|
|
|
<div class="card-body">
|
|
|
|
<ul class="list-group">
|
|
|
|
{% for tx in proposal.balance['txs'] %}
|
|
|
|
<li class="list-group-item">
|
|
|
|
{{tx['datetime'].strftime('%Y-%m-%d %H:%M')}}
|
|
|
|
<span style="float:right"><b>Blockheight</b>: {{tx['height']}}</span>
|
|
|
|
<br>
|
|
|
|
<a target="_blank" href="https://explore.wownero.com/tx/{{tx['txid']}}">{{tx['txid'][:32]}}...</a>
|
2018-07-12 00:39:49 +00:00
|
|
|
<span style="float:right;color:#008926;font-weight:bold;">
|
|
|
|
+ {{tx['amount_human']|round(2)}} WOW
|
|
|
|
{% if 'amount_usd' in tx %}
|
|
|
|
<small style="color: black">
|
|
|
|
➞ $ {{tx['amount_usd']}}
|
|
|
|
</small>
|
|
|
|
{% endif %}
|
|
|
|
</span>
|
2018-06-26 21:48:25 +00:00
|
|
|
</li>
|
|
|
|
{% endfor %}
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<!-- /.row -->
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
2018-08-19 13:48:56 +00:00
|
|
|
<script>
|
|
|
|
$(document).ready(function(){
|
2018-08-19 14:16:36 +00:00
|
|
|
let regexp_xss = /^[a-zA-Z0-9.:\/]+$/;
|
2018-08-19 13:48:56 +00:00
|
|
|
let regexp_address = /(W[o|W][a-zA-Z0-9]{95})/g;
|
2018-08-19 14:20:26 +00:00
|
|
|
let regexp_imgur = /(https:\/\/i.imgur.com\/[a-zA-Z0-9]{0,7}.[jpg|png|gif|webm]+)/g;
|
2018-08-19 14:16:36 +00:00
|
|
|
let regexp_imgflip = /(https:\/\/i.imgflip.com\/[a-zA-Z0-9]{0,7}.[jpg|png|gif|webm]+)/g;
|
2018-08-19 13:48:56 +00:00
|
|
|
let truncated_addy = function(obj){ return `<span data-addy="${obj}" class="wow_addy">${obj.substring(0, 4)}...${obj.slice(-4)}</span>`; }
|
|
|
|
|
|
|
|
function rich_addy(obj) {
|
2018-08-19 14:16:36 +00:00
|
|
|
// richtext addy's
|
2018-08-19 13:48:56 +00:00
|
|
|
let html = obj.html();
|
|
|
|
var matches = html.match(regexp_address);
|
|
|
|
if(matches) {
|
|
|
|
matches.filter(function(value, index,self){ return self.indexOf(value) === index; }).forEach(function (obj) {
|
|
|
|
html = html.replace(new RegExp(obj, 'g'), truncated_addy(obj));
|
|
|
|
});
|
|
|
|
}
|
|
|
|
obj.html(html);
|
|
|
|
}
|
|
|
|
|
|
|
|
function rich_img(obj) {
|
2018-08-19 14:16:36 +00:00
|
|
|
// convert images to <img>
|
|
|
|
let html = obj.html();
|
2018-08-19 14:20:26 +00:00
|
|
|
let uid = obj.attr('data-id');
|
|
|
|
if(uid == 30){
|
|
|
|
debugger;
|
|
|
|
}
|
|
|
|
|
2018-08-19 14:16:36 +00:00
|
|
|
var matches = html.match(regexp_imgur) || [];
|
|
|
|
matches = matches.concat(html.match(regexp_imgflip));
|
|
|
|
if(matches) {
|
|
|
|
matches.filter(function (value, index, self) {
|
|
|
|
return self.indexOf(value) === index && typeof value === 'string';
|
|
|
|
}).forEach(function (obj) {
|
|
|
|
html = html.replace(new RegExp(obj, 'g'), `<br><img src="${obj}"/></a><br>`)
|
|
|
|
});
|
|
|
|
}
|
|
|
|
obj.html(html);
|
2018-08-19 13:48:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
$(document).on('click', '.wow_addy', function(event){
|
|
|
|
let obj = $(this);
|
|
|
|
if(obj.attr('data-active') === "true"){
|
|
|
|
//obj.attr('data-active', 'false');
|
|
|
|
//obj.html(truncated_addy(obj.attr('data-addy')));
|
|
|
|
} else {
|
|
|
|
obj.attr('data-active', 'true');
|
|
|
|
obj.html(obj.attr('data-addy'));
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
$('.comments-panel .comment-container .media-body span.body').each(function (i, obj){
|
|
|
|
obj = $(obj);
|
|
|
|
|
|
|
|
// convert images to <img>
|
|
|
|
rich_img(obj);
|
|
|
|
|
|
|
|
// truncate addys
|
|
|
|
let html = rich_addy(obj);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
2018-06-26 21:48:25 +00:00
|
|
|
<!-- /.container -->
|
|
|
|
{% endblock %}
|