nova-web/web/templates/finances.html

70 lines
2.7 KiB
HTML
Raw Permalink Normal View History

2023-09-22 01:00:00 +02:00
{% include 'common/begin.html' %}
<main>
<h1>Our finances - transparency is key!</h1>
<p>
2023-09-23 18:06:27 +02:00
<b>Warning</b> - no guarantees can be made that this information is 100% accurate.
2023-09-23 23:17:48 +02:00
Crypto currency prices are being updated once every hour.
2023-09-23 18:06:27 +02:00
<br>
2023-09-23 23:17:48 +02:00
<b>As of: </b> <span id="lastUpdateDisplay">Loading...</span>
2023-09-23 18:06:27 +02:00
<script>
const unix_timestamp = {{ finances.last_update }};
2023-09-23 23:17:48 +02:00
lastUpdateDisplay.innerText = new Date(unix_timestamp * 1000).toLocaleString();
2023-09-23 18:06:27 +02:00
</script>
2023-09-22 01:00:00 +02:00
</p>
<a href="/finances/json" target="_blank">
<button class="special">
<i class="bi bi-file-earmark-arrow-down"></i>
Download entire database
</button>
</a>
<h2>Donations</h2>
2023-09-23 23:17:48 +02:00
<div class="featured__facts box"><p>
We have received <b>{{ finances.donations_num }} donations</b> so far,
2023-10-09 00:29:33 +02:00
totaling <b>${{ finances.donations_total }}</b>. The largest donation is <b>${{ finances.donations_max }}</b>.
2023-09-23 23:17:48 +02:00
</p></div>
<div class="featured__facts box"><p>
2023-10-09 00:29:33 +02:00
The average donation has an amount of <b>${{ finances.donations_avg }}</b>.
2023-09-23 23:17:48 +02:00
Most people used <b>{{ finances.most_used_donation_currency }}</b> to donate.
</p></div>
2023-09-22 01:00:00 +02:00
<h2>Expenses</h2>
2023-10-09 00:29:33 +02:00
<div class="featured__facts box"><p>We have spent <b>${{ finances.expenses_total }}</b> so far, <b>${{ finances.expenses_wages }}</b> of which are wages to our employees.</p></div>
<h2>Balance</h2>
<div class="featured__facts box"><p>Our current balance is ~<b>${{ finances.donations_total - finances.expenses_total }}</b>.
Please note that this is just a rough estimate and not an exact value. Due to transaction fees and price fluctuations,
the actual balance is actually lower.
</p></div>
2023-09-22 01:00:00 +02:00
2023-10-09 00:29:33 +02:00
<h2>Transactions</h2>
{{ transaction_table | safe }}
2023-09-22 01:00:00 +02:00
</main>
2023-10-09 00:29:33 +02:00
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<link rel="stylesheet" href="//cdn.datatables.net/1.13.6/css/jquery.dataTables.min.css">
<script src="//cdn.datatables.net/1.13.6/js/jquery.dataTables.min.js"></script>
<script>
$(document).ready( function () {
$('#transactionTable').DataTable({
'order': [[ 4, 'desc' ]]
});
} );
// add a column that links to https://3xpl.com/search?q= and then the "Proof" column value of each row
const table = document.getElementById('transactionTable');
for (let i = 1; i < table.rows.length; i++) {
const row = table.rows[i];
const proof = row.cells[5].innerText;
if (proof == '') continue;
row.cells[5].innerHTML = `<a href="https://3xpl.com/search?q=${proof}" target="_blank"><i class="bi bi-box-arrow-up-right"></i></a>`;
}
</script>
2023-09-22 01:00:00 +02:00
{% include 'common/end.html' %}