{% extends "oscar/catalogue/browse.html" %}

{% load i18n %}

{% block title %}
    {{ category.name }} | {{ block.super }}
{% endblock %}

{% block description %}
    {{ category.description|default:""|striptags }}
{% endblock %}

{% block header%}
    <div class="page-header action">
        {% if user.is_staff %}
            <a class="pull-right hidden-xs" href="{% url 'dashboard:catalogue-category-update' pk=category.id %}"><small><i class="icon-edit"></i> {% trans "Edit this category" %}</small></a>
        {% endif %}
        <h1>{% block headertext %}{{ category.name }}{% endblock %}</h1>
    </div>
{% endblock %}

{% block breadcrumbs %}
    <ul class="breadcrumb">
        <li>
            <a href="{{ homepage_url }}">{% trans "Home" %}</a>
        </li>
        {% for category in category.get_ancestors %}
            <li>
                <a href="{{ category.get_absolute_url }}">{{ category.name }}</a>
            </li>
        {% endfor %}
        <li class="active">{{ category.name }}</li>
    </ul>
{% endblock breadcrumbs %}

{% block content %}
    {% if category.description %}
        <div class="row">
            <div class="col-sm-9"><p>{{ category.description|safe }}</p></div>
            {% if category.image %}
                <div class="col-sm-3"><img src="{{ category.image.url }}" alt="{{ category.name }}" class="img-responsive" /></div>
            {% endif %}
        </div>
    {% endif %}
    {{ block.super }}
{% endblock %}
