{% extends "blog/blog_post_detail.html" %}

{% load mezzanine_tags i18n %}

{% block blog_post_detail_featured_image %}
    {% if blog_post.featured_image %}
        <p><img src="{{ MEDIA_URL }}{% thumbnail blog_post.featured_image 720 0 %}"></p>
    {% endif %}
{% endblock %}

{% block extension_2 %}
{{ block.super }}

{% block recipe_hero %}
<div class="hero-unit">

    {% block recipe_summary %}
    {% if blog_post.summary %}
        {% editable blog_post.summary %}<p>{{ blog_post.summary }}</p>{% endeditable %}
    {% endif %}
    {% endblock %}

    {% block recipe_ingredients %}
    {% if blog_post.ingredients.count %}
        <dl class="dl-horizontal ingredients">
            <h4><dt>{% trans 'Ingredients' %}:</dt></h4>
            {% for ingredient in blog_post.ingredients.all %}
                <dd>{{ ingredient }}</dd>
            {% endfor %}
        </dl>
    {% endif %}
    {% endblock %}

    {% block recipe_portions %}
    {% if blog_post.portions %}
        {% editable blog_post.portions %}
            <dl class="dl-horizontal">
                <h4><dt>{% trans 'Portions' %}:</dt></h4>
                <dd>{{ blog_post.portions }}</dd>
            </dl>
        {% endeditable %}
    {% endif %}
    {% endblock %}

    {% block recipe_difficulty %}
    {% if blog_post.difficulty %}
        {% editable blog_post.difficulty %}
            <dl class="dl-horizontal">
                <h4><dt>{% trans 'Difficulty' %}:</dt></h4>
                <dd>{{ blog_post.get_difficulty_display }}</dd>
            </dl>
        {% endeditable %}
    {% endif %}
    {% endblock %}

    {% block recipe_working_hours %}
    {% if blog_post.working_hours %}
        <dl class="dl-horizontal">
            <h4><dt>{% trans 'Working Hours' %}:</dt></h4>
            <dd>
                {% if blog_post.working_hours.hours %}
                    {% blocktrans count hours=blog_post.working_hours.hours %}
                        {{ hours }} Hour
                    {% plural %}
                        {{ hours }} Hours
                    {% endblocktrans %}
                {% endif %}

                {% blocktrans count minutes=blog_post.working_hours.minutes %}
                    {{ minutes }} Minute
                {% plural %}
                    {{ minutes }} Minutes
                {% endblocktrans %}
            </dd>
        </dl>
    {% endif %}
    {% endblock %}

    {% block recipe_cooking_time %}
    {% if blog_post.cooking_time %}
        <dl class="dl-horizontal">
            <h4><dt>{% trans 'Cooking Time' %}:</dt></h4>
            <dd>
                {% if blog_post.cooking_time.hours %}
                    {% blocktrans count hours=blog_post.cooking_time.hours %}
                        {{ hours }} Hour
                    {% plural %}
                        {{ hours }} Hours
                    {% endblocktrans %}
                {% endif %}

                {% blocktrans count minutes=blog_post.cooking_time.minutes %}
                    {{ minutes }} Minute
                {% plural %}
                    {{ minutes }} Minutes
                {% endblocktrans %}
            </dd>
        </dl>
    {% endif %}
    {% endblock %}

    {% block recipe_rest_period %}
    {% if blog_post.rest_period %}
        <dl class="dl-horizontal">
            <h4><dt>{% trans 'Rest Period' %}:</dt></h4>
            <dd>
                {% if blog_post.rest_period.days %}
                    {% blocktrans count days=blog_post.rest_period.days %}
                        {{ days }} Day
                    {% plural %}
                        {{ days }} Days
                    {% endblocktrans %}
                {% endif %}

                {% if blog_post.rest_period.hours %}
                    {% blocktrans count hours=blog_post.rest_period.hours %}
                        {{ hours }} Hour
                    {% plural %}
                        {{ hours }} Hours
                    {% endblocktrans %}
                {% endif %}

                {% blocktrans count minutes=blog_post.rest_period.minutes %}
                    {{ minutes }} Minute
                {% plural %}
                    {{ minutes }} Minutes
                {% endblocktrans %}
            </dd>
        </dl>
    {% endif %}
    {% endblock %}

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

