{% extends 'base.html' %}

{% block twittercard %}summary{% endblock %}

{% block title %}{{ category.name }}{% endblock %}
{% block description %}{{ category.description }}{% endblock %}
{% block longdescription %}{{ category.formatted_content|striptags|truncatechars:500 }}{% endblock %}

{% block content %}
<div class="page-content">
    <div class="ui container">
        {% if request.user.is_staff %}
        <div class="ui center aligned basic segment">
            <a href="{% url 'admin:journal_category_change' category.pk %}"
               class="ui blue icon button">
               <i class="edit icon"></i>
               Edit in admin
            </a>
        </div>
        {% endif %}
        <div class="nfb-content-box">
	    <div class="ui stackable two column grid">
	    <div class="column">
            <div class="section" style="padding-left:15px">
		<br>
                <h2 class="ui header" style="font-size:1.5em">{{ category.description }}</h2>
                <hr class="nfb-divider" />
                {{ category.formatted_content|safe }}
                <!--<h3>Za več informacij ustvari stran za to kategorijo.({{category.slug}}) <a href="{{ category.about_page.get_absolute_url }}">{{ category.about_page.title }}</a></h3>-->
            </div>
	    </div>
	    <div class="column right aligned">
		<br><br>
		{% include 'ads.html' %}
	    </div>
	    </div>
        </div>
        <div class="ui padded stackable grid">
	    {% for article in category.get_articles %}
            <div class="six wide column">
                <!--<h4 class="ui header">
                    Prispevki:
                </h4>-->
                <hr class="nfb-divider" />
                {% include 'article_thumb.html' with article=article only %}
            </div>
	    {% endfor %}
            <!--<div class="six wide column">
                {% include 'category_browse.html' with category=category only %}
            </div>-->
            <div class="four wide row">
                <h4 class="ui header">
                    <a href="{% url 'archives' category.slug 1 %}">Arhiv <i class="angle right icon"></i></a>
                </h4>
                <hr class="nfb-divider" />
            </div>
        </div>
    </div>
</div>
{% endblock %}
