mirror of
https://git.wownero.com/wownero/wownero-funding-system.git
synced 2024-08-15 00:53:45 +00:00
folder rename; future commits make sense after this
This commit is contained in:
parent
09d0f09d8e
commit
f473a4234e
71 changed files with 0 additions and 0 deletions
192
funding/templates/proposal/disclaimer.html
Normal file
192
funding/templates/proposal/disclaimer.html
Normal file
|
@ -0,0 +1,192 @@
|
|||
{% extends "base.html" %}
|
||||
{% block content %}
|
||||
|
||||
<style>
|
||||
.container>.row>div{
|
||||
margin-bottom:10px;
|
||||
}
|
||||
</style>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<div class="alert alert-danger">
|
||||
<img src="/static/doge_head.png" style="
|
||||
width: 64px;
|
||||
margin-right: 8px;
|
||||
">
|
||||
<p style="margin-top:10px;margin-bottom:0px;">
|
||||
<b>The Wownero Funding System maintains standardized rules for proposal submission.</b>
|
||||
Please read the following disclaimer carefully before submitting yours.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">WFS length</h5>
|
||||
<p class="card-text">
|
||||
Tasks should be capable of being completed within <b>90 days</b> of the proposal reaching the target funding unless the proposal is a bounty.
|
||||
</p>
|
||||
<p>
|
||||
Having indefinite, open-ended tasks could lead to <b>mission creep</b> and expanded completion time, which is not ideal because the value of WOW could become volatile.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Measurable Outcome(s)</h5>
|
||||
<p class="card-text">
|
||||
Proposals should have an <b>objectively measurable outcome</b>, not aspirational.
|
||||
</p>
|
||||
<p>
|
||||
A WFS should make the Wownero network stronger, raising liquidity, or attracting more developers/community members.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Estimated costs</h5>
|
||||
<p class="card-text">
|
||||
Proposals should break down estimated costs per item and number of hours for labor per task.
|
||||
</p>
|
||||
<p>
|
||||
<b>The costs should be comparable to the fair market value at the time the proposal is made</b>.
|
||||
The exchange rates are based on the prevailing price of WOW and BTC on TradeOgre and CoinMarketCap.
|
||||
</p>
|
||||
<p>
|
||||
A 10% premium above costs may be added to take into account of volatility.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Unwanted marketing</h5>
|
||||
<p class="card-text">
|
||||
A donation address <b>should not</b> be included in the proposal that would bypass the WFS mechanism.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Inactivity</h5>
|
||||
<p class="card-text">
|
||||
If a proposal is partially completed by one developer that subsequentlay abandons the project,
|
||||
<b>another developer can take up any outstanding milestones</b>. Developers will be compensated
|
||||
in proportion with the work that has been completed. A proposal is considered abandoned if
|
||||
the developer is MIA for more than 60 days.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Headstart</h5>
|
||||
<p class="card-text">
|
||||
A proposal can begin before it's fully funded.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Early payouts</h5>
|
||||
<p class="card-text">
|
||||
Developers can be paid for completed milestones <b>before</b> a proposal is fully funded.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Failed to raise funds</h5>
|
||||
<p class="card-text">
|
||||
If a proposal has not been fully funded within 60 days, the proposal may be cancelled and
|
||||
<b>any amount raised automatically transferred to the general development fund</b>. However, if a
|
||||
developer has taken on a milestone, the proposal may remain open unless it is later considered abandoned.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Adjustments</h5>
|
||||
<p class="card-text">
|
||||
Minor amendments may be made to proposals <b>as long it is within the general spirit of the original
|
||||
proposal</b>. However, for major changes, the developer should bring up the proposed change on IRC and
|
||||
open a meta issue. There should be a rough consensus for accepting major changes to proposals.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Review</h5>
|
||||
<p class="card-text">
|
||||
Before a proposal is moved to 'Seeking Funding' status, <b>an administrator will review the proposal</b>
|
||||
to ensure it is sufficiently detailed and it meets the basic requirements of the WFS Rules. An
|
||||
administrator may ask the developer to clarify ideas or break up tasks into multiple milestones.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">License</h5>
|
||||
<p class="card-text">
|
||||
Any software funded by WFS will be <b>open sourced under a MIT license</b> authored by the Wownero Project.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" style="margin-bottom: 160px;margin-top:20px;">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<a href="/proposal/add">
|
||||
<button class="btn btn-primary">Yes yes, I understand.</button>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<!-- /.container -->
|
||||
{% endblock %}
|
179
funding/templates/proposal/edit.html
Normal file
179
funding/templates/proposal/edit.html
Normal file
|
@ -0,0 +1,179 @@
|
|||
{% extends "base.html" %}
|
||||
{% block content %}
|
||||
<!-- Page Content -->
|
||||
|
||||
<div class="container">
|
||||
{% include 'messages.html' %}
|
||||
|
||||
{% if logged_in %}
|
||||
{% if proposal %}
|
||||
{% set headline = proposal.headline %}
|
||||
{% set content = proposal.content %}
|
||||
{% set date_added = proposal.date_added.strftime('%Y-%m-%d') %}
|
||||
{% set pid = proposal.id %}
|
||||
{% set funds_target = proposal.funds_target %}
|
||||
{% set addr_receiving = proposal.addr_receiving if proposal.addr_receiving else '' %}
|
||||
{% else %}
|
||||
{% set headline = '' %}
|
||||
{% set content = '' %}
|
||||
{% set date_added = '' %}
|
||||
{% set pid = '' %}
|
||||
{% set funds_target = '' %}
|
||||
{% set addr_receiving = '' %}
|
||||
{% endif %}
|
||||
|
||||
<div class="row">
|
||||
<!-- Post Content Column -->
|
||||
<div class="col-lg-8">
|
||||
<h2 style="padding-top:0">Add proposal</h2>
|
||||
|
||||
<p style="padding-top:0">
|
||||
This page allows you to add your funding proposal. Some help:
|
||||
</p>
|
||||
|
||||
<ol>
|
||||
<li>Proposals are written in Markdown format. Use the HTML preview functionality of the editor.</li>
|
||||
<li>Introduce yourself, investors would like to know who they are funding</li>
|
||||
<li>Try to seek out community approval for your idea(s) before submitting a request</li>
|
||||
<li>Keep it short and clean</li>
|
||||
<li>Good luck!</li>
|
||||
</ol>
|
||||
|
||||
<form id="news_post" role="form" lpformnum="2" _lpchecked="1" onsubmit="return false;">
|
||||
{% if current_user.admin %}
|
||||
<hr>
|
||||
<h4>Admin options:</h4>
|
||||
<div class="form-group">
|
||||
<label for="status">Move proposal to:</label>
|
||||
<select class="form-control form-admin" id="status" name="status">
|
||||
{% for k, v in funding_statuses.items() %}
|
||||
<option value="{{k}}"{% if proposal and k == proposal.status %} selected{% elif not proposal and k == 1 %} selected{% endif %}>{{v.capitalize()}}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
{% endif %}
|
||||
<hr>
|
||||
<!-- text input -->
|
||||
<div class="form-group">
|
||||
<label>Title</label>
|
||||
<input id="title" type="text" name="title" class="form-control" placeholder="Title" value="{{ headline }}">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Proposal Date</label>
|
||||
<input type="text" class="form-control" value="{{ date_added }}" disabled="">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Target <small>(In WOW)</small></label>
|
||||
<input {% if funds_target %}disabled{% endif %} id="funds_target" type="text" name="funds_target" class="form-control" placeholder="Target" value="{{ funds_target }}">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Receiving address for withdrawals <small>(WOW address)</small></label>
|
||||
<input {% if addr_receiving %}disabled{% endif %} id="addr_receiving" type="text" name="addr_receiving" class="form-control" placeholder="WOW..." value="{{ addr_receiving }}">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="category">Category</label>
|
||||
<select class="form-control" id="category" name="category">
|
||||
{% for cat in funding_categories %}
|
||||
<option value="{{cat}}"{% if proposal and cat == proposal.category %} selected{% elif not proposal and cat == 'misc' %} selected{% endif %}>{{cat}}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Content</label>
|
||||
<textarea id="content" class="textarea" name="content" placeholder="Place some text here" style="width: 100%; height: 600px; font-size: 14px; line-height: 18px; border: 1px solid #dddddd; padding: 10px;">{% if content %}{{ content }}{% else %}{{default_content}}{% endif %}</textarea>
|
||||
</div>
|
||||
|
||||
<div style="display:none" id="error" class="alert alert-danger">
|
||||
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<button onclick="submit_proposal();" type="submit" class="btn btn-primary">Submit</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
{% include 'sidebar.html' %}
|
||||
</div>
|
||||
<!-- /.row -->
|
||||
{% else %}
|
||||
<div class="row">
|
||||
<!-- Post Content Column -->
|
||||
<div class="col-lg-8">
|
||||
To submit your proposal, <a href="/login">login</a> or <a href="/register">register</a>.
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<!-- /.container -->
|
||||
|
||||
<script>
|
||||
var pid = {{pid or 'null'}};
|
||||
var simplemde = new SimpleMDE({
|
||||
element: document.getElementById("content"),
|
||||
spellChecker: false
|
||||
});
|
||||
|
||||
function submit_proposal() {
|
||||
function error(msg){
|
||||
var error_div = document.getElementById("error");
|
||||
error_div.style.display = "block";
|
||||
error_div.innerHTML = "Error: " + msg;
|
||||
}
|
||||
|
||||
function success(data){
|
||||
var data = JSON.parse(data);
|
||||
window.location.href = data.url;
|
||||
}
|
||||
|
||||
var data = {
|
||||
'title': document.getElementById('title').value,
|
||||
'content': simplemde.value(),
|
||||
'funds_target': parseFloat(document.getElementById('funds_target').value),
|
||||
'addr_receiving': document.getElementById('addr_receiving').value,
|
||||
'category': document.getElementById('category').value
|
||||
};
|
||||
|
||||
if (pid) {
|
||||
data.pid = pid;
|
||||
}
|
||||
|
||||
if (document.getElementById('status')){
|
||||
var status = document.getElementById('status').value
|
||||
status = parseInt(status);
|
||||
data.status = status;
|
||||
} else {
|
||||
data.status = 1;
|
||||
}
|
||||
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.open('POST', '/api/proposal/add', true);
|
||||
xhr.setRequestHeader('Content-Type', 'application/json; charset=UTF-8');
|
||||
xhr.onreadystatechange = function () {
|
||||
if (xhr.readyState === 4) {
|
||||
if (xhr.status === 200) {
|
||||
success(xhr.responseText);
|
||||
} else {
|
||||
error(xhr.responseText);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
xhr.onerror = function () {
|
||||
error(xhr.responseText);
|
||||
};
|
||||
|
||||
xhr.send(JSON.stringify(data));
|
||||
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
{% endblock %}
|
32
funding/templates/proposal/macros/navbar.html
Normal file
32
funding/templates/proposal/macros/navbar.html
Normal file
|
@ -0,0 +1,32 @@
|
|||
<div class="col-lg-8" style="padding-bottom: 0px; display:none;">
|
||||
<div class="row">
|
||||
<div class="form-group" style="text-align: center;">
|
||||
<div>
|
||||
<div data-toggle="buttons" class="btn-group btn-group-toggle">
|
||||
<label onclick="proposalNavbarclickDataHref(this);" data-href="{{ url_for('proposals', status=1) }}" class="btn btn-success {% if status == 1 %}active{% endif %}">
|
||||
Proposed <small>({{summary_data['statuses'][1]}})</small>
|
||||
</label>
|
||||
<label onclick="proposalNavbarclickDataHref(this);" data-href="{{ url_for('proposals', status=2) }}" class="btn btn-success {% if status == 2 %}active{% endif %}">
|
||||
Funding required <small>({{summary_data['statuses'][2]}})</small>
|
||||
</label>
|
||||
<label onclick="proposalNavbarclickDataHref(this);" data-href="{{ url_for('proposals', status=3) }}" class="btn btn-success {% if status == 3 %}active{% endif %}">
|
||||
WIP / Help needed <small>({{summary_data['statuses'][3]}})</small>
|
||||
</label>
|
||||
<label onclick="proposalNavbarclickDataHref(this);" data-href="{{ url_for('proposals', status=4) }}" class="btn btn-success {% if status == 4 %}active{% endif %}">
|
||||
Completed <small>({{summary_data['statuses'][4]}})</small>
|
||||
</label>
|
||||
</div>
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
{% if cat %}
|
||||
<small class="form-text text-muted" style="margin-top: -2px;">
|
||||
Results limited by category '{{cat}}'. <a href="{{ url_for('proposals', status=status) }}">Undo filter</a>.
|
||||
</small>
|
||||
<br>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
44
funding/templates/proposal/macros/table.html
Normal file
44
funding/templates/proposal/macros/table.html
Normal file
|
@ -0,0 +1,44 @@
|
|||
{% macro proposal_table(title, status, _proposals) %}
|
||||
<table class="table table-proposal table-hover" data-status="{{ status }}" style="margin-bottom:6px;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="font-size: 20px;">{{title}}</th>
|
||||
<th>Username</th>
|
||||
<th id="date">Date</th>
|
||||
{% if _proposals and _proposals[0].status >= 2 %}
|
||||
<th style="text-align: right;">Funding</th>
|
||||
{% else %}
|
||||
<th></th>
|
||||
{% endif %}
|
||||
<th style="display: table-cell;text-align: center;">
|
||||
<img width="24" src="/static/msg.png">
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for p in _proposals %}
|
||||
<tr>
|
||||
<td class="id"><b><a href="/proposal/{{ p.id }}">{{ p.headline }}</a></b></td>
|
||||
<td class="user"><a href="/user/{{ p.user.username }}">{{ p.user.username }}</a></td>
|
||||
<td class="date"><small>{{ p.date_added.strftime('%Y-%m-%d %H:%M') }}</small></td>
|
||||
<td class="funds">
|
||||
<span style="float:right;">
|
||||
{% if p.funds_progress >= 0.1 and p.status >= 2 %}
|
||||
{{p.funds_progress|int}}%
|
||||
{% else %}
|
||||
-
|
||||
{% endif %}
|
||||
</span>
|
||||
</td>
|
||||
<td style="text-align:center;">
|
||||
{% if p.comment_count %}
|
||||
{{p.comment_count}}
|
||||
{% else %}
|
||||
-
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% endmacro %}
|
50
funding/templates/proposal/overview.html
Normal file
50
funding/templates/proposal/overview.html
Normal file
|
@ -0,0 +1,50 @@
|
|||
{% extends "base.html" %}
|
||||
{% block content %}
|
||||
{% from 'proposal/macros/table.html' import proposal_table %}
|
||||
|
||||
<div class="container proposal-overview" style="margin-top:25px;">
|
||||
{% include 'proposal/macros/navbar.html' %}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-8">
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
{% if proposals['proposed'] %}
|
||||
{{ proposal_table(title='Proposals', status=1, _proposals=proposals['proposed']) }}
|
||||
<br>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
{% if proposals['funding'] %}
|
||||
{{ proposal_table(title='Funding required', status=2, _proposals=proposals['funding']) }}
|
||||
<br>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
{% if proposals['wip'] %}
|
||||
{{ proposal_table(title='WIP / Help needed', status=3, _proposals=proposals['wip']) }}
|
||||
<br>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
{% if proposals['completed'] %}
|
||||
{{ proposal_table(title='Completed', status=4, _proposals=proposals['completed']) }}
|
||||
<br>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% include 'sidebar.html' %}
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<!-- /.container -->
|
||||
{% endblock %}
|
245
funding/templates/proposal/proposal.html
Normal file
245
funding/templates/proposal/proposal.html
Normal file
|
@ -0,0 +1,245 @@
|
|||
{% extends "base.html" %}
|
||||
{% block content %}
|
||||
<!-- Page Content -->
|
||||
<div class="container" style="margin-bottom:140px;">
|
||||
{% include 'messages.html' %}
|
||||
|
||||
<div class="row">
|
||||
|
||||
<!-- Post Content Column -->
|
||||
<div class="col-lg-12">
|
||||
<!-- Title -->
|
||||
<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>
|
||||
|
||||
<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 %}
|
||||
WIP / Help needed
|
||||
{% elif proposal.status == 4 %}
|
||||
Completed
|
||||
{% endif %}
|
||||
</span>
|
||||
{% if proposal.status <= 1 %}
|
||||
<br>
|
||||
<span>
|
||||
Target: <b>{{proposal.funds_target|round}}</b> WOW
|
||||
{% if proposal.funds_target_usd %}
|
||||
<small>➞ {{proposal.funds_target_usd}} USD</small>
|
||||
{% endif %}
|
||||
</span>
|
||||
{% endif %}
|
||||
</p>
|
||||
|
||||
<p>
|
||||
{% if proposal.user.username == current_user.username or current_user.admin %}
|
||||
<a href="/proposal/{{proposal.id}}/edit">
|
||||
<button type="button" class="btn btn-success btn-sm">Edit</button>
|
||||
</a>
|
||||
{% endif %}
|
||||
</p>
|
||||
|
||||
<hr>
|
||||
{% if proposal.status >= 2 %}
|
||||
<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>
|
||||
<td>
|
||||
<span class="badge">{{proposal.funds_target|round}} WOW
|
||||
{% if proposal.funds_target_usd %}
|
||||
<small>➞ {{proposal.funds_target_usd}} USD</small>
|
||||
{% endif %}
|
||||
</span>
|
||||
</td>
|
||||
</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:
|
||||
<pre class="proposal_address">{% if proposal.addr_donation %}{{ proposal.addr_donation }}{% else %}<small>None generated yet</small>{% endif %}</pre>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% 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 %}
|
||||
|
||||
<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>
|
||||
<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>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.row -->
|
||||
{% endif %}
|
||||
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
let regexp_xss = /^[a-zA-Z0-9.:\/]+$/;
|
||||
let regexp_address = /(W[o|W][a-zA-Z0-9]{95})/g;
|
||||
let regexp_imgur = /(https:\/\/i.imgur.com\/[a-zA-Z0-9]{0,7}.[jpg|png|gif|webm]+)/g;
|
||||
let regexp_imgflip = /(https:\/\/i.imgflip.com\/[a-zA-Z0-9]{0,7}.[jpg|png|gif|webm]+)/g;
|
||||
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) {
|
||||
// richtext addy's
|
||||
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) {
|
||||
// convert images to <img>
|
||||
let html = obj.html();
|
||||
let uid = obj.attr('data-id');
|
||||
if(uid == 30){
|
||||
debugger;
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
$(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>
|
||||
|
||||
<!-- /.container -->
|
||||
{% endblock %}
|
23
funding/templates/proposal/proposals.html
Normal file
23
funding/templates/proposal/proposals.html
Normal file
|
@ -0,0 +1,23 @@
|
|||
{% extends "base.html" %}
|
||||
{% block content %}
|
||||
{% from 'proposal/macros/table.html' import proposal_table %}
|
||||
|
||||
<div class="container">
|
||||
{% include 'proposal/macros/navbar.html' %}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-8">
|
||||
{% if proposals %}
|
||||
{{ proposal_table(title='', status=status, _proposals=proposals) }}
|
||||
{% else %}
|
||||
No proposals here yet.
|
||||
{% endif %}
|
||||
</div>
|
||||
{% include 'sidebar.html' %}
|
||||
</div>
|
||||
|
||||
<br>
|
||||
|
||||
</div>
|
||||
<!-- /.container -->
|
||||
{% endblock %}
|
Loading…
Add table
Add a link
Reference in a new issue