You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

33 lines
1.8 KiB

{% load thumbnail %}
<div class='c'></div>
{{ load_img_formset.management_form }}
{% for form2 in load_img_formset %}
<div class='hidden-fileinput' data-width='{% if forloop.counter == 1 %}300{% else %}75{% endif %}' data-height='{% if forloop.counter == 1 %}240{% else %}60{% endif %}' data-form-id='{{ form2.prefix }}'>{{ form2.image }}</div>
<div id='{{ form2.prefix }}-img' class='add_photo {% if forloop.counter == 1 %}big-img{% else %}small-img{% endif %}' data-form-id='{{ form2.prefix }}' data-counter='{{ forloop.counter }}' {% if forloop.counter == 1 %}data-size='300x240'{% else %}data-size='75x60'{% endif %}>
{% if form2.tmp_tmb.value %}
<img src="{{ form2.tmp_tmb.value }}" title="{{ item.name }}" />
{% else %}
{% if form2.image.value %}
{% if forloop.counter == 1 %}
{% thumbnail form2.image.value "300x240" format="PNG" as img %}
<img src="{{ img.url }}" width="{{ img.width }}" height="{{ img.height }}" title="{{ item.name }}" style="width: {{ img.width }}px; height: {{ img.height }}px;"/>
{% endthumbnail %}
{% else %}
{% thumbnail form2.image.value "75x60" format="PNG" as img %}
<img src="{{ img.url }}" width="{{ img.width }}" height="{{ img.height }}" title="{{ item.name }}" style="width: {{ img.width }}px; height: {{ img.height }}px;"/>
{% endthumbnail %}
{% endif %}
{% endif %}
{% endif %}
{% csrf_token %}
{{ form2.id }}
<div class='hidden'>
<input id="id_{{ form2.prefix }}-ordering" type="text" name="{{ form2.prefix }}-ordering" value="{{ forloop.counter }}">
{{ form2.tmp_image }}
{{ form2.tmp_tmb }}
{{ form2.DELETE }}
</div>
</div>
{% endfor %}
<div class='c'></div>