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
38
funding/templates/about.html
Normal file
38
funding/templates/about.html
Normal file
|
@ -0,0 +1,38 @@
|
|||
{% extends "base.html" %}
|
||||
{% block content %}
|
||||
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-lg-8">
|
||||
<h3>About</h3>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-lg-8">
|
||||
<hr>
|
||||
<p>
|
||||
A simple funding system made with:
|
||||
</p>
|
||||
<ul>
|
||||
<li>Python 3.5+</li>
|
||||
<li>Flask microframework</li>
|
||||
<li>Postgres 9.5+</li>
|
||||
<li>Redis</li>
|
||||
</ul>
|
||||
<p>
|
||||
We do not keep access logs or install tracking cookies. All static resources (javascript/stylesheets/images) are self-hosted.
|
||||
</p>
|
||||
<p>
|
||||
When you encounter problems; please visit #wownero on chat.freenode.org
|
||||
</p>
|
||||
</div>
|
||||
|
||||
{% include 'sidebar.html' %}
|
||||
|
||||
</div>
|
||||
|
||||
<br>
|
||||
|
||||
</div>
|
||||
<!-- /.container -->
|
||||
{% endblock %}
|
77
funding/templates/api.html
Normal file
77
funding/templates/api.html
Normal file
|
@ -0,0 +1,77 @@
|
|||
{% extends "base.html" %}
|
||||
{% block content %}
|
||||
|
||||
<div class="container api_documentation">
|
||||
<div class="row" style="margin-bottom:4px;">
|
||||
<div class="col-lg-8">
|
||||
<h3>API documentation</h3>
|
||||
<p>
|
||||
Requests are made using standard HTTP and responses are returned in JSON format.
|
||||
</p>
|
||||
<p>
|
||||
<ul>
|
||||
<li><a href="#api_convert_wow_usd">/api/1/convert/wow-usd</a></li>
|
||||
<li><a href="#api_proposals">/api/1/proposals</a></li>
|
||||
</ul>
|
||||
</p>
|
||||
<br>
|
||||
|
||||
<div class="api_container" id="api_convert_wow_usd">
|
||||
<h5><small>GET</small> <code>/api/1/convert/wow-usd</code></h5>
|
||||
<hr>
|
||||
<p>
|
||||
WOW to USD conversion. Data from TradeOgre and CoinMarketCap.
|
||||
</p>
|
||||
|
||||
<b>Example:</b>
|
||||
<pre>curl -vvX GET 'https://funding.wownero.com/api/1/convert/wow-usd?wow=1000'</pre>
|
||||
|
||||
<b>Response:</b>
|
||||
<pre>{"usd": 6.7}</pre>
|
||||
</div>
|
||||
|
||||
<div class="api_container" id="api_proposals">
|
||||
<h5><small>GET</small> <code>/api/1/proposals</code></h5>
|
||||
<hr>
|
||||
<p>
|
||||
Proposal listing.
|
||||
</p>
|
||||
|
||||
<b>Parameters:</b>
|
||||
<ul>
|
||||
<li><code>status</code>: the proposal status, from 0 to 5. Default is 1.</li>
|
||||
<li><code>limit</code>: limit results. Default is 20.</li>
|
||||
<li><code>offset</code>: offset results. Default is 0.</li>
|
||||
</ul>
|
||||
|
||||
<b>Example:</b>
|
||||
<pre>curl -vvX GET 'https://funding.wownero.com/api/1/proposals?offset=0&limit=1&status=2'</pre>
|
||||
|
||||
<b>Response:</b>
|
||||
<pre>{
|
||||
"data": [
|
||||
{
|
||||
"id": 15,
|
||||
"user": "dsc",
|
||||
"headline": "[Bounty] Memes",
|
||||
"content": "### markdown Content",
|
||||
"category": "marketing",
|
||||
"addr_donation": "WW3LcKRi3vJGSn11256Q819gExLtfsR3DZeGneu7K55QeeS4YcKMaDAHZ16hRM2gmJT7pVRiTGesjCsJUNAJPTn42rnh7wZEa",
|
||||
"date_posted": "Jul 09 2018 21:59:26",
|
||||
"date_posted_epoch": "1531173566",
|
||||
"funded_pct": 33.3333333333333,
|
||||
"funds_target": 15000.0,
|
||||
"status": 2
|
||||
}
|
||||
]
|
||||
}</pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% include 'sidebar.html' %}
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<!-- /.container -->
|
||||
{% endblock %}
|
72
funding/templates/base.html
Normal file
72
funding/templates/base.html
Normal file
|
@ -0,0 +1,72 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<!--
|
||||
░░░░░░░█▐▓▓░████▄▄▄█▀▄▓▓▓▌█ very website
|
||||
░░░░░▄█▌▀▄▓▓▄▄▄▄▀▀▀▄▓▓▓▓▓▌█
|
||||
░░░▄█▀▀▄▓█▓▓▓▓▓▓▓▓▓▓▓▓▀░▓▌█
|
||||
░░█▀▄▓▓▓███▓▓▓███▓▓▓▄░░▄▓▐█▌ such html
|
||||
░█▌▓▓▓▀▀▓▓▓▓███▓▓▓▓▓▓▓▄▀▓▓▐█
|
||||
▐█▐██▐░▄▓▓▓▓▓▀▄░▀▓▓▓▓▓▓▓▓▓▌█▌ WOW
|
||||
█▌███▓▓▓▓▓▓▓▓▐░░▄▓▓███▓▓▓▄▀▐█
|
||||
█▐█▓▀░░▀▓▓▓▓▓▓▓▓▓██████▓▓▓▓▐█
|
||||
▌▓▄▌▀░▀░▐▀█▄▓▓██████████▓▓▓▌█▌
|
||||
▌▓▓▓▄▄▀▀▓▓▓▀▓▓▓▓▓▓▓▓█▓█▓█▓▓▌█▌ many donations
|
||||
█▐▓▓▓▓▓▓▄▄▄▓▓▓▓▓▓█▓█▓█▓█▓▓▓▐█ gib lambo
|
||||
-->
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
<meta name="HandheldFriendly" content="True">
|
||||
<meta name="MobileOptimized" content="320">
|
||||
<link rel="shortcut icon" href="/static/favicon.ico" type="image/x-icon" />
|
||||
|
||||
<meta property="fb:app_id" content="0" />
|
||||
<meta property="og:image" content="https://funding.wownero.com/static/wowdoge-a.jpg" />
|
||||
<meta property="og:description" content="The Wownero forum funding system" />
|
||||
<meta property="og:url" content="https://funding.wownero.com/" />
|
||||
<meta property="og:title" content="WFS" />
|
||||
<meta property="og:type" content="website" />
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<meta name="theme-color" content="#ffffff">
|
||||
<meta name="apple-mobile-web-app-title" content="WOW WFS">
|
||||
<meta name="application-name" content="WOWNERO WFS">
|
||||
<meta name="msapplication-TileColor" content="#da532c">
|
||||
{% if proposal %}
|
||||
<meta name="description" content="{{proposal.content[:50]}}" />
|
||||
<title>WOW WFS - {{proposal.headline[:20]}}</title>
|
||||
{% else %}
|
||||
<meta name="description" content="The Wownero Funding System" />
|
||||
<title>WOW WFS</title>
|
||||
{% endif %}
|
||||
<meta name="keywords" content="monero, xmr, bitmonero, cryptocurrency, crypto money, mining crypto currencies, virtual currency">
|
||||
|
||||
<link href="/static/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link href="/static/css/bootstrap-grid.min.css" rel="stylesheet">
|
||||
<link href="/static/css/bootstrap-reboot.min.css" rel="stylesheet">
|
||||
<link rel="stylesheet" href="/static/css/simplemde.min.css">
|
||||
<script src="/static/js/simplemde.min.js"></script>
|
||||
<link href="/static/css/wow.css" rel="stylesheet">
|
||||
<script src="/static/js/app.js"></script>
|
||||
<script src="/static/js/jquery-3.2.1.slim.min.js"></script>
|
||||
<script src="/static/js/bootstrap.min.js"></script>
|
||||
</head>
|
||||
|
||||
<body onload="fix_anchors();">
|
||||
|
||||
{% include 'navbar.html' %}
|
||||
|
||||
<!-- Page Content -->
|
||||
{% block content %} {% endblock %}
|
||||
|
||||
<!-- Footer -->
|
||||
<footer class="bg-dark footer">
|
||||
<div class="container">
|
||||
<p class="m-0 text-center text-white">WOW 2018</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
</body>
|
||||
</html>
|
51
funding/templates/comment_reply.html
Normal file
51
funding/templates/comment_reply.html
Normal file
|
@ -0,0 +1,51 @@
|
|||
{% 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">
|
||||
<div class="proposal_content">
|
||||
<!-- Post Content -->
|
||||
<div class="media mb-4">
|
||||
<div class="votearrow" title="upvote"></div>
|
||||
<div class="media-body">
|
||||
<span class="username"><a href="/user/{{ c.user.username }}">{{c.user.username}}</a></span>
|
||||
<span class="date_posted">{{c.date_added.strftime('%Y-%m-%d %H:%M')}}</span><br>
|
||||
<span style="word-break: break-all">
|
||||
{{c.message}}
|
||||
</span>
|
||||
<br><br>
|
||||
{% if logged_in %}
|
||||
|
||||
<form method="post" action="{{url_for('proposal_comment')}}">
|
||||
<input type="hidden" name="pid" value="{{pid}}">
|
||||
<input type="hidden" name="cid" value="{{cid}}">
|
||||
<textarea class="comment" name="text" rows="6" cols="60"></textarea>
|
||||
<br><br>
|
||||
<div class="row">
|
||||
<div class="col-md-10">
|
||||
<div class="alert alert-secondary" role="alert">
|
||||
Posting imgur/imgflip media can be done by linking directly to the image, no [img] bbcode needed.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<input type="submit" value="add comment">
|
||||
</form>
|
||||
{% else %}
|
||||
You need to be logged in to comment.
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- /.container -->
|
||||
{% endblock %}
|
88
funding/templates/comments.html
Normal file
88
funding/templates/comments.html
Normal file
|
@ -0,0 +1,88 @@
|
|||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="card my-6" id="incoming_txs">
|
||||
<h5 id="comments" class="card-header">Comments</h5>
|
||||
<div class="card-body comments-panel">
|
||||
{% if logged_in %}
|
||||
<form method="post" action="comment">
|
||||
<input type="hidden" name="pid" value="{{proposal.id}}">
|
||||
<textarea class="comment" name="text" rows="6" cols="60"></textarea>
|
||||
<br><br>
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<div class="alert alert-secondary" role="alert">
|
||||
Posting imgur/imgflip media can be done by linking directly to the image, no [img] bbcode needed.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<input type="submit" value="add comment">
|
||||
</form>
|
||||
{% else %}
|
||||
You need to be logged in 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>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
56
funding/templates/login.html
Normal file
56
funding/templates/login.html
Normal file
|
@ -0,0 +1,56 @@
|
|||
{% extends "base.html" %}
|
||||
{% block content %}
|
||||
<!--main-->
|
||||
<div class="container" id="main">
|
||||
{% include 'messages.html' %}
|
||||
|
||||
<div class="row">
|
||||
<style>
|
||||
#xox>*{
|
||||
float:left;
|
||||
}
|
||||
#xox>img{
|
||||
height:42px;
|
||||
padding-left:4px;
|
||||
}
|
||||
</style>
|
||||
<div class="col-lg-12" id="xox">
|
||||
<h3>Secure login </h3>
|
||||
<img src="/static/nasa.png"/>
|
||||
<img src="/static/cyber.png"/>
|
||||
<img src="/static/ie9.png"/>
|
||||
<img src="/static/java.png"/>
|
||||
<hr>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-3">
|
||||
<form class="form-horizontal" action="" method=post>
|
||||
<div class="form-group">
|
||||
<label class="sr-only" for="inlineFormInput">Name</label>
|
||||
<input type="text" class="form-control mb-2 mr-sm-2 mb-sm-0" id="inlineFormInput"
|
||||
placeholder="Username" name="username">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="sr-only" for="password">Password</label>
|
||||
<div class="input-group mb-2 mr-sm-2 mb-sm-0">
|
||||
<input class="form-control" type="password" id="password" placeholder="Password"
|
||||
name="password">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<button type="submit" class="btn btn-primary btn-sm">Login</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="col-lg-12">
|
||||
<a href="/register">Or register here</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
<!--/main-->
|
||||
{% endblock %}
|
17
funding/templates/messages.html
Normal file
17
funding/templates/messages.html
Normal file
|
@ -0,0 +1,17 @@
|
|||
{% with messages = get_flashed_messages(with_categories=True) %}
|
||||
{% if messages %}
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
{% for message in messages %}
|
||||
<div class="alert {% if message[0] != 'error' %}alert-success{% else %}alert-danger{% endif %}">
|
||||
<img src="/static/doge_head.png" style="
|
||||
width: 64px;
|
||||
margin-right: 8px;
|
||||
">
|
||||
{{ message[1] }}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endwith %}
|
43
funding/templates/navbar.html
Normal file
43
funding/templates/navbar.html
Normal file
|
@ -0,0 +1,43 @@
|
|||
<!-- Navigation -->
|
||||
<nav class="navbar navbar-expand-lg navbar-dark bg-dark fixed-top">
|
||||
<div class="container">
|
||||
<a class="navbar-brand" href="/">
|
||||
<img id="logo" src="/static/wownero.png">
|
||||
<img id="text" src="/static/wfs-navbar.png"
|
||||
</a>
|
||||
<a class="navbar-brand-mobile" href="/" style="font-family:monospace;display:none;">Wownero Funding System</a>
|
||||
|
||||
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarResponsive"
|
||||
aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
|
||||
<div class="collapse navbar-collapse" id="navbarResponsive">
|
||||
<ul class="navbar-nav ml-auto">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="/proposals">Proposals
|
||||
<span class="sr-only">(current)</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="/proposal/add/disclaimer">Add Proposal</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="/about">About</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="/api">API</a>
|
||||
</li>
|
||||
{% if logged_in %}
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="/logout">Logout</a>
|
||||
</li>
|
||||
{% else %}
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="/login">Login</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
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 %}
|
56
funding/templates/register.html
Normal file
56
funding/templates/register.html
Normal file
|
@ -0,0 +1,56 @@
|
|||
{% extends "base.html" %}
|
||||
{% block content %}
|
||||
<!--main-->
|
||||
<div class="container" id="main">
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
{% with messages = get_flashed_messages() %}
|
||||
{% if messages %}
|
||||
<div class="alert alert-danger">
|
||||
{% for message in messages %}
|
||||
{{ message }}<br>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endwith %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<h3>Register an account </h3>
|
||||
<hr>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-3">
|
||||
<form class="form-horizontal" action="" method=post>
|
||||
<div class="form-group">
|
||||
<input type="text" id="username" name="username" class="form-control mb-2 mr-sm-2 mb-sm-0"
|
||||
placeholder="Enter Username" value="{{ request.form.username }}"
|
||||
required>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<input type="password" id="password" name="password" class="form-control mb-2 mr-sm-2 mb-sm-0"
|
||||
placeholder="Enter Password" value="{{ request.form.password }}"
|
||||
required>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<input type="email" id="email" name="email" class="form-control mb-2 mr-sm-2 mb-sm-0"
|
||||
placeholder="Enter Email" value="{{ request.form.username }}"
|
||||
required>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<button type="submit" class="btn btn-success">Signup</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
<!--/main-->
|
||||
{% endblock %}
|
39
funding/templates/search.html
Normal file
39
funding/templates/search.html
Normal file
|
@ -0,0 +1,39 @@
|
|||
{% extends "base.html" %}
|
||||
{% block content %}
|
||||
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-lg-8">
|
||||
<span class="form-text text-muted" style="margin-top: -2px;">
|
||||
Results for '{{key}}'
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-lg-8">
|
||||
{% if results %}
|
||||
<table class="table table-proposal table-hover" style="margin-bottom:6px;">
|
||||
<tbody>
|
||||
{% for p in results %}
|
||||
<tr>
|
||||
<td><b><a href="/proposal/{{ p.id }}">{{ p.headline }}</a></b></td>
|
||||
<td><a href="/user/{{ p.user.username }}">{{ p.user.username }}</a></td>
|
||||
<td>{{ p.date_added.strftime('%Y-%m-%d') }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% else %}
|
||||
No search results.
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{% include 'sidebar.html' %}
|
||||
|
||||
</div>
|
||||
|
||||
<br>
|
||||
|
||||
</div>
|
||||
<!-- /.container -->
|
||||
{% endblock %}
|
91
funding/templates/sidebar.html
Normal file
91
funding/templates/sidebar.html
Normal file
|
@ -0,0 +1,91 @@
|
|||
{% if not status %}
|
||||
{% set status = 0 %}
|
||||
{% endif %}
|
||||
|
||||
<!-- Sidebar Widgets Column -->
|
||||
<div class="col-md-4 sidebar">
|
||||
|
||||
<!-- Search Widget -->
|
||||
<div class="card my-4" style="margin-top: 0 !important;">
|
||||
<h5 style="transform: rotate(-0.4deg);" class="card-header">Search</h5>
|
||||
<div class="card-body">
|
||||
<div class="input-group">
|
||||
<input id="search_input" type="text" class="form-control" placeholder="Search for..." value="{% if key %}{{key}}{% endif %}">
|
||||
<span class="input-group-btn">
|
||||
<button onclick="do_search()" style="border-top-left-radius: 0px;border-bottom-left-radius: 0px;" class="btn btn-primary" type="button">
|
||||
Go!
|
||||
</button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Categories Widget -->
|
||||
<div class="card my-4">
|
||||
<h5 class="card-header">Categories</h5>
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-lg-6">
|
||||
<ul class="list-unstyled mb-0">
|
||||
<li>
|
||||
<a href="{{ url_for('proposals', status=status, cat="wallets") }}">Wallets <small>({{summary_data['cats']['wallets']}})</small></a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{ url_for('proposals', status=status, cat="core") }}">Core <small>({{summary_data['cats']['core']}})</small></a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{ url_for('proposals', status=status, cat="marketing") }}">Marketing <small>({{summary_data['cats']['marketing']}})</small></a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="col-lg-6">
|
||||
<ul class="list-unstyled mb-0">
|
||||
<li>
|
||||
<a href="{{ url_for('proposals', status=status, cat="misc") }}">Misc <small>({{summary_data['cats']['misc']}})</small></a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{ url_for('proposals', status=status, cat="design") }}">Design <small>({{summary_data['cats']['design']}})</small></a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Side Widget -->
|
||||
<div class="card my-4">
|
||||
<h5 class="card-header">Recent comments</h5>
|
||||
<div class="card-body">
|
||||
<ul class="b">
|
||||
{% for c in recent_comments %}
|
||||
<a href="/proposal/{{c.proposal.id}}#comment-{{c.id}}">
|
||||
<li>
|
||||
{{c.user.username}} in #{{c.proposal.id}}
|
||||
<small>
|
||||
({{c.ago}})
|
||||
</small>
|
||||
</li>
|
||||
</a>
|
||||
{% endfor %}
|
||||
</li>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var search_input = document.getElementById("search_input");
|
||||
|
||||
function do_search(){
|
||||
var url = '{{url_for('search')}}?key=' + search_input.value;
|
||||
location.replace(url);
|
||||
}
|
||||
|
||||
search_input.addEventListener("keyup", function(event) {
|
||||
event.preventDefault();
|
||||
if (event.keyCode === 13) {
|
||||
do_search();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
</div>
|
43
funding/templates/user.html
Normal file
43
funding/templates/user.html
Normal file
|
@ -0,0 +1,43 @@
|
|||
{% extends "base.html" %}
|
||||
{% block content %}
|
||||
|
||||
{% if user %}
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-lg-8">
|
||||
<span class="form-text text-muted" style="margin-top: -2px;">
|
||||
Details for '{{user.username}}'
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-lg-8">
|
||||
{% if user.proposals %}
|
||||
<table class="table table-proposal table-hover" style="margin-bottom:6px;">
|
||||
<tbody>
|
||||
{% for p in user.proposals %}
|
||||
<tr>
|
||||
<td><b><a href="/proposal/{{ p.id }}">{{ p.headline }}</a></b></td>
|
||||
<td><a href="/user/{{ p.user.username }}">{{ p.user.username }}</a></td>
|
||||
<td>{{ p.date_added.strftime('%Y-%m-%d') }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% else %}
|
||||
This user did not submit any proposals yet.
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{% include 'sidebar.html' %}
|
||||
|
||||
</div>
|
||||
|
||||
<br>
|
||||
|
||||
</div>
|
||||
{% else %}
|
||||
No user found by that name.
|
||||
{% endif %}
|
||||
<!-- /.container -->
|
||||
{% endblock %}
|
Loading…
Add table
Add a link
Reference in a new issue