{% extends 'django_spire/knowledge/page/full_page.html' %}

{% load spire_core_tags %}

{% block full_page_sub_navigation_title %}
    {{ collection.name_short }}
{% endblock %}

{% block full_page_sub_navigation_buttons %}
    {% if AuthController.knowledge.can_add %}
        {% url 'django_spire:knowledge:collection:form:create_with_parent' parent_pk=collection.id as create_url %}
        {% include 'django_spire/button/primary_button.html' with button_text='Add' button_href=create_url button_icon="bi bi-plus" %}
    {% endif %}
{% endblock %}

{% block full_page_sub_navigation %}
    {% include 'django_spire/knowledge/sub_navigation/widget/collection_entry_sub_navigation_widget.html' with current_collection_id=entry.collection.id current_version_id=current_version.id %}
{% endblock %}

{% block knowledge_full_page_content %}
    <div class="row">
        <div class="col-12 col-lg-8 mx-auto pb-4 h4 text-app-primary">
            {{ collection.name }}
        </div>
    </div>
    <div class="row">
        <div class="col-12 col-lg-8 mx-auto pb-4">
            Description:<br>{{ collection.description }}
        </div>
    </div>
    <div class="row">
        <div class="col-12 col-lg-8 mx-auto pb-4">
            Sub Collections:<br>{{ collection.children.count }}
        </div>
    </div>
    <div class="row">
        <div class="col-12 col-lg-8 mx-auto pb-4">
            Entries:<br>{{ collection.entries.count }}
        </div>
    </div>
    <div class="row">
        <div class="col-12 col-lg-8 mx-auto pb-4">
            Popular Collections & Entries ETC
        </div>
    </div>
    <div class="row">
        <div class="col-12 col-lg-8 mx-auto pb-4">
            Last Edits ETC
        </div>
    </div>
    <div class="row">
        <div class="col-12 col-lg-8 mx-auto pb-4">
            Tags:
            {% for tag, weight in collection.simplified_and_weighted_tag_dict|safe_dict_items %}
                {% include 'django_spire/tag/element/tag.html' %}
            {% endfor %}
        </div>
    </div>
    <div class="row">
        <div class="col-12 col-lg-8 mx-auto pb-4">
            Aggregated Tags:
            {% for tag, weight in collection.services.tag.get_simplified_and_weighted_aggregated_tag_set|safe_dict_items %}
                {% include 'django_spire/tag/element/tag.html' %}
            {% endfor %}
        </div>
    </div>
{% endblock %}
