Update template css

This commit is contained in:
Edgar P. Burkhart 2022-05-20 18:35:14 +02:00
parent 6a763a836d
commit 1acf27cac2
Signed by: edpibu
GPG Key ID: 9833D3C5A25BD227
3 changed files with 16 additions and 14 deletions

View File

@ -22,6 +22,12 @@ class Category(models.Model):
for child in self.__class__.objects.filter(parent=self):
child.save()
@property
def tree(self):
if self.parent is None:
return [self.name]
return self.parent.tree + [self.name]
class Meta:
ordering = ["full_name"]

View File

@ -13,6 +13,7 @@
#transactions > div > * {
padding: 1em;
white-space: nowrap;
}
#transactions > div.g> * {
background: var(--bg-01);
@ -23,22 +24,17 @@
color: var(--text-inv);
}
#transactions > div > .date,
#transactions > div > .category,
#transactions > div > .trader {
#transactions > div > .center {
text-align: center;
}
#transactions > div > .value {
text-align: right;
}
#transactions > div > .value,
#transactions > div > .date {
#transactions > div > .num {
font-feature-settings: "tnum", "ss01";
}
#transactions > div > span.description,
#transactions > div > span.name {
white-space: nowrap;
#transactions > div > span.text {
overflow: hidden;
text-overflow: ellipsis;
}

View File

@ -24,12 +24,12 @@
</div>
{% for trans in transactions %}
<div class="transaction {% cycle 'w' 'g' %}">
<span class="date">{{ trans.date|date:"Y-m-d" }}</span>
<span class="name"><a href="{% url 'transaction' trans.id %}">{{ trans.name }}</a></span>
<span class="value">{{ trans.value|floatformat:"2g" }} €</span>
<span class="trader">{{ trans.trader|default_if_none:"" }}</span>
<span class="category">{% if trans.category %}{{ trans.category.name }}{% else %}{% endif %}</span>
<span class="description">{{ trans.description }}</span>
<span class="date num center">{{ trans.date|date:"Y-m-d" }}</span>
<span class="name text"><a href="{% url 'transaction' trans.id %}">{{ trans.name }}</a></span>
<span class="value num">{{ trans.value|floatformat:"2g" }} €</span>
<span class="trader text center">{{ trans.trader|default_if_none:"" }}</span>
<span class="category text center">{% if trans.category %}{{ trans.category.tree|join:" → " }}{% else %}{% endif %}</span>
<span class="description text">{{ trans.description }}</span>
</div>
{% endfor %}
</div>