{% load i18n cms_tags %}

<article class="aldryn-jobs-article
    {% if user.is_staff and not object.get_active %} jobs-article-inactive{% endif %}">
    {% block jobs_headline %}
        <h3>
            {% if not detail_view %}
                <a href="{{ job_opening.get_absolute_url }}">{% render_model job_opening "title" %}</a>
            {% else %}
                {% render_model job_opening "title" %}
            {% endif %}
            {% if user.is_staff and not job_opening.get_active %}
                <span class="label label-warning pull-right">{% trans "inactive" %}</span>
            {% endif %}
        </h3>
    {% endblock %}

    {% block jobs_meta %}
        <div class="aldryn-jobs-meta">
            <span class="fa fa-book"></span>
            <a href="{{ job_opening.category.get_absolute_url }}">{{ job_opening.category }}</a>
            {% if job_opening.publication_start %}
                &nbsp;
                <span class="fa fa-clock-o"></span> {{ job_opening.publication_start|date  }}
            {% endif %}
        </div>
        <hr>
    {% endblock %}

    {% block jobs_content %}
        <div class="lead">
            {% render_model job_opening "lead_in" "lead_in" safe %}
        </div>
        {% if detail_view %}
            {% render_placeholder job_opening.content %}
        {% endif %}
    {% endblock %}

    {% block jobs_application %}
        {% if detail_view and job_opening.can_apply %}
            {% include "aldryn_jobs/includes/application.html" %}
        {% endif %}
    {% endblock %}
</article>
