{% load i18n %}
{% load main_extras %}
<div class="file-input">
  {% if widget.is_initial %}
    <div class="current">
      <a href="{{ widget.value.url }}" target="_blank">{{ "file"|remix }}{% translate "File" %} [{{ widget.value|extension }}]</a>
      {% if not widget.required %}
        <span class="field checkbox">
          <label for="{{ widget.checkbox_id }}">{{ widget.clear_checkbox_label }}</label>
          <input type="checkbox"
                 name="{{ widget.checkbox_name }}"
                 id="{{ widget.checkbox_id }}"
                 {% if widget.attrs.disabled %}disabled{% endif %}>
        </span>
      {% endif %}
    </div>
  {% endif %}
  <input type="{{ widget.type }}"
         name="{{ widget.name }}"
         {% include "django/forms/widgets/attrs.html" %}>
</div>
