{% load media_widgets %}
<fieldset class="module aligned {{ fieldset.classes }}">
  {% if fieldset.name %}<h2>{{ fieldset.name }}</h2>{% endif %}
  {% if fieldset.description %}<div class="description">{{ fieldset.description|safe }}</div>{% endif %}
  {% for line in fieldset %}
      <div class="form-row{% if line.errors %} errors{% endif %} {% for field in line %}{{ field.field.name }} {% endfor %} ">
      {{ line.errors }}
      {% for field in line %}
      <div{% if not line.fields|length_is:"1" %} class="field-box"{% endif %}>

          {% if field.is_checkbox %}
              {{ field.field }}{{ field.label_tag }}
          {% else %}
              {{ field.label_tag }}{{ field.field }}
          {% endif %}
          {% ifequal app_label 'massmedia' %}
            {% ifequal field.field.name 'file' %}
              {% ifequal fieldset.name 'Content' %}
                {% ifequal title 'Change image' %}
                <div>{{ original.thumb|safe }}<br>
                <a href="#" onclick="var win = window.open('{% snipshot_url original %}','snipshot', 'height=500,width=800,resizable=yes,scrollbars=yes');win.focus();">Crop image with snipshot</a>
                </div>
                {% endifequal %}
              {% endifequal %}
            {% endifequal %}
          {% endifequal %}
          {% if field.field.field.help_text %}<p class="help">{{ field.field.field.help_text|safe }}</p>{% endif %}
      </div>
      {% endfor %}
      </div>
  {% endfor %}
</fieldset>
