{% extends '__layout__.html' %}
{% block title %}Admin{% endblock %}
{% block head %}
<link href="/static/css/admin.css" rel="stylesheet"/> <!-- ava was here :D-->
{% endblock %}
{% block content %}
<div id="main">
    <div class="container">
        <div class="d-md-flex align-items-center mb-1">
            <div class="d-flex align-items-center mb-2 mb-md-0">
                <img src="/Thumbs/Head.ashx?x=100&y=100&userId={{user.id}}" class="rounded-2" width="90px" height="90px">
                <div class="ms-2">
                    <h3 class="m-0"><span id="random-greeting"></span>, {{user.username}}!</h3>
                    <p class="m-0" style="font-size: 12px; color: var(--text-muted);">Server Time: {{stats.SystemTime}} UTC</b></p>
                    <p class="m-0" style="font-size: 12px; color: var(--text-muted);">ava was here! :3</b></p>
                </div>
            </div>
            <div class="row text-center ms-auto p-2 me-2" style="background-color: var(--surface-alt);box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);">
                <p class="col-6 col-md-3 m-0">Online: <b class="text-body">{{stats.UsersOnline}}</b></p>
                <p class="col-6 col-md-3 m-0">In-Game: <b class="text-body">{{stats.UsersPlaying}}</b></p>
                <p class="col-6 col-md-3 m-0">Active Servers: <b class="text-body">{{stats.PlaceServersCount}}</b></p>
                <p class="col-6 col-md-3 m-0">Users today: <b class="text-body">{{stats.UsersSignedUpToday}}</b></p>
                <p class="col-6 col-md-3 m-0">Assets Pending: <b class="text-body">{{stats.PendingAssets}}</b></p>
            </div>
        </div>
        <div class="row p-2">
            {% for permission in permissions %}
                {% if "Hidden" not in permission: %}
                <div class="col-md-4 mb-1 p-1">
                    <a href="{{permission.route}}">
                        <div class="admin-box p-2">
                            <h2 class="mb-1 text-truncate"><i class="bi {{permission.icon}} me-2"></i>{{permission.Name}}</h2>
                            <p class="m-0 mb-2 text-truncate">{{permission.Description}}</p>
                        </div>
                    </a>
                </div>
                {% endif %}
            {% endfor %}
        </div>
    </div>
</div>

<script>
    const greetings = ["Hello", "Bonjour", "Hola", "Ciao", "Hallo", "Olá", "Hej", "Salam", "Namaste", "Konnichiwa"];
    const randomGreeting = greetings[Math.floor(Math.random() * greetings.length)];
    document.getElementById("random-greeting").textContent = randomGreeting;
</script>
{% endblock %}