{% extends "settings/base.html" %}

{% block subtitle %}Hashtags{% endblock %}

{% block content %}
    <section class="icon-menu">
        {% for hashtag in page_obj %}
            <a class="option" href="{{ hashtag.urls.admin_edit }}">
                <i class="fa-solid fa-hashtag"></i>
                <span class="handle">
                    {{ hashtag.display_name }}
                    <small>
                        {% if hashtag.public %}Public{% elif hashtag.public is None %}Unreviewed{% else %}Private{% endif %}
                    </small>
                </span>
                {% if hashtag.stats %}
                <span class="handle">
                    <small>Total:</small>
                    {{ hashtag.stats.total }}
                </span>
                {% endif %}
                {% if hashtag.aliases %}

                <span class="handle">
                    <small>Aliases:</small>
                    {% for alias in hashtag.aliases %}
                        {{ alias }}{% if not forloop.last %}, {% endif %}
                    {% endfor %}
                </span>
                {% endif %}

            </a>
        {% empty %}
            <p class="option empty">There are no hashtags yet.</p>
        {% endfor %}
        <div class="load-more">
            {% if page_obj.has_previous %}
                <a class="button" href=".?page={{ page_obj.previous_page_number }}">Previous Page</a>
            {% endif %}
            {% if page_obj.has_next %}
                <a class="button" href=".?page={{ page_obj.next_page_number }}">Next Page</a>
            {% endif %}
        </div>
    </section>
{% endblock %}
