{# 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 %} {%- call ui.util.call(ui.sidebar_section, title=_("Details"), attrs={"id": "package-info"}) -%} {% block package_info_inner %}
{% block heading %} {{ pkg.title }} {%- endblock -%}
{% if pkg.private %} {{ ui.badge(_("Private"), style="info",) }} {% endif %} {% if pkg.state == 'deleted' %} {{ ui.badge(_("Deleted"), style="warning") }} {% elif pkg.state == 'draft' %} {{ ui.badge(_("Draft"), style="warning") }} {% endif %} {% block description %} {% if pkg.notes %}

{{ h.markdown_extract(pkg.notes, 180) }}

{% endif %} {% endblock %}
{% block follow_button %} {% if current_user.is_authenticated %} {{ ui.alert(error_message, style="danger") if error_message }} {% if am_following %} {{ ui.button(_("Unfollow"), style="secondary", icon="bell-slash", hx={"target": "#package-info", "post": h.url_for('dataset.unfollow', id=pkg.id)}, full=true) }} {% else %} {{ ui.button(_("Follow"), style="secondary", icon="bell", hx={"target": "#package-info", "post": h.url_for('dataset.follow', id=pkg.id)}, full=true) }} {% endif %} {% endif %} {% endblock %} {% block nums %} {% set num_followers = h.follow_count('dataset', pkg.id) %} {%- call ui.util.call(ui.table, striped=true, condensed=true, adaptive=true) -%} {{ _('Followers') }} {{ h.SI_number_span(num_followers) }} {{ _("Resources") }} {{ pkg.resources|length }} {%- endcall %} {% endblock %} {% endblock %} {%- endcall %} {% endif %} {% endblock %}