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 %} {% include 'coinc/filter_country.html' with countrys=countrys %}
<p><h5>Zuletzt hinzugefügt</h5></p> <p><h5>Zuletzt hinzugefügt</h5></p>
{% for coin in recent_coins %} {% 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 %} {% endfor %}
{% else %} {% else %}
<p>Trage zuerst Länder im Adminbereich ein.</p>{% endif %} <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> </body>
</html> </html>

View File

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