{% extends 'base.html' %}

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

{% block title %}{{ page.title }}{% endblock %}

{% block description %}{{ page.subtitle }}{% endblock %}
{% block longdescription %}{{ page.formatted_content|striptags|truncatechars:500 }}{% endblock %}

{% block content %}
<article class="page-content">
    <div class="ui container">
        {% if request.user.is_staff %}
        <div class="ui center aligned basic segment">
            <a href="{% url 'admin:cms_page_change' page.pk %}"
               class="ui blue icon button">
               <i class="edit icon"></i>
               Edit in admin
            </a>
        </div>
        {% endif %}
        {% block precontent %}
        {% endblock %}
        {% if page.content %}
        <div class="nfb-content-box">

            <div class="ui basic segment">
                <div class="ui stackable grid">
					<div class="thirteen wide column">
						<h1 class="ui header">
							{{ page.title }}
							<div class="sub header">
								{{ page.subtitle }}
							</div>
						</h1>
						<div class="section">
							{{ page.formatted_content|safe }}
						</div>
					</div>
					<div class="three wide column"> 
					{% include "ads.html" %}					
					</div>
                </div>
            </div>
        </div>

        {% endif %}
        {% block postcontent %}
        {% endblock %}
    </div>
</article>
{% endblock %}
