From 7412d67ed693ad1296e8b2a89de025595d9c24cf Mon Sep 17 00:00:00 2001 From: Jojo144 Date: Fri, 1 Sep 2023 16:29:50 +0200 Subject: [PATCH] [History] Truncate external links in history when they are too long --- ihatemoney/static/css/main.css | 9 +++++++++ ihatemoney/templates/history.html | 7 ++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/ihatemoney/static/css/main.css b/ihatemoney/static/css/main.css index 713e7064..46c24642 100644 --- a/ihatemoney/static/css/main.css +++ b/ihatemoney/static/css/main.css @@ -424,6 +424,15 @@ footer .footer-left { display: table-cell; } +/* used to tuncate long urls */ +.truncated { + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + max-width: 250px; + display: inline-block; + vertical-align: top; +} .balance .balance-value { text-align: right; diff --git a/ihatemoney/templates/history.html b/ihatemoney/templates/history.html index 97523ad9..262e04f0 100644 --- a/ihatemoney/templates/history.html +++ b/ihatemoney/templates/history.html @@ -177,9 +177,11 @@ {% trans %}Project {{ name }} added{% endtrans %} {% elif event.object_type == "Bill" %} {% trans %}Bill {{ name }} added{% endtrans %} + {% elif event.object_type == "Person" %} {% trans %}Participant {{ name }} added{% endtrans %} {% endif %} + {% elif event.operation_type == OperationType.UPDATE %} {% if event.object_type == "Project" %} {% if event.prop_changed == "password" %} @@ -200,7 +202,7 @@ {% set new_description=event.val_after|em_surround %} {% trans %}Bill {{ name }} renamed to {{ new_description }}{% endtrans %} {% elif event.prop_changed == "external_link" %} - {{ bill_property_change(event, _("External link"), None, "{link}".format(link=event.val_after | escape) | safe | em_surround) }} + {{ bill_property_change(event, _("External link"), None, "{link}".format(link=event.val_after | escape) | safe | em_surround) }} {% elif event.prop_changed == "owers_added" %} {{ owers_changed(event, True)}} {% elif event.prop_changed == "owers_removed" %} @@ -218,6 +220,7 @@ {% else %} {% trans %}Bill {{ name }} modified{% endtrans %} {% endif %} + {% elif event.object_type == "Person" %} {% if event.prop_changed == "activated" %} {% if event.val_after == False %} @@ -236,12 +239,14 @@ {% trans %}Participant {{ name }} modified{% endtrans %} {% endif %} {% endif %} + {% elif event.operation_type == OperationType.DELETE %} {% if event.object_type == "Bill" %} {% trans %}Bill {{ name }} removed{% endtrans %} {% elif event.object_type == "Person" %} {% trans %}Participant {{ name }} removed{% endtrans %} {% endif %} + {% else %} {# Should be unreachable #} {% if event.object_type == "Project" %}