{% extends '__layout__.html' %}
{% block title %}{{profile.username}}{% endblock %}
{% block head %}
<link href="/static/css/profile.css" rel="stylesheet"/> <!-- Its just easier to resuse this-->
<style>
    .border {
        border-color: var(--linebreak) !important;
    }
    #nav-tab .nav-link {
        color: var(--text-muted) !important;
    }
    #nav-tab .nav-link.active {
        color: var(--bs-body-color) !important;
    }
</style>
{% endblock %}
{% block content %}
<div id="main">
    <div class="container" style="max-width: 800px;">
        <div class="d-flex align-items-center">
            <a href="/users/{{profile.id}}/profile">
                <img src="/Thumbs/Head.ashx?x=100&y=100&userId={{profile.id}}" width="80px" height="80px" class="rounded-2">
            </a>
            <h2 class="ms-3">{{profile.username}}'s Followers</h2>
        </div>
        <nav class="mt-2 rounded-top" style="background-color: var(--surface-alt) !important;overflow: hidden;">
            <div class="nav nav-underline nav-fill" id="nav-tab" role="tablist">
              <a class="nav-link" type="button" role="tab" aria-selected="false" href="/users/{{profile.id}}/friends">Friends</a>
              <a class="nav-link" type="button" role="tab" aria-selected="true" href="/users/{{profile.id}}/following">Following</a>
              <a class="nav-link active" type="button" role="tab" aria-selected="true">Followers</a>
              {% if profile.id == currentuser.id %}
              <a class="nav-link" type="button" role="tab" aria-selected="true" href="/users/{{profile.id}}/requests">Requests{% if currentuser.friend_requests > 0: %}<span class="badge text-bg-danger ms-1">{{currentuser.friend_requests}}</span>{%endif%}</a>
              {%endif%}
            </div>
        </nav>
        <div>
            <h4 class="m-0 mt-2">Followers ( {{FollowCount}} )</h4>
            <div class="row mt-2">
                {% for following in FollowUsers: %}
                <div class="col-6 col-sm-4 mb-2">
                    <div class="bg-surface border p-2 rounded d-flex">
                        <a href="/users/{{following.id}}/profile">
                            <img src="/Thumbs/Head.ashx?x=100&y=100&userId={{following.id}}" width="80px" height="80px" class="rounded-2" alt="{{following.username}}">
                        </a>
                        <a class="text-body text-decoration-none ms-2" href="/users/{{following.id}}/profile">{{following.username}}</a>
                    </div>
                </div>
                {%endfor%}
            </div>
            {% if len(FollowUsers) <= 0: %}
                <p class="w-100 text-secondary text-center text-body mt-4 mb-4">No results found</p>
            {% endif %}
        </div>
        <div class="d-flex mt-2 align-items-center">
            <a class="ms-auto text-decoration-none {%if not isTherePreviousPage:%}text-secondary{%endif%}" {%if isTherePreviousPage: %}href="/users/{{profile.id}}/followers?page={{PageNumber - 1}}{%endif%}">Previous</a>
            <p class="m-0 ms-2 me-2 text-body">Page {{PageNumber}} of {{TotalPages}}</p>
            <a class="me-auto text-decoration-none {%if not isThereNextPage: %}text-secondary{%endif%}" {%if isThereNextPage: %}href="/users/{{profile.id}}/followers?page={{PageNumber + 1}}{%endif%}">Next</a>
        </div>
    </div>
</div>
{% endblock %}