{% extends 'base.html' %}

{% block image %}{% if tag.image %}{{ tag.image.url }}{% endif %}{% endblock %}

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

{% block title %}{{ tag.name }}{% endblock %}
{% block description %}{{ tag.description }}{% endblock %}
{% block date %}{{ tag.get_date|date:"Y-m-d" }}{% 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_tag_change' tag.pk %}"
               class="ui blue icon button">
               <i class="edit icon"></i>
               Edit in admin
            </a>
        </div>
        {% endif %}
        <div class="nfb-content-box">
            {% if tag.image %}
            <div class="ui basic segment">
                <div class="ui stackable two column grid">
                    <div class="column">
                        <div class="section">
                            <h1 class="ui header">{{ tag.name }}
                                <a class="ui red label" href="{{ tag.category.get_absolute_url }}">
                                    {{ tag.category }}
                                </a>
                                <div class="sub header">{{ tag.description }}</div>
                            </h1>
                        </div>
                    </div>
                    <div class="column">
                            <img src="{{ tag.image.url }}" class="ui centered image" />
                    </div>
                </div>
            </div>
            {% else %}
                <div class="section">
                    <h1 class="ui header">{{ tag.name }}
                        <a class="ui red label" href="{{ tag.category.get_absolute_url }}">
                            {{ tag.category }}
                        </a>
                        <div class="sub header">{{ tag.description }}</div>
                    </h1>
                </div>
            {% endif %}
        </div>
        <br /><br />
        <div class="ui stackable three column grid">
            {% for article in tag.get_articles %}
            <div class="column">
            {% include 'article_thumb.html' with article=article only %}
            </div>
            {% endfor %}
            </div>
        </div>
    </div>
</div>
{% endblock %}

