{% extends "base_help.html" %}{% load i18n %}

{% block pagetitle %}{% trans "Knowledge Base" %}{% endblock %}
{% block helpdesk_body %}
    <div class="block padded-block">
        <p>{% trans "Please check to see if any of these answers address your problem prior to opening a support ticket." %}</p>

        {% for category in categories %}
            {% with category.get_entry_count as entry_count %}
                {% if entry_count >= 1 %}
                    <h3>{{ category.name }}</h3>

                    <ul class="kb-cat-top-questions">
                        {% for item in category.get_top_entries %}
                            <li><a href="{{ item.get_absolute_url }}">{{ item.question }}</a></li>
                        {% endfor %}
                        {% if entry_count > config.KB_MAX_TOP_ENTRIES %}
                        <li class="more">
                            <a href='{{ category.get_absolute_url }}'><b>{% trans 'View all questions' %}</b></a>
                        </li>
                        {% endif %}
                    </ul>
                {% endif %}
            {% endwith %}
        {% endfor %}
    </div>
{% endblock %}
