{% from 'developers/includes/macros.html' import empty_unless, required, tip %} {{ csrf() }} {% set editable = (context == 'edit' and editable) or context == 'submit' %}
{% if context == 'edit' %} {% endif %} {% if context == 'edit' %} {% endif %}
{{ tip(_('App Icon'), _("Upload an icon for your app or choose from one of ours. " "The icon is displayed nearly everywhere your app is. " "Uploaded images must be one of the following image " "types: .png, .jpg")) }} {% if context == 'submit' %} {% endif %} {% if editable %}
{# L10n: The size of the icon #} {{ _('64x64px') }} {{ tip(None, _('Used in app detail pages.')) }}
{# L10n: The size of the icon #} {{ _('32x32px') }} {{ tip(None, _('Used in listings of apps, like search results ' 'and featured apps.')) }}
{{ form.icon_upload_hash }}
{% trans %} PNG and JPG supported. Icons resized to 64x64 pixels if larger. {% endtrans %}
{% else %} {% call empty_unless(addon.icon_type) %}
{% endcall %} {% endif %}
{% if waffle.switch('video-upload') %} {% else %} {% endif %} {{ required() if editable }} {% if context == 'submit' %} {% endif %}
{% if editable %} {% if preview_form %} {{ preview_form.management_form }} {{ preview_form.non_form_errors() }}
{% for form in preview_form.forms %}
  {% if form.instance.id %}
{% else %}
{% endif %} {{ form.id }} {{ form.DELETE }}{{ form.DELETE.label_tag() }}
{{ form.caption }} x
{{ form.position }}
{{ form.upload_hash }} {{ form.unsaved_image_type }} {{ form.unsaved_image_data }}
{{ form.errors }}
{% endfor %}
{% endif %} {% else %} {% set previews = addon.get_previews() %} {% call empty_unless(previews) %} {% for preview in previews %}
{% endfor %} {% endcall %} {% endif %}
{% if editable and context == 'edit' %} {% elif context == 'submit' %}
{% endif %}