home · contact · privacy
Improve ledger templates and their testing files. master
authorChristian Heller <c.heller@plomlompom.de>
Sun, 11 Jan 2026 17:29:18 +0000 (18:29 +0100)
committerChristian Heller <c.heller@plomlompom.de>
Sun, 11 Jan 2026 17:29:18 +0000 (18:29 +0100)
src/ledgplom/ledger.py
src/templates/_base.tmpl
src/templates/_macros.tmpl
src/templates/ledger_raw.tmpl
src/templates/ledger_structured.tmpl
src/tests/empty.html
src/tests/full.dat
src/tests/full.html

index bc7323bac656e647744a8791ac2b2c46e8cd9808..5e6b00b2049da9229d85f870cea697cd9b7e1fb8 100644 (file)
@@ -593,8 +593,8 @@ class Ledger:
         if (not dat_lines) or dat_lines[-1].code:  # ensure final gap line so
             dat_lines += [_DatLine()]              # last booking gets finished
         booking_lines: list[_BookingLine] = []
         if (not dat_lines) or dat_lines[-1].code:  # ensure final gap line so
             dat_lines += [_DatLine()]              # last booking gets finished
         booking_lines: list[_BookingLine] = []
-        new_block = DatBlock(None, _Gap())
-        self._blocks_start = new_block
+        i_block = DatBlock(None, _Gap())
+        self._blocks_start = i_block
         for dat_line in dat_lines:
             if bool(dat_line.code):
                 if not booking_lines:
         for dat_line in dat_lines:
             if bool(dat_line.code):
                 if not booking_lines:
@@ -603,10 +603,12 @@ class Ledger:
                     booking_lines += [_TransferLine.from_dat(dat_line)]
             else:  # enter new gap -> ready to start next block
                 if booking_lines:
                     booking_lines += [_TransferLine.from_dat(dat_line)]
             else:  # enter new gap -> ready to start next block
                 if booking_lines:
-                    new_block.next = DatBlock(_Booking(booking_lines))
-                    new_block = new_block.next
-                    booking_lines = []
-                new_block.gap.add([_GapLine.from_dat(dat_line)])
+                    ### i_block = i_block.next = DatBlock(_Booking(booking_lines))
+                    i_block.next = DatBlock(_Booking(booking_lines))
+                    i_block = i_block.next
+                    ### booking_lines.clear()
+                    booking_lines = [] # .clear()
+                i_block.gap.add([_GapLine.from_dat(dat_line)])
         self.last_save_hash = self._hash_dat_lines()
 
     @property
         self.last_save_hash = self._hash_dat_lines()
 
     @property
@@ -700,7 +702,7 @@ class Ledger:
         lines_gap_post_booking: list[_GapLine] = []
         for dat_line in [_DatLine.from_raw(line) for line in new_lines]:
             if dat_line.code:
         lines_gap_post_booking: list[_GapLine] = []
         for dat_line in [_DatLine.from_raw(line) for line in new_lines]:
             if dat_line.code:
-                if lines_gap_post_booking:
+                if lines_gap_post_booking:  # .code belongs to _next_ Booking
                     lines_gap_post_booking += [_GapLine.from_dat(dat_line)]
                 elif not lines_booking:
                     lines_booking += [_IntroLine.from_dat(dat_line)]
                     lines_gap_post_booking += [_GapLine.from_dat(dat_line)]
                 elif not lines_booking:
                     lines_booking += [_IntroLine.from_dat(dat_line)]
index d91f5d8370d03a175525b9c198fa4a34270797da..afecacc77c8003d72cea365078acec5efb096920 100644 (file)
@@ -30,13 +30,13 @@ table.alternating > tbody > tr:nth-child(odd) {
     background-color: #dcdcdc;
 }
 table.alternating > tbody > tr:nth-child(even) {
     background-color: #dcdcdc;
 }
 table.alternating > tbody > tr:nth-child(even) {
-    {{macros.css_bg_white()}};
+    {{macros.css_bg_white()}}
 }
 td {
     vertical-align: top;
 }
 }
 td {
     vertical-align: top;
 }
