fix #48 aka. show recent coins on index page

This commit is contained in:
Moritz Münch 2021-07-05 20:45:21 +00:00
parent 5ba73e0e1e
commit e65e901a66
3 changed files with 4 additions and 4 deletions

View File

@ -4,7 +4,7 @@
{% include 'coinc/filter_country.html' with countrys=countrys %}
<p><h5>Zuletzt hinzugefügt</h5></p>
{% for coin in recent_coins %}
<p>{{ coin.found_on|date:"d.m.Y" }}: {{ coin.value }}€ {{ coin.name }} von {{ coin.found_by }}</p>
<p>{{ coin.found_on|date:"d.m.Y" }}: {{ coin.value|floatformat:2 }} € {{ coin.name }} von {{ coin.found_by }}</p>
{% endfor %}
{% else %}
<p>Trage zuerst Länder im Adminbereich ein.</p>{% endif %}

View File

@ -1,3 +1,3 @@
<span class="badge badge-pill badge-light">Version 201026</span>
<span class="badge badge-pill badge-light">Version 210705</span>
</body>
</html>

View File

@ -42,8 +42,8 @@ def index(request):
users = User.objects.order_by('id')
coin_sum = total_coin_sum()
recent_coins = Coin.objects.order_by('-found_on')[:10]
for coin in recent_coins:
recent_coins[coin][value] /= 100
for coin in range(len(recent_coins)):
recent_coins[coin].value /= 100
context = {
'countrys': countrys,
'users': users,