
{% load widget_tweaks %}

{% csrf_token %}


<div class="input-group {% if form.name.errors %}has-error{% endif %} col-xs-12">
    {{ form.name.label_tag }} *
    {{ form.name|add_class:"form-control input-lg" }}
    <div class="help-block">{{ form.name.errors }}</div>
</div>

<div class="input-group {% if form.text.errors %}has-error{% endif %} col-xs-12">
    {{ form.text.label_tag }} *
    {{ form.text|add_class:"form-control input-lg"|attr:"rows:5" }}
    <div class="help-block">{{ form.text.errors }}</div>
</div>

<div class="input-group col-xs-12">
    {{ form.rating.label_tag }} *
    <div class="clearfix xs-margin"></div>
    {{ form.rating|attr:'min:0'|attr:'max:5'|attr:'step:1'  }}
    <div class="rateit" data-rateit-backingfld="#{{ form.rating.auto_id }}"></div>
    <div class="help-block">{{ form.rating.errors }}</div>
</div>

<div class="input-group {% if form.photo.errors %}has-error{% endif %} col-xs-12">
    {{ form.photo.label_tag }}
    {{ form.photo|add_class:"form-control input-lg" }}
    <div class="help-block">{{ form.photo.errors }}</div>
</div>

<div class="input-group {% if form.captcha.errors %}has-error{% endif %} col-xs-12">
    {{ form.captcha.label_tag }} *
    {{ form.captcha }}
    <div class="help-block">{{ form.captcha.errors }}</div>
</div>

<script>
    $('.rateit').rateit();
</script>
