mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
* Add Bootstrap Extension * Rename main.yml * Artifact Upload * Fix Bootstrap Reference Error * BootstrapTreeProcessor * getiterator removed * keys function * Style Images * Update docs_build.yml * Added Meta Files * Template Get * Fix Page Ref * Update BASE_URL * Sort Schemas * Add Sitemaps * Add favicons, open-graph, and setup guide * Update Setup.md * Update .gitignore * Update Setup.md * Use _blank on external links * Restructured Docs * Fix Links * Added XML Schemas * Name XML Schemas
86 lines
3.2 KiB
Django/Jinja
86 lines
3.2 KiB
Django/Jinja
{% extends "base/base.jinja2" %}
|
|
|
|
{% from "base/macros.jinja2" import badge %}
|
|
|
|
{% macro body(element, trail) %}
|
|
<div class="breadcrumbs">
|
|
{% for node in trail|split("-") %}
|
|
{% if loop.first %}
|
|
Root
|
|
{% else %}
|
|
<a href="#{{ node }}"
|
|
onclick="anchorLink('{{ node }}')">{{ node }}</a>
|
|
{% endif %}
|
|
{% if not loop.last %}
|
|
<i class="bi-arrow-right-short"></i>
|
|
{% endif %}
|
|
{% endfor %}
|
|
</div>
|
|
{% if element.occurs[0] != 1 or element.occurs[1] != 1 %}
|
|
{{ badge("secondary", element.occurs|occurs_text) }}
|
|
{% endif %}
|
|
{{ badge("secondary", "Type: " + element.type|name, "ms-2") }}
|
|
{% if element.type.has_complex_content() %}
|
|
{% for child in element.type.content|children %}
|
|
{{ render(child, trail) }}
|
|
{% endfor %}
|
|
{% endif %}
|
|
{% endmacro %}
|
|
|
|
{% macro render(element, trail) %}
|
|
<div class="row my-2">
|
|
<div class="col">
|
|
{% set trail=trail+"-"+element.name %}
|
|
{% set html_id=trail %}
|
|
<div class="accordion" id="accordion_{{ html_id }}">
|
|
<div class="accordion-item">
|
|
<h2 class="accordion-header" id="heading_{{ html_id }}">
|
|
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse"
|
|
data-bs-target="#{{ html_id }}" aria-expanded="false"
|
|
aria-controls="{{ html_id }}" onclick="setAnchor('#{{ html_id }}')">
|
|
<span class="property-name align-middle pb-1">{{ element.name | escape }}</span>
|
|
{% if element.occurs[0] == 1 and element.occurs[1] == 1 %}
|
|
{{ " " }}{{ badge("warning", "Required", "ms-2") }}
|
|
{% endif %}
|
|
</button>
|
|
</h2>
|
|
<div id="{{ trail }}" class="accordion-collapse collapse"
|
|
aria-labelledby="heading_{{ html_id }}"
|
|
data-parent="#accordion_{{ html_id }}">
|
|
<div class="accordion-body">
|
|
{% if element.parent != None and element.type.name == element.parent.parent.name %}
|
|
{{ badge("info", "<em>Recursive Reference</em>") }}
|
|
{% else %}
|
|
{{ body(element, trail) }}
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endmacro %}
|
|
|
|
{% block resources %}
|
|
{% include "base/schema/schema_includes.jinja2" %}
|
|
{% endblock %}
|
|
|
|
{% block onLoad %}anchorOnLoad();{% endblock %}
|
|
|
|
{% block content %}
|
|
<div class="row">
|
|
<div class="col text-center">
|
|
<h1>{{ page.title|title }}</h1>
|
|
</div>
|
|
</div>
|
|
<div class="row">
|
|
<div class="col">
|
|
{% for element in schema.elements.values() %}
|
|
{% for child in element.type.content %}
|
|
{{ render(child, element.name) }}
|
|
{% endfor %}
|
|
{% endfor %}
|
|
</div>
|
|
</div>
|
|
{% endblock %}
|