From 25f0184d76fcd460c3c661cb959a7f32cd5e24e9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Moritz=20M=C3=BCnch?=
Date: Mon, 12 Jul 2021 12:18:43 +0000
Subject: [PATCH] #48 add optional coin.stamp attribute to template
---
coinmanager/coinc/models.py | 2 +-
coinmanager/coinc/templates/coinc/index.html | 6 +-----
2 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/coinmanager/coinc/models.py b/coinmanager/coinc/models.py
index de2a194..5063565 100644
--- a/coinmanager/coinc/models.py
+++ b/coinmanager/coinc/models.py
@@ -66,7 +66,7 @@ class Stamp(Model):
def __str__(self):
- return f"{self.name_short} - {self.name}"
+ return f"{self.name_short}"
diff --git a/coinmanager/coinc/templates/coinc/index.html b/coinmanager/coinc/templates/coinc/index.html
index fa8f12a..2b96b53 100644
--- a/coinmanager/coinc/templates/coinc/index.html
+++ b/coinmanager/coinc/templates/coinc/index.html
@@ -4,11 +4,7 @@
{% include 'coinc/filter_country.html' with countrys=countrys %}
Zuletzt gefunden
{% for coin in recent_coins %}
- {% if coin.name %}
- {{ coin.found_on|date:"d.m.Y" }}: {{ coin.value|floatformat:2 }} € von {{ coin.year }} "{{ coin.name }}" aus {{ coin.country}} von {{ coin.found_by }}
- {% else %}
- {{ coin.found_on|date:"d.m.Y" }}: {{ coin.value|floatformat:2 }} € von {{ coin.year }} aus {{ coin.country}} von {{ coin.found_by }}
- {% endif %}
+ {{ coin.found_on|date:"d.m.Y" }}: {{ coin.value|floatformat:2 }} € {{ coin.year }}{% if coin.stamp %}-{{ coin.stamp }}{% endif %}{% if coin.name %} "{{ coin.name }}"{% endif %} aus {{ coin.country}} von {{ coin.found_by }}
{% endfor %}
{% else %}
Trage zuerst Länder im Adminbereich ein.