move chat number and remove now-redundant icon

master
Aevann 2024-04-06 04:35:36 +02:00
parent 7bbd7891e2
commit 4f3a3a0b8e
6 changed files with 7 additions and 27 deletions

View File

@ -221,11 +221,12 @@ socket.on('online', function(data) {
const muted_li = Object.keys(data[1])
document.getElementsByClassName('chat-count')[0].innerHTML = online_li.length
for (const el of document.getElementsByClassName('chat-count')) {
el.innerHTML = online_li.length
}
document.getElementById('chat-count-header-bar').innerHTML = online_li.length
const admin_level = parseInt(document.getElementById('admin_level').value)
let online = ''
let online2 = '<b>Users Online</b>'
for (const u of online_li)
{
let patron = ''
@ -238,7 +239,6 @@ socket.on('online', function(data) {
if (admin_level && muted_li.includes(u[1].toLowerCase()))
online += '<b class="text-danger muted" data-bs-toggle="tooltip" title="Muted">X</b> '
online += `<a class="font-weight-bold" target="_blank" href="/@${u[1]}" style="color:#${u[2]}"><img loading="lazy" class="mr-1" src="/pp/${u[4]}"><span${patron}>${u[1]}</span></a></li>`
online2 += `<br>@${u[1]}`
}
const online_el = document.getElementById('online')
@ -247,7 +247,6 @@ socket.on('online', function(data) {
bs_trigger(online_el)
}
document.getElementById('online2').setAttribute("data-bs-original-title", online2);
document.getElementById('online3').innerHTML = online
bs_trigger(document.getElementById('online3'))
})

View File

@ -12,8 +12,6 @@
<div class="container pb-4 pb-md-2">
<div class="row justify-content-around" id="main-content-row">
<div class="col h-100 {% block customPadding %}custom-gutters{% endblock %}" id="main-content-col">
{{macros.chat_users_online()}}
<div id="chat-group-template" class="d-none">
{{macros.chat_group_template()}}
</div>

View File

@ -502,7 +502,7 @@
{% endif %}
<div class="mx-2">
<h5 class="mt-3">Users Online</h5>
<h5 class="mt-3">Users Online (<span class="chat-count"></span>)</h5>
<div id="online3" class="col text-left d-lg-none bg-white mb-4 pb-2" style="max-width:300px"></div>
{% if (orgies)|length > 1 %}
<h5>Orgy Playlist</h5>
@ -532,7 +532,7 @@
<br><br><br><br><br><br><br><br>
{% elif request.path.startswith('/chat/') %}
<div class="mx-2">
<h5 class="mt-2 mb-3">Members</h5>
<h5 class="mt-2 mb-3">Members ({{chat.memberships|length}})</h5>
<ul class="col text-left d-lg-none bg-white mb-4 pb-2" style="max-width:300px;list-style-type:none">
{% for membership in chat.memberships %}
{% set user = membership.user %}

View File

@ -67,7 +67,6 @@
<div id="chat-line-template" class="d-none">
{{macros.chat_line_template()}}
</div>
{{macros.chat_users_online()}}
{{macros.chat_window(vlink)}}
</div>
</div>

View File

@ -29,13 +29,6 @@
<button id="leave-private-chat" type="submit" class="btn btn-danger ml-1 ml-md-3 px-2 text-small-sm" data-nonce="{{g.nonce}}" data-onclick="areyousure(this)" data-areyousure="postToastReload(this, '/chat/{{chat.id}}/leave')">Leave</button>
{% endif %}
<div class="border-right d-md-none fl-r pt-2 mr-3" style="margin-top:-3px">
<span data-bs-html="true" data-bs-toggle="tooltip" data-bs-placement="bottom" title="<b>Members</b> {% for membership in chat.memberships %}<br>@{{membership.user.username}}{% endfor %}" class="text-muted">
<i class="fas fa-user fa-sm mr-1"></i>
<span class="chat-count" style="cursor:default">{{chat.memberships|length}}</span>
</span>
</div>
<div id="chat-group-template" class="d-none">
{{macros.chat_group_template()}}
</div>
@ -49,7 +42,7 @@
</div>
<div class="col text-left d-none d-lg-block pt-3 pb-5" style="max-width:313px">
<h5>Members</h5>
<h5>Members ({{chat.memberships|length}})</h5>
<div id="members" class="mt-2">
{% for membership in chat.memberships %}
{% set user = membership.user %}

View File

@ -270,15 +270,6 @@
{% endif %}
{% endmacro %}
{% macro chat_users_online() %}
<div class="border-right pb-1 px-3">
<span id="online2" data-bs-html="true" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Users Online" class="text-muted">
<i class="fas fa-user fa-sm mr-1"></i>
<span class="chat-count">0</span>
</span>
</div>
{% endmacro %}
{% macro chat_group_template(id, m) %}
<div class="chat-group">
<a class="font-weight-bold userlink" target="_blank" {% if m %}style="color:#{{m.namecolor}}" href="/@{{m.username}}" {% endif %}>
@ -403,7 +394,7 @@
</ul>
{% endif %}
<h5>Users Online</h5>
<h5>Users Online (<span class="chat-count"></span>)</h5>
<div id="online" class="mt-2 {% if SITE_NAME == 'WPD' %}online-wpd{% endif %}"></div>
</div>
{% endmacro %}