diff --git a/files/templates/chat.html b/files/templates/chat.html index 251fd80e9..6080990df 100644 --- a/files/templates/chat.html +++ b/files/templates/chat.html @@ -6,132 +6,27 @@ {% include "header.html" %} {% include "modals/expanded_image.html" %} {% include "modals/emoji.html" %} + {% include "util/macros.html" %} {% set vlink = '' %}
- -
- - - 0 - -
- - {% macro chat_group_template(id, m) %} -
-
{% if m %}{{m['username']}}{% else %}NULL{% endif %}
- {% if m %}{{m['time'] | timestamp}}{% else %}just now{% endif %} - - {% endmacro %} - - {% macro chat_line_template(id, m) %} - {% set quote_exists = m and m['quotes'] and messages.get(m['quotes']) %} - {% set mentioned = m and vlink in m['text_html'] or (quote_exists and messages[m['quotes']]['user_id'] == v.id) %} -
-
-
- - -
- - {% if m %} - {% if v.slurreplacer %} - {{m['text_censored'] | safe}} - {% else %} - {{m['text_html'] | safe}} - {% endif %} - {% endif %} - - {% if m %}{{m['text']}}{% endif %} - - {% if v.admin_level >= PERMS['POST_COMMENT_MODERATION'] %} - - - {% endif %} -
-
-
-
- {% endmacro %} - + + {{ macros.chat_users_online() }}
- {{chat_group_template()}} + {{macros.chat_group_template()}}
- {{chat_line_template()}} + {{macros.chat_line_template()}}
-
-
- {% set messages_list = messages.items()|list %} - {% for id, m in messages_list %} - {% set same = loop.index > 1 and m['user_id'] == messages_list[loop.index-2][1]['user_id'] %} - {% if not same %} - {% if loop.index > 1 %} -
- {% endif %} - {{chat_group_template(id, m)}} - {% endif %} - {{chat_line_template(id, m)}} - {% endfor %} -
-
- -
- - -
-
- - -
- - - - - - - - - - - - -
-
+ {{macros.chat_window(vlink)}}
-
-
Users Online
-
-
+ {{macros.chat_users_list()}} diff --git a/files/templates/util/macros.html b/files/templates/util/macros.html index 1ebb21174..e22b99c87 100644 --- a/files/templates/util/macros.html +++ b/files/templates/util/macros.html @@ -222,3 +222,120 @@ {% endif %} {% endmacro %} + +{% macro chat_users_online() %} +
+ + + 0 + +
+{% endmacro %} + +{% macro chat_group_template(id, m) %} +
+
{% if m %}{{m['username']}}{% else %}NULL{% endif %}
+ {% if m %}{{m['time'] | timestamp}}{% else %}just now{% endif %} + +{% endmacro %} + +{% macro chat_line_template(id, m, vlink) %} + {% set quote_exists = m and m['quotes'] and messages.get(m['quotes']) %} + {% set mentioned = m and vlink in m['text_html'] or (quote_exists and messages[m['quotes']]['user_id'] == v.id) %} +
+
+
+ + +
+ + {% if m %} + {% if v.slurreplacer %} + {{m['text_censored'] | safe}} + {% else %} + {{m['text_html'] | safe}} + {% endif %} + {% endif %} + + {% if m %}{{m['text']}}{% endif %} + + {% if v.admin_level >= PERMS['POST_COMMENT_MODERATION'] %} + + + {% endif %} +
+
+
+
+{% endmacro %} + +{% macro chat_window(vlink)%} +
+
+ {% set messages_list = messages.items()|list %} + {% for id, m in messages_list %} + {% set same = loop.index > 1 and m['user_id'] == messages_list[loop.index-2][1]['user_id'] %} + {% if not same %} + {% if loop.index > 1 %} +
+ {% endif %} + {{chat_group_template(id, m)}} + {% endif %} + {{chat_line_template(id, m, vlink)}} + {% endfor %} +
+
+ +
+
+ + @: + + + +
+ +
+
+ + +
+ + + + + + + + + + + + +
+ +{% endmacro %} + +{% macro chat_users_list() %} +
+
Users Online
+
+
+{% endmacro %} \ No newline at end of file