{% ckan_extends %}

{% block resources_inner %}
  {% asset 'feedback/feedback-package-item-css' %}
  {% asset 'feedback/feedback-tooltip-css' %}
  {% for resource in h.dict_list_reduce(package.resources, 'format') %}
    <li>
      {% if h.is_base_public_folder_bs3() %}
        <a href="{{ h.url_for(package.type ~ '.read', id=package.name) }}" class="label label-default" data-format="{{ resource.lower() }}">{{ resource }}</a>
      {% else %}
        <a href="{{ h.url_for(package.type ~ '.read', id=package.name) }}" class="badge badge-default" data-format="{{ resource.lower() }}">{{ resource }}</a>
      {% endif %}
    </li>
  {% endfor %}
  <br>
  <li>
    {% if h.is_enabled_downloads_org(package.owner_org) %}
      <div class = "bubble">
        <i class="fa-solid fa-arrow-circle-down"></i>
        {{ h.get_package_downloads(package.id) }}
        <div class="description">{{ _('Downloads') }}</div>
      </div>
    {% endif %}
  </li>
  <li>
    {% if h.is_enabled_utilizations_org(package.owner_org) %}
      <div class="utilization-data bubble">
        <i class="fa-solid fa-seedling"></i>
        <a href="{{ h.url_for('utilization.search', id=package.id, disable_keyword=true) }}">{{ h.get_package_utilizations(package.id) }}</a>
        <div class="description">{{ _('Utilizations') }}</div>
      </div>
    {% endif %}
  </li>
  <li>
    {% if h.is_enabled_resources_org(package.owner_org) %}
      <div class="utilization-data bubble">
        <i class="fa-solid fa-comment-dots"></i>
        {{ h.get_package_comments(package.id) }}
        <div class="description">{{ _('Comments') }}</div>
      </div>
    {% endif %}
  </li>
  <li>
    {% if h.is_enabled_resources_org(package.owner_org) %}
      {% if h.is_enabled_rating_org(package.owner_org) %}
        <div class="utilization-data bubble">
          <i class="fa-solid fa-star"></i>
          {{ h.get_package_rating(package.id)|round(1) }}
          <div class="description">{{ _('Rating') }}</div>
        </div>
      {% endif %}
    {% endif %}
  </li>
  <li>
    {% if h.is_enabled_utilizations_org(package.owner_org) %}
      <div class="bubble">
        <img id="issue-resolution" src="/images/issue_resolution_badge.png">
        {{ h.get_package_issue_resolutions(package.id) }}
        <div class="description">{{ _('Issue Resolutions') }}</div>
      </div>
    {% endif %}
  </li>
{% endblock %}