{% extends "base.html" %}

{% block title %}Start{% endblock %}

{% block header_content %}
AppStream data hints for {{project_name}}
{% endblock %}

{% block content %}
<div class="wrapper">

    <h1>Welcome!</h1>
    <p>Welcome to the AppStream Generator HTML pages!</p>
    <p>
      These pages exist to provide a user-friendly view on the issues discovered by the
      AppStream metadata generator while extracting metadata from packages in the {{project_name}} archive.
      They can also be used to take a look at the raw metadata, to spot possible problems
      with the data itself or the generation process.
    </p>

    <h1>Select a suite</h1>

    <ul class="stat-tiles">
    {% for suite in suites %}
      <li class="stat-tile">
        <h3 class="stat-tile-label"><a href="{{suite.suite}}/">{{suite.suite}}</a></h3>

        {% if existsIn(suite, "metainfo_count") %}
          <div class="stat-tile-figure">
            <p class="stat-tile-count">
              <span class="stat-tile-value">{{suite.metainfo_count}}</span>
              components in {{suite.section_count}} section{% if suite.section_count != 1 %}s{% endif %}
            </p>
          </div>

          {% if suite.health.total > 0 %}
            <div class="healthbar" role="img"
                 aria-label="{% for seg in suite.health.segments %}{{seg.count}} {{seg.label}}{% if not loop.is_last %}, {% endif %}{% endfor %}">
              {% for seg in suite.health.segments %}
                <div class="healthbar-segment healthbar-segment-{{seg.key}}" style="width: {{round(seg.percentage, 1)}}%"></div>
              {% endfor %}
            </div>
            <ul class="healthbar-legend">
              {% for seg in suite.health.segments %}
                <li><span class="swatch healthbar-segment-{{seg.key}}"></span>{{seg.label}} <span class="count">{{seg.count}}</span></li>
              {% endfor %}
            </ul>
          {% endif %}
        {% endif %}
      </li>
    {% endfor %}
    </ul>

    {% if length(oldsuites) > 0 %}
      <h2>No longer updated</h2>
      <ul class="suite-archived">
      {% for oldsuite in oldsuites %}
        <li><a href="{{oldsuite.suite}}/">{{oldsuite.suite}}</a></li>
      {% endfor %}
      </ul>
    {% endif %}

    <hr/>
    <img src="{{root_url}}/static/img/asgen.png" alt="AppStream Generator Logo" style="margin: 4px; float: right;" />
    <h1>What is AppStream?</h1>
    <p>
      AppStream is a cross-distro XML format to provide metadata for software components and to assign unique identifiers to software.<br/>
      In {{project_name}}, we parse all XML provided by upstream projects as well as other metadata (.desktop-files, ...), and compile a single
      metadata file from it, which is then shipped to users.
    </p>
    <p>
      The generated metadata can for example be used by software centers like GNOME Software or KDE Discover to display a user-friendly application-centric
      view on the package archive.<br/>
      It can also be used by other software to find missing plugins, codecs, fonts, etc. or simply by users to install software on any Linux distribution
      without knowing the exact package name.
    </p>

    <h1>More information</h1>
    <p>
      The offical AppStream specification can be found at <a href="http://www.freedesktop.org/software/appstream/docs/">freedesktop.org</a>.
    </p>
    <p>
      You can find the source-code of the AppStream Generator <a href="https://github.com/ximion/appstream-generator">here</a>.
    </p>

</div>
{% endblock %}
