# HG changeset patch # User Goffi # Date 1701347083 -3600 # Node ID 8b990c78d4b545ae275c39e105e8dd4181e6f526 # Parent e63fb06052aeaba93bf34c7aba4e658dfac26fa0 (bulma/chat): add menu + style for message retraction diff -r e63fb06052ae -r 8b990c78d4b5 sat_templates/templates/bulma/chat/chat.html --- a/sat_templates/templates/bulma/chat/chat.html Tue Nov 28 17:48:00 2023 +0100 +++ b/sat_templates/templates/bulma/chat/chat.html Thu Nov 30 13:24:43 2023 +0100 @@ -4,7 +4,7 @@ {{ icon_defs( "lock-open", "lock-filled", "ok", "pencil", "dot-3", "share", "attach", "paper-plane-empty", "doc", "download", "wrench", "eye", "smile", "plus-circled", - "quote-left" + "quote-left", "trash-empty" ) }} {# TODO: this should be done in a more generic way in dialog module #} diff -r e63fb06052ae -r 8b990c78d4b5 sat_templates/templates/bulma/chat/extra_menu.html --- a/sat_templates/templates/bulma/chat/extra_menu.html Tue Nov 28 17:48:00 2023 +0100 +++ b/sat_templates/templates/bulma/chat/extra_menu.html Thu Nov 30 13:24:43 2023 +0100 @@ -12,5 +12,12 @@ {% endif %} + {% if retract %} +
  • + + {{ icon('trash-empty', cls='icon is-small has-text-danger') }} {% trans %}Retract{% endtrans %} + +
  • + {% endif %} diff -r e63fb06052ae -r 8b990c78d4b5 sat_templates/templates/bulma/chat/message.html --- a/sat_templates/templates/bulma/chat/message.html Tue Nov 28 17:48:00 2023 +0100 +++ b/sat_templates/templates/bulma/chat/message.html Thu Nov 30 13:24:43 2023 +0100 @@ -8,10 +8,9 @@
    {%- if msg.type != "info" %} @@ -52,15 +51,22 @@
    {% endif -%} -

    - {{- msg.html or (msg.text|e|urlize|safe) -}} +

    + {%- if msg.extra.retracted %} + {% trans %}This message has been retracted.{% endtrans %} + {% else %} + {{- msg.html or (msg.text|e|urlize|safe) -}} + {% endif -%}

    -
    +
    {#{{ icon('share', cls='icon is-small action-button', id='msg_share_{{msg.id}}') }} #} {{ icon('smile', cls='icon is-small action-button reaction-button', id='msg_actions_{{msg.id}}') }} {{ icon('dot-3', cls='icon is-small action-button extra-button', id='msg_actions_{{msg.id}}') }} diff -r e63fb06052ae -r 8b990c78d4b5 sat_templates/templates/bulma/static/chat.css --- a/sat_templates/templates/bulma/static/chat.css Tue Nov 28 17:48:00 2023 +0100 +++ b/sat_templates/templates/bulma/static/chat.css Thu Nov 30 13:24:43 2023 +0100 @@ -24,7 +24,6 @@ .is-chat-message { transition: all 0.3s ease; - padding-left: 1.5em; } .is-chat-message:hover, .is-chat-message.has-popup-focus { @@ -32,6 +31,13 @@ box-shadow: 0 8px 16px 0 rgba(0,0,0,0.2); } +.media.is-chat-message.is-retracted { + padding: 0.5em; + border-left: 3px solid #ff3860; /* Reddish border for distinction */ + background-color: #f5f5f5; /* Light grey background */ + color: #636363; /* Slightly darker text for better readability */ +} + .message-attachment { max-width: 20rem; } diff -r e63fb06052ae -r 8b990c78d4b5 sat_templates/templates/bulma/static/styles.css --- a/sat_templates/templates/bulma/static/styles.css Tue Nov 28 17:48:00 2023 +0100 +++ b/sat_templates/templates/bulma/static/styles.css Thu Nov 30 13:24:43 2023 +0100 @@ -113,10 +113,10 @@ box-shadow: 0px 0px 0 0.25rem var(--col-primary); } -.is-chat-message { - margin: 0.5rem 0 0 !important; - padding: 0 !important; - border: 0 !important; +.media.is-chat-message { + margin: 0.5rem 0 0; + padding: 0; + border: 0; } .is-text-content {