{% extends "public_base.html" %} {% import "configurator/_macros.html" as ck %} {# What an option card says about its feature: the name with its released version, what it does, and its package. The package is two boxes, the org and the name, so a narrow card wraps after the slash rather than at the hyphen in "splent-io"; the org is the same everywhere, so a phone hides it (skin_store). The description and version come from the marketplace index and are simply left out for a feature it does not publish. The note is filled in by the script with why the card is locked or unavailable. #} {% macro option_body(feature) -%} {{ feature.short }}{% if feature.version %} v{{ feature.version }}{% endif %}{% if feature.external %} {{ _("external") }}{% endif %} {% if feature.description %}{{ feature.description }}{% endif %} {% if feature.org %}{{ feature.org }}/{% endif %}{{ feature.package }} {%- endmacro %} {# The feature's marketplace page, in a new tab so the selection stays put. A link inside a label follows the link and leaves the checkbox alone. #} {% macro option_link(feature) -%} {% if feature.url %}{{ ck.icon("external-link", 15) }}{% endif %} {%- endmacro %} {# One feature of the model. Its input is a radio when it sits in an alternative group and a checkbox otherwise. The features under it (its own options, groups and sections) follow the card, indented, and the card spans the whole row so they line up under it. #} {% macro render_feature(feature) -%} {% set nested = feature.options or feature.choices or feature.sections %}
{% if nested %}
{{ render_children(feature, 2) }}
{% endif %}
{%- endmacro %} {# What hangs from a node: its features under mandatory or optional, its alternative and or groups, and the nodes without a package, as headings. Level 1 is the line itself; deeper sections take smaller headings. #} {% macro render_children(node, level) -%} {% if node.options %}
{% for feature in node.options %}{{ render_feature(feature) }}{% endfor %}
{% endif %} {% for choice in node.choices %} {% set multiple = choice.kind == "or" %}

{{ ck.icon("git-branch", 14) }}{% if choice.owner != node.name %}{{ choice.owner }}{% endif %} {% if multiple %}{{ _("Pick one or more.") }}{% else %}{{ _("Pick one.") }}{% endif %}

{% for member in choice.members %}{{ render_feature(member) }}{% endfor %} {% if not multiple %}
{% endif %}
{% endfor %} {% for section in node.sections %}
{% if level == 1 %}

{{ ck.icon("layers") }}{{ section.name }}

{% else %}

{{ section.name }}

{% endif %} {{ render_children(section, level + 1) }}
{% endfor %} {%- endmacro %} {% block title %}{{ _("Configure %(name)s", name=spl.name) }}{% endblock %} {% block head %} {% endblock %} {% block hero %}

{{ spl.name }}

{% if spl.description %}

{{ spl.description }}

{% endif %}
{% endblock %} {% block content %}

{{ _("Lowercase letters, digits and underscores.") }}

{% if tree.options or tree.choices %}

{{ ck.icon("sliders") }}{{ _("Features") }}

{{ _("Pick what your product needs. What a feature depends on comes along with it.") }}

{{ render_children({"options": tree.options, "choices": tree.choices, "sections": []}, 2) }}
{% endif %} {{ render_children({"options": [], "choices": [], "sections": tree.sections}, 1) }} {# A phone shows the panel below every option, so checking one gave no feedback in sight. This bar keeps the verdict at the bottom of the screen while the options scroll, and rests at the end of them, right above the panel it points to, so it never covers anything there. A wide screen has the panel beside the options and never shows it (skin_store). Not a live region: the panel already announces the verdict. #}
{{ ck.icon("loader", 18) }} {{ ck.icon("check-circle", 18) }} {{ ck.icon("x-circle", 18) }} {{ ck.icon("alert-triangle", 18) }} {{ _("Checking the selection") }} {{ _("See commands") }}{{ ck.icon("arrow-down", 14) }}
{% endblock %} {% block scripts %} {% endblock %}