use dynamic drinks table in finance template and rework table styling

This commit is contained in:
2022-07-17 16:52:43 +02:00
parent 0e93f52040
commit bf577733ce
2 changed files with 43 additions and 96 deletions

View File

@@ -2,7 +2,7 @@ html, body, div,
h1, h2, h3, h4, h5, h6,
a, p, b, i,
form, label, input,
table, thead, tbody, tr, td {
table, thead, tfoot, tr, td {
margin: 0;
border: none;
padding: 0;
@@ -104,18 +104,41 @@ p, ul {
table {
margin-top: 12px;
margin-bottom: 12px;
border-spacing: 0;
border-right: 1px solid #664422;
border-bottom: 1px solid #664422;
border-spacing: 1px;
}
thead {
color: #EECC66;
}
.odd-row {
background-color: rgba(102, 68, 24, 0.3);
}
.even-row {
background-color: rgba(102, 68, 24, 0.1);
}
td {
white-space: nowrap;
padding: 3px 8px;
}
.align-right {
text-align: right;
}
#drinks-table {
font-size: 0.9rem;
border-top: 1px solid #664422;
border-left: 1px solid #664422;
padding: 3px 6px;
}
#drinks-table td {
padding: 2px 5px;
text-align: right;
white-space: nowrap;
}
#drinks-table tfoot {
color: #EE9933;
}
.bandbox {

View File

@@ -32,9 +32,9 @@
<p>{{ topic }}:</p>
<table>
{% for payment in payments %}
<tr>
<tr class="{% cycle 'odd-row' 'even-row' %}">
<td>{{ payment.date|date:"d.m." }}</td>
<td>{{ payment.amount }}€</td>
<td class="align-right">{{ payment.amount }}€</td>
<td>{{ payment.other_party }}</td>
<td>
{% if payment.is_estimated %}(geschätzt){% endif %}
@@ -46,92 +46,16 @@
{% endfor %}
<h3>geplante Getränke</h3>
<p>Wir haben hier mal mit der Erfahrung des letzten Jahres grob überschlagen:</p>
<table>
<thead>
<tr>
<td></td>
<td>Kästen</td>
<td>Fl./K.</td>
<td>Fl. ges.</td>
<td>Preis/K.</td>
<td>Preis ges.</td>
<td>Pfand/K.</td>
<td>Pfand ges.</td>
</tr>
</thead>
<tr>
<td>Sterni</td>
<td>25</td>
<td>20</td>
<td>500</td>
<td>8,- €</td>
<td>200,- €</td>
<td>3,10 €</td>
<td>77,50 €</td>
</tr>
<tr>
<td>Uri</td>
<td>15</td>
<td>20</td>
<td>300</td>
<td>11,- €</td>
<td>165,- €</td>
<td>3,10 €</td>
<td>46,50 €</td>
</tr>
<tr>
<td>Radler</td>
<td>10</td>
<td>20</td>
<td>200</td>
<td>11,- €</td>
<td>110,- €</td>
<td>3,10 €</td>
<td>31,- €</td>
</tr>
<tr>
<td>Wasser</td>
<td>10</td>
<td>12</td>
<td>120</td>
<td>6,- €</td>
<td>60,- €</td>
<td>3,10 €</td>
<td>31,- €</td>
</tr>
<tr>
<td>Limo</td>
<td>5</td>
<td>12</td>
<td>60</td>
<td>8,- €</td>
<td>40,- €</td>
<td>3,10 €</td>
<td>15,50 €</td>
</tr>
<tr>
<td>Mate</td>
<td>4</td>
<td>20</td>
<td>80</td>
<td>14,- €</td>
<td>56,- €</td>
<td>4,50 €</td>
<td>18,- €</td>
</tr>
<tr>
<td>Summe</td>
<td>69</td>
<td>-</td>
<td>1260</td>
<td>-</td>
<td>631,- €</td>
<td>-</td>
<td>219,50 €</td>
<table id="drinks-table">
{% for line in drinks_table %}
{% if forloop.first %} <thead> {% elif forloop.last %} <tfoot> {% endif %}
<tr class="{% cycle 'odd-row' 'even-row' %}">
{% for cell in line %}
<td>{{ cell }}</td>
{% endfor %}
</tr>
{% if forloop.first %} </thead> {% elif forloop.last %} </tfoot> {% endif %}
{% endfor %}
</table>
{% endblock %}