{% load getattribute %}
<!-- Iterate through the main tables that we've prebuilt pages for -->
{% if calculation.table_name == "StaticEnergy" %}
    {% include "core_components/base_data_types/static-energy.html" %}
{% elif calculation.table_name == "DiffusionAnalysis" %}
    {% include "core_components/base_data_types/diffusion-analysis.html" %}
{% elif calculation.table_name == "DensityofStatesCalc" %}
    {% include "core_components/base_data_types/density-of-states-calc.html" %}
{% elif calculation.table_name == "BandStructureCalc" %}
    {% include "core_components/base_data_types/band-structure-calc.html" %}
{% elif calculation.table_name == "Dynamics" %}
    {% include "core_components/base_data_types/dynamics-run.html" %}
{% elif calculation.table_name == "Relaxation" %}
    {% include "core_components/base_data_types/relaxation.html" %}
{% elif calculation.table_name == "FixedCompositionSearch" %}
    {% include "core_components/base_data_types/fixed_composition_search.html" %}
{% else %}
    <!-- If none of the pages above were used, then we iterate through the fundamental
    mixins and pull the proper components. Is there a better way to do this as a django for-loop? -->
    {% if "Calculation" in table_mixins %}
        {% include "core_components/base_data_types/calculation.html" %}
    {% endif %}
    {% if "Structure" in table_mixins %}
        {% include "core_components/base_data_types/structure.html" %}
    {% endif %}
    {% if "Thermodynamics" in table_mixins %}
        {% include "core_components/base_data_types/thermodynamics.html" %}
    {% endif %}
    {% if "Forces" in table_mixins %}
        {% include "core_components/base_data_types/forces.html" %}
    {% endif %}
    {% if "BandStructure" in table_mixins %}
        {% include "core_components/base_data_types/band-structure.html" %}
    {% endif %}
    {% if "DensityofStates" in table_mixins %}
        {% include "core_components/base_data_types/density-of-states.html" %}
    {% endif %}
    {% if "Molecule" in table_mixins %}
        {% include "core_components/base_data_types/molecule.html" %}
    {% endif %}
    <!-- end of mix-ins -->
{% endif %}
<!-- Add any extra columns using default formatting -->
{% if extra_columns %}
    <div class="container p-4">
        <h3>Extra Information:</h3>
        <ul>
            {% for extra_column in extra_columns %}
                <li>
                    <b>{{ extra_column }}:</b> {{ calculation|getattribute:extra_column }}
                </li>
            {% endfor %}
        </ul>
    </div>
{% endif %}
<!-- end extra columns -->
