{% load static %}
{% load i18n %}
{% load l10n %}
{% load admin_url %}
{% load mastodon %}
{% load oauth_token %}
{% load truncate %}
{% load thumb %}
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  {% block title %}
  <title>{{ site_name }} - {{ user.mastodon_username }}</title>
  {% endblock %}
  {% include "common_libs.html" with jquery=0 %}
</head>

<body>
  <div id="page-wrapper">
    <div id="content-wrapper">
      {% include "partial/_navbar.html" %}

      <section id="content" class="container">
        <div class="grid grid--reverse-order">
          <div class="grid__main grid__main--reverse-order">
            <div class="main-section-wrapper">
              <div class="entity-list">

                <div class="set">
                  <h5 class="entity-list__title">
                    {% block head %}
                    {{ user.mastodon_username }}
                    {% endblock %}
                  </h5>
                </div>
                <ul class="entity-list__entities">
                  {% for member in members %}
                  {% with "list_item_"|add:member.item.class_name|add:".html" as template %}
                  {% include template with item=member.item mark=member.mark hide_category=True %}
                  {% endwith %}
                  {% empty %}
                  <div>{% trans '无结果' %}</div>
                  {% endfor %}
                </ul>
              </div>
              <div class="pagination">

                {% if members.pagination.has_prev %}
                <a href="?{% if request.GET.t %}t={{ request.GET.t }}&{% endif %}page=1" class="pagination__nav-link pagination__nav-link">&laquo;</a>
                <a href="?{% if request.GET.t %}t={{ request.GET.t }}&{% endif %}page={{ members.previous_page_number }}"
                class="pagination__nav-link pagination__nav-link--right-margin pagination__nav-link">&lsaquo;</a>
                {% endif %}

                {% for page in members.pagination.page_range %}

                {% if page == members.pagination.current_page %}
                <a href="?{% if request.GET.t %}t={{ request.GET.t }}&{% endif %}page={{ page }}" class="pagination__page-link pagination__page-link--current">{{ page }}</a>
                {% else %}
                <a href="?{% if request.GET.t %}t={{ request.GET.t }}&{% endif %}page={{ page }}" class="pagination__page-link">{{ page }}</a>
                {% endif %}

                {% endfor %}

                {% if members.pagination.has_next %}
                <a href="?{% if request.GET.t %}t={{ request.GET.t }}&{% endif %}page={{ members.next_page_number }}"
                class="pagination__nav-link pagination__nav-link--left-margin">&rsaquo;</a>
                <a href="?{% if request.GET.t %}t={{ request.GET.t }}&{% endif %}page={{ members.pagination.last_page }}" class="pagination__nav-link">&raquo;</a>
                {% endif %}

              </div>
            </div>
          </div>

          {% include "partial/_sidebar.html" %}
        </div>
      </section>
    </div>
    {% include "partial/_footer.html" %}
  </div>

  <script>
    document.body.addEventListener('htmx:configRequest', (event) => {
      event.detail.headers['X-CSRFToken'] = '{{ csrf_token }}';
    })
  </script>
</body>


</html>
