{% extends "page.html" %}

{% block htmltitle -%}
  <title>{{ indextitle|striptags|e }} - {{ docstitle|striptags|e }}</title>
{% endblock htmltitle -%}

{% block scripts -%}
  {{ super() }}
  {%- if not embedded and collapse_index %}
    <script>DOCUMENTATION_OPTIONS.COLLAPSE_INDEX = true</script>
  {%- endif -%}
{%- endblock scripts %}

{% block content %}
<section class="domainindex-section">
  <h1>{{ indextitle }}</h1>

  <!-- rufu: add note for config option index -->
  {% if indextitle == "Configuration options" %}
  <p>This page lists the available configuration options for different entities.</p>
  <div class="admonition note">
    <p class="admonition-title">Note</p>
    <p>The <a href="#cap-sysctl">SYSCTL</a> configuration options are settings specified in the server's <code class="docutils literal notranslate"><span class="pre">/etc/sysctl.conf</span></code> file rather than LXD configuration options.</code> </p>
  </div>
  {% endif %}
  <!-- end note -->

  <div class="domainindex-jumpbox">
    {%- for (letter, entries) in content -%}
      <a href="#cap-{{ letter }}"><strong>{{ letter }}</strong></a>
    {%- if not loop.last %} | {% endif -%}
    {%- endfor -%}
  </div>
</section>

{%- set groupid = idgen() %}
<table class="domainindex-table">
  {%- for letter, entries in content %}
  <tr class="pcap">
    <td></td><td>&#160;</td><td></td>
  </tr>
  <tr class="cap" id="cap-{{ letter }}">
    <td></td><td><strong>{{ letter }}</strong></td><td></td>
  </tr>
  {%- for (name, grouptype, page, anchor, extra, qualifier, description) in entries %}
  <tr{% if grouptype == 2 %} class="cg-{{ groupid.current() }}"{% endif %}>
    <td>{% if grouptype == 1 -%}
        <img src="{{ pathto('_static/minus.png', 1) }}" class="toggler"
              id="toggle-{{ groupid.next() }}" style="display: none" alt="-" />
        {%- endif %}</td>
    <td>{% if grouptype == 2 %}&#160;&#160;&#160;{% endif %}
        {% if page %}<a href="{{ pathto(page)|e }}#{{ anchor }}">{% endif -%}
            <code class="xref">{{ name|e }}</code>
            {%- if page %}</a>{% endif %}
      <!-- ru-fu: extra has HTML for config options -->
      {%- if extra %}
        {% if indextitle == "Configuration options" %}
          ({{ extra|safe }})
        {% else %}
          <em>({{ extra|e }})</em>
        {% endif -%}
      {% endif -%}
    </td><td>{% if qualifier %}<strong>{{ qualifier|e }}:</strong>{% endif %}
    <em>{{ description|e }}</em></td>
  </tr>
  {%- endfor %}
  {%- endfor %}
</table>
{% endblock content %}
