avoid warning: 'filter' is used for multiple template tag modules: 'apps.monitor.templatetags.filter', 'apps.transactions.templatetags.filter'
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
{% extends 'base.html' %}
|
{% extends 'base.html' %}
|
||||||
{% load filter %}
|
{% load monitor_filter %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<div class="form-box">
|
<div class="form-box">
|
||||||
@@ -17,8 +17,8 @@
|
|||||||
<input type="checkbox" id="acc{{ c.crypto }}" />
|
<input type="checkbox" id="acc{{ c.crypto }}" />
|
||||||
<label for="acc{{ c.crypto }}">
|
<label for="acc{{ c.crypto }}">
|
||||||
{{ c.crypto }}
|
{{ c.crypto }}
|
||||||
{% if c.rateEUR %}{{c.rateEUR|formatcurrency}} EUR{% endif %}
|
{% if c.rateEUR %}{{c.rateEUR|monitorformatcurrency}} EUR{% endif %}
|
||||||
{% if c.rateUSD %}{{c.rateUSD|formatcurrency}} USD{% endif %}
|
{% if c.rateUSD %}{{c.rateUSD|monitorformatcurrency}} USD{% endif %}
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
<div class="content">
|
<div class="content">
|
||||||
@@ -67,13 +67,13 @@
|
|||||||
We have sold {{ c.crypto }} for {{ c.sold|floatformat:2 }} EUR<br/>
|
We have sold {{ c.crypto }} for {{ c.sold|floatformat:2 }} EUR<br/>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if c.amount_kept %}
|
{% if c.amount_kept %}
|
||||||
Current value of our <span title="{{ c.amount_kept }} {{ c.crypto }}">{{ c.amount_kept|formatcurrency }} {{ c.crypto }}</span> is {{ c.current_value|floatformat:2 }} EUR<br/>
|
Current value of our <span title="{{ c.amount_kept }} {{ c.crypto }}">{{ c.amount_kept|monitorformatcurrency }} {{ c.crypto }}</span> is {{ c.current_value|floatformat:2 }} EUR<br/>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if c.bought_recently %}
|
{% if c.bought_recently %}
|
||||||
We have bought within the last 12 months: {{ c.bought_recently|formatcurrency }} {{ c.crypto }}<br/>
|
We have bought within the last 12 months: {{ c.bought_recently|monitorformatcurrency }} {{ c.crypto }}<br/>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if c.bought_tax_free %}
|
{% if c.bought_tax_free %}
|
||||||
We can sell without paying taxes: {{ c.bought_tax_free|formatcurrency }} {{ c.crypto }} for {{ c.value_tax_free|floatformat:2 }} EUR<br/>
|
We can sell without paying taxes: {{ c.bought_tax_free|monitorformatcurrency }} {{ c.crypto }} for {{ c.value_tax_free|floatformat:2 }} EUR<br/>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<br/><a href="/transactions/show?crypto={{ c.crypto }}">My transactions</a><br/>
|
<br/><a href="/transactions/show?crypto={{ c.crypto }}">My transactions</a><br/>
|
||||||
@@ -93,7 +93,7 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td>{{ r.dateRelative }}</td>
|
<td>{{ r.dateRelative }}</td>
|
||||||
<td>{{ r.date|date:'Y-m-d' }}</td>
|
<td>{{ r.date|date:'Y-m-d' }}</td>
|
||||||
<td>{{ r.rateEUR|formatcurrency }} EUR/{{ c.crypto }}</td>
|
<td>{{ r.rateEUR|monitorformatcurrency }} EUR/{{ c.crypto }}</td>
|
||||||
<td>{% if r.diffPercentage %}
|
<td>{% if r.diffPercentage %}
|
||||||
{{ r.diffPercentage|floatformat:1 }}%
|
{{ r.diffPercentage|floatformat:1 }}%
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@@ -107,11 +107,11 @@
|
|||||||
<div class="tab-pane {{g.active}}" id="{{ g.id }}{{ c.crypto }}">
|
<div class="tab-pane {{g.active}}" id="{{ g.id }}{{ c.crypto }}">
|
||||||
<h4>{{ g.label }}</h4>
|
<h4>{{ g.label }}</h4>
|
||||||
<img src="/graph?crypto={{ c.crypto }}&fiat=EUR&{{g.period}}" loading="lazy"><br/>
|
<img src="/graph?crypto={{ c.crypto }}&fiat=EUR&{{g.period}}" loading="lazy"><br/>
|
||||||
Start: {{ g.startdate }} {{ g.startvalue|formatcurrency }} EUR<br/>
|
Start: {{ g.startdate }} {{ g.startvalue|monitorformatcurrency }} EUR<br/>
|
||||||
Now: {{ g.curdate }} {{ g.curvalue|formatcurrency }} EUR<br/>
|
Now: {{ g.curdate }} {{ g.curvalue|monitorformatcurrency }} EUR<br/>
|
||||||
Diff: {{ g.diffPercentage|floatformat:1 }} %<br/>
|
Diff: {{ g.diffPercentage|floatformat:1 }} %<br/>
|
||||||
Min: {{ g.mindate }} {{ g.minvalue|formatcurrency }} EUR<br/>
|
Min: {{ g.mindate }} {{ g.minvalue|monitorformatcurrency }} EUR<br/>
|
||||||
Max: {{ g.maxdate }} {{ g.maxvalue|formatcurrency }} EUR<br/>
|
Max: {{ g.maxdate }} {{ g.maxvalue|monitorformatcurrency }} EUR<br/>
|
||||||
</div>
|
</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
@@ -124,7 +124,7 @@
|
|||||||
<input type="checkbox" id="accWALLET" />
|
<input type="checkbox" id="accWALLET" />
|
||||||
<label for="accWALLET">
|
<label for="accWALLET">
|
||||||
My Wallet
|
My Wallet
|
||||||
{% if wallet.rateEUR %}{{wallet.rateEUR|formatcurrency}} EUR{% endif %}
|
{% if wallet.rateEUR %}{{wallet.rateEUR|monitorformatcurrency}} EUR{% endif %}
|
||||||
</label>
|
</label>
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<ul class="tab-nav" id="tabnavWallet">
|
<ul class="tab-nav" id="tabnavWallet">
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ from django import template
|
|||||||
register = template.Library()
|
register = template.Library()
|
||||||
|
|
||||||
@register.filter
|
@register.filter
|
||||||
def formatcurrency(value):
|
def monitorformatcurrency(value):
|
||||||
if not value:
|
if not value:
|
||||||
return "0.00"
|
return "0.00"
|
||||||
if value > 100:
|
if value > 100:
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{% extends 'base.html' %}
|
{% extends 'base.html' %}
|
||||||
{% load humanize %}
|
{% load humanize %}
|
||||||
{% load filter %}
|
{% load transaction_filter %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<div class="form-box">
|
<div class="form-box">
|
||||||
@@ -35,16 +35,16 @@
|
|||||||
</span>
|
</span>
|
||||||
</td>
|
</td>
|
||||||
<td><span title="{% if transaction.fiat_fee and transaction.fiat_fee > 0 %}Fee: {{ transaction.fiat_fee }}{% else %}{{ transaction.fiat_total }}{% endif %}">
|
<td><span title="{% if transaction.fiat_fee and transaction.fiat_fee > 0 %}Fee: {{ transaction.fiat_fee }}{% else %}{{ transaction.fiat_total }}{% endif %}">
|
||||||
{{ transaction.fiat_total|formatcurrency }}
|
{{ transaction.fiat_total|transactionformatcurrency }}
|
||||||
{{ transaction.fiat_currency }}
|
{{ transaction.fiat_currency }}
|
||||||
</span>
|
</span>
|
||||||
</td>
|
</td>
|
||||||
<td>{% if transaction.transaction_type == 'S' %}
|
<td>{% if transaction.transaction_type == 'S' %}
|
||||||
{{ transaction.exchange_rate|formatcurrency }} {{ transaction.crypto_currency }}/{{ transaction.fiat_currency }}
|
{{ transaction.exchange_rate|transactionformatcurrency }} {{ transaction.crypto_currency }}/{{ transaction.fiat_currency }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
<td>{% if transaction.transaction_type == 'B' %}
|
<td>{% if transaction.transaction_type == 'B' %}
|
||||||
{{ transaction.exchange_rate|formatcurrency }} {{ transaction.crypto_currency }}/{{ transaction.fiat_currency }}
|
{{ transaction.exchange_rate|transactionformatcurrency }} {{ transaction.crypto_currency }}/{{ transaction.fiat_currency }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
|
|||||||
+1
-1
@@ -3,7 +3,7 @@ from django import template
|
|||||||
register = template.Library()
|
register = template.Library()
|
||||||
|
|
||||||
@register.filter
|
@register.filter
|
||||||
def formatcurrency(value):
|
def transactionformatcurrency(value):
|
||||||
if value > 100:
|
if value > 100:
|
||||||
return "%0.0f" % (value,)
|
return "%0.0f" % (value,)
|
||||||
if value < 0.01:
|
if value < 0.01:
|
||||||
Reference in New Issue
Block a user