{% extends "helpdesk/public_base.html" %}{% load i18n humanize %}

{% block helpdesk_body %}
<h2>{% trans 'Knowledgebase Category' %}: {% blocktrans with category.title as kbcat %}{{ kbcat }}{% endblocktrans %}</h2>

<div class="col-lg-12">
    <div class="well well-sm">
        <h4>{% blocktrans with category.title as kbcat %}You are viewing all items in the {{ kbcat }} category.{% endblocktrans %}</h4>
        <p>{{ category.description }}</p>
    </div>
</div>

{% for item in items %}
{% cycle 'one' 'two' 'three' as itemnumperrow silent %}
{% ifequal itemnumperrow 'one' %}<div class="row">{% endifequal %}
    <div class="col-lg-3">
        <div class="panel panel-primary">
            <div class="panel-heading">
                <h4>{{ item.title }}</h4>
            </div>
            <div class="panel-body">
                <p>{{ item.question }}</p>
            </div>
            <div class="panel-footer">
                <p>
                    {% blocktrans with item.get_absolute_url as url %}View <a href='{{ url }}'>Answer <i class="fa fa-arrow-right"></i></a>{% endblocktrans %}
                </p>
                <div class="well well-sm">
                    <p>{% trans 'Rating' %}: 
                        {% if item.votes > 0 %}
                            {{ item.score|floatformat }}/10
                        {% else %}
                            {% trans 'no score yet' %}
                        {% endif %}
                    </p>
                    <p>{% trans 'Last Update' %}: {{ item.last_updated|naturaltime }}</p>
                </div>
            </div>
        </div>
    </div>
{% ifequal itemnumperrow 'three' %}</div>{% endifequal %}
{% endfor %}

{% endblock %}
