{# Displays a single of dataset. package - A package to display. item_class - The class name to use on the list item. hide_resources - If true hides the resources (default: false). banner - If true displays a popular banner (default: false). truncate - The length to trucate the description to (default: 180) truncate_title - The length to truncate the title to (default: 80). Example: {% snippet 'snippets/package_item.html', package=c.datasets[0] %} #} {% set organization = package.organization %} {% set truncate = truncate or 180 %} {% if organization and show_organization %} {% set truncate = truncate - organization|length if organization|length < truncate else 10 %} {% endif %} {% set title = package.title or package.name %} {% set notes = h.markdown_extract(package.notes | striptags, extract_length=truncate) %} {% set resource_limit = resource_limit or 7 %}
  • {% block package_item_content %}
    {% if organization %} {% set organization_type = organization.organization_type|replace(' Government', '') %} {% endif %} {% if organization_type and show_organization %}
    {{ organization_type }}
    {% endif %}

    {% if package.private %} {{ _('Private') }} {% endif %} {% if h.get_pkg_dict_extra(package, 'collection_metadata', '') %} {{ _('Collection') }} {% endif %} {{ h.link_to(title, h.url_for(controller='dataset', action='read', id=package.name)) }} {% if package.get('state', '').startswith('draft') %} {{ _('Draft') }} {% elif package.get('state', '').startswith('deleted') %} {{ _('Deleted') }} {% endif %} {% if h.is_tagged_ngda(package) %} {{ _('NGDA') }} {% endif %} {{ h.render_popular('recent views', package, min=10) }}

    {% if organization and show_organization %}

    {{ organization.title or organization.name }} —

    {% endif %} {% if notes %}
    {{ notes|urlize }}
    {% endif %}
    {% if package.resources and not hide_resources and (h.get_pkg_dict_extra(package, 'accessLevel') != 'non-public') %} {% endif %}
    {% endblock %}