<article id="inputs-panel" class="panel is-info">
  <p class="panel-heading py-2 is-size-6">
    Inputs
  </p>
  {% for input in inputs_with_source %}
    <div class="panel-block is-justify-content-space-between is-up">
      <div class="break-all pr-2 is-cursor-help dropdown is-hoverable">
        <div class="panel-icon pt-1">
          <div class="dropdown-trigger">
            <i class="is-size-6 {% if input.is_file %}fa-regular fa-file{% else %}fa-solid fa-folder{% endif %}" aria-hidden="true" aria-haspopup="true" aria-controls="dropdown-input-{{ file.name|slugify }}"></i>
          </div>
          <div class="dropdown-menu" id="dropdown-input-{{ file.name|slugify }}" role="menu">
            <div class="dropdown-content">
              <div class="dropdown-item">
                Source:
                <strong>
                  {% if input.source == "not_found" %}
                    Manually added
                  {% elif input.source == "uploaded" %}
                    Uploaded
                  {% elif input.source %}
                    Downloaded from {{ input.source }}
                  {% endif %}
                  </strong>
              </div>
            </div>
          </div>
        </div>
        {{ input.name }}
      </div>
      <div class="is-flex is-size-7">
        {% if input.is_file %}
          <span class="mr-1">{{ input.size|filesizeformat }}</span>
        {% endif %}
        <a class="is-grey-link is-clickable" href="{% url 'project_download_input' project.slug input.name %}"><span class="icon width-1 height-1"><i class="fa-solid fa-download"></i></span></a>
        {% if project.can_change_inputs %}
          <a class="modal-button is-grey-link is-clickable ml-1" data-target="modal-inputs-delete" aria-haspopup="true" data-url="{% url 'project_delete_input' project.slug input.name %}" data-filename="{{ input.name }}" href="#"><i class="fa-regular fa-trash-can"></i></a>
        {% endif %}
      </div>
    </div>
  {% endfor %}
  <div class="panel-block">
    {% if project.can_change_inputs %}
      <button class="button is-link is-outlined is-fullwidth modal-button" data-target="add-inputs-modal" aria-haspopup="true">Add inputs</button>
      {% include "scanpipe/modals/add_inputs_modal.html" %}
    {% else %}
      <button class="button is-link is-outlined is-fullwidth" disabled>Add inputs</button>
    {% endif %}
  </div>
</article>
{% if project.can_change_inputs %}
  {% include 'scanpipe/modals/project_inputs_delete_modal.html' %}
{% endif %}