{% extends "layout/base.html" %}
{% set active_page = "about" %}

{% block title %}About Explorer{% endblock %}
{% block head %}
    {{ super() }}
    <style>

        .uri-path {
            margin-bottom: 15px;
            display: block;
        }

        .path-variable {
            font-style: italic;
            background-color: #ccc
        }
        .path-variable::before {
            content: '['
        }
        .path-variable::after {
            content: ']'
        }

    </style>
{% endblock %}
{% block content %}
    <div class="panel highlight">
        <h2 class="followed">
            Exploring {{ '{:,d}'.format(total_dataset_count) }} datasets
        </h2>
    </div>

    <div class="panel">
        <h3>
            Collection APIs
            {{ hanchor('apis') }}
        </h3>
        Explorer exposes the collections over a <span class="badge header-badge"><a href="https://stacspec.org/">Stac</a> {{ stac_version }}</span> API:
        <p class="uri-path">
            <a href="{{ url_for('stac.root') }}">{{ url_for('stac.root', _external=True) }}</a>
        </p>
    </div>



    <div class="panel odd overflowable">
        <h3>
            Datacube Resources
            {{ hanchor('datacube-resources') }}
        </h3>

        Datacube-ready config and metadata can be downloaded from Explorer programatically:

        <ul>
            <li>
                A dataset:
                <span class="uri-path">
                     {{ explorer_root_url}}dataset/<span class="path-variable">Dataset UUID</span>.odc-metadata.yaml
                </span>
            </li>
            <li>
                A Product:
                <span class="uri-path">
                    {{ explorer_root_url}}products/<span class="path-variable">Product Name</span>.odc-product.yaml
                </span>
            </li>
            <li>
                A Metadata Type:
                <span class="uri-path">
                    {{ explorer_root_url}}metadata-types/<span class="path-variable">Metadata Type Name</span>.odc-type.yaml
                </span>
            </li>
            <li>
                All Products:
                <span class="uri-path">
                    {{ url_for('product.raw_all_products_doc', _external=True) }}
                </span>
            </li>
            <li>
                All Metadata Types:
                <span class="uri-path">
                    {{ url_for('product.raw_all_metadata_types_doc', _external=True) }}
                </span>
            </li>
        </ul>
    </div>

    <div class="panel overflowable">
        <h3>
            Extents and Summaries
            {{ hanchor('extent-apis') }}
        </h3>
        Extent data displayed by Explorer can be downloaded as GeoJSON
        <ul>
            <li>
                Total footprint
                <span class="uri-path">
                    {{ explorer_root_url}}api/footprint/<span class="path-variable">Product Name</span><br/>
                    {{ explorer_root_url}}api/footprint/<span class="path-variable">Product Name</span>/<span class="path-variable">Year</span><br/>
                    {{ explorer_root_url}}api/footprint/<span class="path-variable">Product Name</span>/<span class="path-variable">Year</span>/<span class="path-variable">Month</span><br/>
                    {{ explorer_root_url}}api/footprint/<span class="path-variable">Product Name</span>/<span class="path-variable">Year</span>/<span class="path-variable">Month</span>/<span class="path-variable">Day</span><br/>
                </span>
            </li>
            <li>
                Region footprints
                <span class="uri-path">
                    {{ explorer_root_url}}api/regions/<span class="path-variable">Product Name</span><br/>
                    {{ explorer_root_url}}api/regions/<span class="path-variable">Product Name</span>/<span class="path-variable">Year</span><br/>
                    {{ explorer_root_url}}api/regions/<span class="path-variable">Product Name</span>/<span class="path-variable">Year</span>/<span class="path-variable">Month</span><br/>
                    {{ explorer_root_url}}api/regions/<span class="path-variable">Product Name</span>/<span class="path-variable">Year</span>/<span class="path-variable">Month</span>/<span class="path-variable">Day</span><br/>
                </span>
            </li>
            <li>
                Dataset footprints
                <span class="muted">
                    (<tt>?limit={{ config['CUBEDASH_DEFAULT_API_LIMIT'] }}</tt> by default,
                    can be increased up to {{ config["CUBEDASH_HARD_API_LIMIT"] }} on this host)
                </span>
                <span class="uri-path">
                    {{ explorer_root_url}}api/datasets/<span class="path-variable">Product Name</span><br/>
                    {{ explorer_root_url}}api/datasets/<span class="path-variable">Product Name</span>/<span class="path-variable">Year</span><br/>
                    {{ explorer_root_url}}api/datasets/<span class="path-variable">Product Name</span>/<span class="path-variable">Year</span>/<span class="path-variable">Month</span><br/>
                    {{ explorer_root_url}}api/datasets/<span class="path-variable">Product Name</span>/<span class="path-variable">Year</span>/<span class="path-variable">Month</span>/<span class="path-variable">Day</span><br/>
                </span>
            </li>
        </ul>
    </div>

    <div class="panel odd overflowable">
         <h3>
             Audit and Examine
             {{ hanchor('audit-apis') }}
         </h3>

        Much of Explorer's audit pages are available in CSV or text format.

        <ul>
            <li>
                <a href="{{ url_for('product.storage_page') }}">Storage</a> information:
                <span class="uri-path">
                    {{ url_for('product.storage_csv', _external=True) }}
                </span>
            </li>
            <li>
                Raw, bulk <a href="{{ url_for('audit.dscount_report_page') }}">dataset counts</a>:
                <span class="uri-path">
                    {{ url_for('audit.dsreport_csv', _external=True) }}
                </span>
            </li>
            <li>
                <a href="{{ url_for('pages.arrivals_page') }}">Arriving data</a> summary:
                <span class="uri-path">
                    {{ url_for('pages.arrivals_csv', _external=True) }}
                </span>
            </li>
            <li>
                Simple, bash-ready list of names:
                <span class="uri-path">
                    {{ url_for('product.product_list_text', _external=True) }}<br/>
                    {{ url_for('product.metadata_type_list_text', _external=True) }}
                </span>
            </li>
            <li>
                <a href="{{ url_for('audit.datasets_metadata_page', _anchor='query-timings') }}">
                    Day query timing
                </a> information:
                <span class="uri-path">
                    {{ url_for('audit.get_timings_text', _external=True) }}
                </span>
            </li>
        </ul>
    </div>
{% endblock %}
