Profile pages now display user status.

This commit is contained in:
rainbow napkin 2025-09-18 02:43:43 -04:00
parent 6445950f90
commit 1384b02f4d
11 changed files with 119 additions and 5 deletions

View file

@ -20,6 +20,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. %>
<% }else{ %>
<a class="panel profile-link" target="_blank" href="/profile/<%- profile.user %>">View Full Profile<i class="bi-box-arrow-in-up-right"></i></a>
<h2 class="panel profile-name"><%- profile.user %></h2>
<%- include('../profile/status', {profile, presence, auxClass:"panel"}); %>
<img class="panel profile-img" src="<%- profile.img %>">
<p class="panel profile-info">Toke Count: <%- profile.tokeCount %></p>
<% if(profile.pronouns != '' && profile.pronouns != null){ %>

View file

@ -0,0 +1,22 @@
<%# Canopy - The next generation of stoner streaming software
Copyright (C) 2024-2025 Rainbownapkin and the TTN Community
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. %>
<% if(profile.user == "Tokebot"){ %>
<p id="profile-status" class="<%- auxClass %> positive profile-status"><span class="bi-record-fill"></span>Perma-Couched</p>
<% }else{ %>
<% const statusClass = (presence.status == "Streaming") ? "positive" : ((presence.status == "Offline") ? "inactive" : "positive-low");%>
<% const curChan = (presence.activeConnections == null || presence.activeConnections.length <= 0) ? '' : (presence.activeConnections.length == 1 ? ` - /c/${presence.activeConnections[0].channel.name}` : " - Multiple Channels"); %>
<p id="profile-status" class="<%- auxClass %> <%- statusClass %> profile-status"><span class="bi-record-fill"></span><%- presence.status %><%-curChan%></p>
<% } %>

View file

@ -33,6 +33,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. %>
<div class="profile dynamic-container" id="profile-div">
<span id="profile-info" class="profile">
<h1 class="profile-item" id="profile-username"><%- profile.user %></h1>
<%- include('partial/profile/status', {profile, presence, auxClass: ""}); %>
<%- include('partial/profile/image', {profile, selfProfile}); %>
<%- include('partial/profile/pronouns', {profile, selfProfile}); %>
<%- include('partial/profile/signature', {profile, selfProfile}); %>