{% extends "report_base.html" %}
{% block content %}
<div class="page-header">
    <h1>{{ page_title }}</h1>
</div>

{{ macros.merging_statistics(scaling_tables, None, "main") }}

{% if error_model_summary %}
<div>
    <h2>Error model details</h2>
    <div class="panel panel-default">
        <div class="panel-heading" data-toggle="collapse" data-target="#collapse_errorsummary">
            <h4 class="panel-title">
                <a> Error model parameters </a>
            </h4>
        </div>
        <div id="collapse_errorsummary" class="panel-collapse collapse">
            <div class="panel-body">
                <div class="container-fluid">
                    <div>
                        <p style="white-space: pre-wrap">{{ error_model_summary }}</p>
                    </div>
                </div>
            </div>
        </div>
    </div>

</div>

{% endif %}


</div>
    <h2>Analysis plots</h2>
    <div class="panel-group">
        {{ macros.panel('Analysis by resolution', 'resolution_plots', resolution_plots) }}
        {{ macros.panel('Analysis by image number', 'batch_plots', batch_plots, tables=image_range_tables)}}
        {{ macros.panel('Scaling model plots', 'scaling_model', scaling_model_graphs) }}
        {{ macros.panel('Scaling outlier plots', 'outlier_plots', scaling_outlier_graphs) }}
        {{ macros.panel('Error distribution plots', 'error_model_plots', error_model_plots) }}
        {{ macros.panel('Anomalous plots', 'anom_plots', anom_plots) }}
        {% if filter_plots|length %}
            {{ macros.panel('Scaling and filtering plots', 'filter_plots', filter_plots) }}
        {% endif %}
        {{ macros.panel('Miscellaneous plots', 'misc_plots', misc_plots) }}
    </div>
</div>

{% endblock %}
