-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaccount.html
64 lines (41 loc) · 1.75 KB
/
account.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
{% extends "finances/layout.html" %}
{% load static %}
{% block body %}
<h2>{{ account.name }}</h2>
<h5>Total Amount: ${{account.all_money}} </h5>
<div class="float-container" >
{% if plabels %}
<div class="float-child" style="width: 20%vw; display: inline-block;" >
<h5 style="text-align: center;">Income</h5>
<canvas id="income"></canvas>
</div>
{% endif %}
{% if nlabels %}
<div class="float-child" style="width: 20%vw; display: inline-block;">
<h5 style="text-align: center;">Expenses</h5>
<canvas id="expenses"></canvas>
</div>
{% endif %}
</div>
<br>
{% include 'finances/transactions.html' %}
<br>
<ul class="pagination">
{% if transactions.has_previous %}
<li class="page-item"><a class="page-link" href="{% url 'account_trans' account.id %}?page={{transactions.previous_page_number}}">Previous</a></li>
{% endif %}
<li class="page-item"><a class="page-link" href="{% url 'account_trans' account.id %}?page={{transactions.number}}">{{transactions.number}}</a></li>
{% if transactions.has_next %}
<li class="page-item"><a class="page-link" href="{% url 'account_trans' account.id %}?page={{transactions.next_page_number}}">Next</a></li>
{% endif %}
</ul>
<script>
createPiechart({{plabels|safe}}, {{pdata|safe}}, "Income", 'income');
createPiechart({{nlabels|safe}}, {{ndata|safe}}, "Expenses", 'expenses');
</script>
<a href="{% url 'delete_account' account.id %}">Delete Account</a>
{% endblock %}
{% block script %}
<script src="{% static 'finances/index.js' %}"></script>
<script src="{% static 'finances/graphs.js' %}"></script>
{% endblock %}