From e4946853e3da57f0186dd20034dc6becc316b549 Mon Sep 17 00:00:00 2001 From: Adrien CLERC Date: Mon, 17 Feb 2020 21:51:28 +0100 Subject: [PATCH] Align tables in statistics The table in sidebar is now aligned with the one in content, to avoid redundant informations. All tables are back to normal on small devices. --- ihatemoney/static/css/main.css | 8 ++++ ihatemoney/templates/statistics.html | 63 +++++++++++++++------------- 2 files changed, 41 insertions(+), 30 deletions(-) diff --git a/ihatemoney/static/css/main.css b/ihatemoney/static/css/main.css index 1a7dc1fb..eaafd7ba 100644 --- a/ihatemoney/static/css/main.css +++ b/ihatemoney/static/css/main.css @@ -316,6 +316,13 @@ footer .footer-left { margin-bottom: 30px; } +@media (min-width: 768px) { + .split_bills, #table_overflow.statistics { + /* The table is shifted to left, so add the spacer width on the right to match */ + width: calc(100% + 15px); + } +} + .project-actions > .delete, .project-actions > .edit { font-size: 0px; @@ -388,6 +395,7 @@ tr.payer_line .balance-name { .balance.table { table-layout: fixed; + margin-top: 30px; } #bill-form > fieldset { diff --git a/ihatemoney/templates/statistics.html b/ihatemoney/templates/statistics.html index 539781ff..73211883 100644 --- a/ihatemoney/templates/statistics.html +++ b/ihatemoney/templates/statistics.html @@ -1,12 +1,14 @@ {% extends "sidebar_table_layout.html" %} {% block sidebar %} -
+
- - - - + + + + + + {% for stat in members_stats| sort(attribute='member.name') %} @@ -21,30 +23,31 @@ {% block content %} -

{{ _("Balance") }}

-
{{ _("Balance") }}
{{ _("Who?") }}{{ _("Balance") }}
{{ stat.member.name }}
- - - {% for stat in members_stats %} - - - - - - {% endfor %} - -
{{ _("Who?") }}{{ _("Paid") }}{{ _("Spent") }}
{{ stat.member.name }}{{ "%0.2f"|format(stat.paid) }}{{ "%0.2f"|format(stat.spent) }}
-

{{ _("Expenses by Month") }}

- - - - {% for month in months %} - - - - - {% endfor %} - -
{{ _("Period") }}{{ _("Spent") }}
{{ _(month.strftime("%B")) }} {{ month.year }}{{ "%0.2f"|format(monthly_stats[month.year][month.month]) }}
+
+ + + + {% for stat in members_stats %} + + + + + + {% endfor %} + +
{{ _("Who?") }}{{ _("Paid") }}{{ _("Spent") }}
{{ stat.member.name }}{{ "%0.2f"|format(stat.paid) }}{{ "%0.2f"|format(stat.spent) }}
+

{{ _("Expenses by Month") }}

+ + + + {% for month in months %} + + + + + {% endfor %} + +
{{ _("Period") }}{{ _("Spent") }}
{{ _(month.strftime("%B")) }} {{ month.year }}{{ "%0.2f"|format(monthly_stats[month.year][month.month]) }}
+
{% endblock %}