<!--Canopy - The next generation of stoner streaming software
Copyright (C) 2024  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/>.-->
<!DOCTYPE html>
<html>
    <head>
        <%- include('partial/styles', {instance, user}); %>
        <% var selfProfile = user ? profile ? profile.user == user.user : false : false %>
        <link rel="stylesheet" type="text/css" href="/css/profile.css">
        <% if(profile){ %>
            <title><%= instance %> - Profile: <%= profile.user %></title>
        <% } else { %>
            <title><%= instance %> - Profile: Logged Out</title>
        <% } %>
    </head>
    <body>
        <%- include('partial/navbar', {user}); %>
        <% if(profile){ %>
            <div class="profile" id="profile-div">
                <h1 class="profile-item" id="profile-username"><%- profile.user %></h1>
                <%- include('partial/profile/image', {profile, selfProfile}); %>
                <%- include('partial/profile/tokeCount', {profile, selfProfile}); %>
                <%- include('partial/profile/signature', {profile, selfProfile}); %> 
                <%- include('partial/profile/bio', {profile, selfProfile}); %> 
                <%- include('partial/profile/date', {profile, selfProfile}); %> 
                <%- include('partial/profile/badges', {profile, selfProfile}); %> 
            </div>
            <% if(selfProfile){ %>
                <%- include('partial/profile/settings', {profile, selfProfile}); %> 
            <% } %>
        <% }else if(user){ %>
            <h1 class="profile-item" id="profile-error-label">Profile not found!</h1>
        <% } else {%>
            <h1 class="profile-item" id="profile-error-label">Please login to view your profile!</h1>
        <% } %>
    </body>
    <footer>
        <%- include('partial/scripts', {user}); %>
        <script src="/js/profile.js"></script>
    </footer>
</html>
