CIMAC-CIDC/cidc-schemas

View on GitHub
docs/templates/index.j2

Summary

Maintainability
Test Coverage
{% extends "base.j2" %}
{% block content %}

    <div class="container">
        <h1>CIDC Documentation</h1>

        <div class="alert alert-primary" role="alert">
            Documentation for CIDC concepts, assays, and manifests.
        </div>
        <div class="container">
            <div class="accordion" id="index_accordion">
                {% for group, schemas in schema_groups.items() %}
                    {% if not group %}
                        {% set group = "concepts" %}
                    {% endif %}

                    <div class="card">
                        <div class="card-header" id="{{ group }}">
                            <h2 class="mb-0">
                                <button class="btn btn-link" type="button" data-toggle="collapse" data-target="#{{ group }}_card" aria-expanded="false" aria-controls="{{ group }}_card">
                                    {{ group.replace('.', ' > ').title() }}
                                </button>
                            </h2>
                        </div>
                        <div id="{{ group }}_card" class="collapse {{ 'show' if group == 'assays' else '' }}" aria-labelledby="{{ group }}" data-parent="#index_accordion">
                            <div class="card-body">
                                <table class="table table-striped">
                                    {% for entity_name, entity_schema in schemas.items() %}
                                        <tr>
                                            {% if group == "concepts" %}
                                                <td width=25%>
                                                    <a href='{{ entity_name }}.html'>
                                                        {{ entity_schema["title"] }}
                                                    </a>
                                                </td>
                                                <td>
                                                    {{ entity_schema["description"] }}
                                                </td>
                                            {% elif group == "assays" %}
                                                {% if "old" not in entity_name %}
                                                    <td width=25%>
                                                        <a href='{{ group }}.{{ entity_name }}.html'>
                                                            {{ entity_schema.schema["title"] }}
                                                        </a>
                                                    </td>
                                                    <td>
                                                        {{ entity_schema.schema["description"] }}
                                                    </td>
                                                {% endif %}
                                            {% elif group == "manifests" %}
                                                <td width=25%>
                                                    <a href='{{ group }}.{{ entity_name }}.html'>
                                                        {{ entity_schema.schema["title"] }}
                                                    </a>
                                                </td>
                                                <td>
                                                    {{ entity_schema.schema["description"] }}
                                                </td>
                                            {% else %}
                                                <td width=25%>
                                                    <a href='{{ group }}.{{ entity_name }}.html'>
                                                        {{ entity_schema["title"] }}
                                                    </a>
                                                </td>
                                                <td>
                                                    {{ entity_schema["description"] }}
                                                </td>
                                            {% endif %}
                                        </tr>
                                    {% endfor %}
                                </table>
                            </div>
                        </div>
                    </div>
                {% endfor %}
            </div>
        </div>
    </div>

{% endblock %}