add: chat pins

This commit is contained in:
trisua 2025-09-03 17:12:26 -04:00
parent 9546c580e7
commit 82eafdadb3
21 changed files with 330 additions and 56 deletions

View file

@ -41,20 +41,27 @@
(text "{%- endif %}")
(text "{%- endmacro %}")
(text "{% macro message(message) -%}")
(text "{% macro message(message, is_pinned=false) -%}")
(div
("class" "flex w_full gap_ch message {%- if user.id == message.owner %} justify_right mine {%- endif %}")
("id" "message_{{ message.id }}")
(text "{% if message.owner == user.id -%}")
(div
("class" "dropdown")
("class" "dropdown hidden")
(button
("onclick" "open_dropdown(event)")
("exclude" "dropdown")
("class" "button")
("class" "button icon_only big_icon")
(text "{{ icon \"ellipsis\" }}"))
(div
("class" "inner surface")
(text "{% if not is_pinned -%}")
(button
("class" "button surface")
("onclick" "pin_message(event, '{{ message.id }}')")
(text "pin"))
(text "{%- endif %}")
(text "{% if message.owner == user.id -%}")
(button
("class" "button surface")
("onclick" "edit_message_ui('{{ message.id }}')")
@ -62,8 +69,8 @@
(button
("class" "button surface red")
("onclick" "delete_message('{{ message.id }}')")
(text "delete"))))
(text "{%- endif %}")
(text "delete"))
(text "{%- endif %}")))
(div
("class" "body no_p_margin")