{% if not export %}{% extends "admin/layout.html" %}{% endif -%}
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
  "http://www.w3.org/TR/html4/strict.dtd">
<title>{% block title %}{{ _("About The System") }}{% endblock %}</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<style type="text/css">
  body { font-family: monospace; margin: 0; padding: 20px; }
  ul.plugin-table { list-style: none; padding: 0; }
  ul.plugin-table li dl { margin-left: 20px; }
  h1, h2 { color: white; font-family: 'Trebuchet MS', sans-serif; }
  h1 { background: #222e4b; margin: -20px; padding: 20px; }
  h2 { background: #316182; margin: 20px -20px 10px -20px; padding: 5px 20px; }
  dl dt { font-weight: bold; }
  table { border-collapse: collapse; width: 100%; }
  table th, table td { padding: 2px; }
  table th { text-align: left; border-bottom: 1px solid black; }
</style>
<body>
{%- block contents %}
  <h1>{{ _("About The System") }}</h1>
  <h2>{{ _('Zine Environment') }}</h2>
  <dl>
    <dt>{{ _('Zine Version') }}</dt>
    <dd>{{ zine_version|e }}</dd>
    <dt>{{ _('Distribution Mode') }}</dt>
    <dd>{{ zine_env.MODE }}</dd>
    <dt>{{ _('Package Location') }}</dt>
    <dd>{{ zine_env.PACKAGE_LOCATION|e }}</dd>
    <dt>{{ _('Shared Data') }}</dt>
    <dd>{{ zine_env.SHARED_DATA|e }}</dd>
    <dt>{{ _('Builtin Templates') }}</dt>
    <dd>{{ zine_env.BUILTIN_TEMPLATE_PATH|e }}</dd>
    <dt>{{ _('Builtin Plugins') }}</dt>
    <dd>{{ zine_env.BUILTIN_PLUGIN_FOLDER|e }}</dd>
    <dt>{{ _('Builtin Translations') }}</dt>
    <dd>{{ zine_env.LOCALE_PATH|e }}</dd>
    <dt>{{ _('Path to Instance') }}</dt>
    <dd>{{ instance_path|e }}</dd>
    <dt>{{ _('Database URI') }}</dt>
    <dd>{{ database_uri|e }}</dd>
  </dl>
  <h2>{{ _("Hosting Environment") }}</h2>
  <dl>
    <dt>{{ _('Python Version') }}</dt>
    <dd>{{ python_version }}</dd>
    <dt>{{ _('Platform') }}</dt>
    <dd>{{ platform|e }}</dd>
    <dt>{{ _('Persistent Environment') }}</dt>
    <dd>{{ _('yes') if hosting_env.persistent else _('no') }}</dd>
    <dt>{{ _('Multithreaded') }}</dt>
    <dd>
    {%- if hosting_env.multithreaded -%}
      {% trans count=hosting_env.thread_count %}yes ({{ count }} active threads){% endtrans %}
    {%- else -%}
      {{ _("no") }}
    {%- endif -%}
    </dd>
    <dt>{{ _('Multiprocess') }}</dt>
    <dd>{{ _('yes') if hosting_env.multiprocess else _('no') }}</dd>
    <dt>{{ _('WSGI Version') }}</dt>
    <dd>{{ hosting_env.wsgi_version|e }}</dd>
  </dl>
  <h2>{{ _("URL Endpoints") }}</h2>
  <p>{% trans %}
    The following endpoints are registered on this instance:
  {% endtrans %}</p>
  <ul>
  {%- for endpoint in endpoints %}
    <li><strong>{{ endpoint.name|e }}</strong> -&gt; <small>{{ endpoint.rule|e }}</small></li>
  {%- endfor %}
  </ul>
  <h2>{{ _("Absolute URL Handlers") }}</h2>
  <p>{% trans %}
    The following absolute URL handlers are registered on this instance:
  {% endtrans %}</p>
  <ul>
  {%- for handler in absolute_url_handlers %}
    <li><code>{{ handler|e }}</code>
  {%- endfor %}
  </ul>
  <h2>{{ _("View Handlers") }}</h2>
  <p>{% trans %}
    The following view handlers for endpoints are registered on this instance:
  {% endtrans %}</p>
  <ul>
  {%- for view in views %}
    <li><strong>{{ view.endpoint|e }}</strong> by <code>{{ view.handler|e }}</code></li>
  {%- endfor %}
  </ul>
  <h2>{{ _("Content Types") }}</h2>
  <p>{% trans %}
    The following content types are registered on this instance:
  {% endtrans %}</p>
  <ul>
  {%- for type in content_types %}
    <li><strong>{{ type.name|e }}</strong><ul>
      {% for action, handler in type|dictsort if action != 'name' %}
        <li><code>{{ handler }}</code> [{{ action }}]</li>
      {% endfor %}</ul></li>
  {%- endfor %}
  </ul>
  <h2>{{ _("Privileges") }}</h2>
  <p>{% trans %}
    The following privileges are known to the system:
  {% endtrans %}</p>
  <ul>
  {%- for id, explanation in privileges %}
    <li><code>{{ id }}</code> &mdash; {{ explanation|e }}</li>
  {%- endfor %}
  </ul>
  <h2>{{ _("Services") }}</h2>
  <p>{% trans %}
    The following servicepoints are registered on this instance to be callable
    via one of the available services.
    {% endtrans %}</p>
  <ul>
  {%- for service in servicepoints %}
    <li><strong>{{ service.name|e }}</strong> by <code>{{ service.handler }}</code>
  {%- endfor %}
  </ul>
  <h2>{{ _("Installed APIs") }}</h2>
  <p>{% trans %}
    The following APIs are installed on this blog instance. APIs marked with
    a star (*) are preferred.
  {% endtrans %}</p>
  <ul>
  {%- for api in apis %}
    <li><strong>{{ api.name|e }}</strong>
      <small>(provided by {{ api.endpoint|e }})</small> {% if api.preferred %}*{% endif %}
    </li>
  {%- else %}
    <li><em>no APIs installed</em></li>
  {%- endfor %}
  </ul>
  <h2>{{ _("ZEML Element Handlers") }}</h2>
  <p>{% trans %}
    The following ZEML element handlers are registered on this instance:
  {% endtrans %}</p>
  <ul>
  {%- for handler in zeml_element_handlers %}
    <li><strong>{{ handler.tag }}</strong> by <code>{{ handler.name }}</code>
  {%- else %}
    <li><em>{{ _('no ZEML element handlers installed.') }}</em>
  {%- endfor %}
  </ul>
  <h2>{{ _("Parsers") }}</h2>
  <p>{% trans %}
    The following parsers are currently installed:
  {% endtrans %}</p>
  <ul>
  {%- for parser in parsers %}
    <li><strong>{{ parser.name }}</strong>: <code>{{ parser.id }}</code>
      [<small>{{ parser.key }}</small>]
  {%- endfor %}
  </ul>
  <h2>{{ _("Plugins") }}</h2>
  <ul class="plugin-table">
  {%- for plugin in plugins %}
    <li><h3>{{ plugin.metadata.name|e }}{% if plugin.active
      %} [{{_('active') }}]{% endif %}</h3><dl>
      <dt>{{ _("UID") }}</dt>
      <dd>{{ plugin.name }}</dd>
      <dt>{{ _("Author") }}</dt>
      <dd>{{ plugin.metadata.author|e }}</dd>
      <dt>{{ _("Location") }}</dt>
      <dd class="location">{{ plugin.path|e }}</dd>
    </dl></li>
  {%- endfor %}
  </ul>
  <h2>{{ _("Configuration Variables") }}</h2>
  <table>
    <tr>
      <th>{{ _("Key") }}</th>
      <th>{{ _("Value") }}</th>
      <th>{{ _("Default") }}</th>
    </tr>
  {%- for item in configuration %}
    <tr>
      <td><strong>{{ item.key|e }}</strong></td>
      <td>{{ item.value|e }}</td>
      <td><small>{{ item.default|e }}</small></td>
    </tr>
  {%- endfor %}
  </table>
  <h2>{{ _("Template Globals") }}</h2>
  <ul>
  {%- for global in template_globals %}
    <li><strong>{{ global|e }}</strong></li>
  {%- endfor %}
  </ul>
  <h2>{{ _("Template Filters") }}</h2>
  <ul>
  {%- for filter_ in template_filters %}
    <li><strong>{{ filter_|e }}</strong></li>
  {%- endfor %}
  </ul>
  {%- if not export %}
  <div class="text">{% trans %}
    You can export this list and share it for troubleshooting by clicking
    on the button below.  The resulting file is stripped of confidential
    information such as passwords.
  {% endtrans %}</div>
  <form action="" method="get">
    <div class="actions">
      <input type="hidden" name="do" value="export">
      <input type="submit" value="{{ _('Export')|e }}">
    </div>
  </form>
  {%- endif %}
{% endblock -%}
</body>