-div.critical, td.critical, tr.critical, span.critical, input[type="submit"].critical {
-    {{macros.css_bg_red()}}
+.critical {
+    background: {{macros.css_red()}} !important;
 }
 {% block css %}
 {% endblock %}
 }
 {% block css %}
 {% endblock %}
index 46a55a3c7c8a4adecb1c97e976f7435db75cfab8..e6b9268dd53b755991ee6d5d89388d605d30d3c0 100644 (file)
@@ -1,7 +1,14 @@
 {# =====================[ general css ]========================== #}
 
 {# =====================[ general css ]========================== #}
 
-{% macro css_bg_white() %}background: #ffffff;{% endmacro %}
-{% macro css_bg_red() %}background: #ff6666;{% endmacro %}
+{% macro css_red()          %}#ff6666{% endmacro %}
+{% macro css_red_lighter()  %}#ff8a8a{% endmacro %}
+{% macro css_white()        %}#ffffff{% endmacro %}
+
+
+
+{% macro css_bg_white() -%}
+{##}background: {{ css_white() }};
+{%- endmacro %}
 
 
 
 
 
 
 {% endmacro %}
 
 
 {% endmacro %}
 
 
+
 {% macro css_tabular_money() %}
 td.amount {
     text-align: right;
 }
 {% macro css_tabular_money() %}
 td.amount {
     text-align: right;
 }
-td.amount, td.currency {
-{{ css_noninput_monospace()
-}}}{% endmacro %}
-{# endmacro #}
+td.amount,
+td.currency {
+{{ css_noninput_monospace() -}}
+}
+{%- endmacro %}
 
 
 
 {% macro css_balance() %}
 
 
 
 {% macro css_balance() %}
-table.alternating.critical > tbody > tr:nth-child(odd) {
-    {{ css_bg_red() }}
-}
 table.alternating.critical > tbody > tr:nth-child(even) {
 table.alternating.critical > tbody > tr:nth-child(even) {
-    background-color: #ff8a8a;
+    background-color: {{ css_red_lighter() }};
 }
 td.balance.amount {
     width: 10em;
 }
 td.balance.currency {
     width: 3em;
 }
 td.balance.amount {
     width: 10em;
 }
 td.balance.currency {
     width: 3em;
-}{%
-endmacro %}
-{# endmacro #}
+}
+{%- endmacro %}
 
 
 
 
 
 
@@ -63,10 +68,7 @@ endmacro %}
 td.block_column {
     {{css_bg_white()}}
 }
 td.block_column {
     {{css_bg_white()}}
 }
-td.block_column.critical {
-    {{css_bg_red()}}
-}{% endmacro %}
-{# endmacro #}
+{%- endmacro %}
 
 
 
 
 
 
@@ -80,20 +82,38 @@ td.block_column.critical {
 
 
 {% macro ledger_block_columns(mode, block) %}
 
 
 {% macro ledger_block_columns(mode, block) %}
-    <tr></tr><!-- just to keep the background-color alternation in proper order -->
-    <tr id="block_{{block.id_}}">
-        <td class="block_column {% if block.date_error %}critical{% endif %}" rowspan={{block.lines|length + 1}}>
-            <input type="submit" name="ledger_moveup_{{block.id_}}" value="^" {% if not block.can_move(1) %}disabled{% endif %}/><br />
-            <input type="submit" name="ledger_movedown_{{block.id_}}" value="v" {% if not block.can_move(0) %}disabled{% endif %}/><br />
-            <input type="submit" name="ledger_copy_{{block.id_}}" value="C" />
+    <tr></tr><!-- keep the background-color alternation in proper order -->
+    <tr id="block_{{ block.id_ }}">
+        <td rowspan={{ block.lines | length + 1 }} {# -#}
+            class="block_column{{ ' critical' if block.date_error }}">
+            <input type="submit"
+                   name="ledger_moveup_{{ block.id_ }}"
+                   value="^"
+                   {{- '
+                   disabled' if not block.can_move(1) }}
+                   />
+            <br />
+            <input type="submit"
+                   name="ledger_movedown_{{ block.id_ }}"
+                   value="v"
+                   {{- '
+                   disabled' if not block.can_move(0) }}
+                   />
+            <br />
+            <input type="submit" {# -#}
+                   name="ledger_copy_{{ block.id_ }}" {# -#}
+                   value="C"{# -#}
+                   />
         </td>
         </td>
-        <td class="block_column {% if block.booking and block.booking.sink_error %}critical{% endif %}" rowspan={{block.lines|length + 1}}>
+        <td rowspan={{ block.lines | length + 1 }} {# -#}
+            class="block_column{{ 'critical' if block.booking
+                                             and block.booking.sink_error}}">
             [<a href="#block_{{block.id_}}">#</a>]<br />
             [<a href="/balance?up_incl={{block.id_}}">b</a>]<br />
             [<a href="/edit_{{mode}}/{{block.id_}}">e</a>]
         </td>
             [<a href="#block_{{block.id_}}">#</a>]<br />
             [<a href="/balance?up_incl={{block.id_}}">b</a>]<br />
             [<a href="/edit_{{mode}}/{{block.id_}}">e</a>]
         </td>
-    </tr >{% endmacro %}
-{# endmacro #}
+    </tr>
+{% endmacro %}
 
 
 {# =====================[ for edit pages ]======================= #}
 
 
 {# =====================[ for edit pages ]======================= #}
index 87795040388cf4ad8c4dca6797b2374a653fb59f..5f129fb8535719633a3f860da78e753e044b46af 100644 (file)
@@ -3,7 +3,7 @@
 
 
 {% block css %}
 
 
 {% block css %}
-{{macros.css_ledger()}}
+{{ macros.css_ledger() }}
 table {
     font-family: monospace;
 }
 table {
     font-family: monospace;
 }
@@ -13,15 +13,15 @@ table {
 
 {% block content %}
 <form action="/ledger_raw" method="POST">
 
 {% block content %}
 <form action="/ledger_raw" method="POST">
-{{macros.ledger_empty_lines_fix(has_redundant_empty_lines)}}
+{{ macros.ledger_empty_lines_fix(has_redundant_empty_lines) -}}
 <table class="alternating">
 {% for block in blocks %}
 <table class="alternating">
 {% for block in blocks %}
-    {{macros.ledger_block_columns('raw', block)}}
-    {% for line in block.lines %}
+    {{ macros.ledger_block_columns('raw', block) }}
+{##}{% for line in block.lines %}
         <tr>
         <tr>
-        <td {% if line.errors %}class="critical"{% endif %}>{{line.raw}}&nbsp;</td>
+        <td class="{{ 'critical' if line.errors }}">{{line.raw}}&nbsp;</td>
         </tr>
         </tr>
-    {% endfor %}
+{##}{% endfor %}
 {% endfor %}
 </table>
 </form>
 {% endfor %}
 </table>
 </form>
index fd1c120e4161fa9b6c2ba7e5ddddebb7577936f2..aeae2ba5859848e75bb7c062209f4ed23a800840 100644 (file)
@@ -3,31 +3,40 @@
 
 
 {% block css %}
 
 
 {% block css %}
-{{macros.css_ledger()}}
-{{macros.css_tabular_money()}}
+{{ macros.css_ledger() }}
+{{ macros.css_tabular_money() }}
 {% endblock %}
 
 
 
 {% block content %}
 <form action="/ledger_structured" method="POST">
 {% endblock %}
 
 
 
 {% block content %}
 <form action="/ledger_structured" method="POST">
-{{ macros.ledger_empty_lines_fix(has_redundant_empty_lines)
-}}<table class="alternating">
+{{ macros.ledger_empty_lines_fix(has_redundant_empty_lines) -}}
+<table class="alternating">
 {% for block in blocks %}
 {% for block in blocks %}
-{##}{{ macros.ledger_block_columns('structured', block) }}
+{{ macros.ledger_block_columns('structured', block) -}}
 {##}{% if block.booking %}
     <tr>
 {##}{% if block.booking %}
     <tr>
-        <td colspan=3 {% if block.booking.intro_line.errors %}class="critical"{% endif %}>{{block.booking.date}} {{block.booking.target}}</td>
-        <td>{{block.booking.intro_line.comment}}</td>
+        <td colspan=3 class="{{ 'critical'
+                                if block.booking.intro_line.errors }}">
+            {{- block.booking.date }} {{ block.booking.target -}}
+        </td>
+        <td>{{ block.booking.intro_line.comment }}</td>
     </tr>
     </tr>
-{######}{% for line in block.booking.transfer_lines %}
+{####}{% for line in block.booking.transfer_lines %}
     <tr>
     <tr>
-        <td class="amount {% if line.errors %}critical{% endif %}">{{line.amount_short}}</td>
-        <td class="currency {% if line.errors %}critical{% endif %}">{{ macros.currency_short(line.currency) }}</td>
-        <td {% if line.errors %}class="critical"{% endif %}>{{line.account}}</td>
-        <td>{{line.comment}}</td>
+        <td class="amount{{ ' critical' if line.errors }}">
+            {{- line.amount_short -}}
+        </td>
+        <td class="currency{{ ' critical' if line.errors }}">
+            {{- macros.currency_short(line.currency) -}}
+        </td>
+        <td class="{{ 'critical' if line.errors }}">
+            {{- line.account -}}
+        </td>
+        <td>{{ line.comment }}</td>
     </tr>
     </tr>
-{######}{% endfor %}
+{####}{% endfor %}
 {##}{% endif %}
 {##}{% for line in block.gap.lines %}
     <tr>
 {##}{% endif %}
 {##}{% for line in block.gap.lines %}
     <tr>
index 15c4cdebd01b3b0521778b8945ca28f2a26d6a6f..b173595f8756f019f814630b90ca1a092edfac8f 100644 (file)
@@ -27,24 +27,22 @@ table.alternating > tbody > tr:nth-child(odd) {
     background-color: #dcdcdc;
 }
 table.alternating > tbody > tr:nth-child(even) {
     background-color: #dcdcdc;
 }
 table.alternating > tbody > tr:nth-child(even) {
-    background: #ffffff;;
+    background: #ffffff;
 }
 td {
     vertical-align: top;
 }
 }
 td {
     vertical-align: top;
 }
-div.critical, td.critical, tr.critical, span.critical, input[type="submit"].critical {
-    background: #ff6666;
+.critical {
+    background: #ff6666 !important;
 }
 td.block_column {
     background: #ffffff;
 }
 }
 td.block_column {
     background: #ffffff;
 }
-td.block_column.critical {
-    background: #ff6666;
-}
 td.amount {
     text-align: right;
 }
 td.amount {
     text-align: right;
 }
-td.amount, td.currency {
+td.amount,
+td.currency {
     font-family: monospace;
     font-size: 1.25em;
 }
     font-family: monospace;
     font-size: 1.25em;
 }
@@ -63,19 +61,29 @@ td.amount, td.currency {
 </div>
 <form action="/ledger_structured" method="POST">
 <table class="alternating">
 </div>
 <form action="/ledger_structured" method="POST">
 <table class="alternating">
-    <tr></tr><!-- just to keep the background-color alternation in proper order -->
+    <tr></tr><!-- keep the background-color alternation in proper order -->
     <tr id="block_0">
     <tr id="block_0">
-        <td class="block_column " rowspan=2>
-            <input type="submit" name="ledger_moveup_0" value="^" disabled/><br />
-            <input type="submit" name="ledger_movedown_0" value="v" disabled/><br />
-            <input type="submit" name="ledger_copy_0" value="C" />
+        <td rowspan=2 class="block_column">
+            <input type="submit"
+                   name="ledger_moveup_0"
+                   value="^"
+                   disabled
+                   />
+            <br />
+            <input type="submit"
+                   name="ledger_movedown_0"
+                   value="v"
+                   disabled
+                   />
+            <br />
+            <input type="submit" name="ledger_copy_0" value="C"/>
         </td>
         </td>
-        <td class="block_column " rowspan=2>
+        <td rowspan=2 class="block_column">
             [<a href="#block_0">#</a>]<br />
             [<a href="/balance?up_incl=0">b</a>]<br />
             [<a href="/edit_structured/0">e</a>]
         </td>
             [<a href="#block_0">#</a>]<br />
             [<a href="/balance?up_incl=0">b</a>]<br />
             [<a href="/edit_structured/0">e</a>]
         </td>
-    </tr >
+    </tr>
     <tr>
         <td colspan=4>&nbsp;</td>
     </tr>
     <tr>
         <td colspan=4>&nbsp;</td>
     </tr>
index 3cf3339b55f51d46eba42471dbfd39318c91aa1c..2866ede4e46b563ca0e89dc3e13136eb57f32cff 100644 (file)
@@ -1,7 +1,17 @@
-2001-01-01 test
-    foo  10 €
+2001-01-01 test  ; foo
+    foo    10 €
     bar   -10 €
 
 2001-01-02 test
     bar   -10 €
 
 2001-01-02 test
-    bar  20 €
-    baz  -20 €
+    bar   -10 €  ; bar
+    baz    10 €
+
+
+2001-01-02 test
+    bar    20 €
+    baz   -20 €  ; baz
+
+2001-01-01 test
+    foo    10 €
+    bar   -10 €
+
index 41c0ed6d94412ab8899470456f21454c130b6ff6..8f3b3b250c0490ca19f1b2c6e2a6a8def99152c2 100644 (file)
@@ -27,24 +27,22 @@ table.alternating > tbody > tr:nth-child(odd) {
     background-color: #dcdcdc;
 }
 table.alternating > tbody > tr:nth-child(even) {
     background-color: #dcdcdc;
 }
 table.alternating > tbody > tr:nth-child(even) {
-    background: #ffffff;;
+    background: #ffffff;
 }
 td {
     vertical-align: top;
 }
 }
 td {
     vertical-align: top;
 }
-div.critical, td.critical, tr.critical, span.critical, input[type="submit"].critical {
-    background: #ff6666;
+.critical {
+    background: #ff6666 !important;
 }
 td.block_column {
     background: #ffffff;
 }
 }
 td.block_column {
     background: #ffffff;
 }
-td.block_column.critical {
-    background: #ff6666;
-}
 td.amount {
     text-align: right;
 }
 td.amount {
     text-align: right;
 }
-td.amount, td.currency {
+td.amount,
+td.currency {
     font-family: monospace;
     font-size: 1.25em;
 }
     font-family: monospace;
     font-size: 1.25em;
 }
@@ -63,78 +61,193 @@ td.amount, td.currency {
 </div>
 <form action="/ledger_structured" method="POST">
 <table class="alternating">
 </div>
 <form action="/ledger_structured" method="POST">
 <table class="alternating">
-    <tr></tr><!-- just to keep the background-color alternation in proper order -->
+    <tr></tr><!-- keep the background-color alternation in proper order -->
     <tr id="block_0">
     <tr id="block_0">
-        <td class="block_column " rowspan=1>
-            <input type="submit" name="ledger_moveup_0" value="^" disabled/><br />
-            <input type="submit" name="ledger_movedown_0" value="v" disabled/><br />
-            <input type="submit" name="ledger_copy_0" value="C" />
+        <td rowspan=1 class="block_column">
+            <input type="submit"
+                   name="ledger_moveup_0"
+                   value="^"
+                   disabled
+                   />
+            <br />
+            <input type="submit"
+                   name="ledger_movedown_0"
+                   value="v"
+                   disabled
+                   />
+            <br />
+            <input type="submit" name="ledger_copy_0" value="C"/>
         </td>
         </td>
-        <td class="block_column " rowspan=1>
+        <td rowspan=1 class="block_column">
             [<a href="#block_0">#</a>]<br />
             [<a href="/balance?up_incl=0">b</a>]<br />
             [<a href="/edit_structured/0">e</a>]
         </td>
             [<a href="#block_0">#</a>]<br />
             [<a href="/balance?up_incl=0">b</a>]<br />
             [<a href="/edit_structured/0">e</a>]
         </td>
-    </tr >
-    <tr></tr><!-- just to keep the background-color alternation in proper order -->
+    </tr>
+    <tr></tr><!-- keep the background-color alternation in proper order -->
     <tr id="block_1">
     <tr id="block_1">
-        <td class="block_column " rowspan=5>
-            <input type="submit" name="ledger_moveup_1" value="^" disabled/><br />
-            <input type="submit" name="ledger_movedown_1" value="v" disabled/><br />
-            <input type="submit" name="ledger_copy_1" value="C" />
+        <td rowspan=5 class="block_column">
+            <input type="submit"
+                   name="ledger_moveup_1"
+                   value="^"
+                   disabled
+                   />
+            <br />
+            <input type="submit"
+                   name="ledger_movedown_1"
+                   value="v"
+                   disabled
+                   />
+            <br />
+            <input type="submit" name="ledger_copy_1" value="C"/>
         </td>
         </td>
-        <td class="block_column " rowspan=5>
+        <td rowspan=5 class="block_column">
             [<a href="#block_1">#</a>]<br />
             [<a href="/balance?up_incl=1">b</a>]<br />
             [<a href="/edit_structured/1">e</a>]
         </td>
             [<a href="#block_1">#</a>]<br />
             [<a href="/balance?up_incl=1">b</a>]<br />
             [<a href="/edit_structured/1">e</a>]
         </td>
-    </tr >
+    </tr>
     <tr>
     <tr>
-        <td colspan=3 >2001-01-01 test</td>
-        <td></td>
+        <td colspan=3 class="">2001-01-01 test</td>
+        <td>foo</td>
     </tr>
     <tr>
     </tr>
     <tr>
-        <td class="amount ">10.00</td>
-        <td class="currency ">€</td>
-        <td >foo</td>
+        <td class="amount">10.00</td>
+        <td class="currency">€</td>
+        <td class="">foo</td>
         <td></td>
     </tr>
     <tr>
         <td></td>
     </tr>
     <tr>
-        <td class="amount ">-10.00</td>
-        <td class="currency ">€</td>
-        <td >bar</td>
+        <td class="amount">-10.00</td>
+        <td class="currency">€</td>
+        <td class="">bar</td>
         <td></td>
     </tr>
     <tr>
         <td colspan=4>&nbsp;</td>
     </tr>
         <td></td>
     </tr>
     <tr>
         <td colspan=4>&nbsp;</td>
     </tr>
-    <tr></tr><!-- just to keep the background-color alternation in proper order -->
+    <tr></tr><!-- keep the background-color alternation in proper order -->
     <tr id="block_2">
     <tr id="block_2">
-        <td class="block_column " rowspan=5>
-            <input type="submit" name="ledger_moveup_2" value="^" disabled/><br />
-            <input type="submit" name="ledger_movedown_2" value="v" disabled/><br />
-            <input type="submit" name="ledger_copy_2" value="C" />
+        <td rowspan=6 class="block_column">
+            <input type="submit"
+                   name="ledger_moveup_2"
+                   value="^"
+                   disabled
+                   />
+            <br />
+            <input type="submit"
+                   name="ledger_movedown_2"
+                   value="v"
+                   />
+            <br />
+            <input type="submit" name="ledger_copy_2" value="C"/>
         </td>
         </td>
-        <td class="block_column " rowspan=5>
+        <td rowspan=6 class="block_column">
             [<a href="#block_2">#</a>]<br />
             [<a href="/balance?up_incl=2">b</a>]<br />
             [<a href="/edit_structured/2">e</a>]
         </td>
             [<a href="#block_2">#</a>]<br />
             [<a href="/balance?up_incl=2">b</a>]<br />
             [<a href="/edit_structured/2">e</a>]
         </td>
-    </tr >
+    </tr>
+    <tr>
+        <td colspan=3 class="">2001-01-02 test</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td class="amount">-10.00</td>
+        <td class="currency">€</td>
+        <td class="">bar</td>
+        <td>bar</td>
+    </tr>
+    <tr>
+        <td class="amount">10.00</td>
+        <td class="currency">€</td>
+        <td class="">baz</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td colspan=4>&nbsp;</td>
+    </tr>
+    <tr>
+        <td colspan=4>&nbsp;</td>
+    </tr>
+    <tr></tr><!-- keep the background-color alternation in proper order -->
+    <tr id="block_3">
+        <td rowspan=5 class="block_column">
+            <input type="submit"
+                   name="ledger_moveup_3"
+                   value="^"
+                   />
+            <br />
+            <input type="submit"
+                   name="ledger_movedown_3"
+                   value="v"
+                   disabled
+                   />
+            <br />
+            <input type="submit" name="ledger_copy_3" value="C"/>
+        </td>
+        <td rowspan=5 class="block_column">
+            [<a href="#block_3">#</a>]<br />
+            [<a href="/balance?up_incl=3">b</a>]<br />
+            [<a href="/edit_structured/3">e</a>]
+        </td>
+    </tr>
+    <tr>
+        <td colspan=3 class="">2001-01-02 test</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td class="amount">20.00</td>
+        <td class="currency">€</td>
+        <td class="">bar</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td class="amount">-20.00</td>
+        <td class="currency">€</td>
+        <td class="">baz</td>
+        <td>baz</td>
+    </tr>
+    <tr>
+        <td colspan=4>&nbsp;</td>
+    </tr>
+    <tr></tr><!-- keep the background-color alternation in proper order -->
+    <tr id="block_4">
+        <td rowspan=5 class="block_column critical">
+            <input type="submit"
+                   name="ledger_moveup_4"
+                   value="^"
+                   disabled
+                   />
+            <br />
+            <input type="submit"
+                   name="ledger_movedown_4"
+                   value="v"
+                   disabled
+                   />
+            <br />
+            <input type="submit" name="ledger_copy_4" value="C"/>
+        </td>
+        <td rowspan=5 class="block_column">
+            [<a href="#block_4">#</a>]<br />
+            [<a href="/balance?up_incl=4">b</a>]<br />
+            [<a href="/edit_structured/4">e</a>]
+        </td>
+    </tr>
     <tr>
     <tr>
-        <td colspan=3 >2001-01-02 test</td>
+        <td colspan=3 class="">2001-01-01 test</td>
         <td></td>
     </tr>
     <tr>
         <td></td>
     </tr>
     <tr>
-        <td class="amount ">20.00</td>
-        <td class="currency ">€</td>
-        <td >bar</td>
+        <td class="amount">10.00</td>
+        <td class="currency">€</td>
+        <td class="">foo</td>
         <td></td>
     </tr>
     <tr>
         <td></td>
     </tr>
     <tr>
-        <td class="amount ">-20.00</td>
-        <td class="currency ">€</td>
-        <td >baz</td>
+        <td class="amount">-10.00</td>
+        <td class="currency">€</td>
+        <td class="">bar</td>
         <td></td>
     </tr>
     <tr>
         <td></td>
     </tr>
     <tr>