{% extends "ralph_pricing/base.html" %}
{% load url from future %}
{% load icons %}
{% load formats %}
{% load bob %}

{% block content %}
{% if formset %}
<form method="POST">
{% csrf_token %}
{{ formset.management_form }}
<table class="table table-striped table-bordered details-dns table-condensed">
    <thead><tr>
        <th width="16"></th>
        <th width="*">Type</th>
        <th width="*">Price</th>
        <th width="*">Start</th>
        <th width="*">End</th>
        <th width="20">Del</th>
    </tr></thead>
    <tbody>
        {% for form in formset %}
        <tr>
            <td style="vertical-align:middle">
                {% icon 'fugue-money-coin' %}
                {% for f in form.hidden_fields %}{{ f }}{% endfor %}
            </td>
            {% for f in form.visible_fields %}
            <td class="control-group {{ f.css_classes }} {% if f.errors %}error{% endif %}" style="vertical-align:middle;text-align:center">
                {{ f }}
                {% for e in f.errors %}
                    <div class="help-block">{{ e }}</div>
                {% endfor %}
            </td>
            {% endfor %}
        </tr>
        {% endfor %}
    </tbody>
</table>
<div class="buttons pull-right">
    {% spaceless %}
    <button type="submit" value="Save" class="btn btn-primary"
    >{% icon 'fugue-tick' %}&nbsp;Save</button>
    {% endspaceless %}
</div>
</form>
{% endif %}
{% endblock content %}
