mirror of https://git.sr.ht/~sircmpwn/fosspay
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
166 lines
7.3 KiB
166 lines
7.3 KiB
{% extends "layout.html" %}
|
|
{% block title %}
|
|
<title>Gestion des dons</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">
|
|
Obtenir un bouton de donation
|
|
</a>
|
|
<a class="btn btn-default" href="logout">Se déconnecter</a>
|
|
</p>
|
|
<h1>Gestion des dons</h1>
|
|
<p>Utilisez cette page en plus du <a href="https://dashboard.stripe.com">panneau de contrôle Stripe</a> pour davantage d'informations.</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://github.com/ddevault/fosspay">Contribute code to fosspay upstream</a>?
|
|
</li>
|
|
</ol>
|
|
</div>
|
|
{% endif %}
|
|
<h2>Projets</h2>
|
|
<div class="row">
|
|
<div class="col-md-9">
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th style="width: 10%"></th>
|
|
<th>Projets</th>
|
|
<th>Uniques</th>
|
|
<th>Récurrents (actifs)</th>
|
|
<th>Récurrents (somme totale)</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>(non précisé)</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>Ajouter un projet</h4>
|
|
<p>Les donateurices ne pourront pas choisir de projet avant que vous en ayez ajouté au moins deux.</p>
|
|
<form method="POST" action="{{root}}/create-project">
|
|
<div class="form-group">
|
|
<input class="form-control" type="text" placeholder="Nom du projet" name="name" />
|
|
</div>
|
|
<input type="submit" value="Valider" class="btn btn-default pull-right" />
|
|
</form>
|
|
</div>
|
|
</div>
|
|
<h2>Dons récents <small>(50 derniers)</small></h2>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th style="min-width: 10rem">Date</th>
|
|
<th>Email</th>
|
|
<th>Projet</th>
|
|
<th>Commentaire</th>
|
|
<th>Montant</th>
|
|
<th>Type</th>
|
|
<th>Payments</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for donation in donations %}
|
|
<tr>
|
|
<td>{{ donation.created.strftime("%d-%m-%Y") }}</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>
|
|
{{ "Unique" if str(donation.type) == "DonationType.one_time" else "Mensuel" }}
|
|
{{ "(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">Boutons de donation</h4>
|
|
</div>
|
|
<div class="modal-body">
|
|
<p>
|
|
Vous pouvez ajouter un bouton de donation sur vos pages.<br>
|
|
Voici à quoi il ressemble :
|
|
<a href="{{root}}">
|
|
<img src="{{root}}/static/donate-with-fosspay.png" />
|
|
</a>
|
|
</p>
|
|
<p>Si vous ajoutez <code>?project=1</code> à votre URL, cela préselectionnera ce projet
|
|
(où <code>1</code> est le 1er projet dans la liste sur cette page) lorsque les utilisateurices arriveront sur la page de don.</p>
|
|
<p><strong>Markdown</strong></p>
|
|
<pre>[![Donate with fosspay]({{root}}/static/donate-with-fosspay.png)]({{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">
|
|
Fermer
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endblock %}
|
|
|