{% extends "_base.html" %} {% block title %}{{ super() }} Items {% endblock %} {% block extrahead %} {% endblock %} {% block crumbs %} {{ super() }} / Collections / {{ data['title'] }} / Items {% endblock %} {% block body %}
{% set nav_links = namespace(prev=None, next=None, self=None) %} {% for link in data['links'] %} {% if link['rel'] == 'prev' %} {% set nav_links.prev = link['href'] %} {% endif %} {% if link['rel'] == 'self' %} {% set nav_links.self = link['href'] %} {% endif %} {% if link['rel'] == 'next' %} {% set nav_links.next = link['href'] %} {% endif %} {% endfor %} {# parse the querystring as dict #} {% set attrs = {} %} {% if '?' in nav_links.self %} {% for kv in nav_links.self.split('#')[0].split('?').pop().split('&') %} {% if kv.split('=')[0] not in [None,''] %} {{ attrs.update({kv.split('=')[0] : kv.split('=')[1]}) or '' }} {% endif %} {% endfor %} {% else %} {% set nav_links.self = link['href'].split('#')[0] + '?' %} {% endif %} {# update existing url with new key,val. indent prevents spaces in output #} {# reset pagination, else you may end up in empty result #} {% macro updateurl(key=None,val=None) %}{{ nav_links.self.split('?')[0] }}?{% for at in attrs.keys() %}{% if at != 'offset' %}{% if attrs[at] not in [None,''] %}{% if key not in [None,''] and key == at %}&{{ at }}={{ val }}{% else %}&{{ at }}={{ attrs[at] }}{% endif %}{% endif %}{% endif %}{% if key not in attrs.keys() %}&{{ key }}={{ val }}{% endif %}{% endfor %}{% endmacro %} {% macro reseturl(key,val) %}{{ nav_links.self.split('?')[0]}}?facets=true{% if 'q' in attrs %}&q={{ attrs['q'] }}{% endif %}{% if 'sortby' in attrs %}&sortby={{ attrs['sortby'] }}{% endif %}{% endmacro %}

{{ data['numberMatched'] }} results.
{% if 'facets=true' in nav_links.self %} Reset {% endif %}
{% if data['facets'] %} {% for facet in data['facets'].keys() %}
{{ facet }}
{% for bucket in data['facets'][facet].buckets %} {% if bucket['value'] %} {{(bucket['value'] or "") | truncate(20, False, '..') | capitalize }} {{bucket['count']}}
{% endif %} {% endfor %}
{% endfor %} {% endif %}
{% for rec in data['features'] %} {% if 'properties' in rec %} {% else %} {% endif %} {% if 'properties' in rec %} {% if 'type' in rec['properties'] %} {% elif rec.get('type') == 'Feature' and 'stac_version' not in rec %} {% elif rec.get('type') == 'Feature' and 'stac_version' in rec %} {% else%} {% endif %} {% else %} {% if rec.get('type') == 'Feature' and 'stac_version' not in rec %} {% elif rec.get('type') == 'Feature' and 'stac_version' in rec %} {% elif rec.get('type') == 'Collection' and 'stac_version' in rec %} {% elif rec.get('type') == 'Catalog' and 'stac_version' in rec %} {% else%} {% endif %} {% endif %} {% endfor %}
Title Type Date
{{ rec['properties'].get('title', rec['id']) }}{{ rec.get('title', rec['id']) }}{{ rec['properties']['type'] }}recorditem{{ rec.get('type') }}recorditemcollectioncatalog{{ rec.get('type') }}{{ rec['properties']['updated'].split('T')[0].replace('-','/') }}
{% if nav_links.prev %} {% else %} {% endif %}
Showing {{ data['numberReturned'] }} of {{ data['numberMatched'] }} results.
{% if nav_links.next %} {% else %} {% endif %}
{% endblock %} {% block extrafoot %} {% if data['features'] %} {% endif %} {% endblock %}