{% extends post.type.theme_layout.key %}

{% block content %}
    <div id="posts">
        <div class="container">
            <article id="post">

                <header>

                    <a class="btn btn-info"
                       href="{{ url_route('anomaly.module.posts::posts.index') }}?type={{ post.type.slug }}">
                        {{ post.type.name }}
                    </a>

                    {% if post.type.slug.value == 'events' %}
                        <a class="btn btn-danger"
                           href="{{ post.route('ics') }}">
                            Add to Calendar
                        </a>
                    {% endif %}

                    <div class="meta">

                        {% if post.type.slug.value == 'events' %}
                            <time class="date" datetime="{{ post.publish_at.iso }}">
                                {{ post.date_start.format(config_get('streams::datetime.date_format')) }}
                                {% if post.time_start.value %}
                                    at
                                    {{ post.time_start.value.format(config_get('streams::datetime.time_format')) }}
                                {% endif %}
                            </time>
                        {% else %}
                            <time class="date" datetime="{{ post.publish_at.iso }}">
                                {{ post.publish_at.format(config_get('streams::datetime.date_format')) }}
                            </time>
                        {% endif %}

                    </div>

                </header>

                <br>
                <br>

                <div class="content">
                    {% block post %}
                        {{ content|raw }}
                    {% endblock %}
                </div>

            </article>
        </div>
    </div>
{% endblock %}
