mirror of
https://git.wownero.com/wownero/wownero-funding-system.git
synced 2024-08-15 00:53:45 +00:00
Initial commit
This commit is contained in:
commit
edb3d8f57b
55 changed files with 15544 additions and 0 deletions
38
wowfunding/templates/about.html
Normal file
38
wowfunding/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 %}
|
72
wowfunding/templates/base.html
Normal file
72
wowfunding/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>
|
||||
|
||||
{% 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>
|
66
wowfunding/templates/comments.html
Normal file
66
wowfunding/templates/comments.html
Normal file
|
@ -0,0 +1,66 @@
|
|||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="card my-6" id="incoming_txs">
|
||||
<h5 class="card-header">Comments</h5>
|
||||
<div class="card-body">
|
||||
Comment functionality not made yet!<br>
|
||||
Press <b>F</b> to pay respects.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--<!– Comments Form –>-->
|
||||
<!--<div class="card my-4">-->
|
||||
<!--<h5 class="card-header">Leave a Comment:</h5>-->
|
||||
<!--<div class="card-body">-->
|
||||
<!--<form>-->
|
||||
<!--<div class="form-group">-->
|
||||
<!--<textarea class="form-control" rows="3"></textarea>-->
|
||||
<!--</div>-->
|
||||
<!--<button type="submit" class="btn btn-primary">Submit</button>-->
|
||||
<!--</form>-->
|
||||
<!--</div>-->
|
||||
<!--</div>-->
|
||||
|
||||
<!--<!– Single Comment –>-->
|
||||
<!--<div class="media mb-4">-->
|
||||
<!--<img class="d-flex mr-3 rounded-circle" src="http://placehold.it/50x50" alt="">-->
|
||||
<!--<div class="media-body">-->
|
||||
<!--<h5 class="mt-0">Commenter Name</h5>-->
|
||||
<!--Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin. Cras-->
|
||||
<!--purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi-->
|
||||
<!--vulputate fringilla. Donec lacinia congue felis in faucibus.-->
|
||||
<!--</div>-->
|
||||
<!--</div>-->
|
||||
|
||||
<!--<!– Comment with nested comments –>-->
|
||||
<!--<div class="media mb-4">-->
|
||||
<!--<img class="d-flex mr-3 rounded-circle" src="http://placehold.it/50x50" alt="">-->
|
||||
<!--<div class="media-body">-->
|
||||
<!--<h5 class="mt-0">Commenter Name</h5>-->
|
||||
<!--Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin. Cras-->
|
||||
<!--purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi-->
|
||||
<!--vulputate fringilla. Donec lacinia congue felis in faucibus.-->
|
||||
|
||||
<!--<div class="media mt-4">-->
|
||||
<!--<img class="d-flex mr-3 rounded-circle" src="http://placehold.it/50x50" alt="">-->
|
||||
<!--<div class="media-body">-->
|
||||
<!--<h5 class="mt-0">Commenter Name</h5>-->
|
||||
<!--Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin.-->
|
||||
<!--Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc-->
|
||||
<!--ac nisi vulputate fringilla. Donec lacinia congue felis in faucibus.-->
|
||||
<!--</div>-->
|
||||
<!--</div>-->
|
||||
|
||||
<!--<div class="media mt-4">-->
|
||||
<!--<img class="d-flex mr-3 rounded-circle" src="http://placehold.it/50x50" alt="">-->
|
||||
<!--<div class="media-body">-->
|
||||
<!--<h5 class="mt-0">Commenter Name</h5>-->
|
||||
<!--Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin.-->
|
||||
<!--Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc-->
|
||||
<!--ac nisi vulputate fringilla. Donec lacinia congue felis in faucibus.-->
|
||||
<!--</div>-->
|
||||
<!--</div>-->
|
||||
|
||||
<!--</div>-->
|
||||
<!--</div>-->
|
68
wowfunding/templates/login.html
Normal file
68
wowfunding/templates/login.html
Normal file
|
@ -0,0 +1,68 @@
|
|||
{% 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">
|
||||
<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 %}
|
37
wowfunding/templates/navbar.html
Normal file
37
wowfunding/templates/navbar.html
Normal file
|
@ -0,0 +1,37 @@
|
|||
<!-- Navigation -->
|
||||
<nav class="navbar navbar-expand-lg navbar-dark bg-dark fixed-top">
|
||||
<div class="container">
|
||||
<a class="navbar-brand" href="/">Wownero Funding System (WFS)</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 active">
|
||||
<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">Add Proposal</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="/about">About</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>
|
127
wowfunding/templates/proposal.html
Normal file
127
wowfunding/templates/proposal.html
Normal file
|
@ -0,0 +1,127 @@
|
|||
{% extends "base.html" %}
|
||||
{% block content %}
|
||||
<!-- Page Content -->
|
||||
|
||||
<div class="container" style="margin-bottom:140px;">
|
||||
|
||||
<div class="row">
|
||||
|
||||
<!-- Post Content Column -->
|
||||
<div class="col-lg-12">
|
||||
|
||||
<!-- Title -->
|
||||
<h1 class="mt-4">{{ proposal.headline }}</h1>
|
||||
|
||||
<p class="lead">
|
||||
<p>Posted on {{ proposal.date_added.strftime('%Y-%m-%d') }} by <a href="/user/{{ proposal.user.username }}">{{ proposal.user.username}}</a></p>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
{% if proposal.user.username == current_user.username %}
|
||||
<a href="/proposal/{{proposal.id}}/edit">
|
||||
<button type="button" class="btn btn-success btn-sm">Edit</button>
|
||||
</a>
|
||||
{% endif %}
|
||||
</p>
|
||||
|
||||
<hr>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<!-- Side Widget -->
|
||||
<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</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">{{ proposal.addr_donation }}</pre>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<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</span>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.row -->
|
||||
{% endif %}
|
||||
|
||||
</div>
|
||||
|
||||
<!-- /.container -->
|
||||
{% endblock %}
|
150
wowfunding/templates/proposal_edit.html
Normal file
150
wowfunding/templates/proposal_edit.html
Normal file
|
@ -0,0 +1,150 @@
|
|||
{% extends "base.html" %}
|
||||
{% block content %}
|
||||
<!-- Page Content -->
|
||||
|
||||
<div class="container">
|
||||
{% 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 pid %}
|
||||
<input style="display:none" name="pid" value="{{pid}}">
|
||||
{% endif %}
|
||||
|
||||
<!-- 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>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;">{{ content }}</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
|
||||
};
|
||||
|
||||
if (pid) {
|
||||
data.pid = pid;
|
||||
}
|
||||
|
||||
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 %}
|
104
wowfunding/templates/proposals.html
Normal file
104
wowfunding/templates/proposals.html
Normal file
|
@ -0,0 +1,104 @@
|
|||
{% extends "base.html" %}
|
||||
{% block content %}
|
||||
|
||||
|
||||
<div class="container">
|
||||
<div class="col-lg-8" style="padding-bottom: 0px;">
|
||||
<div class="row">
|
||||
<div class="form-group" style="text-align: center;">
|
||||
<div>
|
||||
<div data-toggle="buttons" class="btn-group btn-group-toggle">
|
||||
<label onclick="clickDataHref(this);" data-href="{{ url_for('proposals', status=0) }}" class="btn btn-success {% if status == 0 %}active{% endif %}">
|
||||
Proposals <small>({{summary_data['statuses'][0]}})</small>
|
||||
</label>
|
||||
<label onclick="clickDataHref(this);" data-href="{{ url_for('proposals', status=1) }}" class="btn btn-success {% if status == 1 %}active{% endif %}">
|
||||
Work in progress <small>({{summary_data['statuses'][1]}})</small>
|
||||
</label>
|
||||
<label onclick="clickDataHref(this);" data-href="{{ url_for('proposals', status=2) }}" class="btn btn-success {% if status == 2 %}active{% endif %}">
|
||||
Completed <small>({{summary_data['statuses'][2]}})</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>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-8">
|
||||
{% if proposals %}
|
||||
{% for p in proposals %}
|
||||
{% if loop.index == 1 %}
|
||||
<table class="table table-proposal table-hover table-tilted" style="margin-bottom:6px;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="font-size: x-large;">Proposal</th>
|
||||
<th>Username</th>
|
||||
<th id="date">Date</th>
|
||||
{% if status == 0 %}
|
||||
<th style="text-align: right;">Funding</th>
|
||||
{% else %}
|
||||
<th></th>
|
||||
{% endif %}
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% else %}
|
||||
{% if loop.index % 3 == 0 %}
|
||||
</tbody>
|
||||
</table>
|
||||
<table class="table table-proposal table-hover {% if (loop.index/3) % 2 == 0 %}table-tilted{% else %}table-tilted-v{% endif %}">
|
||||
<tbody>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
<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 id="date"><small>{{ p.date_added.strftime('%Y-%m-%d %H:%M') }}</small></td>
|
||||
<td>
|
||||
<span style="float:right;">
|
||||
{% if p.funds_progress >= 0.1 and status == 0 %}
|
||||
{{p.funds_progress|int}}%
|
||||
{% else %}
|
||||
-
|
||||
{% endif %}
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% else %}
|
||||
No proposals here yet.
|
||||
{% endif %}
|
||||
</div>
|
||||
{% include 'sidebar.html' %}
|
||||
</div>
|
||||
|
||||
<!--<div class="col-md-12">-->
|
||||
|
||||
<!--<!– Pagination –>-->
|
||||
<!--<ul class="pagination mb-4">-->
|
||||
<!--<li class="page-item">-->
|
||||
<!--<a class="page-link" href="#">← Older</a>-->
|
||||
<!--</li>-->
|
||||
<!--<li class="page-item disabled">-->
|
||||
<!--<a class="page-link" href="#">Newer →</a>-->
|
||||
<!--</li>-->
|
||||
<!--</ul>-->
|
||||
<!--</div>-->
|
||||
<br>
|
||||
|
||||
</div>
|
||||
<!-- /.container -->
|
||||
{% endblock %}
|
56
wowfunding/templates/register.html
Normal file
56
wowfunding/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
wowfunding/templates/search.html
Normal file
39
wowfunding/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 %}
|
80
wowfunding/templates/sidebar.html
Normal file
80
wowfunding/templates/sidebar.html
Normal file
|
@ -0,0 +1,80 @@
|
|||
{% if not status %}
|
||||
{% set status = 0 %}
|
||||
{% endif %}
|
||||
|
||||
<!-- Sidebar Widgets Column -->
|
||||
<div class="col-md-4">
|
||||
|
||||
<!-- 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 style="transform: rotate(0.6deg);" 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">Cool widget</h5>
|
||||
<div class="card-body">
|
||||
Many widgets. Such sidebar. Wow.
|
||||
</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
wowfunding/templates/user.html
Normal file
43
wowfunding/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