<%- include("../../partials/header.ejs") %>
<link href="/css/theme/<%= preferredTheme %>/all.css?v=<%= cssVersion %>" media="screen, print" rel="stylesheet" />
<style>.stats{padding:15px;border-radius:5px;}p.heading.main{margin-top:5px}.stats-header{background-color:<%= siteThemeColourDarker %>bd !important;padding:3px;filter: drop-shadow(0px 0px 1px black)}</style>
<%- include("../../partials/nav.ejs") %>
<section class="hero is-primary">
    <div class="hero-body">
        <div class="container has-text-centered">
            <br />
            <h1 class="title">
                <span class="icon is-medium iconalign">
                    <i aria-hidden="true" class="fad fa-cogs has-text-default fa-1x"></i>
                </span>
                <br />
                <span><%= title %></span>
            </h1>
            <h2 class="subtitle"><%= subtitle %></h2>
        </div>
    </div>
</section>
<div class="container">
    <div class="section">
        <p>
            <img style="border-radius: 50%; vertical-align: middle; height: 32px; width: auto; margin-left: 6px;" src="<%= req.user.db.avatar.hash ? req.user.db.avatar.url : `${baseURL}/img/defaultavatar` %>.<%= imageFormat %>" alt="<%= __("common.img.avatar", req.user.db.fullUsername) %>" onerror="this.onerror=null;this.src='/img/defaultavatar.<%= imageFormat %>';" draggable="false">
            &nbsp;
            <span style="vertical-align: middle;"><%= user.db.fullUsername %></span>
            <span style="vertical-align: middle; color: #354146;">&nbsp;|&nbsp;</span>
            <% if (user.db.rank.mod === true) { %>
                <% if (req.user.db.rank.admin === false && req.user.db.rank.assistant === false) { %>
                    <span style="vertical-align: middle;" title="<%= __("common.rank.mod") %>" class="icon is-small iconalign">
                        <i aria-hidden="true" class="fad fa-hammer has-text-success fa-1x"></i>
                    </span>
                    <span style="vertical-align: middle;" class="has-text-success">
                        <%= __("common.rank.mod") %>
                    </span>
                <% } else if (req.user.db.rank.admin === false && req.user.db.rank.assistant === true) { %>
                    <span style="vertical-align: middle;" title="<%= __("common.rank.assistant") %>" class="icon is-small iconalign">
                        <i aria-hidden="true" class="fad fa-tools has-text-orange fa-1x"></i>
                    </span>
                    <span style="vertical-align: middle;" class="has-text-orange">
                        <%= __("common.rank.assistant") %>
                    </span>
                <% } else { %>
                    <span style="vertical-align: middle;" title="<%= __("common.rank.admin") %>" class="icon is-small iconalign">
                        <i aria-hidden="true" class="fad fa-crown has-text-danger fa-1x"></i>
                    </span>
                    <span style="vertical-align: middle;" class="has-text-danger">
                        <%= __("common.rank.admin") %>
                    </span>
                <% } %>
            <% } %>
        </p>
        <br />
        <div class="stats has-background-primary">
            <nav class="level stats-header">
                <div class="level-item has-text-centered">
                    <div>
                        <p class="heading main"><%= __("page.staff.webStats") %></p>
                    </div>
                </div>
            </nav>
            <nav class="level">
                <div class="level-item body-item has-text-centered">
                    <div>
                        <p class="heading"><%= __("page.staff.webStats.botCount") %></p>
                        <p class="title"><%= siteStats.botCount %></p>
                    </div>
                </div>
                <div class="level-item body-item has-text-centered">
                    <div>
                        <p class="heading"><%= __("page.staff.webStats.serverCount") %></p>
                        <p class="title"><%= siteStats.serverCount %></p>
                    </div>
                </div>
                <div class="level-item body-item has-text-centered">
                    <div>
                        <p class="heading"><%= __("page.staff.webStats.templateCount") %></p>
                        <p class="title"><%= siteStats.templateCount %></p>
                    </div>
                </div>
                <div class="level-item body-item has-text-centered">
                    <div>
                        <p class="heading"><%= __("page.staff.webStats.userCount") %></p>
                        <p class="title"><%= siteStats.userCount %></p>
                    </div>
                </div>
                <div class="level-item body-item has-text-centered">
                    <div>
                        <p class="heading"><%= __("page.staff.webStats.botCount.unapproved") %></p>
                        <p class="title"><%= siteStats.unapprovedBots %></p>
                    </div>
                </div>
            </nav>
        </div>
        <br />
        <div class="stats has-background-primary">
            <nav class="level stats-header">
                <div class="level-item has-text-centered">
                    <div>
                        <p class="heading main"><%= __("page.staff.me") %></p>
                    </div>
                </div>
            </nav>
            <nav class="level">
                <div class="level-item body-item has-text-centered">
                    <div>
                        <p class="heading"><%= __("page.staff.me.standing") %></p>
                        <p class="title"><%= req.user.db.staffTracking.details.standing %></p>
                    </div>
                </div>
                <div class="level-item body-item has-text-centered">
                    <div>
                        <p class="heading"><%= __("page.staff.me.strikes") %></p>
                        <p class="title"><%= req.user.db.staffTracking.punishments.strikes.length %></p>
                    </div>
                </div>
                <div class="level-item body-item has-text-centered">
                    <div>
                        <p class="heading"><%= __("page.staff.me.warnings") %></p>
                        <p class="title"><%= req.user.db.staffTracking.punishments.warnings.length %></p>
                    </div>
                </div>
                <div class="level-item body-item has-text-centered">
                    <div>
                        <p class="heading"><%= __("page.staff.me.onLeave") %></p>
                        <p class="title"><%= req.user.db.staffTracking.details.away.status ? __("common.yes") : __("common.no") %></p>
                    </div>
                </div>
            </nav>
        </div>
        <br>
        <div class="stats has-background-primary">
            <nav class="level stats-header">
                <div class="level-item has-text-centered">
                    <div>
                        <p class="heading main"><%= __("page.staff.manager.botStat") %></p>
                    </div>
                </div>
            </nav>
            <nav class="level">
                <div class="level-item body-item has-text-centered">
                    <div>
                        <p class="heading"><%= __("page.staff.manager.botStat.thisWeek") %></p>
                        <%- include("../../partials/botHandlingStats.ejs", { user: req.user.db, range: "thisWeek" }) %>
                    </div>
                </div>
                <div class="level-item body-item has-text-centered">
                    <div>
                        <p class="heading"><%= __("page.staff.manager.botStat.previousWeek") %></p>
                        <%- include("../../partials/botHandlingStats.ejs", { user: req.user.db, range: "prevWeek" }) %>
                    </div>
                </div>
                <div class="level-item body-item has-text-centered">
                    <div>
                        <p class="heading"><%= __("page.staff.manager.botStat.allTime") %></p>
                        <%- include("../../partials/botHandlingStats.ejs", { user: req.user.db, range: "allTime" }) %>
                    </div>
                </div>
            </nav>
        </div>
    </div>
</div>
<%- include("../../partials/footer.ejs") %>
