{% load custom_tags_and_filters %} {# Set the form here (as good as any place) #}
{% csrf_token %}

{{ rate_form.display_title }}

Effective date {% if rate_times %}Time{% endif %} Amount Minimum charge Flat Daily rate {% for rate in rate_form.rate_history.all_rates %} {{ rate.effective_date|default_if_none:"" }} {% if rate_times %}{{ rate.time|default_if_none:"" }}{% endif %} {{ rate.amount }} {{ rate.minimum_charge|default_if_none:"" }} {% if rate.flat %}{% endif %} {% if rate.daily %} {% if rate.daily_split_multi_day_charges %} (Split per day) {% else %} (Once at the end) {% endif %} {% endif %} {% now "Y-m-d" as today_date %} {% if rate.effective_date and rate.effective_date|date:"Y-m-d" >= today_date %} {% button type="delete" value="" size="small" title="Delete this rate" onclick="delete_rate_form('#rate_history_"|concat:rate.id|concat:"', '"|concat:rate.id|default_if_none:''|concat:"');" %} {% endif %} {% endfor %} {% csrf_token %} {% if rate_form.effective_date.errors %}
{{ rate_form.effective_date.errors|striptags }}
{% endif %} {% if rate_times %} {% if rate_form.instance.type.can_have_rate_time %} {% if rate_form.time.errors %}
{{ rate_form.time.errors|striptags }}
{% endif %} {% endif %} {% endif %} {% if rate_form.amount.errors %}
{{ rate_form.amount.errors|striptags }}
{% endif %} {% if rate_form.minimum_charge.errors %}
{{ rate_form.minimum_charge.errors|striptags }}
{% endif %}
{% if rate_form.flat.errors %}
{{ rate_form.flat.errors|striptags }}
{% endif %} {% if rate_form.instance.type.type == "TOOL_USAGE" or rate_form.instance.type.type == "AREA_USAGE" %}
{% if rate_form.daily.errors or rate_form.daily_split_multi_day_charges.errors %}
{{ rate_form.daily.errors|striptags }} {{ rate_form.daily_split_multi_day_charges.errors|striptags }}
{% endif %}
{% endif %}
{% button type="save" size="small" submit=False value="" onclick="save_rate_form('"|concat:index|concat:"')" %}
{% if rate_form.non_field_errors %}
{{ rate_form.non_field_errors|striptags }}
{% endif %}