{% extends 'dashboard/layout.html' %}
{% load currency_filters %}
{% load i18n %}

{% block body_class %}{{ block.super }} create-page{% endblock %}

{% block title %}
    {% trans "Update review" %} | {{ block.super }}
{% endblock %}

{% block breadcrumbs %}
    <ul class="breadcrumb">
        <li>
            <a href="{% url 'dashboard:index' %}">{% trans "Dashboard" %}</a>
            <span class="divider">/</span>
        </li>
        <li>
            <a href="{% url 'dashboard:reviews-list' %}">{% trans "Reviews" %}</a>
            <span class="divider">/</span>
        </li>
        <li class="active">{% blocktrans %}Review #{{ review.id }}{% endblocktrans %}</li>
    </ul>
{% endblock %}

{% block headertext %}
    {% blocktrans %}Review #{{ review.id }}{% endblocktrans %}
{% endblock %}

{% block dashboard_content %}
    <form action="." method="post" class="form-stacked" enctype="multipart/form-data">
        {% csrf_token %}
        <div class="table-header">
            <h3>{% trans "Review information" %}</h3>
        </div>
        <div class="well">
            <div class="clearfix">
                {{ form.first }}
                {% for field in form %}
                    {# display title (first) and body (last) as full lines #}
                    {% if forloop.counter < 3 %}
                        <div class="control-group {% for error in field.errors %}error{% endfor %}">
                            {% if field.is_hidden %}
                                {{ field }}
                            {% else %}
                                {{ field.label_tag }}
                                <div class="controls">
                                    {{ field }}
                                    {% for error in field.errors %}
                                        <span class="error-block">
                                            {{ error|escape }}
                                        </span>
                                    {% endfor %}
                                    {% if field.help_text %}
                                        <span class='help-block'>
                                            {{ field.help_text }}
                                        </span>
                                    {% endif %}
                                </div>
                            {% endif %}
                        </div>
                    {% else %}
                        <div class="form-inline pull-left">
                            {% if field.is_hidden %}
                                {{ field }}
                            {% else %}
                                <span class="control-group {% if field.errors %}error{% endif %}">
                                    {{ field.label_tag }}
                                    {{ field }}
                                    {% for error in field.errors %}
                                        <ul class="error-block">
                                            <li>{{ error|escape }}</li>
                                        </ul>
                                    {% endfor %}
                                </span>
                            {% endif %}
                        </div>
                    {% endif %}
                {% endfor %}
            </div>
            <div class="form-actions">
                <button class="btn btn-primary btn-large" type="submit">{% trans "Save" %}</button> {% trans "or" %}
                <a href="{% url 'dashboard:reviews-list' %}">{% trans "cancel" %}</a>
            </div>
        </div>
    </form>
{% endblock dashboard_content %}
