add: images in messages for supporters

This commit is contained in:
trisua 2025-09-03 20:05:43 -04:00
parent 1c1eb3be5d
commit dfa1abe2d9
7 changed files with 116 additions and 4 deletions

View file

@ -30,10 +30,38 @@
("style" "flex: 1 0 auto")
("id" "messages_stream")
(div ("ui_ident" "data_marker")))
(div ("id" "read_receipt_zone") ("class" "card") ("style" "min-height: 32.5px; position: sticky; bottom: 0")))
(div ("id" "read_receipt_zone") ("class" "card") ("style" "min-height: 32.5px; position: sticky; bottom: 0"))
(div ("id" "images_zone") ("class" "card hidden flex gap_2 flex_wrap")))
(form
("class" "card flex flex_row items_center gap_2")
("onsubmit" "create_message(event)")
(text "{% if user.permissions|has_supporter -%}")
(div
("class" "dropdown")
(button
("onclick" "open_dropdown(event)")
("exclude" "dropdown")
("class" "button icon_only big_icon")
("type" "button")
(text "{{ icon \"plus\" }}"))
(div
("class" "inner left")
(button
("class" "button")
("onclick" "document.getElementById('images').click()")
("type" "button")
(text "attach image"))))
(text "{%- endif %}")
(input
("type" "file")
("class" "hidden")
("accept" "image/*")
("id" "images")
("name" "images")
("multiple" "")
("onchange" "display_pending_images(event)"))
(input
("type" "text")
("class" "w_full")

View file

@ -75,7 +75,15 @@
(div
("class" "body no_p_margin")
("id" "{{ message.id }}_body")
(text "{{ message.content|markdown|safe }}"))
(text "{{ message.content|markdown|safe }}")
(div
("class" "flex flex_col gap_1 {% if message.uploads|length == 0 -%} hidden {%- endif %}")
(text "{% for upload in message.uploads -%}")
(a
("href" "{{ config.service_hosts.buckets }}/message_media/{{ upload }}")
("target" "_blank")
(img ("class" "upload") ("src" "{{ config.service_hosts.buckets }}/message_media/{{ upload }}") ("alt" "Media upload")))
(text "{%- endfor %}")))
(form
("class" "body hidden flex flex_row gap_ch")
("id" "{{ message.id }}_edit_area")