{% extends "skeleton.html" %}
{% block page_title %}Datastore Indexes{% endblock %}

{% block page_head %}
  <style type="text/css">{% include "datastore_indexes_viewer.css" %}</style>
{% endblock %}


{% block body %}
<div id="datastore-indexes">
  <h3>Datastore Indexes</h3>
  {% if indexes %}
    <p>
    Below are indexes for the application.
    Indexes are managed in an index.yaml file.<br/>
    Learn more about
    <a href="https://developers.google.com/appengine/kb/general#indexes"
      target="_blank">indexes</a>.
    </p>
    <ul>
    {% for kind_indexes in indexes %}
      <li><div class="index-name">{{ kind_indexes.0 }}</div>
      <ul>
      {% for kind_index in kind_indexes.1 %}
        <li class="index-defs">&nbsp;&nbsp;&nbsp;
          {% for property in kind_index.properties %}
            {{ property.name }}
            <span class="unimportant" title="{{ property.sort_direction }}">
              {{ property.sort_symbol|safe }}</span>
          {% endfor %}
          {% if kind_index.has_ancestor %}
            <div class="unimportant">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Includes ancestors</div>
          {% endif %}
        </li>
      {% endfor %}
      </ul></li>
    {% endfor %}
    </ul>
  {% else %}
    <p>
    Datastore contains no indexes.
    </p>
  {% endif %}
</div>
{% endblock %}
