MarseyWorld/files/templates/chat.html

128 lines
6.3 KiB
HTML

{%- extends 'root.html' -%}
{% block pagetitle -%}{{chat.name}}{%- endblock %}
{% block pagetype %}chat{% endblock %}
{% block body_attributes %}class="has_header"{% endblock %}
{% block body %}
<link rel="stylesheet" href="{{'css/chat.css' | asset}}">
{% include "header.html" %}
{% include "modals/emoji.html" %}
{% include "modals/gif.html" %}
{% set vlink = '<a href="/id/' ~ v.id ~ '"' %}
<div class="container pb-3">
<div class="row justify-content-around" id="main-content-row">
<div id="chat" class="col {% block customPadding %}custom-gutters{% endblock %}">
<span>
{% if chat.id != 1 %}
<h5 class="mt-2 mb-3 ml-1 toggleable d-mob-none" style="display:inline-block">{{chat.name}}</h5>
<b class="mt-2 mb-2 ml-1 text-small toggleable d-md-none" style="display:inline-block">{{chat.name}}</b>
{% if v.id in chat.mod_ids %}
<button class="chat-control fas fa-pen text-small text-muted px-2 toggleable" type="button" data-nonce="{{g.nonce}}" data-onclick="toggleElement('chat-name-form', 'chat-name')">
</button>
<form id="chat-name-form" class="d-none mt-2" action="/chat/{{chat.id}}/name" method="post">
<input hidden name="formkey" value="{{v|formkey}}" class="notranslate" translate="no">
<input id="chat-name" autocomplete="off" class="form-control d-inline-block" name="new_name" value="{{chat.name}}" style="max-width:300px">
<button type="submit" class="btn btn-primary" style="margin-top:-5px">Save</button>
</form>
<a href="/chat/{{chat.id}}/orgies" class="chat-control fas fa-tv text-muted mx-2"></a>
<a href="/chat/{{chat.id}}/custom_css" class="chat-control fas fa-palette text-muted mx-2"></a>
<i data-bs-html="true" data-bs-toggle="tooltip" data-bs-placement="bottom" title="<h5>Chat Commands</h5><p><code>+@grue</code> adds @grue to the chat</p><p><code>-@grue</code> removes @grue from the chat</p>{% if v.id == chat.owner_id %}<p><code>*@grue</code> makes @grue a chat mod</p><p><code>/@grue</code> removes @grue as a chat mod</p>{% endif %}" class="chat-control fas fa-terminal text-muted ml-2"></i>
{% else %}
<button class="px-2" type="button" data-nonce="{{g.nonce}}" data-bs-toggle="tooltip" title="{% if muting_chat %}Unmute (do it){% else %}Mute (don't do it){% endif %}" data-nonce="{{g.nonce}}" data-onclick="postToastReload(this, '/chat/{{chat.id}}/toggle_mute')">
<i class="fas fa-bell-slash {% if muting_chat %}text-danger{% else %}text-muted{% endif %}"></i>
</button>
{% endif %}
<button id="leave-private-chat" type="submit" class="btn btn-danger fl-r mt-1 mt-md-2 pt-0 px-2 text-small-sm" data-nonce="{{g.nonce}}" data-onclick="areyousure(this)" data-areyousure="postToastReload(this, '/chat/{{chat.id}}/leave')">Leave</button>
{% endif %}
</span>
<div id="chat-group-template" class="d-none">
{{macros.chat_group_template()}}
</div>
</div>
<div id="chat-line-template" class="d-none">
{{macros.chat_line_template()}}
</div>
{{macros.chat_window(vlink, v.group_memberships_names, v.keyword_notifs_li)}}
</div>
<div class="col text-left d-none d-lg-block pb-5" style="max-width:350px">
{% if chat.id == 1 %}
{% if SITE_NAME == 'WPD' %}
<h5>Chat Rules</h5>
<ul class="mt-2 mb-4">
<li>Follow <a href="/rules">the site rules</a>.</li>
<li>Do not try to crash the chatroom with CSS.</li>
<li>Do not spam.</li>
<li>No loli/cp/necro of any kind including cartoons.</li>
<li>No real life bestiality.</li>
</ul>
{% endif %}
<h5>Users Online (<span class="chat-count"></span>)</h5>
<div id="online" class="mt-2 {% if SITE_NAME == 'WPD' %}online-wpd{% endif %}"></div>
{% else %}
<h5>Members ({{sorted_memberships|length}})</h5>
<div id="members" class="members mt-2">
{% for membership in sorted_memberships %}
{% set user = membership.user %}
{% set patron = '' %}
{% if user.patron %}
{% set patron = patron + 'class="patron chat-patron" style="background-color:#' ~ user.name_color ~ '"' %}
{% endif %}
{% if user.pride_username(None) %}
{% set patron = patron + ' pride_username' %}
{% endif %}
<li class="user-{{user.id}}">
<a class="font-weight-bold" target="_blank" href="/@{{user.username}}" style="color:#{{user.name_color}}">
<img loading="lazy" class="mr-1" src="/pp/{{user.id}}">
<span {{patron | safe}}>{{user.username}}</span>
</a>
{% if user.id == chat.owner_id %}
<img class="ml-1 chat-mod" data-bs-toggle="tooltip" alt="Owner" title="Owner" src="{{SITE_FULL_IMAGES}}/e/marseykingretard.webp">
{% elif user.id in chat.mod_ids %}
<img class="ml-1 chat-mod" data-bs-toggle="tooltip" alt="Mod" title="Mod" src="{{SITE_FULL_IMAGES}}/e/marseyjanny.webp">
{% endif %}
{% if membership.muted %}
<i class="fas fa-bell-slash text-danger" data-bs-toggle="tooltip" title="Muted chat ({% if v.id == membership.user_id %}kys{% elif v.id in chat.mod_ids %}kick him{% else %}kill him{% endif %})"></i>
{% endif %}
<i class="d-none ml-1 text-smaller text-success online-marker online-marker-{{user.id}} fas fa-circle"></i>
</li>
{% endfor %}
</div>
{% endif %}
</div>
</div>
</div>
<input id="chat_id" hidden value="{{chat.id}}">
<input id="vid" hidden value="{{v.id}}">
<input id="slurreplacer" hidden value="{{v.slurreplacer}}">
<input id="blocked_user_ids" hidden value="{{(v.userblocks|string)[1:-1]}}">
<input id="group_names" hidden value="{{(v.group_memberships_names|string)[1:-1]}}">
{% if v.keyword_notifs_li %}
<input id="keyword_notifs_li" hidden value="{{(v.keyword_notifs_li|string)[1:-1]}}">
{% endif %}
<script defer src="{{'js/vendor/socketio.js' | asset}}"></script>
<script defer src="{{'js/flash.js' | asset}}"></script>
<script defer src="{{'js/vendor/lozad.js' | asset}}"></script>
<script defer src="{{'js/vendor/lite-youtube.js' | asset}}"></script>
{% if not session.get("GLOBAL") %}
<script defer src="{{'js/chat.js' | asset}}"></script>
{% endif %}
<input id="twitter" hidden value="{{v.twitter}}">
<input id="reddit" hidden value="{{v.reddit}}">
<input id="chat_id" hidden value="{{chat_id}}">
<script defer src="{{'js/embed_twitter_reddit.js' | asset}}"></script>
{% endblock %}