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

View File

@@ -32,9 +32,9 @@
<p>{{ topic }}:</p> <p>{{ topic }}:</p>
<table> <table>
{% for payment in payments %} {% for payment in payments %}
<tr> <tr class="{% cycle 'odd-row' 'even-row' %}">
<td>{{ payment.date|date:"d.m." }}</td> <td>{{ payment.date|date:"d.m." }}</td>
<td>{{ payment.amount }}€</td> <td class="align-right">{{ payment.amount }}€</td>
<td>{{ payment.other_party }}</td> <td>{{ payment.other_party }}</td>
<td> <td>
{% if payment.is_estimated %}(geschätzt){% endif %} {% if payment.is_estimated %}(geschätzt){% endif %}
@@ -46,92 +46,16 @@
{% endfor %} {% endfor %}
<h3>geplante Getränke</h3> <h3>geplante Getränke</h3>
<p>Wir haben hier mal mit der Erfahrung des letzten Jahres grob überschlagen:</p> <table id="drinks-table">
<table> {% for line in drinks_table %}
<thead> {% if forloop.first %} <thead> {% elif forloop.last %} <tfoot> {% endif %}
<tr> <tr class="{% cycle 'odd-row' 'even-row' %}">
<td></td> {% for cell in line %}
<td>Kästen</td> <td>{{ cell }}</td>
<td>Fl./K.</td> {% endfor %}
<td>Fl. ges.</td> </tr>
<td>Preis/K.</td> {% if forloop.first %} </thead> {% elif forloop.last %} </tfoot> {% endif %}
<td>Preis ges.</td> {% endfor %}
<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>
</tr>
</table> </table>
{% endblock %} {% endblock %}