{# Displays a sidebar module with information for given package pkg - The package dict that owns the resources. am_following - True if the user is following the package. Example: {% snippet "package/snippets/info.html", pkg=pkg, am_following=am_following %} #} {% block package_info %} {% if pkg %}
{% block heading %}

{{ h.dataset_display_name(pkg) }}

{% endblock %}
{% block package_info_inner %} {% block nums %} {% set num_followers = h.follow_count('dataset', pkg.id) %}
{{ ui.definition_list([[_('Followers'), h.SI_number_span(num_followers)]]) }}
{% endblock %} {% block follow_button %} {% if current_user.is_authenticated %} {{ ui.alert(error_message, style="danger") if error_message }} {% if am_following %} {{ ui.button(ui.icon("circle-minus", style="solid") ~ _("Unfollow"), style="danger", hx={"target": "#package-info", "post": h.url_for('dataset.unfollow', id=pkg.id)}) }} {% else %} {{ ui.button(ui.icon("circle-plus", style="solid") ~ _("Follow"), style="success", hx={"target": "#package-info", "post": h.url_for('dataset.follow', id=pkg.id)}) }} {% endif %} {% endif %} {% endblock %} {% endblock %}
{% endif %} {% endblock %}