mirror of
https://github.com/tildeclub/fosspay.git
synced 2026-01-24 11:10:18 +00:00
Source incoming :)
This commit is contained in:
167
templates/admin.html
Normal file
167
templates/admin.html
Normal file
@@ -0,0 +1,167 @@
|
||||
{% extends "layout.html" %}
|
||||
{% block title %}
|
||||
<title>Donation Admin</title>
|
||||
{% endblock %}
|
||||
{% block body %}
|
||||
<div class="well">
|
||||
<div class="container">
|
||||
<p class="pull-right">
|
||||
<a class="btn btn-primary" href="#" data-toggle="modal" data-target="#donation-button-modal">
|
||||
Get donation button
|
||||
</a>
|
||||
<a class="btn btn-default" href="logout">Log out</a>
|
||||
</p>
|
||||
<h1>Donation Admin</h1>
|
||||
<p>Combine this with your <a href="https://dashboard.stripe.com">Stripe
|
||||
dashboard</a> for the full effect.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container">
|
||||
{% if first %}
|
||||
<div class="well">
|
||||
<p>
|
||||
You're set up and ready to go! This is your admin panel. Next steps:
|
||||
</p>
|
||||
<ol>
|
||||
<li>
|
||||
<strong>Set up a cron job to handle monthly donations.</strong>
|
||||
<a href="https://github.com/ddevault/fosspay/wiki/Recurring-donations-cronjob">
|
||||
Relevant documentation
|
||||
</a>.
|
||||
</li>
|
||||
<li>
|
||||
Add some projects. Donors can tell you which project they want to support
|
||||
when they donate.
|
||||
</li>
|
||||
<li>
|
||||
Customize the look & feel. Look at the contents of the <code>templates</code>
|
||||
directory - you can copy and paste any of these templates into the
|
||||
<code>overrides</code> directory and change it to suit your needs.
|
||||
</li>
|
||||
<li>
|
||||
<a href="https://drewdevault.com/donate?project=fosspay">Donate to fosspay upstream</a>?
|
||||
</li>
|
||||
<li>
|
||||
<a href="https://git.sr.ht/~sircmpwn/fosspay">Contribute code to fosspay upstream</a>?
|
||||
</li>
|
||||
</ol>
|
||||
</div>
|
||||
{% endif %}
|
||||
<h2>Projects</h2>
|
||||
<div class="row">
|
||||
<div class="col-md-9">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 10%"></th>
|
||||
<th>Project Name</th>
|
||||
<th>One-time</th>
|
||||
<th>Recurring (active)</th>
|
||||
<th>Recurring (total paid)</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for project in projects %}
|
||||
<tr>
|
||||
<td><button type="button" class="close">×</button></td>
|
||||
<td>{{ project.name }}</td>
|
||||
<td>{{ currency.amount("{:.2f}".format(one_times(project) / 100)) }}</td>
|
||||
<td>{{ currency.amount("{:.2f}".format(recurring(project) / 100)) }}</td>
|
||||
<td>{{ currency.amount("{:.2f}".format(recurring_ever(project) / 100)) }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>(not specified)</td>
|
||||
<td>{{ currency.amount("{:.2f}".format(unspecified_one_times / 100)) }}</td>
|
||||
<td>{{ currency.amount("{:.2f}".format(unspecified_recurring / 100)) }}</td>
|
||||
<td>{{ currency.amount("{:.2f}".format(unspecified_recurring_ever / 100)) }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td><strong>Total</strong></td>
|
||||
<td>{{ currency.amount("{:.2f}".format(total_one_time / 100)) }}</td>
|
||||
<td>{{ currency.amount("{:.2f}".format(total_recurring / 100)) }}</td>
|
||||
<td>{{ currency.amount("{:.2f}".format(total_recurring_ever / 100)) }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="col-md-3 well">
|
||||
<h4>Add Project</h4>
|
||||
<p>Donors will not be given a choice of project unless you have at least 2.</p>
|
||||
<form method="POST" action="{{root}}/create-project">
|
||||
<div class="form-group">
|
||||
<input class="form-control" type="text" placeholder="Project name" name="name" />
|
||||
</div>
|
||||
<input type="submit" value="Add" class="btn btn-default pull-right" />
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<h2>Recent Donations <small>50 most recent</small></h2>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="min-width: 10rem">Date</th>
|
||||
<th>Email</th>
|
||||
<th>Project</th>
|
||||
<th>Comment</th>
|
||||
<th>Amount</th>
|
||||
<th>Type</th>
|
||||
<th>Payments</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for donation in donations %}
|
||||
<tr>
|
||||
<td>{{ donation.created.strftime("%Y-%m-%d") }}</td>
|
||||
<td><a href="mailto:{{ donation.user.email }}">{{ donation.user.email }}</a></td>
|
||||
<td>{{ donation.project.name if donation.project else "" }}</td>
|
||||
<td title="{{ donation.comment }}">{{ donation.comment if donation.comment else "" }}</td>
|
||||
<td>{{ currency.amount("{:.2f}".format(donation.amount / 100)) }}</td>
|
||||
<td>
|
||||
{{ "Once" if str(donation.type) == "DonationType.one_time" else "Monthly" }}
|
||||
{{ "(cancelled)" if not donation.active else "" }}
|
||||
</td>
|
||||
<td>
|
||||
{{donation.payments}}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="modal fade" id="donation-button-modal" tabindex="-1" role="dialog" aria-labelledby="donation-modal-label">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title" id="donation-modal-label">Donation buttons</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p>
|
||||
You can include a donation button in various places to
|
||||
drive people to your donation page. Here's how it looks:
|
||||
<a href="{{root}}">
|
||||
<img src="{{root}}/static/donate-with-fosspay.png" />
|
||||
</a>
|
||||
</p>
|
||||
<p>If you add <code>?project=1</code> to your URL, it will pre-select that project
|
||||
(where 1 is the 1st project you have listed on this page) when users arrive to donate.</p>
|
||||
<p><strong>Markdown</strong></p>
|
||||
<pre>[]({{root}})</pre>
|
||||
<p><strong>HTML</strong></p>
|
||||
<pre><a href="{{root}}"><img src="{{root}}/static/donate-with-fosspay.png" alt="Donate with fosspay" /></a></pre>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">
|
||||
Dismiss
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
4
templates/goal-summary.html
Normal file
4
templates/goal-summary.html
Normal file
@@ -0,0 +1,4 @@
|
||||
{#
|
||||
This is a little blurb you can write to explain why your goal is set to what
|
||||
it is.
|
||||
#}
|
||||
117
templates/goal.html
Normal file
117
templates/goal.html
Normal file
@@ -0,0 +1,117 @@
|
||||
{% if _cfg("public-income") == "yes" %}
|
||||
<div class="container" style="padding-top: 5rem">
|
||||
<div class="row">
|
||||
<div class="col-md-8 col-md-offset-2">
|
||||
{% set total_sum = recurring_sum + patreon_sum + lp_sum + gh_sum %}
|
||||
{% set total_count = recurring_count + patreon_count + lp_count + gh_count %}
|
||||
{% if _cfg("goal") %}
|
||||
{% set goal = int(_cfg("goal")) %}
|
||||
|
||||
{% if goal < total_sum %}
|
||||
{# Make the graph still make sense if we exceeded the goal #}
|
||||
{% set adjusted_goal = total_sum %}
|
||||
{% else %}
|
||||
{% set adjusted_goal = goal %}
|
||||
{% endif %}
|
||||
|
||||
{% set recurring_progress = recurring_sum / adjusted_goal %}
|
||||
{% set patreon_progress = patreon_sum / adjusted_goal %}
|
||||
{% set lp_progress = lp_sum / adjusted_goal %}
|
||||
{% set gh_progress = gh_sum / adjusted_goal %}
|
||||
{% set progress = total_sum / goal %}
|
||||
<div class="progress" style="height: 3rem">
|
||||
<div
|
||||
class="progress-bar progress-bar-primary"
|
||||
style="width: {{ recurring_progress * 100 }}%; line-height: 2.5"
|
||||
>
|
||||
<span>{{ currency.amount("{:.0f}".format(recurring_sum / 100)) }}</span>
|
||||
</div>
|
||||
|
||||
<div
|
||||
class="progress-bar progress-bar-info"
|
||||
style="width: {{ patreon_progress * 100 }}%; line-height: 2.5"
|
||||
>
|
||||
<span>{{ currency.amount("{:.0f}".format(patreon_sum / 100)) }}</span>
|
||||
</div>
|
||||
|
||||
<div
|
||||
class="progress-bar progress-bar-warning"
|
||||
style="width: {{ lp_progress * 100 }}%; line-height: 2.5"
|
||||
>
|
||||
<span>{{ currency.amount("{:.0f}".format(lp_sum / 100)) }}</span>
|
||||
</div>
|
||||
|
||||
<div
|
||||
class="progress-bar progress-bar-primary"
|
||||
style="width: {{ gh_progress * 100 }}%; line-height: 2.5"
|
||||
>
|
||||
<span>{{ currency.amount("{:.0f}".format(gh_sum / 100)) }}</span>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6 col-md-offset-3">
|
||||
{% if patreon_count or lp_count %}
|
||||
<p>
|
||||
{{ currency.amount("{:.2f}".format(recurring_sum / 100)) }}/mo
|
||||
via <strong class="text-primary">{{ domain }}</strong>
|
||||
({{ recurring_count }} supporter{{ "s" if recurring_count != 1 else "" }})
|
||||
</p>
|
||||
{% if patreon_count %}
|
||||
<p>
|
||||
{{ currency.amount("{:.2f}".format(patreon_sum / 100)) }}/mo
|
||||
via
|
||||
<strong><a
|
||||
href="https://patreon.com/{{ _cfg("patreon-campaign") }}"
|
||||
style="color: #51acc7">
|
||||
Patreon <i class="glyphicon glyphicon-share"></i>
|
||||
</a></strong> ({{ patreon_count }} supporter{{ "s" if patreon_count != 1 else "" }})
|
||||
</p>
|
||||
{% endif %}
|
||||
{% if lp_count %}
|
||||
<p>
|
||||
{{ currency.amount("{:.2f}".format(lp_sum / 100)) }}/mo
|
||||
via
|
||||
<strong><a
|
||||
class="text-warning"
|
||||
href="https://liberapay.com/{{ _cfg("liberapay-campaign") }}">
|
||||
Liberapay <i class="glyphicon glyphicon-share"></i>
|
||||
</a></strong> ({{ lp_count }} supporter{{ "s" if lp_count != 1 else "" }})
|
||||
</p>
|
||||
{% endif %}
|
||||
{% if gh_count %}
|
||||
<p>
|
||||
{{ currency.amount("{:.2f}".format(gh_sum / 100)) }}/mo
|
||||
via
|
||||
<strong><a
|
||||
class="text-primary"
|
||||
href="https://github.com/{{gh_user}}">
|
||||
GitHub <i class="glyphicon glyphicon-share"></i>
|
||||
</a></strong> ({{ gh_count }} supporter{{ "s" if lp_count != 1 else "" }})
|
||||
</p>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% if goal %}
|
||||
<p class="{{ "text-center" if not patreon_sum else "" }}">
|
||||
{{ currency.amount("{:.2f}".format(total_sum / 100))}}/mo
|
||||
of
|
||||
{{ currency.amount("{:.2f}".format(goal / 100)) }}/mo
|
||||
goal
|
||||
</p>
|
||||
{% else %}
|
||||
<p>
|
||||
Supported with {{ currency.amount("{:.2f}".format(total_sum / 100)) }}
|
||||
from {{ total_count }} supporters!
|
||||
</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6 col-md-offset-3">
|
||||
{% include "goal-summary.html" %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
160
templates/index.html
Normal file
160
templates/index.html
Normal file
@@ -0,0 +1,160 @@
|
||||
{% extends "layout.html" %}
|
||||
{% block scripts %}
|
||||
<script>
|
||||
window.stripe_key = "{{ _cfg("stripe-publish") }}";
|
||||
window.avatar = "{{ avatar }}";
|
||||
window.your_name = "{{ _cfg("your-name") }}";
|
||||
window.default_amount = {{ _cfg("default-amount") }};
|
||||
window.default_type = "{{ _cfg("default-type") }}";
|
||||
|
||||
// Array used for translation of index.js sentences. See contrib/fr/overrides/index.html for example use
|
||||
const i18n = {
|
||||
"Monthly Donation": "Monthly Donation",
|
||||
"One-time Donation": "One-time Donation",
|
||||
"Donate ": "Donate ",
|
||||
"Submitting...": "Submitting...",
|
||||
"Donate": "Donate"
|
||||
};
|
||||
// End of translation of index.js
|
||||
|
||||
const currency = "{{ _cfg("currency") }}";
|
||||
|
||||
{% if user %}
|
||||
window.email = "{{user.email}}";
|
||||
{% endif %}
|
||||
</script>
|
||||
<script src="//checkout.stripe.com/checkout.js"></script>
|
||||
<script src="static/index.js"></script>
|
||||
{% endblock %}
|
||||
{% block body %}
|
||||
<div class="well">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-8 col-md-offset-2">
|
||||
<img
|
||||
class="pull-right"
|
||||
src="{{ avatar }}?s=129"
|
||||
style="border-radius: 5px; margin-left: 1rem"
|
||||
width="128" height="128" />
|
||||
<h1>Donate to {{ _cfg("your-name") }}</h1>
|
||||
{% include "summary.html" %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<noscript>
|
||||
<div class="container">
|
||||
<div class="alert alert-danger">
|
||||
<p>This page requires Javascript. It's necessary to send your credit card number to
|
||||
<a href="https://stripe.com/">Stripe</a> directly, so you don't need to trust me with it.</p>
|
||||
</div>
|
||||
</div>
|
||||
</noscript>
|
||||
<div class="container text-center hidden" id="thanks">
|
||||
{% include "post-donation-message.html" %}
|
||||
<form id="new-donor-password" class="hidden" action="{{root}}/password-reset" method="POST">
|
||||
<p>Set a password now if you want to manage your donations later:</p>
|
||||
<input type="password" placeholder="Password" name="password" />
|
||||
<input type="hidden" name="token" id="reset-token" />
|
||||
<button class="btn btn-primary btn-sm">Submit</button>
|
||||
</form>
|
||||
</div>
|
||||
<div class="container text-center" id="donation-stuff">
|
||||
<h3>How much?</h3>
|
||||
<div class="row">
|
||||
<div class="col-md-8 col-md-offset-2">
|
||||
<div class="btn-group btn-group-justified amounts" role="group" aria-label="...">
|
||||
{% for amt in _cfg("default-amounts").split(" ") %}
|
||||
<div class="btn-group" role="group">
|
||||
<button data-amount="{{ amt }}" type="button"
|
||||
class="btn btn-default {{"active" if _cfg("default-amount") == amt else ""}}"
|
||||
>{{ currency.amount(amt) }}</button>
|
||||
</div>
|
||||
{% endfor %}
|
||||
<div class="btn-group" role="group">
|
||||
<button data-amount="custom" type="button" class="btn btn-default">Custom</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row hidden" id="custom-amount" style="margin-top: 20px;">
|
||||
<div class="col-md-4 col-md-offset-4">
|
||||
<div class="form-group">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon">{{ currency.symbol }}</span>
|
||||
<input id="custom-amount-text" type="text" value="13.37"
|
||||
class="form-control" placeholder="Amount" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<h3>How often?</h3>
|
||||
<div class="row">
|
||||
<div class="col-md-4 col-md-offset-4">
|
||||
<div class="form-group">
|
||||
<div class="btn-group btn-group-justified frequencies" role="group" aria-label="...">
|
||||
<div class="btn-group" role="group">
|
||||
<button data-frequency="once" type="button"
|
||||
class="btn btn-default {{"active" if _cfg("default-type")=="once" else ""}}"
|
||||
>Once</button>
|
||||
</div>
|
||||
<div class="btn-group" role="group">
|
||||
<button data-frequency="monthly" type="button"
|
||||
class="btn btn-default {{"active" if _cfg("default-type")=="monthly" else ""}}"
|
||||
>Monthly</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% if len(projects) > 1 %}
|
||||
<h3>What project?</h3>
|
||||
<div class="row">
|
||||
<div class="col-md-4 col-md-offset-4">
|
||||
<div class="form-group">
|
||||
<select id="project" name="project" class="form-control">
|
||||
<option value="null"
|
||||
{{ "selected" if selected_project == None else "" }}>None in particular</option>
|
||||
{% for project in projects %}
|
||||
<option value="{{ project.id }}"
|
||||
{{ "selected" if selected_project == project.id else "" }}>{{ project.name }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="row">
|
||||
<div class="col-md-4 col-md-offset-4">
|
||||
<div class="form-group">
|
||||
<input type="text" id="comments" class="form-control" placeholder="Any comments?" maxlength="512" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-4 col-md-offset-4">
|
||||
<div class="alert alert-danger hidden" id="errors">
|
||||
<p></p>
|
||||
</div>
|
||||
<button class="btn btn-block btn-success" id="donate-button">Donate</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% include "goal.html" %}
|
||||
<hr />
|
||||
<div class="container text-center">
|
||||
{% if not user %}
|
||||
<p>
|
||||
<small class="text-muted">
|
||||
Been here before? <a href="login">Log in</a> to view your donation
|
||||
history, edit recurring donations, and so on.
|
||||
</small>
|
||||
</p>
|
||||
{% endif %}
|
||||
<p>
|
||||
<small class="text-muted">
|
||||
Powered by <a href="https://git.sr.ht/~sircmpwn/fosspay">fosspay</a>.
|
||||
</small>
|
||||
</p>
|
||||
</div>
|
||||
{% endblock %}
|
||||
5
templates/internal_error.html
Normal file
5
templates/internal_error.html
Normal file
@@ -0,0 +1,5 @@
|
||||
{% extends "layout.html" %}
|
||||
{% block container %}
|
||||
<h1>500 Internal Error</h1>
|
||||
<p><a href="/">Trying to donate?</a></p>
|
||||
{% endblock %}
|
||||
60
templates/invoice.html
Normal file
60
templates/invoice.html
Normal file
@@ -0,0 +1,60 @@
|
||||
{% extends "layout.html" %}
|
||||
{% block scripts %}
|
||||
<script>
|
||||
window.stripe_key = "{{ _cfg("stripe-publish") }}";
|
||||
window.your_name = "{{ _cfg("your-name") }}";
|
||||
window.amount = {{invoice.amount}};
|
||||
window.invoice = "{{invoice.external_id}}";
|
||||
window.comment = "{{invoice.comment}}";
|
||||
const currency = "{{ _cfg("currency") }}";
|
||||
</script>
|
||||
<script src="//checkout.stripe.com/checkout.js"></script>
|
||||
<script src="../static/invoice.js"></script>
|
||||
{% endblock %}
|
||||
{% block body %}
|
||||
<div class="well">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-8 col-md-offset-2">
|
||||
<h1>Invoice to {{ _cfg("your-name") }}</h1>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<noscript>
|
||||
<div class="container">
|
||||
<div class="alert alert-danger">
|
||||
<p>This page requires Javascript. It's necessary to send your credit card number to
|
||||
<a href="https://stripe.com/">Stripe</a> directly.</p>
|
||||
</div>
|
||||
</div>
|
||||
</noscript>
|
||||
<div class="container text-center hidden" id="thanks">
|
||||
<p>Thank you for your payment - it has been processed successfully.</p>
|
||||
</div>
|
||||
<div class="container text-center" id="donation-stuff">
|
||||
<h3>Invoice for ${{"{:.2f}".format(invoice.amount / 100)}}</h3>
|
||||
<div class="row">
|
||||
<div class="col-md-4 col-md-offset-4">
|
||||
<p>
|
||||
{{invoice.comment}}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-4 col-md-offset-4">
|
||||
<div class="alert alert-danger hidden" id="errors"><p></p></div>
|
||||
<button class="btn btn-block btn-success" id="submit">
|
||||
Submit Payment
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container text-center">
|
||||
<p>
|
||||
<small class="text-muted">
|
||||
Powered by <a href="https://github.com/ddevault/fosspay">fosspay</a>.
|
||||
</small>
|
||||
</p>
|
||||
</div>
|
||||
{% endblock %}
|
||||
24
templates/layout.html
Normal file
24
templates/layout.html
Normal file
@@ -0,0 +1,24 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<link rel="icon" href="static/icon.png" type="image/png" />
|
||||
{% block title %}
|
||||
<title>Donate to {{_cfg("your-name")}}</title>
|
||||
{% endblock %}
|
||||
<link rel="stylesheet" href="{{root}}/static/club.css" />
|
||||
{% block styles %}{% endblock %}
|
||||
</head>
|
||||
<body>
|
||||
{% block body %}
|
||||
<div class="container">
|
||||
{% block container %}
|
||||
{% endblock %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
<script src="{{root}}/static/jquery/jquery.min.js"></script>
|
||||
<script src="{{root}}/static/bootstrap/bootstrap.min.js"></script>
|
||||
{% block scripts %}{% endblock %}
|
||||
</body>
|
||||
</html>
|
||||
32
templates/login.html
Normal file
32
templates/login.html
Normal file
@@ -0,0 +1,32 @@
|
||||
{% extends "layout.html" %}
|
||||
{% block body %}
|
||||
<div class="well">
|
||||
<div class="container">
|
||||
<h1>Donate to {{ _cfg("your-name") }}</h1>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-6 col-md-offset-3">
|
||||
<h1>Log In</h1>
|
||||
{% if errors %}
|
||||
<div class="alert alert-danger">
|
||||
<p>
|
||||
Username or password incorrect.
|
||||
</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
<form action="{{root}}/login" method="POST">
|
||||
<div class="form-group">
|
||||
<input class="form-control" type="text" name="email" placeholder="your@example.org" />
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input class="form-control" type="password" name="password" placeholder="Password" />
|
||||
</div>
|
||||
<input type="submit" value="Log in" class="btn btn-primary" />
|
||||
<a style="margin-left: 20px" href="password-reset">Reset password</a>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
5
templates/not_found.html
Normal file
5
templates/not_found.html
Normal file
@@ -0,0 +1,5 @@
|
||||
{% extends "layout.html" %}
|
||||
{% block container %}
|
||||
<h1>404 Not Found</h1>
|
||||
<p><a href="/">Trying to donate?</a></p>
|
||||
{% endblock %}
|
||||
62
templates/panel.html
Normal file
62
templates/panel.html
Normal file
@@ -0,0 +1,62 @@
|
||||
{% extends "layout.html" %}
|
||||
{% block body %}
|
||||
<div class="well">
|
||||
<div class="container">
|
||||
<p class="pull-right">
|
||||
<a class="btn btn-primary" href="..">Donate again</a>
|
||||
<a class="btn btn-default" href="logout">Log out</a>
|
||||
</p>
|
||||
<h1>Your Donations</h1>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container">
|
||||
{% if any(recurring(user)) %}
|
||||
<h2>Monthly Donations</h2>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 10%"></th>
|
||||
<th>Date</th>
|
||||
<th>Amount</th>
|
||||
<th>Project</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for donation in recurring(user) %}
|
||||
<tr>
|
||||
<td>
|
||||
<form method="DELETE" action="{{root}}/cancel/{{ donation.id }}">
|
||||
<button type="submit" class="btn btn-danger btn-sm">Cancel</button>
|
||||
</form>
|
||||
</td>
|
||||
<td>{{ donation.created.strftime("%Y-%m-%d") }}</td>
|
||||
<td>{{ currency.amount("{:.2f}".format(donation.amount / 100)) }}</td>
|
||||
<td>{{ donation.project.name if donation.project else "Not specified" }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% endif %}
|
||||
{% if any(one_times(user)) %}
|
||||
<h2>One-time Donations</h2>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Date</th>
|
||||
<th>Amount</th>
|
||||
<th>Project</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for donation in one_times(user) %}
|
||||
<tr>
|
||||
<td>{{ donation.created.strftime("%Y-%m-%d") }}</td>
|
||||
<td>{{ currency.amount("{:.2f}".format(donation.amount / 100)) }}</td>
|
||||
<td>{{ donation.project.name if donation.project else "Not specified" }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
2
templates/post-donation-message.html
Normal file
2
templates/post-donation-message.html
Normal file
@@ -0,0 +1,2 @@
|
||||
<h3>Thanks!</h3>
|
||||
<p>Have a great day!</p>
|
||||
43
templates/reset.html
Normal file
43
templates/reset.html
Normal file
@@ -0,0 +1,43 @@
|
||||
{% extends "layout.html" %}
|
||||
{% block body %}
|
||||
<div class="well">
|
||||
<div class="container">
|
||||
<h1>Donate to {{ _cfg("your-name") }}</h1>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-6 col-md-offset-3">
|
||||
<h1>Reset Password</h1>
|
||||
{% if errors %}
|
||||
<div class="alert alert-danger">
|
||||
<p>
|
||||
{{ errors }}
|
||||
</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if done %}
|
||||
<p>
|
||||
An email should arrive shortly. If you need help, contact
|
||||
<a href="mailto:{{_cfg("your-email")}}">{{_cfg("your-email")}}</a>.
|
||||
</p>
|
||||
{% elif token %}
|
||||
<form action="{{root}}/password-reset" method="POST">
|
||||
<div class="form-group">
|
||||
<input class="form-control" type="password" name="password" placeholder="New password" />
|
||||
<input type="hidden" name="token" value="{{ token }}" />
|
||||
</div>
|
||||
<input type="submit" value="Submit" class="btn btn-primary" />
|
||||
</form>
|
||||
{% else %}
|
||||
<form action="{{root}}/password-reset" method="POST">
|
||||
<div class="form-group">
|
||||
<input class="form-control" type="text" name="email" placeholder="your@example.org" />
|
||||
</div>
|
||||
<input type="submit" value="Submit" class="btn btn-primary" />
|
||||
</form>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
87
templates/setup.html
Normal file
87
templates/setup.html
Normal file
@@ -0,0 +1,87 @@
|
||||
{% extends "layout.html" %}
|
||||
{% block container %}
|
||||
<h1>FossPay Setup</h1>
|
||||
<p>Congrats! You have FossPay up and running.</p>
|
||||
|
||||
<h2>config.ini</h2>
|
||||
<ul class="list-unstyled">
|
||||
<li>
|
||||
{% if _cfg("secret-key") == "hello world" %}
|
||||
<span class="glyphicon glyphicon-remove text-danger"></span>
|
||||
You need to change the secret key to something other than "hello world".
|
||||
{% else %}
|
||||
<span class="glyphicon glyphicon-ok text-success"></span>
|
||||
Your secret key looks good.
|
||||
{% endif %}
|
||||
</li>
|
||||
|
||||
<li>
|
||||
{% if _cfg("domain") == "localhost:5000" %}
|
||||
<span class="glyphicon glyphicon-remove text-danger"></span>
|
||||
You should change your domain to something other than localhost.
|
||||
{% else %}
|
||||
<span class="glyphicon glyphicon-ok text-success"></span>
|
||||
Your domain is set to "{{_cfg("domain")}}".
|
||||
{% endif %}
|
||||
</li>
|
||||
|
||||
<li>
|
||||
{% if _cfg("protocol") != "https" %}
|
||||
<span class="glyphicon glyphicon-remove text-danger"></span>
|
||||
Stripe requires your website to use HTTPS.
|
||||
{% else %}
|
||||
<span class="glyphicon glyphicon-ok text-success"></span>
|
||||
Stripe requires your website to use HTTPS.
|
||||
{% endif %}
|
||||
</li>
|
||||
|
||||
<li>
|
||||
{% if not _cfg("smtp-host") %}
|
||||
<span class="glyphicon glyphicon-remove text-danger"></span>
|
||||
You should configure an SMTP server to send emails with.
|
||||
{% else %}
|
||||
<span class="glyphicon glyphicon-ok text-success"></span>
|
||||
Your email configuration looks good.
|
||||
{% endif %}
|
||||
</li>
|
||||
|
||||
<li>
|
||||
{% if not _cfg("stripe-secret") or not _cfg("stripe-publish") %}
|
||||
<span class="glyphicon glyphicon-remove text-danger"></span>
|
||||
Your Stripe API keys are not in your config file.
|
||||
{% else %}
|
||||
<span class="glyphicon glyphicon-ok text-success"></span>
|
||||
Your Stripe API keys look good.
|
||||
{% endif %}
|
||||
</li>
|
||||
|
||||
<li>
|
||||
{% if not _cfg("patreon-access-token") or not _cfg("patreon-campaign") %}
|
||||
<span class="glyphicon glyphicon-remove text-danger"></span>
|
||||
Your Patreon access token and campaign are not configured (optional).
|
||||
{% else %}
|
||||
<span class="glyphicon glyphicon-ok text-success"></span>
|
||||
Your Patreon integration looks good. We'll integrate with
|
||||
<a
|
||||
href="https://patreon.com/{{ _cfg("patreon-campaign") }}"
|
||||
target="_blank" rel="noopener noreferrer"
|
||||
>{{ _cfg("patreon-campaign") }}</a>'s campaign.
|
||||
{% endif %}
|
||||
</li>
|
||||
</ul>
|
||||
<p>You can make changes and refresh this page if you like.</p>
|
||||
|
||||
<h2>Admin Account</h2>
|
||||
<p>Enter your details for the admin account:</p>
|
||||
<form class="form" action="{{root}}/setup" method="POST">
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" name="email"
|
||||
placeholder="Email" value="{{_cfg("your-email")}}" />
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="password" class="form-control" name="password" placeholder="Password" />
|
||||
</div>
|
||||
<input type="submit" value="Continue" class="btn btn-primary" />
|
||||
</form>
|
||||
|
||||
{% endblock %}
|
||||
13
templates/summary.html
Normal file
13
templates/summary.html
Normal file
@@ -0,0 +1,13 @@
|
||||
{#
|
||||
Try to keep this text short. Too long and it distracts from
|
||||
the donation UI and will reduce the number of conversions you
|
||||
actually get.
|
||||
#}
|
||||
<p>Your donation here supports <a href="https://tilde.club">tilde.club</a>, and any other services that are run by tilde.club.</p>
|
||||
|
||||
<p> I pay for hosting and domain costs out of pocket and spend far more time than I should running these services. Anything you can pitch in helps keep everything up and running.</p>
|
||||
|
||||
<p>My hosting costs are around $200/month and domains are around $150/year.</p>
|
||||
|
||||
<p>Donations are securely processed through Stripe, and your payment information is not stored on my servers. I am charged a 2.9%+30c fee per transaction.</p>
|
||||
|
||||
Reference in New Issue
Block a user