{% load i18n %}

    <div class="form-group" ng-if="question.widget_type === 'file'">
        {% include 'projects/project_questions_question_label.html' %}
        {% include 'projects/project_questions_question_help.html' %}
        {% include 'projects/project_questions_question_warning.html' %}

        <div ng-if="question.is_collection">
            {% include 'projects/project_questions_add_field_help.html' %}
        </div>

        <div ng-repeat="value in service.values[question.attribute][valueset.set_prefix][valueset.set_index] track by $index">
            <div class="collection" ng-hide="value.removed">
                <div class="options">
                    {% include 'projects/project_questions_erase_field.html' %}
                    {% include 'projects/project_questions_remove_field.html' %}
                </div>

                <label class="file-control">
                    <p ng-show="value.file_url">
                        {% trans 'Currently:' %} <a href="{$ value.file_url $}" target="blank">{$ value.file_name $}</a>
                    </p>
                    <p>
                        <span ng-show="value.file_url">{% trans 'Update:' %}</span>
                        <input type="file" class="file-input"
                            ng-attr-id="id_{$ question.attribute $}_{$ valueset.set_prefix $}_{$ valueset.set_index $}_{$ $index $}"
                            ng-model="value.file"
                            ng-disabled="service.project.read_only"
                            ng-change="service.changed(value, true)" />
                    </p>
                    <ul class="text-danger list-unstyled" ng-if="value.errors.length">
                        <li ng-repeat="error in value.errors">{$ error $}</li>
                    </ul>
                </label>
            </div>
        </div>

        <div ng-if="question.is_collection">
            {% include 'projects/project_questions_add_field_button.html' %}
        </div>
    </div>
