tawny/app/templates_src/chat.lisp

53 lines
2 KiB
Common Lisp

(text "{% extends \"root.lisp\" %} {% block head %}")
(title
(text "{{ components::chat_name(chat=chat, members=members) }} — {{ config.name }}"))
(text "{% endblock %} {% block body %}")
(div
("class" "flex w_full gap_2 justify_between items_center")
(div
("class" "tabs short bar flex")
(a
("class" "button tab camo")
("href" "/chats")
(text "chats")
(text "{% if user.missed_messages_count > 0 -%}") (b (text "({{ user.missed_messages_count }})")) (text "{%- endif %}"))
(a
("class" "button tab")
("href" "/chats/{{ chat.id }}")
(text "{{ components::chat_name(chat=chat, members=members, advanced=true, avatar_size=\"18px\") }}"))
(a
("class" "button tab camo")
("href" "/chats/{{ chat.id }}/manage")
(text "{{ icon \"settings-2\" }} Manage"))))
(div
("class" "flex flex_col card_nest reverse")
("style" "flex: 1 0 auto")
(div
("class" "card flex flex_rev_col gap_2")
("style" "flex: 1 0 auto; max-height: 80dvh; overflow: auto")
("id" "messages_stream")
(text "{% if messages|length == 0 -%}")
(i ("class" "flex gap_ch items_center fade") (text "{{ icon \"star\" }} This is the start of the chat!"))
(text "{%- endif %}")
(div ("ui_ident" "data_marker")))
(form
("class" "card flex flex_row items_center gap_2")
("onsubmit" "create_message(event)")
(input
("type" "text")
("class" "w_full")
("name" "content")
("id" "content")
("placeholder" "Send a message to {{ components::chat_name(chat=chat, members=members) }}"))
(button
("class" "button")
(text "{{ icon \"send\" }}"))))
(script ("src" "/public/messages.js"))
(script
(text "create_streamer(\"{{ chat.id }}\", document.querySelector(\"[ui_ident=data_marker]\"));
sock_con();
mark_message_read();
read_receipt();"))
(text "{% endblock %}")