diff --git a/nummi/main/static/main/css/plot.css b/nummi/main/static/main/css/plot.css index 4109c6b..e956ef4 100644 --- a/nummi/main/static/main/css/plot.css +++ b/nummi/main/static/main/css/plot.css @@ -1,31 +1,4 @@ -.plot table { - border-collapse: collapse; - width: 100%; - table-layout: auto; -} -.plot thead { - background: var(--bg-01); -} -.plot col.desc, .plot col.value {width: 8rem} -.plot col.icon {width: 1ch} -.plot tr { - padding-bottom: .5rem; - border: .1rem solid var(--gray); -} -.plot th {text-align: left} -.plot th.r {text-align: right} -.plot th.l {text-align: left} -.plot td.c {text-align: center} - -.plot td, .plot th, .plot td.bar div { - position: relative; - height: 2rem; - line-height: 2rem; - white-space: nowrap; -} -.plot td, .plot th { - padding: .5rem var(--gap); -} +col.bar {width: auto} .plot td.bar { position: relative; @@ -33,17 +6,8 @@ } .plot td.bar div { position: absolute; - top: .5rem; -} -.plot td.m { - text-align: right; -} -.plot tbody th { - font-feature-settings: var(--num); -} -.plot td.value { - font-feature-settings: var(--num); - text-align: right; + height: .5rem; + top: 0; } .plot td.bar div:not(.tot) { diff --git a/nummi/main/static/main/css/table.css b/nummi/main/static/main/css/table.css index 86710ac..1b27340 100644 --- a/nummi/main/static/main/css/table.css +++ b/nummi/main/static/main/css/table.css @@ -1,60 +1,26 @@ -.table { - display: grid; - margin: 2em 0; - border-radius: var(--radius); - overflow: hidden; - border-bottom: var(--border) solid var(--theme); +table { + border-collapse: collapse; + width: 100%; } -.table.col2 {grid-template-columns: repeat(2, auto)} -.table.col3 {grid-template-columns: repeat(3, auto)} -.table.col4 {grid-template-columns: repeat(4, auto)} -.table.col5 {grid-template-columns: repeat(5, auto)} -.table.col6 {grid-template-columns: repeat(6, auto)} -.table.col1-1 {grid-template-columns: min-content auto} -.table.col1-1-1 {grid-template-columns: min-content auto min-content} -.table.col2-4 {grid-template-columns: repeat(2, min-content) repeat(4, auto)} -.table.col1-5 {grid-template-columns: min-content repeat(5, auto)} -.table.col2-5 {grid-template-columns: repeat(2, min-content) repeat(5, auto)} -.table.col1-6 {grid-template-columns: min-content repeat(6, auto)} -.table.col1-7 {grid-template-columns: min-content repeat(7, auto)} - -.table > div { - display: contents; +thead { + background: var(--bg-01); } - -.table > div > * { - padding: 1em; +col {width: 8rem} +col.icon {width: 1ch} +tr { + border: .1rem solid var(--gray); + height: 2rem; + line-height: 2rem; +} +td, th { + padding: 0 var(--gap); + position: relative; white-space: nowrap; -} -.table > div:nth-child(odd) > * {background: var(--bg-01)} -.table > div:nth-child(even) > * {background: var(--bg)} - -.table > div.header > * { - background: var(--theme); -} - -.table > div > .center { - text-align: center; -} -.table > div > .right { - text-align: right; -} -.table > div > .num { - font-feature-settings: var(--num); -} -.table > div > span.value { - filter: brightness(95%); - font-weight: 600; -} - -.table > div > span.text { - overflow: hidden; text-overflow: ellipsis; } -.table > div.full-line > * { - grid-column: 1 / -1; - text-align: center; -} -.table > .invoice.new > a { - grid-column: 2 / -1; +.date, .value { + font-feature-settings: var(--num); } +.l {text-align: left} +.r, .value {text-align: right} +.c, .date {text-align: center} diff --git a/nummi/main/templates/main/plot/category.html b/nummi/main/templates/main/plot/category.html index 0ad4584..8a15510 100644 --- a/nummi/main/templates/main/plot/category.html +++ b/nummi/main/templates/main/plot/category.html @@ -12,8 +12,8 @@ {% translate "Category" %} - {% translate "Expenses" %} - {% translate "Income" %} + {% translate "Expenses" %} + {% translate "Income" %} diff --git a/nummi/main/templates/main/plot/history.html b/nummi/main/templates/main/plot/history.html index 60157af..56da292 100644 --- a/nummi/main/templates/main/plot/history.html +++ b/nummi/main/templates/main/plot/history.html @@ -11,15 +11,15 @@ {% translate "Month" %} - {% translate "Expenses" %} - {% translate "Income" %} + {% translate "Expenses" %} + {% translate "Income" %} {% spaceless %} {% for date in history.data %} - {{ date.month|date:"Y-m" }} + {{ date.month|date:"Y-m" }} {{ date.sum_m|pmrvalue }}
diff --git a/nummi/main/templates/main/table/transaction.html b/nummi/main/templates/main/table/transaction.html index 2a49595..7bb1c5b 100644 --- a/nummi/main/templates/main/table/transaction.html +++ b/nummi/main/templates/main/table/transaction.html @@ -1,21 +1,77 @@ {% load main_extras %} {% load i18n %} -
-
- - {% translate "Date" %} - {% translate "Name" %} - {% translate "Value" %} - {% translate "Trader" %} - {% if not category %} - {% translate "Category" %} - {% endif %} - {% if not account %} - - {% endif %} - {% translate "Description" %} -
+
+ + + + + + + + + + + + + + + + + + + {% if not category %} + + {% endif %} + {% if not account %} + + {% endif %} + + + {% for trans in transactions %} + + + + + + + {% if not category %} + {% if trans.category %} + + + {% else %} + + {% endif %} + + {% endif %} + {% if not account %} + + + {% endif %} + + {% endfor %} + +
+ + {% translate "Date" %}{% translate "Name" %}{% translate "Value" %}{% translate "Trader" %}{% translate "Category" %}{% translate "Account" %}
+ {% for invoice in trans.invoices %} + + + + {% endfor %} + {{ trans.date|date:"Y-m-d" }} + {{ trans.name }} + {{ trans.value|pmvalue }}{{ trans.trader|default_if_none:"–" }} + + + {{ trans.category }} + + + + {{ trans.account }} +
+
+{% comment %} +
{% if new_transaction_url %}
{% translate "New transaction" %} @@ -23,39 +79,6 @@ {% endif %} {% for trans in transactions %}
- - {% for invoice in trans.invoices %} - {% spaceless %} - - - - {% endspaceless %} - {% endfor %} - - {{ trans.date|date:"Y-m-d" }} - {{ trans.name }} - {{ trans.value|pmvalue }} - {{ trans.trader|default_if_none:"–" }} - {% if not category %} - - {% if trans.category %} - - {{ trans.category }} - {% else %} - – - {% endif %} - - {% endif %} - {% if not account %} - - {% endif %} {{ trans.description }}
{% endfor %} @@ -65,3 +88,4 @@
{% endif %}
+{% endcomment %}